https://github.com/nizos/tdd-guard
Automated TDD enforcement for Claude Code
https://github.com/nizos/tdd-guard
agentic-coding automation claude-code code-quality hooks llm-tools tdd
Last synced: about 1 month ago
JSON representation
Automated TDD enforcement for Claude Code
- Host: GitHub
- URL: https://github.com/nizos/tdd-guard
- Owner: nizos
- License: mit
- Created: 2025-07-07T09:14:14.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2026-04-18T10:16:44.000Z (about 1 month ago)
- Last Synced: 2026-04-18T12:18:53.322Z (about 1 month ago)
- Topics: agentic-coding, automation, claude-code, code-quality, hooks, llm-tools, tdd
- Language: TypeScript
- Homepage:
- Size: 1.96 MB
- Stars: 1,992
- Watchers: 15
- Forks: 148
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-claude-code - **tdd-guard**
- awesome-claude - tdd-guard - Automated TDD enforcement for Claude Code, ensuring test-driven development practices. (🎯 Project Management & Orchestration / 📖 Community Guides & Tutorials)
- awesome-AI-driven-development - TDD Guard - Automated Test-Driven Development enforcement for Claude Code. (Testing & Security / Other IDEs)
- awesome-ai - nizos/tdd-guard
- awesome-openclaw-skills - TDD Guard - A hooks-driven system that monitors file operations in real-time and blocks chan... | - | (Other)
- awesome-claude-code - nizos/tdd-guard - guard?style=flat-square&logo=github) | TDD enforcement for Claude Code via hooks blocking non-test-driven edits | (Skills & Plugins)
README
# TDD Guard
[](https://www.npmjs.com/package/tdd-guard)
[](https://www.npmjs.com/package/tdd-guard)
[](https://github.com/nizos/tdd-guard/actions/workflows/ci.yml)
[](https://github.com/nizos/tdd-guard/actions/workflows/security.yml)
[](LICENSE)
Automated Test-Driven Development enforcement for Claude Code.
## Overview
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
## 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](docs/installation.md).
## Configuration
- [Custom instructions](docs/custom-instructions.md) - Customize TDD validation rules
- [Lint integration](docs/linting.md) - Automated refactoring support
- [Strengthening enforcement](docs/enforcement.md) - Prevent agents from bypassing validation
- [Ignore patterns](docs/ignore-patterns.md) - Control which files are validated
- [Validation Model](docs/validation-model.md) - Choose faster or more capable model
- [All settings](docs/configuration.md) - Complete settings documentation
## 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](https://docs.anthropic.com/en/docs/claude-code/hooks#security-considerations) for more on hook safety.
## Development
### Contributing
Contributions are welcome! See the [contributing guidelines](CONTRIBUTING.md) to get started.
**Contributors:**
- Python/pytest support: [@Durafen](https://github.com/Durafen)
- PHP/PHPUnit support: [@wazum](https://github.com/wazum)
- Rust/cargo support: [@104hp6u](https://github.com/104hp6u)
- Go support: [@sQVe](https://github.com/sQVe), [@wizzomafizzo](https://github.com/wizzomafizzo)
- Storybook support: [@akornmeier](https://github.com/akornmeier)
- Ruby/RSpec & Minitest support: [@Hiro-Chiba](https://github.com/Hiro-Chiba)
### Roadmap
- 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
## Support
- [Discussions](https://github.com/nizos/tdd-guard/discussions) - Ask questions and share ideas
- [Issues](https://github.com/nizos/tdd-guard/issues) - Report bugs and request features
## License
[MIT](LICENSE)