test-driven-development

Automate test-first development with a RED-GREEN-REFRACTOR cycle.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tight coupling between production code and tests leads to fragile software and missed bugs. TDD forces writing tests before code to define behavior and prevent regressions.

Core Features & Use Cases

  • Red-Green-Refactor cycle clarifies design, ensures test coverage, and promotes safer refactoring.
  • Mandatory failing tests before production code provides a clear failure signal and guards against regressions.
  • Guides development workflows for feature implementation, bug fixes, and maintenance with a test-driven approach.

Quick Start

Write a failing test first, run it to confirm failure, then implement the minimal production code to pass, and refactor as needed.

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 discipline where you write tests before production code. The red-green-refactor cycle means writing a failing test, implementing minimal code to pass it, then refactoring safely.

How do I start writing unit tests before production code?

Start by writing a failing unit test first, run it to confirm failure, then implement the minimal production code to pass the test, and refactor as needed to maintain quality.

Why does writing tests after code lead to fragile software and missed bugs?

Writing tests after code tightly couples production code and tests, leading to fragile software and missed bugs. TDD forces writing tests first to define behavior and prevent regressions.

Can I apply the TDD process to bug fixes and refactoring existing features?

Yes, the TDD process guides development workflows for feature implementation, bug fixes, and maintenance by enforcing a test-driven approach across all software-engineering tasks.

Do I need mandatory failing tests before writing minimal production code?

Yes, mandatory failing tests before production code provide a clear failure signal and guard against regressions, ensuring you only write minimal code needed to pass tests.