test-driven-development

Enforce the red-green-refactor cycle with failing tests before production code.

1|Updated Apr 30, 2025
One-click install
npx skills add https://github.com/lucasfth/config --skill test-driven-development-lucasfth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/lucasfth/config/tree/main/.hermes/skills/software-development/test-driven-development
Command: npx skills add https://github.com/lucasfth/config --skill test-driven-development-lucasfth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enforces a test-first approach to development, helping teams catch bugs early and produce reliable code.

Core Features & Use Cases

  • Red-Green-Refactor Cycle: Follow the RED-GREEN-REFACTOR cycle to drive development with tests first.
  • Mandatory tests before production: Enforce tests that fail before implementing any feature to guarantee correct behavior.
  • Refactoring safety: Use a comprehensive test suite to safely refactor code and prevent regressions.

Quick Start

Write a failing test for the new feature, run the tests to observe the failure, then implement the minimal production code to pass.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is the test-driven development cycle and how does it guide software engineering?

Test-driven development follows the Red-Green-Refactor cycle: write a failing test, implement minimal production code to pass it, then safely refactor. This enforces a test-first approach to catch bugs early and ensure robust behavior.

How do I fix bugs using a test-first workflow?

To fix bugs with a test-first workflow, write a failing test that reproduces the bug before changing any production code. Once the test fails as expected, implement the minimal fix to make it pass, ensuring the behavior is corrected.

Can I use test-driven development for refactoring existing code safely?

Yes, test-driven development provides refactoring safety by using a comprehensive test suite. By ensuring tests pass before and after changes, you can refactor code and prevent regressions while maintaining robust behavior.

Does strict TDD require a failing test before writing any production code?

Yes, strict TDD enforces mandatory test failures prior to writing production code. You must observe the test fail first, then implement minimal code to achieve a green pass before refactoring, ensuring correct behavior from the start.

What's the best way to guarantee quality when adding new software features?

The best way to ensure quality is adopting a test-first development approach. By writing failing tests for new features before implementation, you drive development with tests, catching bugs early and producing reliable code.