nizos/tdd-guard โ€” GitHub Repository Preview
Developer Tools โ˜… 1.8k TypeScript

nizos/tdd-guard

by @nizos ยท

1.8k Stars
137 Forks
33 Issues
TypeScript Language

TDD Guard is an automated Test-Driven Development enforcement tool for Claude Code that ensures AI agents follow proper TDD discipline. It hooks into Claude Code's lifecycle events to block implementation attempts that lack corresponding failing tests, preventing over-implementation and test-skipping. The tool supports multiple languages and frameworks including TypeScript, JavaScript, Python, PHP, Go, Rust, and Storybook. It validates that code changes satisfy only current test requirements, enforces refactoring through lint integration, and provides session-level toggle controls. With customizable validation rules and flexible model selection for speed-versus-capability trade-offs, TDD Guard brings rigorous Red-Green-Refactor workflows to AI-assisted development, ensuring code quality without sacrificing developer velocity.

nizos
@nizos Project maintainer on GitHub
View Profile
View on GitHub
git clone https://github.com/nizos/tdd-guard.git

Quick Start Example

typescript
npm install -g tdd-guard

# In your vitest config:
import { defineConfig } from "vitest/config"
import { VitestReporter } from "tdd-guard-vitest"

export default defineConfig({
  test: {
    reporters: ["default", new VitestReporter("/path/to/project")],
  },
})

# Then configure Claude Code hooks:
# PreToolUse, UserPromptSubmit, SessionStart
# pointing to the tdd-guard command

Tags

#tdd#claude-code#testing#code-quality#hooks#automation

Related Projects