/claude-apd:apd-debugfrom claude-apd
Mandatory four-phase root-cause debugging before re-dispatching the APD pipeline builder after verifier failures or critical reviewer findings.
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 FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you have not completed Phase 1, you CANNOT propose fixes. Guessing is not debugging. Violating the letter IS violating the spirit.
Use when:
Skip when:
digraph debug {
P1 [label="Phase 1\nRoot Cause Investigation" style=filled fillcolor="#ffcccc"];
P2 [label="Phase 2\nPattern Analysis"];
P3 [label="Phase 3\nHypothesis & Test"];
P4 [label="Phase 4\nFix with TDD"];
ESCALATE [label="ESCALATE\n3+ failed fixes\nAsk orchestrator/user" style=filled fillcolor="#ffffcc"];
P1 -> P2;
P2 -> P3;
P3 -> P4 [label="hypothesis confirmed"];
P3 -> P3 [label="hypothesis wrong\nnew hypothesis"];
P3 -> ESCALATE [label="3+ failures"];
P4 -> P1 [label="fix doesn't work"];
}
BEFORE attempting ANY fix:
git diff, recent commits/apd-tdd)| Excuse | Reality |
|---|---|
| "Quick fix for now, investigate later" | Later never comes. The quick fix masks the real bug. |
| "It's probably X, let me fix that" | "Probably" is a guess. Verify before fixing. |
| "Just try changing X and see" | Changing random things is not debugging. Trace the data flow. |
| "I don't fully understand but this might work" | If you don't understand, your fix is random. Phase 1 first. |
| "The error message is misleading" | Maybe. But read it fully before deciding it lies. |
| "It works on my test, ship it" | Did you reproduce the ORIGINAL failure? Run the ORIGINAL failing test. |
| Phase | Do | Don't |
|---|---|---|
| 1. Root Cause | Read errors, reproduce, trace | Guess, skip traces |
| 2. Pattern | Find working code, compare | Assume differences don't matter |
| 3. Hypothesis | One change, verify | Multiple changes at once |
| 4. Fix | Failing test first, single fix | Fix without test, bundle changes |
Example 1 — Phase 1 saves you from the wrong fix.
Input: Builder reports TypeError: Cannot read property 'id' of undefined at UserService.findById:42. Tempting fix: add if (user) guard at line 42.
Output (Phase 1): Trace the data flow upstream. findById receives userId from AuthMiddleware.parseToken() which returns undefined when the token is missing the sub claim. Root cause: middleware silently passes undefined instead of rejecting malformed tokens. Right fix is at the middleware boundary, not the service guard. Phase 4: failing test "malformed token → 401", then validate in parseToken.
Example 2 — Pattern analysis spots the subtle difference.
Input: New endpoint POST /orders/:id/refund returns 500 in CI, works locally. Builder is about to wrap it in try/catch and swallow the error.
Output (Phase 2): Locate three working endpoints (/orders/:id, /cancel, /ship). Diff the registration order: working ones declare router.use(authMiddleware) BEFORE the route; the new one declares the route first. Express middleware order. Phase 4: failing integration test for unauthenticated /refund expecting 401 (currently 500), then reorder router.use.
Example 3 — Three failed hypotheses → escalate, don't form H4.
Input: Verifier blocks pipeline with migration 0042 failed: column already exists. H1 (add IF NOT EXISTS guard) fails. H2 (previous migration not rolled back) — no evidence in history. H3 (stale schema cache) — DB restart, still fails.
Output: STOP. Hand back to user with summary: "0042 fails 'column already exists'; tried IF-NOT-EXISTS, history check, cache restart. Need human inspection of CI schema state." Don't keep guessing — escalate per Iron Law.
You're done when:
apd-tddWhat SKILL.md sets; muted values are Claude Code's defaults
maxThree short reads, in order
Other plugins' skills for the same job
11 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-finishMANDATORY after every successful APD pipeline commit. Use as soon as the pipeline reports commit done — verifies tests from a clean state, shows the pipeline report, presents four options (push, push+PR, keep local, discard), executes the user's choice. Triggers on "after commit", "push", "PR", "pull request", "deploy", "next", "pipeline done", "shipped", commit hash present in pipeline state.npx claudepluginhub zstevovich/claude-apd --plugin claude-apd