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
INSTALL WITH ANY AGENT
npx skills add agentskillexchange/skills --skill enforce-red-green-refactor-discipline-in-claude-code-with-tdd-guard Copy
Works best when you want a reusable capability, not another fragile one-off prompt.
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.