tdd-workflow

Enforces test-driven development workflow with red-green-refactor cycle and 80% coverage requirements.

10|3|Updated Mar 7, 2026
One-click install
npx skills add https://github.com/Cynthia1070711/PHYCOOL_Tools --skill tdd-workflow-cynthia1070711
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/Cynthia1070711/PHYCOOL_Tools/tree/main/config-templates/claude/skills/tdd-workflow
Command: npx skills add https://github.com/Cynthia1070711/PHYCOOL_Tools --skill tdd-workflow-cynthia1070711

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams often write tests after code, skip error paths, or produce brittle tests that verify implementation details instead of behavior. This Skill enforces a disciplined TDD methodology so every feature, bug fix, and refactor starts with a failing test and ends with verified coverage. ## Core Features & Use Cases - Six-Step TDD Flow: Query memory for similar issues, write ATDD acceptance tests first, then cycle through RED (failing unit test), GREEN (minimal code), IMPROVE (refactor), and coverage verification at 80%+. - Test Category Mapping: Maps test scenarios to CMD, QRY, EVT, and SEC categories so boundary validation, authorization rules, queries, and event triggers each get the right test type. - Bug Fix Proof Chain: Requires a two-commit proof (failing reproduction test, then fix) and records root causes to a context memory database for future retrieval. - Use Case: When fixing a bug in an order refund flow, write a failing test named with the bug ID, implement the minimal fix, verify coverage, and log the root cause so the next similar bug is flagged automatically. ## Quick Start Ask the AI to implement a new feature or fix a bug using the TDD workflow with a failing test first and at least 80 percent coverage.

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
How do I apply TDD when fixing a bug?

Write a failing acceptance test from the bug description first, then a failing unit test named with the bug ID. Implement the minimal fix to turn tests green, verify coverage, and record the root cause in the memory database for traceability.

What is the red-green-refactor cycle in TDD?

RED writes a failing test proving the target behavior is missing, GREEN adds the minimal code to pass it, and REFACTOR improves code quality without changing behavior. Each phase gets its own commit, and CI must show red then green.

What test coverage does this TDD workflow require?

A minimum of 80 percent combined coverage across unit, integration, and end-to-end tests. Edge cases, error scenarios, and boundary conditions must all be covered, not just happy paths.

Should test code follow DRY or DAMP principles?

Test code should follow DAMP (Descriptive And Meaningful Phrases) over DRY. Keeping setup inline and slightly repetitive makes each test readable on its own, while over-abstracted helpers hide critical setup details.

What are common TDD mistakes to avoid?

Avoid testing internal implementation details instead of visible behavior, using brittle CSS selectors, creating dependencies between tests, writing code before tests, and skipping error paths. Each test should be independent with descriptive names.

How many debug rounds are allowed when tests keep failing?

Test failure fixes are limited to three rounds. If the issue persists beyond that, the workflow triggers context compression or a fresh root cause analysis instead of continued trial-and-error patching.