test-driven-development

Enforce a test-first workflow requiring failing tests before production code.

Updated Sep 1, 2021
One-click install
npx skills add https://github.com/unclehowell/unclehowell --skill test-driven-development-unclehowell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/unclehowell/unclehowell/tree/main/skills/software-development/test-driven-development
Command: npx skills add https://github.com/unclehowell/unclehowell --skill test-driven-development-unclehowell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents untested production code and reduces regressions by enforcing a test-first development discipline so that every behavior is specified and verified before implementation.

Core Features & Use Cases

  • RED-GREEN-REFACTOR workflow: Write a minimal failing test, implement the simplest change to pass, then refactor while keeping tests green.
  • Applies to features, bug fixes, and refactors: Use when adding new behavior, reproducing and fixing bugs, or cleaning up design safely.
  • Verification and governance: Includes mandatory verification steps, a checklist, and guidance for delegating tasks to subagents with enforced TDD constraints.
  • Anti-patterns and red flags: Identifies common rationalizations and prescribes deleting code that violates TDD principles to avoid technical debt.

Quick Start

Write a focused failing test for the desired behavior, run the project's test command to confirm the failure, then implement the minimal change to make the test pass and 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 do I enforce a test-driven development workflow for new features?

To enforce test-driven development, write an explicit minimal failing test for the desired behavior, run it to observe failure, implement the simplest code to pass, then refactor while keeping tests green.

What is the red-green-refactor cycle and how does it prevent code regressions?

The red-green-refactor cycle writes a failing test, implements the minimal code to pass it, then refactors safely. This test-first discipline prevents regressions by verifying every behavior before implementation.

How do I apply test-first development when fixing bugs?

Apply test-first development for bug fixes by writing a focused failing test that reproduces the bug, implementing the minimal fix to make it pass, then running the full suite to ensure no regressions occur.

Can I delegate test-driven development tasks to subagents?

Yes, you can delegate tasks to subagents with enforced TDD constraints. The governance requires subagents to write failing tests, verify failures, implement minimal fixes, and run full suites to prevent regressions.

What should I do with production code that violates test-first principles?

Production code that violates test-first principles and generates technical debt should be deleted. The workflow identifies common rationalizations as anti-patterns and prescribes removing code lacking explicit failing tests.