/slow-powers:working-with-tddfrom slow-powers
Use when implementing any feature, refactoring, or writing a bugfix.
Ships in slow-powers. 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.
Write the test first. Watch it fail. Write minimal code to pass. Refactor.
THE IRON LAW: NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST.
Write production code before the test? Delete it. Start over. Do not keep it for "reference" or "adapt" it. Delete means delete.
Violating the letter of the rules is violating the spirit of the rules.
REQUIRED PREREQUISITE: You must have already completed
slow-powers:working-in-isolation— establish an isolated workspace before writing any test or production code.
REQUIRED NEXT SKILL: You must complete
slow-powers:verifying-development-worknext, after the TDD implementation work is done and before claiming the task is complete or handing work back to the user.
npm test / pytest / go test.test('retries failed operations 3 times', async () => {
let attempts = 0;
const operation = async () => {
attempts++;
if (attempts < 3) throw new Error('fail');
return 'success';
};
const result = await retryOperation(operation);
expect(result).toBe('success');
expect(attempts).toBe(3);
});
test('retry works', async () => {
const mock = jest.fn()
.mockRejectedValueOnce(new Error())
.mockRejectedValueOnce(new Error())
.mockResolvedValueOnce('success');
await retryOperation(mock);
expect(mock).toHaveBeenCalledTimes(3);
});
While writing or changing a test, check it against this table. If a row matches, read the named section of the testing anti-patterns reference before moving on — mocks are the most common source of these, but not the only one.
| If your test… | Anti-pattern | Section to read |
|---|---|---|
asserts on a mock / *-mock element instead of real output | testing mock behavior | Testing mock behavior |
| needs a method on a production class that only tests call | test-only methods in production | Test-only methods in production |
| mocks a method without knowing its side effects | mocking without understanding | Mocking without understanding |
| uses a mock with only the fields you happen to need | incomplete mocks | Incomplete mocks |
| is written after the implementation, with no failing test first | tests as afterthought | Tests as afterthought |
stubs by call order (...Once chains) or asserts "call N" / "the last call" | order-dependent mocks/assertions | Order-dependent mocks and assertions |
| has more mock setup than test logic | over-complex mocks | When mocks become too complex |
| Excuse | Reality |
|---|---|
| "This is too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "I'll test after to verify it works" | Tests passing immediately prove nothing. |
| "I already know what the code should look like" | Knowing the answer doesn't mean the requirement is specified. |
| "Testing this would be trivial" | Trivial tests are cheap; skipping them costs later. |
| "I'll add tests later, I promise" | Later never comes. The codebase drifts. |
| "The spirit of TDD is what matters, not the letter" | Violating the letter is violating the spirit. |
All of these mean: delete code. Start over with TDD.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub slowdini/slow-powers --plugin slow-powers9 skills in this plugin
/auditing-slow-powers-usageUse only when a slow-powers developer explicitly asks for a post-session audit of how slow-powers skills were used during the session just completed. A manual diagnostic for people working ON slow-powers — never relevant to ordinary development tasks; do not auto-invoke./evaluating-skillsUse when defining eval coverage for a skill, authoring or maintaining its eval suite, or assessing whether a skill or revision improves agent behavior./hardening-plansUse right after you've drafted or revised an implementation plan and before you present it or start coding — a fresh-eyes review that catches placeholders, hallucinated file references, irrelevant steps, coverage gaps, inconsistent names, and structural drift before the user has to/investigating-bugsUse when encountering any bug, test failure, build error, or unexpected behavior./verifying-development-workUse before claiming any task is complete, fixed, or passing, and before handing finished work back to the user./working-in-isolationUse when you're about to start changing files in a repository — code, docs, config, or content, whether a feature, bugfix, refactor, or docs/config update — to establish an isolated workspace so your work doesn't collide with existing or in-progress work.