test-driven-development

Enforce test-first development with failing tests before production code.

9|2|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/DmitriyPolukhin/antigravity-superpower --skill test-driven-development-dmitriypolukhin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/DmitriyPolukhin/antigravity-superpower/tree/main/modules/test-driven-development
Command: npx skills add https://github.com/DmitriyPolukhin/antigravity-superpower --skill test-driven-development-dmitriypolukhin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps teams prevent regressions and low-confidence changes by forcing a strict workflow where tests drive the implementation instead of assumptions or after-the-fact validation.

Core Features & Use Cases

  • Test-first enforcement: Requires a failing test before any production code is written, using the TDD cycle (Red → Green → Refactor).
  • Behavior-focused test design: Encourages clear test names and real code coverage, discouraging “test mock behavior” or vague assertions.
  • Bug-fix reproduction: When a bug is found, write a failing test that reproduces it first, then implement the minimal fix and re-run the full suite.
  • Anti-rationalization guardrails: Treats common shortcuts (tests after implementation, skipping failure verification, keeping code without failing tests) as violations that trigger a restart.

Quick Start

Use the test-driven-development skill when implementing a new feature or bugfix to write a failing test first, then implement only the minimal code needed to make it pass, and finally refactor while keeping tests green.

Frequently Asked Questions about test-driven-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce test-first development when writing new features?

Test-first development is enforced by requiring a failing test before writing production code, following the Red-Green-Refactor cycle. You write a failing test, implement minimal code to pass it, and then refactor while keeping tests green.

What is the best way to fix a bug using test-driven development?

The best way to fix a bug using test-driven development is to first write a failing test that reproduces the exact bug. Then, implement the minimal fix needed to make the test pass and re-run the full suite to prevent regressions.

Why does TDD require verifying that a test fails for the expected reason?

Verifying that a test fails for the expected reason ensures your test actually targets the intended behavior before writing production code. Skipping this failure verification is treated as a shortcut violation that triggers a workflow restart.

How do I write behavior-focused tests instead of testing mock behavior?

Behavior-focused tests use clear test names and validate real code coverage rather than mock behavior or vague assertions. This ensures tests verify actual production requirements instead of implementation side-effects.

Can I use test-driven development for refactoring existing code?

Yes, you can use test-driven development for refactoring existing code. The workflow applies to behavior changes and refactoring tasks by maintaining green tests while you improve the code structure, ensuring reliability and regression prevention.

What happens if I write tests after implementation instead of before?

Writing tests after implementation is treated as an anti-rationalization shortcut. The skill enforces strict test-first discipline, meaning this violation triggers a restart of the development cycle to maintain high-confidence changes.