tdd

Run a RED-GREEN-REFACTOR TDD cycle for a story from prd.json.

1|Updated Jan 13, 2023
One-click install
npx skills add https://github.com/theodrosyimer/.dotfiles --skill tdd-theodrosyimer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/theodrosyimer/.dotfiles/tree/main/claude/skills/dev__tdd
Command: npx skills add https://github.com/theodrosyimer/.dotfiles --skill tdd-theodrosyimer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates and enforces a disciplined Test-Driven Development loop for a single user story sourced from prd.json, removing ambiguity about what to change next and preventing unsafe edits to production or test files.

Core Features & Use Cases

  • Orchestrated TDD Cycle: Guides the developer through RED → GREEN → REFACTOR steps for one story at a time, ensuring each test-first requirement is met.
  • File Locking & Guardrails: Enforces test vs production edit rules (as described by the tdd-guard patterns), preventing accidental modifications outside the allowed phase.
  • TPP-Guided Test Ordering: Uses Transformation Priority Premise guidance to select the next test to write during RED, minimizing overly-large transformations.
  • State & Approvals: Persists phase state in .claude/tdd-phase and requires explicit user approval before advancing phases, with escalation when tests appear incorrect.

Quick Start

Run a full TDD cycle for STORY-001 from prd.json by issuing the command /tdd STORY-001.

Frequently Asked Questions about tdd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a test-driven development cycle for a specific user story?

To run a test-driven development cycle, issue the /tdd command with a specific story ID from prd.json, automating the RED, GREEN, and REFACTOR phases for that single story.

What is the RED GREEN REFACTOR cycle in unit testing?

The RED GREEN REFACTOR cycle is a test-driven development workflow where you write one failing test, implement minimal production code to pass it, and then refactor while validating test runs.

How does Transformation Priority Premise guide test ordering?

Transformation Priority Premise guidance selects the next test to write during the RED phase, minimizing overly-large code transformations and ensuring incremental progression.

Can I prevent accidental edits to production files during TDD phases?

Yes, file locking and git hook patterns enforce test versus production edit rules, preventing accidental modifications outside the allowed phase and maintaining safe guardrails.

Do I need prd.json to start unit testing with this approach?

Yes, you need prd.json because the cycle operates on a single story ID sourced from it, requiring explicit user approvals for phase transitions persisted in the phase state file.

Why does the TDD cycle require explicit user approvals before advancing phases?

Explicit user approvals are required before advancing phases to ensure test correctness and prevent unsafe edits, triggering escalation when tests appear incorrect during the transition.