test-driven-development

Enforce the Red-Green-Refactor cycle for Test-Driven Development.

947|163|Updated Jan 13, 2026
One-click install
npx skills add https://github.com/guanyang/antigravity-skills --skill test-driven-development-guanyang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/guanyang/antigravity-skills/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/guanyang/antigravity-skills --skill test-driven-development-guanyang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces a rigorous Test-Driven Development (TDD) process to ensure code quality, prevent regressions, and improve maintainability by mandating tests be written before implementation.

Core Features & Use Cases

  • Enforces TDD Cycle: Guides users through the Red-Green-Refactor cycle.
  • Prevents Common Pitfalls: Identifies and provides solutions for rationalizations and anti-patterns that undermine TDD.
  • Use Case: When starting a new feature, use this Skill to ensure you write a failing test first, then minimal code to pass, and finally refactor, leading to robust and well-tested code.

Quick Start

Follow the Red-Green-Refactor cycle for all new code.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is the Red-Green-Refactor cycle in test-driven development?

Test-driven development prevents code regressions and improves maintainability by forcing you to write tests before implementation. It ensures robust, well-tested code by addressing common anti-patterns and rationalizations that undermine software quality.

How do I start writing code using TDD principles?

Start writing code using TDD principles by writing a failing test for the new feature before any implementation. Write the minimal code required to pass that test, then refactor the codebase while ensuring the test stays green.

Why does test-driven development require a failing test first?

Test-driven development requires a failing test first to validate that the test actually checks the intended logic and to prevent writing unnecessary production code. This Iron Law ensures every line of code is justified and prevents regressions.

Can I use test-driven development for agile refactoring?

Yes, you can use test-driven development for agile refactoring. The TDD cycle explicitly includes a refactoring phase, allowing you to safely improve code structure and quality while maintaining a passing test suite to prevent regressions.

What are common anti-patterns that undermine TDD?

Common anti-patterns that undermine TDD include rationalizing skipping the failing test phase or writing excessive code beyond what the test requires. TDD identifies these pitfalls and enforces strict adherence to the Red-Green-Refactor cycle to ensure code quality.