brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
tddBDD-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.
Independent GitHub snapshot · Automated classification · Original documentation governs
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 it 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. You can't test everything, so 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), call the Skill tool with "mattpocock:codebase-design" 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.