tdd

Guide red-green-refactor loops with behavior-focused integration tests.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/Canepro/codex-skills --skill tdd-canepro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/Canepro/codex-skills/tree/main/skills/tdd
Command: npx skills add https://github.com/Canepro/codex-skills --skill tdd-canepro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Implementers struggle to deliver features with reliable, high-quality tests without a disciplined workflow; this skill codifies test-first development using red-green-refactor loops and behavior-focused tests.

Core Features & Use Cases

  • Structured TDD workflow with tracer bullets
  • Guidance on writing integration-style tests that exercise public APIs
  • Clear path from failing red tests to green implementation and refactor

Quick Start

Run a tracer-bullet cycle for a new feature: write a failing test, implement just enough code to pass, and refactor for quality.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I implement test-first development using red-green-refactor loops?

Test-first development using red-green-refactor loops involves writing a failing behavior test, implementing just enough code to pass it, and refactoring for quality. This structured workflow ensures incremental design and reliable public API validation.

What is the best way to write integration-style tests for public interfaces?

The best way to write integration-style tests for public interfaces is to focus on behavioral validation. You exercise the public API explicitly, ensuring one test at a time validates external contracts without coupling to internal implementation details.

How does a tracer-bullet cycle work in test-driven development?

A tracer-bullet cycle in test-driven development works by establishing a thin vertical slice of functionality. You write a failing test for a new feature, implement the minimum code to turn it green, and refactor to validate the testing philosophy early.

Can I apply TDD workflows across different languages and toolchains?

Yes, you can apply TDD workflows across different languages and toolchains. The structured guidance focuses on universal testing philosophy and behavior-focused tests, ensuring disciplined incremental design regardless of the specific software project environment.

When do I need behavior-focused tests instead of standard unit tests?

You need behavior-focused tests when validating public interfaces and requiring integration-style coverage. This approach ensures your tests confirm actual system behavior and external contracts, aligning with quality assurance practices better than isolated internal logic tests.

Why does refactoring happen after the green phase in TDD?

Refactoring happens after the green phase in TDD because the passing test provides a safety net. Once the failing red test is resolved with minimal green code, you refactor to improve code quality and design without changing the validated external behavior.