tdd

Guide test-first development through red-green-refactor cycles with failing tests.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/RonanCodes/ronan-skills --skill tdd-ronancodes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/RonanCodes/ronan-skills/tree/main/skills/tdd
Command: npx skills add https://github.com/RonanCodes/ronan-skills --skill tdd-ronancodes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TDD enforces writing tests before code, guiding design decisions, reducing defects, and improving long-term maintainability.

Core Features & Use Cases

  • Red-green-refactor development cycles: write a failing test, implement just enough code, and refactor for clarity.
  • Vertical slices: deliver thin, end-to-end features one slice at a time using incremental tests.
  • Story-driven workflow: align tests to acceptance criteria from feature stories or PRD references.

Quick Start

Invoke /tdd with a feature description to begin the red-green-refactor loop.

Frequently Asked Questions about tdd

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

FAQPage Schema
What is the red-green-refactor cycle in test-driven development?

The red-green-refactor cycle in test-driven development involves writing a failing test, implementing just enough code to pass it, then refactoring for clarity. This iterative process guides design decisions and reduces software defects.

How do I implement features using vertical slices with TDD?

Implementing features using vertical slices with TDD requires delivering thin, end-to-end functionality one slice at a time. You define a minimal failing test per slice and iterate through red, green, and refactor steps.

How do I align test-driven development with acceptance criteria from feature stories?

Align test-driven development with acceptance criteria by treating each story or PRD reference as a driver for test creation. You write tests that validate specific acceptance criteria before implementing the feature code.

Do I need a specific test framework to start writing tests before code?

You must select a test framework before writing tests first, but no specific framework is mandated. The workflow adapts to your chosen framework to drive the red-green-refactor loop across your project.

When should I use strict TDD cycles instead of writing tests after implementation?

Use strict TDD cycles when you need to enforce design decisions, reduce defects, and improve long-term maintainability. Writing tests after implementation does not guide code structure or catch design flaws early.

What is the best way to refactor code during a TDD workflow?

The best way to refactor code during a TDD workflow is to perform it only after the minimal implementation passes the test. This ensures behavior remains unchanged while you improve code clarity and maintainability.