tdd

Guide developers through a test-driven development workflow with red-green-refactor cycles.

Updated Apr 28, 2026
One-click install
npx skills add https://github.com/rnaarla/agent_skills --skill tdd-rnaarla
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/rnaarla/agent_skills/tree/main/skills/engineering/tdd
Command: npx skills add https://github.com/rnaarla/agent_skills --skill tdd-rnaarla

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TDD helps teams build reliable software by focusing tests on public behavior rather than internal implementation, reducing regressions and encouraging incremental design.

Core Features & Use Cases

  • Public-interface driven tests that validate user-visible behavior.
  • Guided workflow for planning, tracer bullets, and incremental implementation.
  • Use cases include feature development, bug fixes, and learning environments to practice TDD.

Quick Start

Start with a tracer bullet by writing one failing test and then implementing the minimal code to pass.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I use test-driven development for feature development?

Test-driven development for feature development is guided through a structured red-green-refactor workflow. It enforces writing public-interface tests first to validate user-visible behavior, followed by minimal implementation per cycle to incrementally build reliable features.

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

The red-green-refactor workflow in TDD is a cycle of writing a failing test, implementing minimal code to pass it, and then refactoring. This process separates behavior from internal structure, ensuring incremental design and reducing regressions.

How do I write TDD tests for public behavior instead of internal implementation?

Writing TDD tests for public behavior involves focusing assertions on user-visible interfaces rather than internal module structure. The workflow guides you to validate actual functional output first, ensuring tests remain robust against internal refactoring.

Can I use TDD for bug fixes and learning environments?

TDD is suitable for both bug fixes and learning environments. It guides developers through a strict test-first cycle to reproduce and resolve bugs reliably, while also serving as a structured practice method for mastering incremental implementation.

What's the best way to start a TDD cycle for a new feature?

The best way to start a TDD cycle is by writing a tracer bullet, which is one failing test for a public interface. You then implement the minimal code required to pass that test, establishing a clear separation of behavior from internal structure.

When should I avoid test-driven development?

Test-driven development may be avoided when internal implementation details are highly volatile or user-visible public interfaces are undefined. Since TDD enforces writing public-interface tests first, lacking a clear behavioral target limits its effectiveness for incremental design.