test-driven-development

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

23|2|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/herdiansah/Antigravity-Skills-Master --skill test-driven-development-herdiansah
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/herdiansah/Antigravity-Skills-Master/tree/main/.agent/skills/test-driven-development
Command: npx skills add https://github.com/herdiansah/Antigravity-Skills-Master --skill test-driven-development-herdiansah

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces a rigorous development process by ensuring that all new code is preceded by a failing test, preventing bugs and regressions before they are introduced.

Core Features & Use Cases

  • Test-First Development: Mandates writing tests before any implementation code.
  • Red-Green-Refactor Cycle: Guides users through the TDD workflow: write a failing test (Red), write minimal code to pass (Green), then clean up (Refactor).
  • Use Case: When starting a new feature or fixing a bug, use this Skill to write a test that describes the expected behavior, then implement the code to make that test pass.

Quick Start

Use the test-driven-development skill to write a failing test for the new 'user-authentication' feature.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I start writing unit tests before implementation code?

Unit testing before implementation requires writing a failing test that describes expected behavior, then writing minimal code to pass it. This systematic approach prevents bugs and regressions by ensuring production code is always preceded by a verifiable test.

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

The Red-Green-Refactor cycle is a test-driven development workflow where you write a failing test (Red), implement minimal code to pass the test (Green), then clean up and refactor the code while maintaining test coverage.

Why does writing tests first help prevent regressions and unclear requirements?

Writing tests first prevents regressions by mandating a systematic approach to verifiable, behavior-driven tests. This process clarifies requirements upfront, ensuring every piece of production code is validated against expected behavior before introduction.

How do I fix a bug using the test-first development methodology?

To fix a bug using test-first development, write a test that describes the expected behavior and fails due to the bug. Then, implement the minimal code changes required to make that test pass, ensuring the regression is permanently resolved.

When should I refactor code in a test-driven workflow?

You should refactor code during the final phase of the Red-Green-Refactor cycle. After writing minimal code to pass the failing test, clean up and improve the code structure while ensuring the tests remain green.

Can I use this test-driven approach for both new features and bug fixes?

Yes, you can use this approach for both new features and bug fixes. Whether starting a new feature or addressing a bug, the methodology guides you to write a test describing expected behavior, then implement the code to make it pass.