tdd

You must select a valid, non-empty response type for this request. (e.g. not an error page)

4|Updated Oct 20, 2025
One-click install
npx skills add https://github.com/motoki317/dotfiles --skill tdd-motoki317
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/motoki317/dotfiles/tree/main/.claude/skills/tdd
Command: npx skills add https://github.com/motoki317/dotfiles --skill tdd-motoki317

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides developers to consistently apply test-driven development, turning feature ideas into validated, maintainable code through a clear Red-Green-Refactor workflow.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write one failing test, implement just enough code to pass, then refactor and verify with tests.
  • Plan-driven testing: follow plan.md style test instructions to organize tests and expectations.
  • Quality-focused workflow: commit small, explainable changes after each stage to maintain traceability and reduce risk.
  • Principles in practice: enforce one test per RED, keep methods small, and perform structured refactors to preserve behavior while improving structure.
  • Use cases: ideal for introducing new features in a codebase or replacing brittle implementations with test-driven replacements.

Quick Start

Start by writing one failing test for your feature, implement just enough code to pass, then refactor and commit after each step.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I implement Test-Driven Development using the Red-Green-Refactor cycle?

Test-Driven Development using the Red-Green-Refactor cycle involves writing one failing test, implementing minimal code to pass it, then refactoring while preserving behavior. This Skill guides you through each step with structured commits.

What is the best way to structure unit tests for a new software feature?

The best way to structure unit tests is following a plan-driven testing approach. This Skill helps you organize test instructions and expectations in a plan.md style to ensure incremental, validated implementation.

Can I use this TDD workflow to replace brittle implementations in my codebase?

Yes, you can use this TDD workflow to replace brittle implementations. It is ideal for replacing fragile code with test-driven replacements by enforcing small, explainable commits and explicit refactor steps.

Does Test-Driven Development require committing code after every RED and GREEN step?

Test-Driven Development requires committing small, explainable changes after each stage. This disciplined approach maintains traceability and reduces risk by verifying tests pass before committing incremental updates.

Why should I write only one failing test per RED phase in TDD?

Writing one failing test per RED phase enforces incremental implementation. This disciplined TDD practice keeps methods small, focuses on minimal code to reach GREEN, and ensures structured refactors without breaking existing behavior.

When do I need to refactor code during the Test-Driven Development workflow?

You need to refactor code during the Test-Driven Development workflow after reaching the GREEN phase. This explicit refactor step improves code structure while preserving behavior, verified by running your existing unit tests.