/claude-apd:apd-tddfrom claude-apd
Enforces test-driven development during the APD builder phase: write a failing test first, minimal code to pass, then refactor while green.
Ships in claude-apd. 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.
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Write code before the test? Delete it. Start over. No exceptions. Violating the letter IS violating the spirit.
Use when:
apd-debugSkip when:
digraph tdd {
RED [label="RED\nWrite failing test" style=filled fillcolor="#ffcccc"];
RUN_RED [label="Run test\nWatch it FAIL" style=filled fillcolor="#ffcccc"];
GREEN [label="GREEN\nMinimal code to pass" style=filled fillcolor="#ccffcc"];
RUN_GREEN [label="Run test\nWatch it PASS" style=filled fillcolor="#ccffcc"];
REFACTOR [label="REFACTOR\nClean up" style=filled fillcolor="#ccccff"];
RUN_REFACTOR [label="Run test\nStill PASS?" style=filled fillcolor="#ccccff"];
NEXT [label="Next behavior?"];
RED -> RUN_RED;
RUN_RED -> GREEN [label="fails ✓"];
RUN_RED -> RED [label="passes — fix test"];
GREEN -> RUN_GREEN;
RUN_GREEN -> REFACTOR [label="passes ✓"];
RUN_GREEN -> GREEN [label="fails — fix code"];
REFACTOR -> RUN_REFACTOR;
RUN_REFACTOR -> NEXT [label="passes ✓"];
RUN_REFACTOR -> REFACTOR [label="fails — revert"];
NEXT -> RED [label="yes"];
}
Write ONE minimal test showing expected behavior:
test('deletes post by id', () => {
// Arrange
$repo->create(['title' => 'Test', 'url' => 'https://x.com']);
// Act
$result = $repo->delete(1);
// Assert
assertTrue($result);
assertEmpty($repo->findAll());
});
Run the test. Watch it FAIL. If it passes — you are testing existing behavior, fix the test.
Write the SIMPLEST code that makes the test pass. Nothing more.
Only after green:
Keep tests green throughout.
Next failing test for next behavior.
| Excuse | Reality |
|---|---|
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "I'll test after" | Tests that pass immediately prove nothing. You must WATCH them fail first. |
| "Need to explore first" | Fine. Throw away exploration code, then start with TDD. |
| "TDD will slow me down" | TDD is faster than debugging. Every time. |
| "Manual test is faster" | Manual testing doesn't prove edge cases or prevent regressions. |
| "I can't test this" | You can't test the CURRENT design. Simplify the design. |
| "The framework makes TDD hard" | Test the behavior, not the framework. Mock the boundary. |
| Problem | Solution |
|---|---|
| Don't know how to test | Write the API you wish existed. Assert first. |
| Test too complicated | Design too complicated. Simplify. |
| Must mock everything | Code too coupled. Use dependency injection. |
| Edge case explosion | Separate input validation from business logic. Test each. |
You're done when:
pipeline-advance buildercode-reviewer and run pipeline-advance reviewer — that step writes .adversarial-pending as the green light for adversarial dispatch. It writes the marker only when an adversarial-reviewer definition exists; missing definition and no valid adversarial: skip → the advance BLOCKs (adversarial-agent-missing) rather than dropping the layeradversarial-reviewer before reviewer.done exists; the pre-flight gate (track-agent hook) exits 2 and the dispatch is wastedapd-debug (Phase 4 of debug uses this skill again)What SKILL.md sets; muted values are Claude Code's defaults
xhighThree short reads, in order
npx claudepluginhub zstevovich/claude-apd --plugin claude-apd11 skills in this plugin
/apd-auditUse when verifying that APD is correctly configured in the current project — qualitative deep audit of agents, hooks, CLAUDE.md, pipeline state, MCP wiring, and guardrails. Goes further than verify-apd. Triggers on "audit APD", "review setup", "is APD configured", "verify framework", "check APD", "APD health", "is everything wired", after any major framework upgrade or version bump./apd-brainstormUse BEFORE writing the APD spec-card.md whenever the task is vague, broad, ambiguous, or has multiple reasonable approaches. Asks ONE question at a time, presents 2-3 options when there are real choices, converges on a design the user explicitly approves. Triggers on "improve X", "what should we", "thinking about", "options", "not sure", "maybe", "vague", "broad", "redesign", any spec-card.md with unclear scope or fewer than 3 R-criteria. For the pipeline gate contract (plan format, rationale format, BLOCKs) load /apd-pipeline-guide — that one is mandatory on every task; this one is for unclear scope./apd-debugMANDATORY before re-dispatching the builder after any APD verifier failure or critical reviewer finding. Use on any bug, test failure, build failure, error, crash, regression, or unexpected behavior during the APD pipeline. Four-phase root-cause analysis — investigate, pattern-match, hypothesize + controlled test, fix with TDD. Triggers on "bug", "fail", "failing", "broken", "doesn't work", "error", "crash", "regression", "verifier blocked", "reviewer rejected".