Back to directory
nizos avatar
nizos / tdd-guard

tdd-guard

Automated TDD enforcement for Claude Code

2,301

Stars

178

Forks

16

Watchers

MIT

License

TDD Guard

npm version npm downloads CI Security License: MIT

[!IMPORTANT] TDD Guard grew into Probity: the same TDD enforcement, now for Claude Code, Codex, and GitHub Copilot CLI, with more reliable validation and no test reporters to set up. New projects should start there. TDD Guard remains maintained for the projects that rely on it.

Automated Test-Driven Development enforcement for Claude Code.

TDD Guard blocking TDD violations

TDD Guard ensures Claude Code follows Test-Driven Development principles. When your agent tries to skip tests or over-implement, TDD Guard blocks the action and explains what needs to happen instead.

Features

  • Test-First Enforcement - Blocks implementation without failing tests
  • Minimal Implementation - Prevents code beyond current test requirements
  • Lint Integration - Enforces refactoring using your linting rules
  • Customizable Rules - Adjust validation rules to match your TDD style
  • Flexible Validation - Choose faster or more capable models for your needs
  • Session Control - Toggle on and off mid-session

Getting Started

Requirements

  • Node.js 22+
  • A supported test framework (Vitest, Jest, Storybook, pytest, PHPUnit, Go, Rust, RSpec, Minitest)

Installation

Open Claude Code in your project and run:

  1. /plugin marketplace add nizos/tdd-guard
  2. /plugin install tdd-guard@tdd-guard
  3. /tdd-guard:setup

This adds the marketplace, installs the plugin, and configures the test reporter for your project. You may need to restart your terminal session or IDE extension for the setup skill to appear. For manual installation and configuration, see the installation guide.

Configuration

Security

TDD Guard hooks run with your user permissions. We maintain automated security scanning, dependency audits, and welcome source code review. See Claude Code's security considerations for more on hook safety.

Development

Contributing

Contributions are welcome! See the contributing guidelines to get started.

Contributors:

Support

  • Discussions - Ask questions and share ideas
  • Issues - Report bugs and request features

License

MIT

Releases

Jun 23, 2026

TDD Guard v1.7.0

Download .zip

What's Changed Bug Fixes

Surface the real cause of a Claude Agent SDK validation error (e.g. credit/balance messages) instead of a truncated parsing error (#191) Handle reasonless, non-JSON, and deci...

Jun 16, 2026

TDD Guard v1.6.9

Download .zip

What's Changed This release updates the default validation model, since the previous default was retired by Anthropic. The new model can validate TDD compliance a little differently than before. If yo...

May 16, 2026

tdd-guard-minitest v0.2.0

Download .zip

What's Changed Breaking Changes

TDD_GUARD_PROJECT_ROOT is now required. The reporter no longer silently falls back to the current working directory; it raises at startup when the variable is not set....

May 2, 2026

TDD Guard v1.6.8

Download .zip

What's Changed Bug Fixes

Fix Claude Code slash commands like /clear being silently swallowed when TDD Guard is active. The CLI's no-op response was being misread by Claude Code's hook protocol as a "...

May 2, 2026

TDD Guard v1.6.7

Download .zip

What's Changed Bug Fixes

Ignore ERB templates by default by @zerone0x (#165) - Thank you for your first contribution!

Plugin

Add Minitest reporter support to the setup skill (plugin v1.3.0)

Full C...