Automated Test-Driven Development enforcement for Claude Code.
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.
Click to watch TDD Guard in action
- 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
- Node.js 22+
- A supported test framework (Vitest, Jest, Storybook, pytest, PHPUnit, Go, Rust, RSpec, Minitest)
Open Claude Code in your project and run:
/plugin marketplace add nizos/tdd-guard/plugin install tdd-guard@tdd-guard/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.
- Custom instructions - Customize TDD validation rules
- Lint integration - Automated refactoring support
- Strengthening enforcement - Prevent agents from bypassing validation
- Ignore patterns - Control which files are validated
- Validation Model - Choose faster or more capable model
- All settings - Complete settings documentation
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.
Contributions are welcome! See the contributing guidelines to get started.
Contributors:
- Python/pytest support: @Durafen
- PHP/PHPUnit support: @wazum
- Rust/cargo support: @104hp6u
- Go support: @sQVe, @wizzomafizzo
- Storybook support: @akornmeier
- Ruby/RSpec & Minitest support: @Hiro-Chiba
- Expand language and test framework support
- Validate file modifications made through MCPs and shell commands
- Encourage meaningful refactoring opportunities when tests are green
- Add support for multiple concurrent sessions per project
- Discussions - Ask questions and share ideas
- Issues - Report bugs and request features