test-driven-development

Enforce test-first Red-Green-Refactor workflows for software engineering tasks.

Updated Nov 24, 2025
One-click install
npx skills add https://github.com/ByronWilliamsCPA/.claude --skill test-driven-development-byronwilliamscpa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/ByronWilliamsCPA/.claude/tree/main/.claude/skills/test-driven-development
Command: npx skills add https://github.com/ByronWilliamsCPA/.claude --skill test-driven-development-byronwilliamscpa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the common risk of skipping test-first development, which leads to untested, buggy production code, unplanned regressions, and unmanageable technical debt from unverified implementations.

Core Features & Use Cases

  • Strict Red-Green-Refactor Workflow: Enforces the mandatory cycle of writing a failing test first, writing minimal code to pass, then refactoring, with no exceptions for production code.
  • Anti-Pattern Prevention: Includes guidance to avoid common testing mistakes like testing mock behavior, adding test-only methods to production code, and writing tests after implementation.
  • Use Case: When implementing a new payment processing feature, this Skill guides you to write a failing test for invalid card number handling first, then write only the minimal code to pass that test, before refactoring for readability.

Quick Start

Ask the AI to implement a new user profile editing feature using test-driven development, and it will guide you to write the failing test for profile validation before writing any production code.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I start test-driven development when implementing a new feature?

Test-driven development begins by writing a failing test for the desired behavior, writing minimal production code to pass that test, then refactoring for readability. This Red-Green-Refactor cycle eliminates untested code and reduces technical debt.

What is the Red-Green-Refactor cycle in unit testing?

The Red-Green-Refactor cycle is a strict test-first workflow where you write a failing test, implement minimal code to make it pass, then refactor the code. It ensures tests validate real behavior before implementation across all software engineering tasks.

Does test-driven development work for bug fixes and refactoring?

Yes, test-driven development applies to bug fixes, refactoring, and behavior changes, not just new features. It enforces writing a failing test that reproduces the bug or validates the new behavior before modifying any production code.

What are common anti-patterns to avoid in test-driven development?

Common test-driven development anti-patterns include testing mock behavior instead of real behavior, adding test-only methods to production code, and writing tests after implementation. Strict adherence to the test-first workflow prevents these software testing mistakes.

Why does writing tests after implementation increase technical debt?

Writing tests after implementation increases technical debt because it often validates existing code rather than desired behavior, leading to untested edge cases and unplanned regressions. Test-first development ensures code is built to pass specific behavioral validations.