tdd-workflow

Enforce a disciplined TDD workflow through a 7-state machine for code tasks.

3|1|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/jagreehal/jagreehal-claude-skills --skill tdd-workflow-jagreehal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/jagreehal/jagreehal-claude-skills/tree/main/skills/tdd-workflow
Command: npx skills add https://github.com/jagreehal/jagreehal-claude-skills --skill tdd-workflow-jagreehal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The TDD workflow enforces a disciplined development process by requiring tests to drive design, using a strict 7-state state machine to govern every interaction.

Core Features & Use Cases

  • Stateful TDD governance: Every message must declare the current TDD state and progress through PLANNING, RED, GREEN, REFACTOR, VERIFY, BLOCKED, or VIOLATION.
  • Deterministic integration: Works with fn(args, deps) pattern, vitest-mock-extended, and typed error handling to ensure test-driven, type-safe development.
  • Use Case: In a Claude code assistant, enforce red/green cycles when implementing a new feature via tests first.

Quick Start

  • Start a session with the skill and ensure every message begins with the current TDD state prefix.
  • Run tests to observe state transitions, then implement minimal changes to move the state forward.

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
How do I enforce a strict red-green-refactor TDD cycle in TypeScript?

You enforce a strict red-green-refactor TDD cycle in TypeScript by applying a 7-state state machine that requires every message to declare its current state. This governs the progression through PLANNING, RED, GREEN, REFACTOR, VERIFY, BLOCKED, or VIOLATION, ensuring tests drive design.

What is a TDD state machine and how does it structure development workflow?

A TDD state machine is a governance mechanism that maps development workflow into seven explicit states: PLANNING, RED, GREEN, REFACTOR, VERIFY, BLOCKED, and VIOLATION. It structures workflow by requiring every interaction to begin with a current state prefix, forcing disciplined transitions.

How do I integrate vitest-mock-extended and dependency injection for deterministic testing?

You integrate vitest-mock-extended and dependency injection for deterministic testing by combining them with the fn(args, deps) pattern and typed error handling. This ensures type-safe, test-driven behavior and provides deterministic mock generation for your dependencies.

Does this TDD workflow approach work for chat-driven code generation tasks?

Yes, this TDD workflow works for chat-driven code generation tasks. The state machine explicitly applies to both code and chat-driven tasks, ensuring the assistant follows the test-first discipline during interactive feature implementation.

When should I use a BLOCKED or VIOLATION state in test-driven development?

You use the BLOCKED or VIOLATION state in test-driven development when progress halts or the red-green-refactor cycle is broken. The state machine transitions to VIOLATION when workflow discipline is compromised, and BLOCKED when external issues prevent forward movement.

Can I apply typed error handling alongside a vitest TDD workflow?

Yes, you can apply typed error handling alongside a vitest TDD workflow. Typed error handling is a required integration that works with vitest-mock-extended and the fn(args, deps) pattern to provide deterministic, type-safe behavior throughout the state machine cycles.