Skill Detail

Enforce red-green-refactor discipline in Claude Code sessions with TDD Guard

Block implementation-first agent behavior and keep Claude Code anchored to failing-tests-first TDD loops.

Code Quality & ReviewClaude Code
Code Quality & Review Claude Code Security Reviewed
⭐ 2k GitHub stars ⬇ 35.5k/wk npm
COPY SKILL INSTRUCTIONS (OPTIONAL)
npx skills add agentskillexchange/skills --skill enforce-red-green-refactor-discipline-in-claude-code-with-tdd-guard Copy
Uses the third-party skills CLI, not an ASE-owned installer. Check your agent’s compatibility. This copies instructions; complete the upstream tool setup below separately.
At a glance
Tools required
Claude Code, Node.js 22+, supported test framework
Install & setup
Add the marketplace in Claude Code, install tdd-guard, then run /tdd-guard:setup to configure the project test reporter and enforcement hooks.
Author
nizos
Publisher
Individual
Last updated
Apr 20, 2026
Quick brief

Use TDD Guard when Claude Code is about to code ahead of the test signal. It intercepts the session, checks whether the change started from a failing test, and pushes the workflow back toward red, then green, then refactor before the agent keeps going. Invoke this instead of relying on normal Claude Code prompting when you need active enforcement of TDD discipline rather than best-effort instructions. The scope is tightly bounded to hook-based TDD validation inside Claude Code sessions, not a generic test runner or broad developer toolkit.