tdd

Enforce red-green-refactor loops with integration-style tests through public APIs.

5|Updated Oct 18, 2025
One-click install
npx skills add https://github.com/rexshihaoren/rexyDigest --skill tdd-rexshihaoren
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/rexshihaoren/rexyDigest/tree/main/docs/ai/skills/tdd
Command: npx skills add https://github.com/rexshihaoren/rexyDigest --skill tdd-rexshihaoren

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development enforces behavior-first design by focusing tests on public interfaces rather than internal details, keeping refactors safe and auditable.

Core Features & Use Cases

  • Red-Green-Refactor workflow guides feature work and bug fixes with rapid feedback loops.
  • Integration-style tests verify observable behavior through public APIs, not internals.
  • Real-world usage example: "As a developer, you write a failing test for a new feature, implement just enough code to pass, and repeat."

Quick Start

Begin by writing a failing integration-style test that exercises a user-facing behavior, then write the minimal code needed to pass it, and iterate.

Frequently Asked Questions about tdd

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

FAQPage Schema
How does test-driven development improve software refactoring safety?

Test-driven development improves refactoring safety by enforcing a red-green-refactor loop with integration-style tests that verify observable behavior through public APIs, ensuring changes remain auditable and regression-free without coupling to internal implementation details.

How do I start writing integration-style tests for a new feature?

To start writing integration-style tests, begin by writing a failing test that exercises a user-facing behavior through public APIs, implement just enough code to pass it, and iterate using the red-green-refactor workflow for rapid feedback.

What is the red-green-refactor workflow in test-driven development?

The red-green-refactor workflow in test-driven development is a rapid feedback loop where you write a failing test, implement minimal code to pass it, and refactor safely to maintain clear behavioral specifications and regression safety.

Should I test internal implementation details or public APIs with TDD?

You should test public APIs with TDD. By focusing integration-style tests on observable behavior through public interfaces rather than internal details, you ensure refactors remain safe, maintainable, and behavior-first.

When should I use test-driven development for bug fixes?

You should use test-driven development for bug fixes across software projects that demand regression safety and maintainable tests. Write a failing integration-style test reproducing the bug, then implement minimal code to pass it.

What are the limitations of focusing TDD only on public interfaces?

Focusing TDD only on public interfaces limits direct testing of internal modules. However, this constraint ensures maintainable tests and clear behavioral specifications, avoiding brittle tests coupled to implementation details that break during refactoring.