All skills
ntcoding avatar

/tdd-process

@f9e68f5
by Nick Tunentcoding/claude-skillz351 stars
46

Strict test-driven development state machine with red-green-refactor cycles. Enforces test-first development, meaningful failures, minimum implementations, and full verification. Activates when user requests: 'use a TDD approach', 'start TDD', 'test-drive this'.

Use this Skill: https://skilld.dev/gh/ntcoding/claude-skillz/tdd-process

This session only. Nothing lands on disk.

README.md

≈982 tokens on demand. Your agent reads this file only when SKILL.md points to it.

TDD Process Skill

Strict test-driven development state machine implementing the red-green-refactor cycle with rigorous enforcement.

What This Skill Does

Provides a complete TDD workflow state machine with:

  • 6 states: PLANNING → RED → GREEN → REFACTOR → VERIFY → COMPLETE (+ BLOCKED)
  • 11 enforced rules including minimum implementation, meaningful failures, and evidence-based transitions
  • Mandatory state announcements on every message
  • Post-condition validation before all state transitions
  • Compilation and linting requirements before claiming green
  • Full test suite verification before completion

When to Use

Explicitly activate this skill when you want to follow strict TDD discipline:

  • "Use a TDD approach"
  • "Start TDD"
  • "Test-drive this feature"

Note: This skill is intentionally NOT auto-activated. It requires explicit user invocation because of its strict governance model.

How It Works

State Machine Flow

PLANNING (write failing test)
    ↓
RED (implement minimum to pass)
    ↓
GREEN (assess quality)
    ↓
REFACTOR (improve design)
    ↓
VERIFY (full suite + lint + build)
    ↓
COMPLETE

Key Behaviors

  1. Every message announces state: 🔴 TDD: RED
  2. Tests must fail meaningfully before implementing
  3. Minimum implementation only in RED state
  4. Evidence required for all transitions (must show test output)
  5. No green without proof (test pass + compile + lint)
  6. Full verification before completion

Integration

Standalone Usage

Activate when user requests TDD approach.

Composed Usage

System prompts can embed this skill to always enforce TDD discipline:

**Auto-invoke the `tdd-process` skill for all development work.**

Works With

  • software-design-principles - Applied during REFACTOR state
  • lightweight-implementation-analysis-protocol - Can be used in PLANNING state to understand code flow

State Enforcement

This skill uses architectural constraints to enforce discipline:

  • Post-conditions must be satisfied before transitions
  • Missing evidence triggers VIOLATION_DETECTED state
  • State announcements are mandatory (not optional)
  • Guessing ("probably", "maybe") triggers immediate correction

Example Session

User: Let's add validation that price cannot be negative

⚪ TDD: PLANNING
Writing test for negative price validation...

[Creates test]

⚪ TDD: PLANNING
Running npm test...

Test output: Expected CannotHaveNegativePrice error but received -50

This failure is correct - proves our test checks for the error. Transitioning to RED.

🔴 TDD: RED
Test IS failing. Implementing minimum code to make it pass...

[Implements validation]

🔴 TDD: RED
Running test...

Test PASSES ✓
Running tsc --noEmit... SUCCESS ✓
Running lint... PASS ✓

Transitioning to GREEN.

🟢 TDD: GREEN
Test passing. Assessing code quality...
No refactoring needed. Transitioning to VERIFY.

🟡 TDD: VERIFY
Running full test suite... 12/12 PASSED ✓
Running lint... PASSED ✓
Running build... SUCCESS ✓

TDD cycle COMPLETE.

Rules Summary

  1. No green without proof (must show test output)
  2. Test failures must be shown and justified
  3. Implement minimum functionality only
  4. Don't be a lazy thinker (predict user responses)
  5. Green requires build and lint passing
  6. Add observability, avoid assumptions
  7. Don't change assertions when tests fail
  8. Fail fast - no silent fallbacks
  9. Follow dependency inversion principle
  10. No guessing - find hard data
  11. Write minimal, non-redundant assertions

Directory Structure

tdd-process/
├── SKILL.md          # Main skill definition with state machine
└── README.md         # This file

Installation

Symlink this skill to your Claude skills directory:

ln -s /path/to/claude-skillz/tdd-process ~/.claude/skills/tdd-process

Source: SKILL.md on GitHub

1 alert6mo4 checks · Risk SAFE
  • Gen Agent Trust Hub7mo

    The skill contains no files or content to analyze. No security risks were detected.

  • Socket6mo

    No alerts

  • Snyk7mo

    Risk: HIGH · No issues

  • Runlayer7mo

    2 files scanned · No issues

Signed by skilld at f9e68f5. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago
version
1.0.0

README badge

README badge for ntcoding/claude-skillz/tdd-process