Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when implementing any feature or bugfix, before writing implementation code - write the test first, watch it fail, write minimal code to pass; ensures tests actually verify behavior by requiring failure first
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-11 | ✗→✓ | ▲ Improved | 72% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 151% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 221% | 0% |
| case-20 | ✗→✓ | ▲ Improved | 55% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 177% | 0% |
<required> CRITICAL Add the following steps to your Todo list using TodoWrite:
<system-reminder>If you have more than one test that you need to write, you should write all of them before moving to the GREEN phase.</system-reminder>
.claude/skills/creating-debug-tests-and-iterating</required>
Write one minimal test showing what should happen.
<good-example>
typescripttest('retries failed operations 3 times', async () => { let attempts = 0; const operation = () => { attempts++; if (attempts < 3) throw new Error('fail'); return 'success'; }; const result = await foobar.retryOperation(operation); expect(result).toBe('success'); expect(attempts).toBe(3); });
Clear name, tests real behavior, one thing. Note that the tested operation is imported -- this is a STRONG sign that this is testing something real.
</good-example>
<bad-example>
typescripttest('retry works', async () => { const mock = jest .fn() .mockRejectedValueOnce(new Error()) .mockRejectedValueOnce(new Error()) .mockResolvedValueOnce('success'); await retryOperation(mock); expect(mock).toHaveBeenCalledTimes(3); });
Vague name, tests mock not code </bad-example>
bashnpm test path/to/test.test.ts
Confirm:
Write simplest code to pass the test.
<good-example>
typescriptasync function retryOperation<T>(fn: () => Promise<T>): Promise<T> { for (let i = 0; i < 3; i++) { try { return await fn(); } catch (e) { if (i === 2) throw e; } } throw new Error('unreachable'); }
Just enough to pass </good-example>
<bad-example>
typescriptasync function retryOperation<T>( fn: () => Promise<T>, options?: { maxRetries?: number; backoff?: 'linear' | 'exponential'; onRetry?: (attempt: number) => void; } ): Promise<T> { // YAGNI }
Over-engineered </bad-example>
Don't add features, refactor other code, or "improve" beyond the test.
bashnpm test path/to/test.test.ts
Confirm:
After green only:
Keep tests green. Do not add behavior.
Other measured skills in the registry, with their headline benchmark lift.