원클릭으로
eia-tdd-enforcement
Use when enforcing TDD via RED-GREEN-REFACTOR. No production code without a failing test first. Trigger with /enforce-tdd.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when enforcing TDD via RED-GREEN-REFACTOR. No production code without a failing test first. Trigger with /enforce-tdd.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Quality gate enforcement for PR integration. Use when verifying code through pre-review, review, pre-merge, or post-merge checkpoints. Trigger with /eia-enforce-gates.
Software release management and coordination. Use when creating releases, bumping versions, or rolling back deployments. Trigger with release tasks or /eia-create-release.
Use when managing team tasks through GitHub Projects V2 or synchronizing project state via GraphQL API. Trigger with /sync-projects or when updating project items.
Use when diagnosing CI/CD failures. Trigger with CI failure logs or pipeline errors.
Use when processing parallel PRs. Trigger with git worktree or parallel development requests.
Use when managing GitHub Issues including creation, labels, milestones, assignees, and comments using gh CLI. Trigger with create issue, set labels, assign milestone.
| name | eia-tdd-enforcement |
| description | Use when enforcing TDD via RED-GREEN-REFACTOR. No production code without a failing test first. Trigger with /enforce-tdd. |
| license | Apache-2.0 |
| compatibility | Requires understanding of TDD principles, RED-GREEN-REFACTOR cycle, test frameworks, and version control. Works with any programming language that supports automated testing. Requires AI Maestro installed. |
| metadata | {"author":"Emasoft","version":"2.0.0"} |
| agent | test-engineer |
| context | fork |
| workflow-instruction | Step 21 |
| procedure | proc-evaluate-pr |
| user-invocable | false |
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.