test-driven-development

Automate the Red-Green-Refactor TDD workflow requiring a failing test before code.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/mrkhachaturov/rkstack --skill test-driven-development-mrkhachaturov
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/mrkhachaturov/rkstack/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/mrkhachaturov/rkstack --skill test-driven-development-mrkhachaturov

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Red-Green-Refactor TDD workflow provides a disciplined, test-first approach so production code is only written after a failing test is identified, reducing regressions and surfacing design issues early.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write a failing test, implement the minimal code to pass, and refactor while keeping tests green.
  • Safe development discipline: prevents skipping tests, documents behavior, and promotes reproducible decisions during feature work and bug fixes.
  • Use cases include new features, bug fixes, and refactoring where high reliability and maintainable tests are required.

Quick Start

Write a failing test for the desired behavior, implement the minimal code to pass, and repeat the Red-Green-Refactor cycle until all tests pass.

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 a test-first development workflow for new features?

Test-first development is enforced by automating a Red-Green-Refactor cycle that requires a failing test to be written before any feature code is implemented, ensuring minimal code is added to pass tests and design is refactored safely.

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, implement the minimal code required to make that test pass, and then refactor the code while keeping all tests green.

Can I use a test-driven development workflow for bug fixes and refactoring?

Yes, a test-driven development workflow applies directly to bug fixes and refactoring by documenting behavior with failing tests first, implementing minimal fixes to pass, and refactoring for clean design with reproducible, documented steps.

How do I start writing code with a test-driven development cycle?

To start test-driven development, write a failing test for the desired behavior, implement the minimal code to make that test pass, and repeat the Red-Green-Refactor cycle until all tests pass and the feature is complete.

Why does a test-driven development workflow reduce regressions?

A test-driven development workflow reduces regressions by preventing developers from skipping tests, surfacing design issues early, and ensuring production code is only written after a failing test is identified and documented.

When should I not use a strict test-first development workflow?

You should avoid a strict test-first workflow when exploring throwaway prototypes or spikes where immediate reliability and maintainable tests are not required, as it enforces reproducible decisions and minimal code implementation.