test-driven-development

Guide developers through red-green-refactor cycles with failing tests first.

2|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/ingbyr/lzcode --skill test-driven-development-ingbyr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/ingbyr/lzcode/tree/main/packages/desktop/src-tauri/lz-assets/skills/test-driven-development
Command: npx skills add https://github.com/ingbyr/lzcode --skill test-driven-development-ingbyr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enforces a test-driven development workflow, guiding teams to write a failing test before implementing code to ensure correct behavior is verified from the start.

Core Features & Use Cases

  • Red-Green-Refactor: follow the Red-Green-Refactor cycle to drive progress with tests.
  • Test as primary contract: every feature, bugfix, or refactor must be backed by real tests; avoid code without tests.
  • Deterministic development process: helps teams maintain quality and reduces regressions across features, bugfixes, and refactors.

Quick Start

Begin every feature or bugfix by writing a failing test, then implement the minimal production code to pass the test, and refactor for clarity after all tests pass.

Frequently Asked Questions about test-driven-development

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 cycle work?

Test-driven development is a workflow where you write a failing test first, implement the minimal code to pass it, then refactor. The red-green-refactor cycle drives this by ensuring every change is validated by tests before production code is introduced.

How do I write a failing test first for a new feature or bugfix?

To write a failing test first, define the expected behavior before any production code exists. This test-driven development workflow ensures correct behavior is verified from the start, guiding you to implement only what is necessary to make the test pass.

Can I use test-driven development for refactoring existing code?

Yes, test-driven development applies to refactors by ensuring every change is validated by tests. You write tests that capture current behavior, confirm they pass, refactor the code for clarity, and verify all tests still pass afterwards.

Do I need unit-testing experience to start with test-first development?

Test-first development requires understanding how to write unit tests that define expected behavior. The workflow guides you through a deterministic process with clear expectations for failing tests, minimal implementation, and refactoring only after all tests pass.

Why does test-driven development help reduce software regressions?

Test-driven development reduces regressions by making tests the primary contract for every feature, bugfix, and refactor. This deterministic process maintains quality across changes by validating behavior before production code is introduced.

When should I not use the red-green-refactor workflow?

The red-green-refactor workflow may not suit exploratory prototyping where behavior is undefined. It enforces a deterministic process requiring clear expectations for failing tests and minimal implementation, which works best when desired outcomes are well understood.