Manages the Red-Green-Refactor cycle to ensure quality code production.
Install
mkdir -p .claude/skills/cm-tdd && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9561" && unzip -o skill.zip -d .claude/skills/cm-tdd && rm skill.zipInstalls to .claude/skills/cm-tdd
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when implementing any feature or bugfix. Routes to the core Red-Green-Refactor loop, test quality guidance, rationalization handling, examples, or stuck-state recovery.Key capabilities
- →Red-Green-Refactor loop
- →Test quality guidance
- →Counter rationalizations
- →Stuck-state recovery
How it works
Enforces the TDD cycle of failing test, minimal implementation, and refactoring.
Inputs & outputs
When to use cm-tdd
- →Implementing a new feature with TDD
- →Refactoring legacy code safely
- →Debugging bugs by writing failing tests first
About this skill
Test-Driven Development (TDD)
TL;DR
- Use when writing or fixing code
- Cycle: Red → Green → Refactor
- Rule: no production code without a failing test first
- Next:
cm-executionorcm-code-review
When to Use
- new features
- bug fixes
- refactors
- behavior changes
The Iron Law
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Choose the Need
Need to execute the normal TDD loop?
└─ YES → Red-Green-Refactor
Need help designing or reviewing test quality?
└─ YES → Test Quality
Need to counter "skip TDD" rationalizations?
└─ YES → Rationalizations
Need a worked bug-fix example?
└─ YES → Bugfix Example
Are you blocked or unsure how to continue?
└─ YES → Stuck / Debugging
| Need | Summary | Load |
|---|---|---|
| Normal execution | core TDD loop and verification | references/red-green-refactor.md |
| Test quality | what good tests look like | references/test-quality.md |
| Reinforcement | anti-rationalization guidance | references/rationalizations.md |
| Example | concrete bug-fix walkthrough | references/bugfix-example.md |
| Recovery | how to proceed when stuck | references/stuck-debugging.md |
Load Rules
- Load
red-green-refactor.mdfor normal execution. - Load
test-quality.mdwhen designing or reviewing tests. - Load
rationalizations.mdonly when the user or agent is trying to bypass TDD discipline. - Load
bugfix-example.mdonly for coaching or example use. - Load
stuck-debugging.mdonly when blocked.
Non-Negotiables
- Watch the test fail before writing production code.
- Keep implementation minimal until green.
- Refactor only after green.
- Re-run verification after each meaningful change.
The Bottom Line
Write the failing test first. Pass it minimally. Refactor only after green.
When not to use it
- →Writing production code without tests
- →Bypassing TDD
Prerequisites
Limitations
- →No production code without a failing test first
- →Refactor only after green
How it compares
Strictly enforces the Iron Law of no production code without a failing test first.
Compared to similar skills
cm-tdd side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| cm-tdd (this skill) | 0 | 3mo | No flags | Intermediate |
| vitest | 41 | 6mo | No flags | Intermediate |
| svelte-expert | 11 | 9mo | No flags | Intermediate |
| implementing-cards | 7 | 2mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by tody-agent
View all by tody-agent →You might also like
vitest
antfu
Vitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.
svelte-expert
Raudbjorn
Expert Svelte/SvelteKit development assistant for building components, utilities, and applications. Use when creating Svelte components, SvelteKit applications, implementing reactive patterns, handling state management, working with stores, transitions, animations, or any Svelte/SvelteKit development task. Includes comprehensive documentation access, code validation with svelte-autofixer, and playground link generation.
implementing-cards
bcollazo
Fill out the implementation of effects of different attacks, abilities, and trainer cards in this Pokemon TCG Pocket engine codebase.
zod-4
prowler-cloud
Zod 4 schema validation patterns. Trigger: When creating or updating Zod v4 schemas for validation/parsing (forms, request payloads, adapters), including v3 -> v4 migration patterns.
csharp-pro
sickn33
Write modern C# code with advanced features like records, pattern matching, and async/await. Optimizes .NET applications, implements enterprise patterns, and ensures comprehensive testing. Use PROACTIVELY for C# refactoring, performance optimization, or complex .NET solutions.
write-unit-tests
tldraw
Writing unit and integration tests for the tldraw SDK. Use when creating new tests, adding test coverage, or fixing failing tests in packages/editor or packages/tldraw. Covers Vitest patterns, TestEditor usage, and test file organization.