test-driven-development

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers frequently write production code first and add tests afterward, which produces tests that pass immediately and prove nothing about correctness. This Skill enforces a strict test-first discipline so every feature and bugfix is backed by a test that was watched failing before implementation. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Guides the agent through writing a failing test, verifying it fails for the right reason, writing minimal code to pass, and refactoring while staying green. - Rationalization Detection: Lists common excuses for skipping TDD ("too simple to test", "I'll test after") with counterarguments, plus red flags that trigger deleting code and starting over. - Testing Anti-Patterns Reference: A companion reference covers testing mock behavior, test-only methods in production classes, incomplete mocks, and mocking without understanding dependencies. - Use Case: When asked to fix a bug where empty emails are accepted, the agent first writes a failing test asserting the rejection, watches it fail, implements the minimal validation, and verifies all tests pass. ## Quick Start Use test-driven development to implement the new retry feature, writing a failing test first and watching it fail before any implementation 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 and watch it fail for the expected reason, then write the simplest code that makes it pass. Refactor only while tests stay green, then repeat the cycle for the next behavior.

How do I write a failing test for a bug fix?▼

Write a test that reproduces the bug by asserting the correct behavior, such as expecting an error for empty email input. Run it to confirm it fails because the fix is missing, then implement the minimal fix and verify the test passes.

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 reason.

Why should I delete code written before its test?▼

Code written first cannot be verified by a test that never failed, so keeping it as reference leads to adapting it and testing after the fact. Deleting it and reimplementing from failing tests proves the tests actually cover the behavior.

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

Never assert on mock existence, never add test-only methods to production classes, and never mock without understanding the real method's side effects. Mocks must mirror the complete real API structure, and complex mock setups often signal that integration tests would be simpler.