tdd

Guide users through the RED-GREEN-REFACTOR cycle for Test-Driven Development.

Updated Jan 28, 2026
One-click install
npx skills add https://github.com/xjiang77/agent-wisp --skill tdd-xjiang77
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/xjiang77/agent-wisp/tree/main/tools/setup-toolkit/skills/tdd
Command: npx skills add https://github.com/xjiang77/agent-wisp --skill tdd-xjiang77

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TDD enforces writing failing tests before implementation to ensure code reliability and design clarity.

Core Features & Use Cases

  • RED-GREEN-REFACTOR cycle drives incremental development with tests guiding design.
  • Clear workflow: write a failing test, make it pass, and refactor while keeping tests green.
  • Use Case: When starting a new feature, begin with a failing spec to define expected behavior and drive implementation.

Quick Start

Write a failing test for the next feature, then implement the minimal code to make it pass and refactor while keeping tests green.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I practice test-driven development using the red-green-refactor cycle?

Test-driven development automates the red-green-refactor cycle by guiding you to write a failing test, implement minimal code to pass it, and refactor while keeping tests green. This enforces a disciplined, incremental workflow that drives software design through tests.

What is the best way to start a new feature with tests-first development?

Start tests-first development by writing a failing spec that defines the expected behavior for your new feature. Once the test fails, implement the minimal code required to make it pass, then refactor the implementation while ensuring all tests remain green.

How does writing failing tests before implementation improve software engineering workflows?

Writing failing tests before implementation improves software engineering workflows by ensuring code reliability and design clarity. It drives incremental development, forcing you to define expected behavior upfront and maintain a clear, test-guided design process throughout the refactoring phase.

Can I document test and code changes during the refactoring phase of TDD?

Yes, you can document test and code changes during the refactoring phase of TDD. The workflow supports documenting these changes while you refactor the codebase, ensuring that the implementation and its corresponding tests remain clear and maintainable as the design evolves.

Does test-driven development require specific testing frameworks to run the red-green-refactor cycle?

No, test-driven development does not require specific testing frameworks. The workflow automates the red-green-refactor cycle conceptually, allowing you to apply the tests-first discipline within your existing software engineering environment regardless of the specific testing tools you use.