Skip to main content
skill

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.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --skill development/tdd-workflow
Open on GitHub

What 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-workflow

2Skills CLI (Vercel)

npx skills add davila7/claude-code-templates --skill tdd-workflow -a claude-code

3Manually: put the files in place

~/.claude/skills/tdd-workflow/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/tdd-workflow/

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.

From the same set804

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor