diff --git a/README.md b/README.md index e5c0ab0..cfce37c 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,43 @@ TDD Guard ensures Claude Code follows Test-Driven Development principles. When y Click to watch TDD Guard in action
+## What is Test-Driven Development? + +**Test-Driven Development (TDD)** follows a simple three-step cycle: + +1. **๐ด Red**: Write one failing test function +2. **๐ข Green**: Write minimal code to make it pass +3. **๐ Refactor**: Clean up code while keeping tests green + +## Why TDD Benefits Claude Code + +Claude Code can sometimes over-implement, skip tests, or add multiple features at once. TDD Guard prevents this by: + +- **๐ฏ One test at a time**: Blocks adding multiple test functions in one operation +- **๐ Minimal implementation**: Prevents code beyond current test requirements +- **๐งช Test-first enforcement**: No implementation without failing tests +- **๐ Safe refactoring**: Only when tests are passing + +## How TDD Guard Works + +```mermaid +flowchart TD + A[Claude Code Edit/Write Operation] --> B[Hook Trigger