tdd

Guide red-green-refactor loops for test-driven development workflows.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development helps teams ensure features work as intended by validating behavior through public interfaces rather than implementation details, enabling safer refactors and earlier bug detection.

Core Features & Use Cases

  • Red-Green-Refactor loop to guide incremental feature development.
  • Integration-style tests that exercise public APIs and user flows.
  • Clear guidance on dependency injection, mocking, and test planning to promote reusable, maintainable tests.

Quick Start

Start by writing a failing test for a small feature, then implement the minimal code to pass it.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I practice test-driven development using red-green-refactor loops?

Test-driven development uses red-green-refactor loops to build features incrementally. You start by writing a failing test, implement the minimal code to pass it, and then refactor while ensuring the public API behavior remains verified.

What is the best way to write integration tests that verify behavior through public APIs?

The best way to verify behavior through public APIs is writing integration-style tests that exercise user flows. Focus on dependency isolation and minimal public API surface testing rather than implementation details to ensure safer refactoring.

Can I use test-driven development for refactoring existing software projects safely?

Yes, test-driven development supports safer refactoring by validating behavior through public interfaces. By maintaining one logical assertion per test and focusing on behavior, you can modify code with confidence without breaking existing user flows.

Does test-driven development require dependency injection and mocking for test planning?

Test-driven development requires dependency isolation for maintainable tests. You apply dependency injection and mocking during test planning to isolate external components and ensure tests exercise the public API surface accurately.

When should I not use test-first development for small feature work?

You should avoid test-first development when verifying implementation details rather than behavior. If your tests cannot isolate dependencies or exercise a minimal public API surface, the imposed requirements for behavior-focused testing may limit flexibility.

Why does test-driven development impose one logical assertion per test?

Test-driven development imposes one logical assertion per test to promote reusable and maintainable tests. This constraint ensures each test verifies a single behavior through the public API, making failures easier to diagnose during the refactor phase.