test-driven-development

Enforce RED-GREEN-REFACTOR cycles by requiring failing tests before production code.

87|20|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/openaeon/OpenAEON --skill test-driven-development-openaeon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/openaeon/OpenAEON/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/openaeon/OpenAEON --skill test-driven-development-openaeon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development prevents broken or unverified changes by forcing you to define the expected behavior in a failing test before writing production code.

Core Features & Use Cases

  • RED-GREEN-REFACTOR enforcement: Run the failing test (RED), implement the smallest change to pass (GREEN), then clean up without adding new behavior (REFACTOR).
  • Verification-focused workflow: Requires watching failures for expected reasons (feature missing, not typos) and re-running the relevant suite to avoid regressions.
  • Bugfix prevention via regression tests: When you find a bug, you reproduce it with a test first so the fix is guaranteed to stay fixed.

Quick Start

Use the test-driven-development skill when implementing a feature or bugfix so you write a failing test first, run it to confirm the RED state, implement minimal code to pass, and then run the full test suite to ensure no regressions.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How does test-driven development prevent regressions in software engineering?

Test-driven development prevents regressions by requiring a failing test to define expected behavior before writing production code. You verify the failure is correct, implement minimal code to pass, and run the full suite to ensure no regressions.

What is the red-green-refactor cycle in TDD?

The red-green-refactor cycle enforces writing a failing test first, implementing the smallest code change to pass it, and cleaning up without adding new behavior. This verification-focused workflow ensures software quality throughout development.

How do I use regression tests to fix bugs without breaking existing features?

To fix bugs without breaking existing features, reproduce the bug with a failing regression test first. Implement the fix to make the test pass, then run the full test suite to verify the bug is resolved and no regressions were introduced.

Can I apply test-first development when refactoring code?

Yes, test-first development applies to refactoring by ensuring existing tests remain green after cleaning up code without adding new behavior. Run the full suite after modifications to verify no regressions occurred during the refactor.

Why should I verify that a failing test fails for the correct reason before writing code?

Verifying a failing test fails for the correct reason prevents false positives from typos or import errors. Confirming the expected feature is missing ensures the subsequent minimal code implementation actually satisfies the desired behavior.

Does test-driven development work with pytest for regression prevention?

Test-driven development works with pytest by leveraging the testing framework to run failing tests, verify red states, implement minimal code to pass, and execute the full test suite for regression prevention across the workflow.