From claude-apd
Use when implementing any feature or fixing any bug as a Builder agent. Write failing test first, then minimal code to pass. MANDATORY for all APD builder dispatches.
npx claudepluginhub zstevovich/claude-apd --plugin claude-apdThis skill is limited to using the following tools:
```
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
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 builderapd-debug (Phase 4 of debug uses this skill again)