/mattpocock-skills:tddfrom mattpocock-skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
Ships in mattpocock-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
TDD is the red → green loop. This skill is the reference that makes that loop produce tests worth keeping: what a good test is, where tests go, the anti-patterns, and the rules of the loop. Every section applies on every cycle: consult them before and during the loop, not after.
FENIX autonomous mode, in brief. Active when the repo's
.compound-engineering/config.yamlhas a lineautonomous: on, orFENIX_AUTONOMOUS=1is set, or the run was launched by/lfg. Check with:grep -qs '^autonomous: on' "$(git rev-parse --show-toplevel)/.compound-engineering/config.yaml" || [ "${FENIX_AUTONOMOUS:-}" = 1 ]Off means this skill behaves exactly as upstream wrote it. On means four rules:
- Never block. Where this skill would ask the user, pick its documented default, log the choice, and continue.
- Prefer the reversible branch. Narrower scope over wider, a new file over an edit, additive over destructive, deferred over speculative.
- Proof, or it did not happen. A unit is done only with an artifact from the running app. "It compiles" or "tests pass" is not proof. If verification cannot run, stop that unit and record why.
- Irreversible actions still stop: force-push, history rewrite, merging a PR, data deletion or destructive migrations, printing or rotating secrets, deploys and publishing, spending money. Commit what is proven, write the trail, and report what waits on a human.
Decision trail. For each non-obvious decision append one tab-separated row to
docs/autonomous/<YYYY-MM-DD>-<branch>-trail.tsv, writing the header row first if the file is new. Columns:timestamp,skill,decision,why,evidence(a path, ornone),reversible(yesorno). Everyreversible=norow also goes in the PR description. A run ends with an open PR, never a merge.
The one blocking point below is "Seams: where tests go" — confirming seams with the user before
writing a test. When the FENIX activation check reports autonomous mode on, resolve it without asking:
use the TDD seam the plan already named for this unit (ce-plan's Lane C instruction requires one
per unit), since a human already reviewed and approved that plan before this autonomous run started
— the confirmation already happened, upstream of this skill. Log which seam was used as a trail row (format in the box above), reversible=yes.
If the plan named no seam for this unit, per Rule 2 pick the narrowest, most obviously public interface rather than guessing at something deep or speculative, and log that choice the same way. If even that is unclear, skip the test rather than write one at a guessed seam — an untested unit is recoverable; a wrong-seam test is a false confidence that outlives the run.
When exploring the codebase, read CONTEXT.md (if it exists) so test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching.
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 "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.code-review skill), not the red → green implementation cycle.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aigeekhub/aigeekskills --plugin mattpocock38 skills in this plugin
/ask-mattAsk which skill or flow fits your situation. A router over the skills in this repo./claude-handoffHand the current conversation off to a fresh background agent that picks up the work immediately./codebase-designShared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.