test-driven-development

Enforce test-first development with evidence-driven RED to GREEN verification.

7|2|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/ajbmachon/ajbm-skills --skill test-driven-development-ajbmachon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/ajbmachon/ajbm-skills/tree/main/plugins/development-skills/skills/test-driven-development
Command: npx skills add https://github.com/ajbmachon/ajbm-skills --skill test-driven-development-ajbmachon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents regressions and vague “it seems to work” changes by enforcing test-first development with evidence-based RED → GREEN → REFACTOR verification.

Core Features & Use Cases

  • Failing-test-first enforcement: Require a meaningful failing test observed before writing any behavior-changing production code.
  • Evidence-driven verification: Mandate test execution for RED and GREEN, including targeted then broader verification when feasible.
  • Tight scope implementation: Implement the smallest change needed to make the new test pass, avoiding broad refactors during GREEN.
  • Quality bar for tests: Encourage happy path, failure path, and at least one boundary/edge case for non-trivial changes.
  • Completion gate with reporting contract: Require concrete commands and outcomes (and specific phrases when tests were not run or were only targeted).

Quick Start

Use test-driven-development when implementing a feature or bugfix and explicitly follow the RED → GREEN → REFACTOR cycle with commands and results.

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 test-first development when implementing a new feature?

To enforce test-first development, require a meaningful failing test to be observed before writing any behavior-changing production code, then make minimal changes to satisfy the test. This approach prevents regressions by mandating evidence-based RED to GREEN verification.

What's the best way to prevent regressions during a behavior-changing refactor?

The best way to prevent regressions during refactoring is to follow the RED to GREEN to REFACTOR cycle, ensuring you run targeted and broader test suites to verify outcomes. This evidence-driven workflow proves behavior remains correct before and after minimal production changes.

How does evidence-driven RED to GREEN verification work in a CI test suite?

Evidence-driven RED to GREEN verification works by mandating test execution commands at each phase, requiring a failing test first, then confirming it passes after implementation. The completion gate requires concrete command-and-outcome reporting to prove the behavior change is verified.

When do I need to write failing tests for bug fixes?

You need to write failing tests for bug fixes before writing any production code to prove the defect exists and specify the required behavior. This test-first approach ensures the fix targets the exact regression, with mandatory test execution verifying the transition from RED to GREEN.

Does test-driven development work with existing codebases and CI test suites?

Yes, test-driven development works across typical codebases and CI test suites by applying targeted then broader verification when feasible. It enforces a completion gate with concrete command-and-outcome reporting, ensuring evidence-based verification for features, bug fixes, and refactors.

What quality bar should unit testing follow for non-trivial changes?

The quality bar for unit testing non-trivial changes encourages covering the happy path, failure path, and at least one boundary or edge case. This ensures comprehensive evidence-driven verification before making minimal production changes to satisfy the test.