TW
TDD Workflow
🔵 Stable🕐 updated 2026-06-30
🔷 SkillSpec L3
pm-craft
Drive a feature with a disciplined test-driven development loop — red, green, refactor. Use when implementing a feature or fixing a bug and you want tests to lead, or when asked to 'do this with TDD' / write the test first. Produces a step-by-step red-green-refactor plan: the failing test to write first, the minimal code to pass it, and the refactor — one small cycle at a time.
What to give it
▸The behavior to build — the feature/bugfix, stated as observable behavior (input → expected output).
▸The stack — language, test framework/runner, where tests live.
▸The seam — the function/module/endpoint under test, and any collaborators to fake/mock.
▸Edge cases — the conditions that matter (errors, empty, boundaries).
✅ The bar it holds itself to
Every skill in this library self-verifies — these are this skill's own quality checks, straight from its definition.
✓Behaviors are listed and ordered simplest-first; each cycle tests ONE behavior
✓The red step writes a genuinely failing test *before* any implementation
✓The green step is the minimal code to pass — no untested extra functionality
✓Refactoring happens only on green, with tests as the safety net
✓Edge/error cases each get their own cycle, not bolted onto the happy path
⚠️ What it refuses to do
Do not write the implementation first and the test after — that's not TDD, it's rationalization
Do not write five tests then all the code — one red→green→refactor cycle at a time
Do not over-build in green — only enough to pass the current test
Do not test implementation details — test observable behavior so refactors don't break tests
Do not skip the refactor step when there's obvious duplication or a bad name
Install
npx pm-claude-skills add --agent claude # or codex · cursor · gemini · hermes
# or one-line MCP (every skill, any client):
claude mcp add pm-skills -- npx -y pm-claude-skills-mcp
Related skills
🔌 Embed this skill
Drop this on your blog, docs, or site — it renders a "Run this skill" card:
<div data-pm-skill="tdd-workflow"></div>
<script src="https://mohitagw15856.github.io/pm-claude-skills/embed.js" async></script>
💬 Discussion
TDD Workflow is one of 625 open-source professional AI agent skills — all SkillSpec L3.
Try them all in the browser · ⭐ Star on GitHub · Browse the full catalog