agentleFS
Facta-DevFacta-Dev/beautifulqt/.claude/skills/tdd/SKILL.md

tdd

Skill0 starsChanged 20 days agoMITView on GitHub

Drives an <app> change test-first: red, green, refactor, with integration tests at the agreed seams.

193 other projects use a version of this, 62 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use capture-learning-tools, design-frontend-dev and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • The-Vibe-CompanySkill

    capture-learning-tools

    Turn technical conversations, bugs, CI failures, review comments,

    Also in 5 projects that use this

  • The-Vibe-CompanySkill

    design-frontend-dev

    Clean Impeccable frontend design skill. Use when the user wants to

    Also in 5 projects that use this

  • jaydubya818Skill

    figure-it-out

    Use when novel or multi-phase work needs an auditable workflow and no narrower playbook fits.

    Also in 66 projects that use this

  • shiwenbin1617Skill

    ketchup-video

    Catch the user up like /ketchup, with a short subtitled video of slides for what happened and the waiting calls as text under it. Use for /ketchup-video.

    Also in 24 projects that use this

  • simo97Skill

    request-refactor-plan

    Use this skill when user wants to create a refactor plan.

    Also in 47 projects that use this

  • jaydubya818Skill

    principle-minimize-reader-load

    Apply when layers, wrappers, or hidden state make simple behavior hard to follow.

    Also in 57 projects that use this

  • +3 more from The-Vibe-Company
  • +2 more from jaydubya818

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 10 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 189 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do NOT activate this skill when:

    line 19
  2. Distinctive:

    Write down the seams under test and confirm them with the requester before writing any test.

    line 45
  3. Distinctive:

    Never anticipate future tests or add speculative features in the green step.

    line 49
  4. Distinctive:

    Do not mock your own classes or internal collaborators.

    line 54
  5. Distinctive:

    Do not assert through a side channel (querying the database instead of using the interface).

    line 57
  6. Distinctive:

    Do not recompute the expected value the way the code computes it.

    line 60
  7. Distinctive:

    Do not write all the tests first and then all the implementation.

    line 63
  8. Distinctive:

    Use the project vocabulary for test names: read the glossary if it exists, and respect the ADRs for the area under test.

    line 66
  9. Distinctive:

    Never claim a test passes without running it, and never assert on a behavior the test does not actually exercise.

    line 71
  10. Distinctive:

    Leave the suite green at the end of every slice: a red test in the tree is a broken contract, not a to-do.

    line 73

“Common” is measured: kept by at least 6 in 10 of the 189 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

<app> Test-Driven Development skill

Reusable workflow for the red to green loop, and the reference that keeps the loop producing tests worth keeping. An agent invokes this skill; the agent supplies the behavior, the skill supplies the loop.

When to Activate

Activate this skill when an <app> feature or bug fix is to be built test-first, when the request mentions red-green-refactor, or when integration tests are wanted at a public interface.

Do NOT activate this skill when:

  • The request is a pure documentation or comment edit.
  • The request is to review existing tests (use review).
  • The behavior cannot be pinned down yet (grill the plan first, then drive the change).

Core Principles

  • Red before green: the failing test comes first, then only enough code to pass it.
  • One vertical slice at a time: one seam, one test, one minimal implementation, repeat. Each test is a tracer bullet that responds to what the last cycle taught you.
  • Tests verify behavior through public interfaces, never implementation details. The code can change entirely; the tests should not.
  • A good test reads like a specification: "a customer can check out with a valid cart" states the capability, not the mechanism.
  • Seams are agreed before the first test is written. You cannot test everything, so agreeing the seams up front is how effort lands on the critical paths.
  • Expected values come from an independent source of truth: a known-good literal, a worked example, the specification.

Rules

  • Write down the seams under test and confirm them with the requester before writing any test. No test is written at an unconfirmed seam.
  • Give each proposed seam a one-line note on what it catches and what it misses.
  • Never anticipate future tests or add speculative features in the green step.
  • Refactoring happens with the suite green, but it is never a step inside the red-to-green cycle: it belongs to the review stage, not to the implementation cycle.
  • Do not mock your own classes or internal collaborators. Mock only at system boundaries: external APIs, the clock, randomness, the filesystem, and sometimes the database.
  • Do not assert through a side channel (querying the database instead of using the interface). The tell: the test breaks on a refactor that changed no behavior.
  • Do not recompute the expected value the way the code computes it. That makes the test pass by construction and it can never disagree with the code.
  • Do not write all the tests first and then all the implementation. Horizontal slicing tests imagined behavior and goes insensitive to real changes.
  • Use the project vocabulary for test names: read the glossary if it exists, and respect the ADRs for the area under test.
  • Integration tests exercise the real boundary: the wired adapter over fakes, or the container-backed suite, with fixtures explicit about which layer they stand in for.
  • Never claim a test passes without running it, and never assert on a behavior the test does not actually exercise.
  • Leave the suite green at the end of every slice: a red test in the tree is a broken contract, not a to-do.

Research References

ClaimSourceYearLink
Red before green, one slice at a time, refactoring is not part of the loopmattpocock/skills, skills/engineering/tdd/SKILL.md2026skills/engineering/tdd/SKILL.md
Good tests verify behavior through public interfaces; tautological tests pass by constructionmattpocock/skills, skills/engineering/tdd/tests.md2026skills/engineering/tdd/tests.md
Mock only at system boundaries, and design for mockability at those boundariesmattpocock/skills, skills/engineering/tdd/mocking.md2026skills/engineering/tdd/mocking.md
The desktop test types and where each assertion belongsPLAYBOOK_TESTS.md §2-PLAYBOOK_TESTS.md
The gate that turns a red test into a green suitePLAYBOOK_CLAUDE_CODE.md §10-PLAYBOOK_CLAUDE_CODE.md

Output Format

Deliver, in order:

  1. The seams under test, with what each catches and what it misses, and the confirmation that they were agreed.
  2. The cycle log, one entry per slice: the failing test (and how it fails), the minimal implementation, the passing run.
  3. The final state: the full test run result and the seam coverage note (what is not covered by design).

Example:

tdd: seam = POST /orders (catches: input validation and pricing, misses:
async fulfillment)
cycle 1: orderTotalTest fails (expected 42.00, got 0.00) -> added the
pricing port -> passes

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.