test-driven-development

Enforce Red-Green-Refactor by writing failing tests before production code.

3|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/dvy1987/agent-loom --skill test-driven-development-dvy1987
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/dvy1987/agent-loom/tree/main/.agents/skills/test-driven-development
Command: npx skills add https://github.com/dvy1987/agent-loom --skill test-driven-development-dvy1987

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents production code from being written without tests by enforcing a disciplined Red-Green-Refactor workflow that improves reliability, clarity, and maintainability of software.

Core Features & Use Cases

  • Enforced Red-Green-Refactor: Guide developers and agents to write a failing test first, implement minimal code to pass, then refactor with safety.
  • Test strategy coverage: Supports unit, integration, and end-to-end testing approaches and emphasizes small, focused test cases.
  • Usage example: Use when adding a new feature, fixing a bug, or refactoring a module to ensure changes are driven by tests, logged, and saved to project test suites.

Quick Start

Write a failing test for the smallest observable behavior of the new feature, run the tests to confirm failure, implement the minimal code to pass, refactor with tests green, and record the session in docs/skill-outputs/SKILL-OUTPUTS.md.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How does test-driven development prevent writing production code without tests?

Test-driven development prevents untested production code by enforcing a strict Red-Green-Refactor workflow. You must write a failing test first, implement minimal code to pass it, and then refactor safely with the test suite verifying your changes.

When should I use the Red-Green-Refactor workflow in my software engineering process?

Use the Red-Green-Refactor workflow when adding new features, fixing bugs, or refactoring modules. This test-first development approach ensures changes are driven by tests, logged, and saved to project test suites to maintain coverage and clarity.

How do I start writing unit tests using a test-first development approach?

To start test-first development, write a failing unit test for the smallest observable behavior of your new feature. Run the tests to confirm the failure, implement minimal code to pass, refactor with tests green, and record the session.

Does this test-driven development approach support both unit and integration testing?

Yes, this test-driven development approach supports unit, integration, and end-to-end testing strategies. It emphasizes writing small, focused test cases to ensure comprehensive test strategy coverage and maintain software reliability.

What is the best way to maintain code quality and test coverage during refactoring?

The best way to maintain code quality during refactoring is to repeat the Red-Green-Refactor cycle with test suite verification. Requiring failing tests before production code ensures changes are driven by tests and maintainability improves.

Why write a failing test before implementing minimal code to pass it?

Writing a failing test before implementing minimal code ensures the test actually validates the new behavior. Running tests to observe failures confirms the test works, preventing false positives and ensuring production code is strictly driven by tests.