test-driven-development

Enforces RED-GREEN-REFACTOR test-first workflow for implementing features and bugfixes.

14|5|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/MLT-OSS/hermes-agent-go --skill test-driven-development-mlt-oss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/MLT-OSS/hermes-agent-go/tree/main/skills/software-development/test-driven-development
Command: npx skills add https://github.com/MLT-OSS/hermes-agent-go --skill test-driven-development-mlt-oss

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code written before tests often ships with unverified behavior, hidden bugs, and no regression safety net. This Skill enforces a strict test-first discipline so every feature and bugfix is proven by a failing test before any production code exists. ## Core Features & Use Cases - RED-GREEN-REFACTOR Enforcement: Guides the agent through writing a failing test, verifying the failure, writing minimal passing code, and refactoring safely. - Rationalization Detection: Lists common excuses for skipping TDD and red flags that trigger a delete-and-restart of untested code. - Subagent Integration: Provides templates for delegating implementation tasks to subagents with TDD requirements embedded in the goal. - Use Case: When asked to add a retry mechanism to an API client, the agent first writes a test asserting three retry attempts, watches it fail, implements the minimal retry loop, confirms the test passes, then runs the full suite to check for regressions. ## Quick Start Implement the new password validation feature using strict test-driven development, writing the failing test first.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I practice test-driven development when fixing a bug?

Write a failing test that reproduces the bug first, then implement the minimal fix until the test passes. The test proves the fix works and prevents the bug from regressing in future changes.

What is the RED-GREEN-REFACTOR cycle in TDD?

RED means writing one failing test for the desired behavior, GREEN means writing the simplest code to make it pass, and REFACTOR means cleaning up duplication and names while keeping all tests green. The cycle repeats one behavior at a time.

Why must the test fail before writing implementation code?

A test that passes immediately proves nothing, since it may test the wrong thing or existing behavior. Watching it fail confirms the test actually exercises the missing feature and would catch the bug.

When is it acceptable to skip test-driven development?

Only for throwaway prototypes, generated code, or configuration files, and only after asking the user first. Exploration spikes are allowed but the exploratory code must be discarded before restarting with TDD.

What should I do if I already wrote code before the test?

Delete the untested code and start over with a failing test. Keeping it as reference or adapting it leads to tests biased by the implementation, which defeats the purpose of test-first development.