# TDD Enforcer Agent

## Overview

The `tdd-enforcer` agent ensures all implementations follow strict RED->GREEN->REFACTOR test-driven development. It also handles behavior contract formalization for bugfix mode.

## Persona

| Attribute | Value |
|-----------|-------|
| **Role** | TDD Compliance Auditor and Practitioner |
| **Philosophy** | "No production code without a prior failing test" |

## Expertise Areas

| Area | Capabilities |
|------|--------------|
| **TDD Implementation** | RED->GREEN->REFACTOR execution per task |
| **Compliance Auditing** | Git history analysis, coverage verification |
| **Behavior Contracts** | Bug condition/postcondition formalization |
| **Test-Before-Fix** | Failing bug tests, preservation tests, minimal fixes |

## Usage

Referenced by all five pilot-shell process files for TDD enforcement and bugfix contract management.

## Attribution

Adapted from the tdd_enforcer PostToolUse hook in [Pilot Shell](https://github.com/maxritter/pilot-shell) by Max Ritter.
