test-driven-development

Enforces red-green-refactor test-driven development workflow before writing production code.

1|Updated Sep 10, 2026
One-click install
npx skills add https://github.com/thienty1207/Hotel_Staff --skill test-driven-development-thienty1207
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/thienty1207/Hotel_Staff/tree/main/.baron/core/skills/superpowers/test-driven-development
Command: npx skills add https://github.com/thienty1207/Hotel_Staff --skill test-driven-development-thienty1207

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? It prevents untested or over-engineered production code by requiring a failing test before any implementation, ensuring every behavior is verified and regressions are caught early. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Guides writing a failing test, verifying the failure, implementing minimal code, and refactoring while keeping tests green. - Rationalization Countermeasures: Lists common excuses for skipping TDD and the red flags that require deleting code and starting over. - Test Quality Reference: Includes a companion guide on naming the break each test catches, avoiding mock assertions, and running mutation checks. - Use Case: When fixing a bug where an empty email is accepted, write a failing test asserting the rejection, watch it fail, implement the validation, and confirm the suite passes. ## Quick Start Ask the AI to implement a new feature or bug fix 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 step by step?

Write one minimal failing test for a single behavior, run it and confirm it fails for the expected reason, then write the simplest code that passes. After the test passes, refactor while keeping all tests green, and repeat for the next behavior.

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

Red means writing a failing test that defines the desired behavior. Green means writing the minimal implementation to make it pass. Refactor means cleaning up duplication and names while keeping every test passing.

When is it acceptable to skip test-driven development?

Exceptions are limited to throwaway prototypes, generated code, and configuration files, and only with explicit approval from your human partner. Thinking 'skip TDD just this once' is treated as rationalization, not a valid exception.

Should tests assert on mocks or real behavior?

Tests should assert on real component behavior, never on the mock itself. Mock only slow or external dependencies after learning their side effects, and mirror the complete real data structure in mock responses.

What should I do if I already wrote code before the test?

Delete the implementation and start over with a failing test. Keeping it as reference or adapting it while writing tests counts as testing after, which violates the core rule that no production code exists without a failing test first.