Use when enforcing TDD via RED-GREEN-REFACTOR. No production code without a failing test first. Trigger with /enforce-tdd.
npx claudepluginhub emasoft/emasoft-plugins --plugin emasoft-integrator-agentThis skill uses the workspace's default tool permissions.
This skill enforces Test-Driven Development (TDD) discipline through the RED-GREEN-REFACTOR cycle. It implements the Iron Law: **no production code can be written without a failing test that justifies its existence**.
README.mdreferences/common-patterns.mdreferences/implementation-procedure-part1-test-creation.mdreferences/implementation-procedure-part1-writing-tests.mdreferences/implementation-procedure-part2-implementation-refactor.mdreferences/implementation-procedure-part3-complete-example.mdreferences/implementation-procedure.mdreferences/iron-law.mdreferences/op-handle-tdd-violation.mdreferences/op-implement-minimum-code.mdreferences/op-refactor-code.mdreferences/op-verify-tdd-compliance.mdreferences/op-write-failing-test.mdreferences/red-green-refactor-cycle.mdreferences/rules-and-constraints.mdreferences/status-tracking.mdreferences/test-engineering.mdreferences/troubleshooting-part1-test-failures.mdreferences/troubleshooting-part2-code-issues.mdreferences/troubleshooting-part3-passing-tests.mdExecutes strict TDD workflow with red-green-refactor phases: test specification/design, failing unit tests (RED), coverage thresholds (80% lines), and refactoring triggers. Use for TDD cycles.
Enforces Test-Driven Development (TDD) with red-green-refactor cycle. Guides writing failing tests first for features, bug fixes, or when OMC_TDD_MODE enabled and TDD keywords detected.
Enforces TDD red-green-refactor cycle: test spec/design, failing unit tests, failure verification, 80% line coverage, refactoring on complexity/length triggers.
Share bugs, ideas, or general feedback.
This skill enforces Test-Driven Development (TDD) discipline through the RED-GREEN-REFACTOR cycle. It implements the Iron Law: no production code can be written without a failing test that justifies its existence.
Critical Rule: Never write production code without a failing test first.
| Output Type | Description |
|---|---|
| TDD Status Report | Current phase status (pending, RED, GREEN, refactor) for each feature being developed |
| Git Commit Messages | Structured commits following pattern: RED: test for [feature], GREEN: implement [feature], REFACTOR: improve [aspect] |
| Test Execution Results | Pass/fail status of test suites after each phase transition |
| Enforcement Decisions | Allow/deny decisions for code changes based on TDD compliance (tests must exist before code) |
| Phase Transition Validation | Verification reports confirming proper RED→GREEN→REFACTOR cycle progression |
| Violation Reports | Documentation of TDD discipline violations with recovery procedures |
| Progress Tracking Updates | Multi-feature TDD cycle tracking with phase completion status |
This skill enforces TDD discipline on remote agents. The coordinator delegates testing and coding to developer agents — it verifies compliance, not performs implementation.
Coordinator Responsibilities:
TDD operates through three phases in strict order:
After completing one cycle, return to RED for the next feature.
This SKILL.md is a map to detailed reference documents. Each section below shows when to read each reference file. Click the links to access the full content.
Copy this checklist and track your progress:
Before Writing ANY Production Code:
REDTDD Cycle Summary:
Git Commit Pattern:
RED: test for [feature]
GREEN: implement [feature]
REFACTOR: improve [aspect] in [feature]
Status States:
pending → Test being writtenRED → Test fails, needs implementationGREEN → Test passes, implementation completerefactor → Code improved, ready for next cycleNew to TDD? Read in this order:
Enforcing TDD on Remote Agents?
TDD Enforcement ensures quality through discipline:
The Iron Law is absolute: No code without a failing test.
This skill enforces discipline, remote agents execute the work.
Follow the cycle: RED → GREEN → REFACTOR → Repeat
TDD enforcement MUST align with RULE 14:
Tests Must Match Requirements
Forbidden TDD Pivots
Correct TDD Approach
Every test file SHOULD include:
# Tests for REQ-003: "User specified exact output format"
def test_output_format_matches_requirement():
# Verifies: REQ-003
...
If writing tests reveals a requirement problem:
| TDD Phase | Requirement Check |
|---|---|
| RED | Is this testing what user actually asked for? |
| GREEN | Does implementation match user's specification? |
| REFACTOR | Does refactoring preserve user's requirements? |
# Phase 1: RED - Write failing test
git add tests/test_user_auth.py
git commit -m "RED: test for user authentication"
# Run tests - should FAIL
# Phase 2: GREEN - Implement minimum code
git add src/auth.py
git commit -m "GREEN: implement user authentication"
# Run tests - should PASS
# Phase 3: REFACTOR - Improve code quality
git add src/auth.py
git commit -m "REFACTOR: extract password validation to separate function"
# Run tests - should still PASS
# Check commit history follows TDD pattern
git log --oneline | grep -E "^[a-f0-9]+ (RED|GREEN|REFACTOR):"
# Expected output:
# abc1234 REFACTOR: improve error messages
# def5678 GREEN: implement login endpoint
# 789abcd RED: test for login endpoint
Cause: Test is not testing the right thing or code already exists.
Solution: Ensure the test fails before writing implementation. If test passes immediately, either the test is wrong or you're not in a true RED state.
Cause: TDD discipline violation.
Solution: Revert the production code, write the failing test first, then reimplement. Use the Violation Recovery Procedure in references/rules-and-constraints.md.
Cause: Behavior changed during refactoring.
Solution: Refactoring must preserve behavior. Revert to GREEN state and try smaller refactoring steps.