tdd

Enforce a red-green-refactor workflow with tests before implementation.

225|62|Updated Dec 29, 2025
One-click install
npx skills add https://github.com/lexler/skill-factory --skill tdd-lexler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/lexler/skill-factory/tree/main/output_skills/testing/tdd
Command: npx skills add https://github.com/lexler/skill-factory --skill tdd-lexler

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces a test-first workflow to ensure code correctness and sustainable design by guiding development through explicit tests before implementation.

Core Features & Use Cases

  • Test-driven planning: Architects the smallest possible tests to drive feature development.
  • Red-Green-Refactor workflow: Enables iterative cycles that validate behavior with tests before and after changes.
  • Quality assurance by design: Keeps code robust by asserting expected outcomes and refactoring when green.
  • Use Case: A developer adds a new module; they write a failing test, implement just enough code to pass, then refactor for clarity and maintainability.

Quick Start

Begin with a failing test, implement the minimal code to pass, then refactor while keeping tests green.

Frequently Asked Questions about tdd

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

FAQPage Schema
What is test-driven development and how does the red-green-refactor workflow work?

Test-driven development enforces a test-first workflow where you write a failing test, implement just enough code to pass it, then refactor for clarity. This iterative red-green-refactor cycle ensures tests guide design and verify behavior throughout the software lifecycle.

How do I implement test-driven development when adding a new module?

Begin with a failing test, implement the minimal code to pass, then refactor while keeping tests green. This test-driven planning architects the smallest possible tests to drive feature development and validate expected outcomes before and after changes.

Do I need external testing tools or frameworks to enforce a test-first workflow?

No external testing tooling is required. This approach relies on standard testing practices to enforce test-driven development, applying to software development tasks from initial feature conception through maintenance without external dependencies.

What's the best way to ensure code correctness and sustainable design during feature work?

The best way to ensure code correctness is through quality assurance by design, keeping code robust by asserting expected outcomes and refactoring only when tests are green. This enforces a disciplined, test-first approach throughout development.

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

Test-driven development is designed for software development tasks from initial feature conception to maintenance. If a task requires rapid prototyping without verifying behavior or asserting expected outcomes, the strict red-green-refactor workflow may limit speed.