/ab-method:tddfrom ab-method
Enforces test-first for bug fixes and test-after with forced red for other changes, always through a seam's interface. Activates on 'red-green-refactor' or integration test requests.
Ships in ab-method. 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.
None: SKILL.md is the whole skill.
Every test must protect a real use case, be seen failing for the right reason, and pass because the production code does the right thing. Work through the steps below in order, once per use case.
Two modes, one standard:
verify: repro missions). The reproducing test fails before the fix, then the fix makes it green.ALWAYS check .ab-method/structure/index.yaml FIRST for where the domain docs live — paths are user-configurable. Look for it under the project root first; only if the project has none (AB Method installed as a plugin), read the bundled default at ../../../.ab-method/structure/index.yaml relative to this SKILL.md. Every path the index names is relative to the project root. From there, read CONTEXT.md and UBIQUITOUS_LANGUAGE.md (if they exist) so test names match the project's domain language, the Testing section of tech-stack.md for the framework and conventions, and respect the ADRs in the area you're touching.
See tests.md for worked examples of each step and mocking.md for where mocks belong.
Inside an AB Method task, tests come from two places only: a verify: repro mission (the bug's reproducing test) and the protect step's list (## Protected). A feature or refactor mission writes no test: it verifies through typecheck/build and the existing tests. If a use case clearly deserves a test mid-mission, note it in the mission summary for the protect step instead of adding it silently. Legacy trackers with a ## Test Plan keep their list. Standalone use is unaffected.
State the starting condition, the action, and the observable result. Ground it in a requirement, actual usage, or a reproduced bug — never in what the code happens to do. The use case is not complete until you can say concretely what breaks for the user if this behavior regresses.
Read the nearby tests and the relevant implementation. Extend an existing test when it already exercises the scenario. Add another only when it protects a distinct failure mode.
Test calculations directly, component interactions through the component, and critical application wiring through integration or E2E tests. Mock external boundaries only where necessary. Exercise the production code responsible for the behavior — never a copy, a stub of it, or a private helper reached around the interface.
Inside an AB Method project, the boundary is a seam's interface (docs/seams/) or the module that owns the domain rule. A test that reaches past the interface into internals breaks on harmless refactors and is the wrong shape.
When the shape of that boundary 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 a reference to consult, not a session to run.
The test must fail because the required behavior is missing or broken — not because of a typo, a missing import, a bad fixture or a wrong path.
Derive expected results from the use case, not from the code. Assert the submitted value, the visible result, the persisted state, or a meaningful interaction. Exact values belong where exactness matters, such as preserving prompt text. Multiple assertions are appropriate when they jointly prove one use case.
For every test, ask:
Rewrite weak assertions and remove tests with no distinct protection. For substantial changes, use a second agent to challenge the grouped findings against source evidence.
Control external data and time when needed, wait for observable outcomes instead of sleeping, and account for platform differences. Run only the focused tests for what you changed, plus the relevant integration checks; the full suite runs once, at the end of the task, not after every change.
Finish with three things stated: the behavior now protected, the evidence of red and green (the failing output, then the passing run), and any verification limits — what you could not run or could not observe.
When no user is there to confirm (ab-start-task, ab-start-roadmap, a mission subagent), the bug report or the diff plus the seam docs are the source of the use case and the boundary. If no seam fits, take the narrowest public interface that exposes the behavior and name it, so the review stage can challenge it. The red/green evidence and verification limits from step 7 go in the mission summary (bug fix) or ## Protected (protect step).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tdd, test-driven-development, red-green-refactor, test-first, test-after
npx claudepluginhub ayoubben18/ab-method --plugin ab-method36 skills in this plugin
/ab-analyze-backendAnalyze and document a project's backend patterns — API design, data access, service structure. Use when the user wants a backend-only architecture analysis./ab-analyze-frontendAnalyze and document a project's frontend patterns — component structure, state management, conventions. Use when the user wants a frontend-only architecture analysis./ab-analyze-projectAnalyze a project's architecture end to end — extract domain language, map the tech stack, document frontend and backend patterns. Use when onboarding a new codebase or refreshing the architecture baseline./ab-cleanupClean up a repo already using AB Method - compact the domain and architecture docs to their budgets, split pattern docs by topic, remove disposable task leftovers, and migrate the structure index to 4.0. Use when docs have grown too large, after upgrading AB Method, or when the user asks to clean up./ab-create-goalProduce a ready-to-run prompt for an autonomous /goal loop. Use when the user wants to hand off one continuous objective with a verifiable stop condition to run autonomously./ab-create-roadmapTurn a larger idea into a dependency-ordered roadmap of tasks — the layer above create-task. Use when the work is several distinct tasks with real ordering between them (schema before API before UI), and you want the whole task graph drawn before implementing. Producer only; ab-start-roadmap executes it.Other plugins' skills for the same job