Use test-first development to improve code quality and maintainability.
Overall this is a prompt-only/documentation TDD skill with no secrets, external endpoints, or declared local execution, so risk is low. The main caution is that it describes testing/code workflow, but the material does not show any actual data exfiltration or overbroad access.
No keys, tokens, or environment variables are required, and there is no indication of credential collection, forwarding, or abuse.
No remote host is declared, and there is no described behavior that sends user data to external services.
As a skill, it guides local development/testing workflow, but it does not declare spawning processes, executing arbitrary code, or using system-level capabilities; this is only the ordinary capability of such a tool.
It does not specify any ability to read or write local files, project resources, or sensitive data.
It comes from GitHub and is open source, which helps auditability; however, the license is undeclared, community adoption is 0 stars, and maintenance status is unknown, so supply-chain trust is limited and should be treated cautiously.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "Test-Driven Development (TDD)" skill from askskill: 1. Download https://raw.githubusercontent.com/obra/clank/main/skills/testing/test-driven-development/SKILL.md 2. Save it as ~/.claude/skills/test-driven-development/SKILL.md 3. Reload skills and tell me it's ready
I want to use TDD for a function that calculates an order total. First list the test cases, then provide the first failing test and the minimal implementation code needed to pass it, using JavaScript.
Returns a test list, the first failing test, and the smallest runnable code to make it pass.
This Python code is about to be refactored. Using TDD thinking, first add unit tests for the current behavior, covering normal, edge, and error cases, and explain what behavior each test protects.
Provides executable unit tests with explanations of coverage intent and refactoring safeguards.
Break the requirement 'lock an account for 15 minutes after 5 failed login attempts' into multiple TDD steps. For each step, provide the test to write first, why it should fail, and the minimal implementation suggestion.
Delivers development steps organized by red-green-refactor for incremental implementation.
Write the test first. Watch it fail. Write minimal code to pass.
Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.
Violating the letter of the rules is violating the spirit of the rules.
Always:
Exceptions (ask your human partner):
Thinking "skip TDD just this once"? Stop. That's rationalization.
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Write code before the test? Delete it. Start over.
No exceptions:
Implement fresh from tests. Period.
digraph tdd_cycle {
rankdir=LR;
red [label="RED\nWrite failing test", shape=box, style=filled, fillcolor="#ffcccc"];
verify_red [label="Verify fails\ncorrectly", shape=diamond];
green [label="GREEN\nMinimal code", shape=box, style=filled, fillcolor="#ccffcc"];
verify_green [label="Verify passes\nAll green", shape=diamond];
refactor [label="REFACTOR\nClean up", shape=box, style=filled, fillcolor="#ccccff"];
next [label="Next", shape=ellipse];
red -> verify_red;
verify_red -> green [label="yes"];
verify_red -> red [label="wrong\nfailure"];
green -> verify_green;
verify_green -> refactor [label="yes"];
verify_green -> green [label="no"];
refactor -> verify_green [label="stay\ngreen"];
verify_green -> next;
next -> red;
}
Write one minimal test showing what should happen.
<Good> ```typescript test('retries failed operations 3 times', async () => { let attempts = 0; const operation = () => { attempts++; if (attempts < 3) throw new Error('fail'); return 'success'; };const result = await retryOperation(operation);
expect(result).toBe('success'); expect(attempts).toBe(3); });
Clear name, tests real behavior, one thing
</Good>
<Bad>
```typescript
test('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>
Requirements:
MANDATORY. Never skip.
npm test path/to/test.test.ts
Confirm:
Test passes? You're testing existing behavior. Fix test.
Test errors? Fix error, re-run until it fails correctly.
Write simplest code to pass the test.
<Good> ```typescript async 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> <Bad> ```typescript async function retryOperation<T>( fn: () => Promise<T>, options?: { maxRetries?: number; backoff?: 'linear' | 'exponential'; onRetry?: (attempt: number) => void; } ): Promise<T> { // YAGNI } ``` Over-engineered </Bad>Don't add features, refactor other code, or "improve" beyond the test.
MANDATORY.
npm test path/to/test.test.ts
Confirm:
Test fails? Fix code, not test.
Other tests fail? Fix now.
After green only:
Keep tests green. Don't add behavior.
Next failing test for next feature.
…
Compare 2-3 approaches before execution to choose a stronger solution.
Write evergreen comments focused on what and why, not historical context.
Search past Claude Code chats to recover facts, decisions, and context.
Design systems by hiding implementation details behind domain-level interfaces.
Plan with pseudocode first, refine approaches, then translate into working code.
Helps developers keep class abstractions cohesive and free of unrelated responsibilities.
Write failing tests first to implement features and bug fixes reliably.
Implement features and fixes by writing tests before production code.
Build features, fix bugs, and refactor code with test-driven development.
Create process documentation with test-driven validation before finalizing the draft.
Practice test-driven development for Spring Boot features, fixes, and refactoring.
Helps developers avoid common testing anti-patterns and write more reliable tests.