br4zz4:tdd

Enforces test-driven development cycles with red-green-refactor discipline and commit checkpoints.

Updated May 25, 2025
One-click install
npx skills add https://github.com/oporpino/commons --skill br4zz4-tdd-oporpino
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: br4zz4:tdd
Source: https://github.com/oporpino/commons/tree/main/ai/shared/skills/br4zz4%3Atdd
Command: npx skills add https://github.com/oporpino/commons --skill br4zz4-tdd-oporpino

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often write production code before tests, producing tests that pass immediately and prove nothing. This Skill enforces a strict test-first workflow so every feature and bugfix is driven by a failing test, with verified red and green phases and clean commits. ## Core Features & Use Cases - Iron Law Enforcement: No production code without a failing test first, with explicit rules to delete code written before tests. - Structured RED-GREEN-REFACTOR Cycle: Mandatory verification of failing tests before implementation and passing tests before refactoring, plus commit conventions at each phase boundary. - Coverage and Red-Flag Guidance: Branch-level coverage requirements, anti-pattern tables, and a completion checklist to catch skipped TDD steps. - Use Case: When implementing a new form validation feature, write a failing test for empty email input, watch it fail, write the minimal code to pass, refactor, and commit with the proper prefix. ## Quick Start Ask the AI to implement a new feature or bugfix using strict test-driven development with the red-green-refactor cycle.

Frequently Asked Questions about br4zz4:tdd

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

FAQPage Schema
How do I practice test-driven development on a new feature?▼

Write one minimal failing test describing the desired behavior, watch it fail for the expected reason, then write the simplest code to make it pass. Refactor only after tests are green, commit at each phase boundary, and repeat the cycle.

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

Red means writing a failing test, green means writing minimal code to pass it, and refactor means cleaning up while tests stay green. Each phase must be verified by actually running the test command before moving on.

Why must I watch the test fail before implementing code?▼

A test that passes immediately proves nothing because it may be testing existing behavior or contain a typo. Watching it fail confirms the test targets the missing feature and fails for the expected reason.

How many tests does each function need under TDD?▼

Every logical branch needs its own test: both paths of each if statement, every case of a switch, plus edge cases like empty input, nil values, boundaries, and error paths.

What should I do when a test is too hard to write?▼

A hard-to-write test signals a hard-to-use design. Simplify the interface, use dependency injection to reduce mocking, and extract helpers when setup grows large rather than skipping the test.