Install any skill in seconds. Free to start, no credit card required.
Get Started Free →BDD-driven test implementation: red-green loop mechanics, seams, mocking, and test quality under BDD Automation. Use when the user wants to write or improve tests during BDD implementation, needs guidance on test structure, or asks about test seams, mocking, or anti-patterns.
.claude/skills/fradser-tdd/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | -56% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -22% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 2% | 0% |
| case-12 | ✗→✓ | ▲ Improved | -17% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 1% | 0% |
BDD cycles through three phases: Discovery (conversations → examples), Formulation (Gherkin scenarios), Automation (red-green-refactor, driven by BDD). This skill is the BDD-driven Automation reference — the how of test implementation, once /mattpocock:bdd has defined the what.
When invoked during /mattpocock:implement or /mattpocock:bdd, use this skill as the test-writing authority. The /mattpocock:bdd skill governs the scenario design and Iron Law; this skill governs the test code quality under BDD discipline.
If you reached this skill directly (not via /mattpocock:bdd or /mattpocock:implement), stop and ask the user: "Have you defined the Gherkin scenarios for this behavior yet?"
/mattpocock:bdd first to define the scenarios via Discovery → Formulation, then return here for Automation..feature files or equivalent, then proceed with the red-green loop below.Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't. A good test reads like a specification — "user can checkout with valid cart" tells you exactly what capability exists — and survives refactors because it doesn't care about internal structure.
See tests.md for examples and mocking.md for mocking guidelines.
A seam is the public boundary you test at: the interface where you observe behavior without reaching inside. Tests live at seams, never against internals.
Test only at pre-agreed seams. Before writing any test, write down the seams under test and confirm them with the user. No test is written at an unconfirmed seam. Not everything can be tested — agreeing the seams up front is how testing effort lands on the critical paths and complex logic instead of every edge case.
Ask: "What's the public interface, and which seams should we test?"
When the shape of that interface is itself in question — how deep the module is, where the seam belongs, what the interface should expose — use the /mattpocock:codebase-design skill for the vocabulary. It is the shared source of the module, interface, depth, seam, adapter, leverage and locality terms, and it is a reference to consult, not a session to run.
expect(add(a, b)).toBe(a + b), a snapshot derived by hand the same way, a constant asserted equal to itself), so it passes by construction and can never disagree with the code. Expected values must come from an independent source of truth — a known-good literal, a worked example, the spec./mattpocock:code-review), not the red → green implementation cycle.This skill is the Automation phase of the BDD lifecycle. It always runs under /mattpocock:bdd or /mattpocock:implement as BDD-driven TDD. If invoked directly, see the CRITICAL check at the top of this file — confirm scenarios exist before writing test code.
/mattpocock:bdd via Gherkin scenarios/mattpocock:bdd via .feature filesInvoke this skill explicitly when:
When invoked directly, first check if Gherkin scenarios exist (see the CRITICAL check at the top). If not, redirect to /mattpocock:bdd before proceeding with Automation.
The /mattpocock:bdd and /mattpocock:implement skills load this automatically during the Automation phase — you do not need to invoke it separately in those flows.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-18 | pass→pass | 9,694 | 5,989 | -38% | 1 | 1 | 0% | 1,708 | 2,123 | +24% | 0 | 0 | — |
case-06 | fail→fail | 25,026 | 7,109 | -72% | 1 | 1 | 0% | 3,702 | 2,521 | -32% | 0 | 0 | — |
case-01 | fail→fail | 16,630 | 22,890 | +38% | 1 | 1 | 0% | 2,823 | 2,286 | -19% | 0 | 0 | — |
case-02 | fail→pass | 21,016 | 3,042 | -86% | 1 | 1 | 0% | 3,839 | 1,677 | -56% | 0 | 0 | — |
case-03 | fail→fail | 15,453 | 4,454 | -71% | 1 | 1 | 0% | 2,634 | 2,053 | -22% | 0 | 0 | — |
case-04 | fail→pass | 15,183 | 5,481 | -64% | 1 | 1 | 0% | 2,665 | 2,073 | -22% | 0 | 0 | — |
case-05 | pass→pass | 7,817 | 7,013 | -10% | 1 | 1 | 0% | 1,226 | 2,150 | +75% | 0 | 0 | — |
case-07 | pass→pass | 14,076 | 5,538 | -61% | 1 | 1 | 0% | 2,304 | 2,260 | -2% | 0 | 0 | — |
case-08 | pass→pass | 13,533 | 7,718 | -43% | 1 | 1 | 0% | 1,961 | 2,453 | +25% | 0 | 0 | — |
case-09 | pass→pass | 9,052 | 5,086 | -44% | 1 | 1 | 0% | 1,445 | 2,008 | +39% | 0 | 0 | — |
case-10 | fail→pass | 15,268 | 6,977 | -54% | 1 | 1 | 0% | 2,261 | 2,314 | +2% | 0 | 0 | — |
case-11 | pass→pass | 14,669 | 12,441 | -15% | 1 | 1 | 0% | 2,686 | 3,332 | +24% | 0 | 0 | — |
case-12 | fail→pass | 13,622 | 6,203 | -54% | 1 | 1 | 0% | 2,712 | 2,242 | -17% | 0 | 0 | — |
case-13 | fail→pass | 14,145 | 5,316 | -62% | 1 | 1 | 0% | 1,911 | 1,929 | +1% | 0 | 0 | — |
case-14 | fail→pass | 9,604 | 3,727 | -61% | 1 | 1 | 0% | 1,677 | 1,873 | +12% | 0 | 0 | — |
case-15 | fail→pass | 16,014 | 12,462 | -22% | 1 | 1 | 0% | 2,404 | 3,102 | +29% | 0 | 0 | — |
case-16 | pass→pass | 14,586 | 7,143 | -51% | 1 | 1 | 0% | 2,162 | 2,472 | +14% | 0 | 0 | — |
case-17 | fail→pass | 18,051 | 6,414 | -64% | 1 | 1 | 0% | 3,018 | 2,454 | -19% | 0 | 0 | — |
case-19 | pass→pass | 13,425 | 8,412 | -37% | 1 | 1 | 0% | 2,299 | 2,592 | +13% | 0 | 0 | — |
case-20 | fail→pass | 7,085 | 4,105 | -42% | 1 | 1 | 0% | 1,096 | 1,939 | +77% | 0 | 0 | — |
case-21 | pass→pass | 11,543 | 5,152 | -55% | 1 | 1 | 0% | 2,074 | 2,133 | +3% | 0 | 0 | — |
case-22 | pass→pass | 14,088 | 7,815 | -45% | 1 | 1 | 0% | 1,955 | 2,567 | +31% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +41 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.