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.zip

Installs 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.
172 chars✓ has a “when” trigger
Intermediate

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

You give it
Feature requirement
You get back
Tested production code

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-execution or cm-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
NeedSummaryLoad
Normal executioncore TDD loop and verificationreferences/red-green-refactor.md
Test qualitywhat good tests look likereferences/test-quality.md
Reinforcementanti-rationalization guidancereferences/rationalizations.md
Exampleconcrete bug-fix walkthroughreferences/bugfix-example.md
Recoveryhow to proceed when stuckreferences/stuck-debugging.md

Load Rules

  • Load red-green-refactor.md for normal execution.
  • Load test-quality.md when designing or reviewing tests.
  • Load rationalizations.md only when the user or agent is trying to bypass TDD discipline.
  • Load bugfix-example.md only for coaching or example use.
  • Load stuck-debugging.md only 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

Test framework

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.

SkillInstallsUpdatedSafetyDifficulty
cm-tdd (this skill)03moNo flagsIntermediate
vitest416moNo flagsIntermediate
svelte-expert119moNo flagsIntermediate
implementing-cards72moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

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.

41183

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.

11107

implementing-cards

bcollazo

Fill out the implementation of effects of different attacks, abilities, and trainer cards in this Pokemon TCG Pocket engine codebase.

790

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.

1260

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.

953

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.

545

Search skills

Search the agent skills registry