tdd

Implement test-first development workflows through red-green-refactor iterations.

1|1|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/robertolopezlopez/agent-skills --skill tdd-robertolopezlopez
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/robertolopezlopez/agent-skills/tree/main/skills/core/tdd
Command: npx skills add https://github.com/robertolopezlopez/agent-skills --skill tdd-robertolopezlopez

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers implement features and fix bugs with a disciplined test-first workflow that reduces regressions and keeps changes focused.

Core Features & Use Cases

  • Red-Green-Refactor Workflow: Guides implementation through small vertical slices by writing failing tests, making them pass, and refactoring safely.
  • Behavior-Focused Testing: Encourages testing public interfaces, dependency injection, and observable outcomes instead of internal implementation details.
  • Use Case: When adding a new API behavior or fixing a confirmed bug, use this Skill to create a regression test first and iteratively deliver the smallest validated code change.

Quick Start

Use the tdd skill to implement the requested behavior by creating tests first and validating each incremental change.

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 for a new API behavior?

Test driven development for a new API behavior requires writing a failing regression test first, then delivering the smallest validated code change through red-green-refactor iteration. This workflow reduces regressions and keeps changes focused.

What is the best way to fix a confirmed bug using a test-first workflow?

A test-first workflow for fixing a confirmed bug involves creating a regression test that captures the broken behavior, then iteratively delivering the minimal code change to make it pass. This ensures the fix is validated and prevents future regressions.

Does test driven development require dependency injection for testing public interfaces?

Test driven development encourages dependency injection to test public interfaces and observable outcomes instead of internal implementation details. This practice isolates behavior validation and supports safer refactoring during the red-green-refactor cycle.

How do I apply red-green-refactor to vertical slice development?

Red-green-refactor for vertical slice development works by guiding implementation through small validated changes: writing a failing test, making it pass with minimal code, and refactoring safely. This incremental approach ensures each slice delivers focused, tested behavior.

Can I use this test-first workflow for regression testing without understanding the target behavior?

This test-first workflow requires the target behavior to already be understood before implementation. It applies to feature implementation and regression bug fixes where the expected outcome is clear, enabling small validated changes through disciplined iteration.

When should I not use a test-first development approach?

A test-first development approach is not suited for scenarios where target behavior is not yet understood or cannot be validated through public interfaces. It requires clear expected outcomes and observable results to drive the red-green-refactor iteration effectively.