Tdd Workflow
Structured guide that teaches the RED-GREEN-REFACTOR cycle with rules and anti-patterns for each phase.
- CCM score
- 50 of 100
- skills.sh installs
- 290
- GitHub stars
- 34.3K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers the RED, GREEN, and REFACTOR phases, plus the three laws of TDD and the AAA test structure
- Includes phase-specific rules, a test prioritization order from happy path through performance, and a table of common anti-patterns
- Guides when TDD pays off most, marking new features, bug fixes, and complex logic as high value and UI layout as low
- Designed for developers and AI agent workflows that need a disciplined test-first sequence
Install
$ npx -y skills add davila7/claude-code-templates --skill tdd-workflow -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
TDD Workflow
Write tests first, code second.
1. The TDD Cycle
π΄ RED β Write failing test
β
π’ GREEN β Write minimal code to pass
β
π΅ REFACTOR β Improve code quality
β
Repeat...
2. The Three Laws of TDD
- Write production code only to make a failing test pass
- Write only enough test to demonstrate failure
- Write only enough code to make the test pass
3. RED Phase Principles
What to Write
| Focus | Example |
|---|---|
| Behavior | "should add two numbers" |
| Edge cases | "should handle empty input" |
| Error states | "should throw for invalid data" |
RED Phase Rules
- Test must fail first
- Test name describes expected behavior
- One assertion per test (ideally)
4. GREEN Phase Principles
Minimum Code
| Principle | Meaning |
|---|---|
| YAGNI | You Aren't Gonna Need It |
| Simplest thing | Write the minimum to pass |
| No optimization | Just make it work |
GREEN Phase Rules
- Don't write unneeded code
- Don't optimize yet
- Pass the test, nothing more
5. REFACTOR Phase Principles
What to Improve
Details
- Repository
- github.com/davila7/claude-code-templates
- Categories
- Testing & QA, Agent Workflow & Planning
- First seen
- Jun 3, 2026
Questions
What is the tdd-workflow skill for?
The tdd-workflow skill sets out Test-Driven Development principles for an agent, following the RED-GREEN-REFACTOR cycle: write a failing test, write minimal code to pass it, then improve the code while keeping tests green. It also covers the AAA test pattern and when TDD suits new features, bug fixes and complex logic. It is listed under the Testing & QA category on Claude Marketplaces, alongside tdd, test-driven-development and webapp-testing.
How do I install the tdd-workflow skill?
Run npx -y skills add davila7/claude-code-templates --skill tdd-workflow -y in your project to install it. Once installed, the tdd-workflow skill lets the agent guide you through writing tests before code, with allowed tools for reading, writing, editing, searching and running shell commands.
Which tools does the tdd-workflow skill use?
The tdd-workflow skill is allowed to use Read, Write, Edit, Glob, Grep and Bash. It needs no separate accounts or API keys, so it works inside any project where the agent can read and change files and run tests.
When should I use the tdd-workflow skill instead of skipping tests?
Use the tdd-workflow skill for new features, bug fixes and complex logic, where its RED phase guidance has the most value. For exploratory spikes or UI layout work, the skill itself suggests lower TDD value, so a spike first and then test-first work is the approach it recommends.
More from davila7/claude-code-templates
All 398- Get Available Resources289
- Gwas Database289
- Torch Geometric289
- Pubchem Database288
- Railway Status288
- Loki Mode285
- Viral Generator Builder285
- Railway Docs284
- Railway New284
- Bioservices282
- Railway Environment282
- Railway Projects282
- Railway Service282
- Anndata281
- Cocoindex281
- Finishing A Development Branch281
- Pdb Database281
- Railway Templates280
- Cc Skill Continuous Learning279
- Chembl Database278
- Deepchem278
- Using Git Worktrees278
- Free Tool Strategy276
- Qms Audit Expert276
Similar to Tdd Workflow
More Testing & QAtddSkillpproenca/dot-skills426 installsStructured guide of 42 test-driven development rules for red-green-refactor workflow and test design.
test-driven-developmentSkilladdyosmani/agent-skills80.2K installsStructured red-green-refactor workflow that writes a failing test before any code change, including bug fixes.
tdd-orchestratorSkillsickn33/agentic-awesome-skills334 installsExpert TDD orchestrator that enforces red-green-refactor discipline and coordinates multi-agent test workflows across teams.
dev-practicesPluginspences10/claude-code-toolkit37 starsDevelopment practices: TDD workflow with red-green-refactor
tdd-guideSkillalirezarezvani/claude-skills1.1K installsTest-first development skill that generates tests, mocks, and coverage analysis across Jest, Pytest, JUnit, Vitest, and Mocha.