tdd-workflow · davila7 — Claude Code skill: what it does, how to install
Guides Claude Code through the test-driven development loop: write a failing test first, make it pass with simple code, then refactor.
npx claude-code-templates@latest --skill development/tdd-workflowWhat tdd-workflow does
This skill guides Claude Code through a disciplined red-green-refactor loop. The agent begins by writing a focused test that verifies expected behavior and confirms it fails. Next, it writes the minimal application logic required to pass, following YAGNI rules without early optimization. Once green, the assistant cleans up code structure while keeping test assertions intact.
Test composition follows the Arrange-Act-Assert convention. Checks are prioritized deliberately: happy-path logic comes first, followed by error states, edge cases, and performance checks. For exploratory spikes or UI styling, the instructions explicitly flag TDD as low value.
Operation relies on Read, Write, Edit, Glob, Grep, and Bash. Without a working test runner configured in your project, the agent cannot execute or verify test runs.
What it helps with
- reproduce a defect with a failing test before editing source files
- scaffold new features using the Arrange-Act-Assert pattern
- refactor repetitive code without breaking existing behavior
- prevent over-engineering by enforcing minimal passing implementations
Example prompts for the agent
- Use TDD to implement the currency conversion utility
- Write a failing unit test for the empty payload bug, then fix it
How to install tdd-workflow
1claude-code-templates
npx claude-code-templates@latest --skill development/tdd-workflow2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill tdd-workflow -a claude-code3Manually: put the files in place
~/.claude/skills/tdd-workflow/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/tdd-workflow/
Manually: put the files in place
.agents/skills/tdd-workflow/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/tdd-workflow/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates tdd-workflow2Manually: put the files in place
.github/skills/tdd-workflow/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/development/tdd-workflowManually: put the files in place
.devin/skills/tdd-workflow/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about tdd-workflow
How do I install tdd-workflow in Claude Code?
Run npx claude-code-templates@latest --skill development/tdd-workflow in your terminal.
When should this workflow be avoided?
The instructions note that exploratory prototyping and UI layout work gain little value from strict test-first development. In those scenarios, write exploratory code before testing.
What tools does tdd-workflow require?
The configuration allows Read, Write, Edit, Glob, Grep, and Bash so the agent can inspect source trees and run test commands.
Similar skills
All skills for Testing and QA →tdd-workflow by other authors comes first.