test-driven-development

Enforce a test-driven development workflow with failing tests before production code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing and maintaining production-ready software often suffers from weak test coverage and regression bugs. This skill enforces a test-first workflow by ensuring a failing test is written before production code, guiding teams through a RED-GREEN-REFACTOR cycle.

Core Features & Use Cases

  • Enforces the RED-GREEN-REFACTOR discipline for feature development, bug fixes, and refactors.
  • Provides structured guidelines and examples to craft meaningful tests, organize test suites, and drive incremental implementation.
  • Use Case: When planning a new feature, write a failing test first, implement the minimal code to pass, then refactor for readability and reliability.

Quick Start

Write a failing test for the intended behavior first, then implement the minimal code to pass that test and refactor.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I enforce a test-driven development workflow in my project?

Test-driven development is a test-first workflow requiring a failing test before any production code. It guides teams through the RED-GREEN-REFACTOR cycle to enforce discipline, keeping code changes minimal and validating progress with automated test runs.

What is the best way to write a failing test before implementing production code?

The best way to write a failing test is to first express the intended behavior clearly in your test suite. Run the test to confirm it fails, implement the minimal production code to make it pass, and then refactor for readability and reliability.

How does the RED-GREEN-REFACTOR cycle work for feature development and bug fixes?

The RED-GREEN-REFACTOR cycle works by first writing a failing test for the intended behavior (RED), implementing minimal code to pass the test (GREEN), and refactoring the code for quality (REFACTOR). It applies to feature development, bug fixes, and refactors.

Can I use pytest to validate my test-driven development progress?

Yes, you can use pytest to validate your test-driven development progress. This workflow supports validating incremental implementation by running automated tests like pytest to confirm the RED-GREEN-REFACTOR cycle phases pass successfully.

When do I need a test-first workflow for software testing?

You need a test-first workflow for software testing when you want to prevent regression bugs and weak test coverage. It ensures intended behavior is explicitly defined before implementation, driving reliable, production-ready software across new features and refactors.

Does test-driven development work for refactoring existing code?

Yes, test-driven development works for refactoring existing code. The workflow guides teams through RED-GREEN-REFACTOR cycles, ensuring you write tests expressing intended behavior before modifying production code, keeping changes minimal and validating outcomes with automated test runs.