test-driven-development

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

1|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/Wishtohear/bucket-water-oms --skill test-driven-development-wishtohear
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/Wishtohear/bucket-water-oms/tree/main/bucket-water-oms-admin-mobile/tool/dart_skills_lint/.agents/skills/test-driven-development
Command: npx skills add https://github.com/Wishtohear/bucket-water-oms --skill test-driven-development-wishtohear

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code written before tests often ships with unverified behavior, hidden bugs, and tests that pass immediately without proving anything. This Skill enforces strict test-driven development so every feature and bugfix is backed by a test that was watched to fail 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 clear rules and red flags that trigger a restart. - Testing Anti-Pattern Reference: Covers pitfalls such as testing mock behavior, adding test-only methods to 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, 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, writing the failing test before 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 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 while all tests stay green, then repeat for the next behavior.

How do I fix a bug using TDD?▼

Write a failing test that reproduces the bug first, then implement the minimal fix until the test passes. This proves the fix works and creates a regression test that prevents the bug from returning.

Why should tests be written before implementation code?▼

Tests written after code pass immediately, which proves nothing—they may test the wrong thing or mirror the implementation. Watching a test fail first confirms it actually verifies the intended behavior.

What are common testing anti-patterns to avoid?▼

Avoid asserting on mock behavior instead of real behavior, adding test-only methods to production classes, mocking without understanding side effects, and creating incomplete mocks missing fields the real API returns.

When is it acceptable to skip TDD?▼

Only for throwaway prototypes, generated code, or configuration files, and only with explicit approval from your human partner. Existing untested code should still gain tests as you modify it.