Writes a failing test first for bug fixes, behavior changes, or edge cases, then implements minimal code to pass. Use when a project has a test framework and the change is an observable contract.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agent-coding-playbook:acp-test-firstThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill when the user asks to fix a bug, add behavior, or make a change that can be verified through tests.
Use this skill when the user asks to fix a bug, add behavior, or make a change that can be verified through tests.
The goal is to let tests describe the expected behavior before implementation details are changed.
Use this skill for:
Do not force test-first work when the project has no test framework or when the task is purely exploratory. In that case, document the missing test environment.
Before writing code, write down:
Prefer a test that fails for the right reason.
A good failing test is:
Avoid tests that only verify that a mocked internal function was called unless that is the actual contract.
Change only the code needed to make the test pass.
Do not:
After implementation:
If checks cannot be run, say so clearly.
Expected behavior:
- ...
Failing test:
- ...
Implementation:
- ...
Verified:
- ...
Not verified:
- ...
Do not change the test just to match a wrong implementation.
If the test reveals that the requirement is ambiguous or wrong, stop and ask for clarification.
npx claudepluginhub bravekingzhang/agent-coding-playbook --plugin agent-coding-playbookEnforces red-green-refactor TDD for features, bugfixes, refactors with testable outcomes. Requires pasting red (failing) and green (passing) test runner outputs as evidence.
Applies Red-Green-Refactor TDD: write a failing test before implementation. Use for new logic, bug fixes (Prove-It Pattern with a failing test), or modifying existing behavior.