test-driven-development

Guide the red-green-refactor cycle for test-driven development.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/rapyuta-robotics/agent-ai --skill test-driven-development-rapyuta-robotics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/rapyuta-robotics/agent-ai/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/rapyuta-robotics/agent-ai --skill test-driven-development-rapyuta-robotics

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams adopt a disciplined test-driven development workflow by ensuring that code is backed by failing tests before any implementation.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write a failing test, implement the minimal code to pass, then refactor for clarity.
  • Broad applicability: useful for new features, bug fixes, and refactoring across projects.
  • Concrete example: start with a small function like sum(a, b) to drive design through tests.

Quick Start

Start by writing a failing test for a small function, run the tests to observe failure, implement the minimal code to pass, and then refactor for readability and maintainability.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is test-driven development and how does the red-green-refactor cycle work?

Test-driven development is a workflow where you write a failing test, implement the minimal code to pass it, then refactor for clarity. The red-green-refactor cycle drives design from verification backward to planning.

How do I start writing failing tests before implementing new features?

Start writing failing tests by creating a small function test, running it to observe failure, implementing minimal code to pass, and refactoring for readability. This disciplined test-driven approach ensures features ship backed by tests.

Do I need a test runner to adopt test-driven development?

Yes, test-driven development requires a test runner and minimal project scaffolding to execute tests and verify behavior during development. These setup tools drive the red-green-refactor cycle from planning to verification.

Can I use test-driven development for bug fixes and refactoring across existing codebases?

Yes, test-driven development has broad applicability for new features, bug fixes, and refactoring across projects. It guides the red-green-refactor cycle to ensure any code changes are backed by failing tests before implementation.

What's the best way to ensure features ship with tests first?

Adopting test-driven development is the best way to ensure features ship with tests first. It enforces writing failing tests before implementation, guiding the red-green-refactor cycle from planning to verification for improved code quality.

Why should I write a failing test before writing implementation code?

Writing a failing test before implementation ensures code is backed by verified behavior. Test-driven development drives design through tests, starting with a small function to observe failure, then implementing minimal code to pass.