tdd is a Test-Driven Development skill for building features, fixing bugs, and writing durable tests with the red-green-refactor loop. It favors behavior-focused tests through public interfaces, boundary-only mocking, and practical guidance for test automation, refactoring, and interface design.

Stars66k
Favorites0
Comments0
AddedMay 8, 2026
CategoryTest Automation
Install Command
npx skills add mattpocock/skills --skill tdd
Curation Score

This skill scores 78/100, which means it is a solid listing candidate for directory users: it clearly triggers on TDD/red-green-refactor requests and gives enough workflow guidance to reduce guesswork, though it is more instructional than tool-like and lacks install-time automation or support files. Users who want a practical TDD playbook for agents should consider installing it; users needing deeper project-specific integration may want more scaffolding.

78/100
Strengths
  • Strong triggerability: the frontmatter explicitly says to use it for building features or fixing bugs with TDD, red-green-refactor, integration tests, or test-first development.
  • Operational guidance is concrete: it covers public-interface testing, when to mock, interface design for testability, and refactoring candidates, with code examples and linked subtopics.
  • Good progressive disclosure: the main SKILL.md points to focused companion docs (tests, mocking, interface design, refactoring, deep modules) so an agent can drill down without guesswork.
Cautions
  • No install command or support files/scripts are present, so adoption is limited to reading the guidance rather than invoking any automation.
  • The content is explicitly opinionated toward integration-style testing and avoiding internal mocks, which may not fit teams that rely heavily on unit-test-heavy TDD styles.
Overview

Overview of tdd skill

tdd is a Test-Driven Development skill for building features and fixing bugs with the red-green-refactor loop. It is best for engineers who want a practical tdd guide that keeps tests aligned to behavior, not implementation. If you are working in a codebase where refactors are common, interfaces matter, and brittle tests are slowing you down, this skill helps you write tests that survive change.

The main job-to-be-done is simple: turn a rough feature idea into a safe sequence of small testable steps. The tdd skill is especially useful for test automation work, integration-style testing, and code that benefits from clearer boundaries. Its strongest opinion is to test through public interfaces and mock only at true system boundaries.

What tdd is for

Use tdd when you want a test-first workflow for new behavior, bug fixes, or refactors that need a safety net. It is a fit when you already know the expected outcome but not the cleanest implementation path.

What makes this tdd skill different

The repo is not just “write tests first.” It pushes a specific discipline: avoid horizontal slicing, prefer behavior-focused tests, and design interfaces that are easy to test. That makes the tdd skill more useful than a generic prompt when you need durable tests instead of fast, fragile ones.

When tdd is a poor fit

If you need a quick one-off unit test, a throwaway script, or a mock-heavy verification of internal calls, this is probably the wrong tool. The skill is aimed at software you expect to refactor, where test quality matters more than test quantity.

How to Use tdd skill

Install and load the skill

Use the directory’s install command for the tdd install step, then open SKILL.md first. After that, read tests.md, mocking.md, interface-design.md, refactoring.md, and deep-modules.md for the rules that actually shape output quality.

Give the skill a behavior, not a solution

The best tdd usage starts with a user-visible outcome, an input, and an expected result. Strong prompt shape:

  • “Add checkout validation so invalid carts return a clear error and valid carts complete payment”
  • “Fix the bug where duplicate emails create two accounts”
  • “Write tests for a retry flow against a payment API, using the public service interface”

Weak prompt shape:

  • “Write tests for checkout”
  • “Make this module more testable”
  • “Mock the database and verify the function was called”

Follow the red-green-refactor loop

Start with the smallest observable behavior, write one failing test that proves it, implement the minimum code to pass, then refactor while keeping the test green. Do not batch all tests first and implementation later; the skill explicitly warns against horizontal slices because they create imagined behavior instead of tested behavior.

Read these files first

For practical execution, prioritize:

  • SKILL.md for the philosophy and workflow
  • tests.md for good vs bad test patterns
  • mocking.md for boundary-only mocking
  • interface-design.md for making code easier to test
  • refactoring.md for what to improve after the first green pass

tdd skill FAQ

Is tdd only for unit tests?

No. This tdd skill prefers integration-style tests through public interfaces, which often makes it better for test automation and behavior testing than for isolated unit-heavy setups.

Do I need to mock everything?

No. A core rule in this tdd guide is to mock only at system boundaries such as external APIs, time, randomness, or sometimes the file system or database. Do not mock your own modules just to make tests pass.

Can beginners use tdd?

Yes, if they can describe expected behavior clearly. The main learning curve is not syntax; it is choosing the right boundary and avoiding implementation-detail tests.

How is tdd different from a normal prompt?

A normal prompt may produce tests that merely compile. The tdd skill is more opinionated: it pushes behavior-first tests, small increments, and interface design that keeps tests stable during refactors.

How to Improve tdd skill

Start with sharper input

You will get better results from tdd when you include the behavior, the boundary, and the constraint. For example, say “build a retryable email sender that uses a real service wrapper, but mock time and the external provider” instead of “make this testable.”

Watch for the common failure modes

The biggest mistakes are over-mocking, testing private methods, and writing tests that describe how the code works instead of what the user sees. If the first draft feels too implementation-aware, revise the prompt to name the public API and the observable result.

Iterate from test to design

After the first output, use the failures to improve interface design: smaller parameters, clearer return values, and fewer side effects. If the code still feels hard to test, the issue may be the API shape, not the tests.

Ask for refactor targets after green

Once the behavior is covered, ask the skill to identify duplication, long methods, shallow modules, feature envy, or primitive obsession. That is where the tdd skill adds extra value: it helps you move from “passing tests” to a cleaner design that will stay easy to test.

Ratings & Reviews

No ratings yet
Share your review
Sign in to leave a rating and comment for this skill.
G
0/10000
Latest reviews
Saving...