test-driven-development

Enforce red-green-refactor cycles with tests written before production code.

Updated May 1, 2026
One-click install
npx skills add https://github.com/xiaoquqi/hermes-agent-skills --skill test-driven-development-xiaoquqi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/xiaoquqi/hermes-agent-skills/tree/main/software-development/test-driven-development
Command: npx skills add https://github.com/xiaoquqi/hermes-agent-skills --skill test-driven-development-xiaoquqi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manual software development often proceeds without validating behavior through automated tests, which leads to undetected bugs and costly regressions. Test-driven development (TDD) enforces writing tests before implementation to guide design and ensure correctness.

Core Features & Use Cases

  • Enforces the RED-GREEN-REFACTOR cycle to guide design with test-first thinking.
  • Reduces regressions by ensuring every feature and bugfix starts with a failing test and ends with green passing tests.
  • Supports safe refactoring by maintaining test coverage and validating behavior through automated tests.

Quick Start

Write a failing test that captures the desired behavior, then implement only enough code to make it pass, and refactor.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is the red-green-refactor cycle in test-driven development?

The red-green-refactor cycle in test-driven development mandates writing a failing test first, implementing minimal production code to pass that test, and then refactoring the code while ensuring tests stay green.

How do I apply test-first development to bug fixes and refactoring?

Apply test-first development to bug fixes and refactoring by writing a failing test that captures the desired behavior or reproduces the bug, then implementing the minimal code required to make the test pass.

Why should I write tests before production code to improve code quality?

Writing tests before production code improves code quality by guiding software design through test-first thinking, reducing undetected bugs and costly regressions, and validating behavior through automated tests.

Can I use test-driven development across different projects and teams?

Yes, test-driven development can be applied across different projects and teams. It enforces a disciplined test-first workflow that standardizes feature development, bug fixes, and safe refactoring practices.

What is the best way to start a feature using a test-first workflow?

The best way to start a feature using a test-first workflow is to write a failing test that captures the desired behavior, implement only enough production code to achieve green, and then refactor the implementation.