BeClaude

tdd-guard

New
2.1kCommunity RegistryGeneralby Nizar Selander

Automated Test-Driven Development enforcement

Community PluginView Source

Overview

![npm version](https://www.npmjs.com/package/tdd-guard) ![npm downloads](https://www.npmjs.com/package/tdd-guard) ![CI](https://github.com/nizos/tdd-guard/actions/workflows/ci.yml) ![Security](https://github.com/nizos/tdd-guard/actions/workflows/security.yml) ![License: MIT](LICENSE)

Automated Test-Driven Development enforcement for Claude Code.

<p align="center"> <img src="docs/assets/tdd-guard-demo.gif" alt="TDD Guard blocking TDD violations" width="1200"> </p>

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:

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

Related Projects

Probity

Enforces TDD and other policies across Claude Code, Codex, and Copilot. Works with any language and test runner. Uses session activity for validation, giving it a fuller picture when distinguishing refactors from new behavior.

For new projects, Probity is the better starting point. Stay on TDD Guard if you use its lint integration. Probity doesn't have an equivalent yet.

Support

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

License

MIT

Install & Usage

1
Create the skills directory
mkdir -p .claude/skills
2
Download the skill file
mkdir -p .claude/skills && curl -o .claude/skills/tdd-guard.md https://raw.githubusercontent.com/nizos/tdd-guard/main/SKILL.md
3
Invoke in Claude Code
/tdd-guard
View source on GitHub
testing

Frequently Asked Questions

What is tdd-guard?

Automated Test-Driven Development enforcement

How to install tdd-guard?

To install tdd-guard, create the .claude/skills directory in your project, then run the curl command to download the skill file. Once installed, invoke it in Claude Code with /tdd-guard.

What is tdd-guard best for?

tdd-guard is a community categorized under General. It is designed for: testing. Created by Nizar Selander.