test-driven-development

Enforces test-first development using the red-green-refactor cycle for features and bugfixes.

92|12|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/ARounder-183/HiFiShifter --skill test-driven-development-arounder-183
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/ARounder-183/HiFiShifter/tree/main/.github/skills/test-driven-development
Command: npx skills add https://github.com/ARounder-183/HiFiShifter --skill test-driven-development-arounder-183

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often write code before tests, producing tests that pass immediately and prove nothing about correctness. This Skill enforces strict test-driven development so every feature and bugfix is backed by a test that was watched failing first. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full TDD cycle—write a failing test, verify it fails for the right reason, write minimal code to pass, then refactor while staying green. - Anti-Rationalization Guardrails: Counters common excuses like "I'll test after" or "deleting code is wasteful" with concrete reasoning and red-flag checklists. - Testing Anti-Pattern Reference: Covers pitfalls such as testing mock behavior, test-only methods in production classes, incomplete mocks, and mocking without understanding dependencies. - Use Case: When fixing a bug where an empty email is accepted, write a failing test asserting the rejection error, watch it fail, implement the minimal validation, and confirm all tests pass before refactoring. ## Quick Start Ask the AI to implement a new feature or bugfix using strict test-driven development with a failing test written first.

Frequently Asked Questions about test-driven-development

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, run it to confirm it fails for the right reason, then write the simplest code that makes it pass. Refactor only after all tests are green, and repeat the cycle for each behavior.

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

Red means writing a failing test, green means writing minimal code to make it pass, and refactor means cleaning up while keeping tests green. Verifying the failure step is mandatory because a test that passes immediately proves nothing.

Should I write tests before or after implementation code?

Write tests before implementation. Tests written after code pass immediately and only verify what was built, not what is required, so they miss edge cases and never prove they can catch bugs.

Why is testing mock behavior considered an anti-pattern?

Asserting on mock elements verifies the mock exists rather than real component behavior, so the test passes for the wrong reason. Test real behavior instead, or unmock the component and assert on actual rendered output.

When is it acceptable to skip TDD?

Only for throwaway prototypes, generated code, or configuration files, and only after confirming with your human partner. Exploration is fine, but the exploratory code should be discarded and rewritten test-first.