test-driven-development

Enforces red-green-refactor test-first workflow for implementing features and bugfixes.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/gmotyl/pavilio --skill test-driven-development-gmotyl
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/gmotyl/pavilio/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/gmotyl/pavilio --skill test-driven-development-gmotyl

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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 line of production code is backed by a test that was watched failing first. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Guides writing one minimal failing test, verifying it fails for the right reason, implementing minimal code to pass, then refactoring while staying green. - Rationalization Detection: Lists common excuses for skipping TDD ("too simple to test", "I'll test after") with concrete rebuttals and red flags that trigger starting over. - Testing Anti-Patterns Reference: Companion guide covering mock behavior testing, test-only production methods, incomplete mocks, and mocking without understanding dependencies. - Use Case: When fixing a bug where empty emails are accepted, write a failing test asserting the rejection error, watch it fail, add the validation check, and confirm all tests pass before committing. ## Quick Start Use the test-driven-development skill to implement this feature by writing a failing test first, then the minimal code to make it pass.

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?▼

Follow the red-green-refactor cycle: write one minimal failing test, run it to confirm it fails for the expected reason, write the simplest code to pass it, verify all tests pass, then refactor while keeping tests green. Repeat for each behavior.

How to write a failing test before implementation code?▼

Write a test with a clear name describing one behavior, calling the API you wish existed, using real code instead of mocks. Run it and confirm it fails because the feature is missing, not because of typos or errors.

Can I skip TDD for simple code or prototypes?▼

Simple code still breaks, and a test takes about 30 seconds. Exceptions exist only for throwaway prototypes, generated code, and configuration files, and those require explicit approval from your human partner.

Why is writing tests after implementation a problem?▼

Tests written after code pass immediately, which proves nothing about whether they test the right thing. They are biased by the implementation, verify remembered edge cases instead of discovered ones, and never demonstrate the test can catch the bug.

What testing anti-patterns should I avoid with mocks?▼

Never assert on mock elements, never add test-only methods to production classes, and never mock without understanding dependency side effects. Mirror the complete real API structure in mock responses to avoid silent downstream failures.

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

A hard-to-write test signals an unclear or overly coupled design. Simplify the interface, use dependency injection instead of heavy mocking, and extract test helpers when setup grows large.