test-driven-development

Enforce a Red-Green-Refactor workflow for code changes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces a Test-Driven Development workflow for code changes, helping teams adopt a consistent, test-first discipline to reduce defects and accelerate learning.

Core Features & Use Cases

  • Red-Green-Refactor guidance: leads engineers through failing tests, minimal implementations, and systematic refactoring.
  • Proactive quality assurance: promotes early failure detection and safer refactors during feature work, bug fixes, and migrations.
  • Use Case: when starting a new feature, you write a failing test first, implement the simplest code to pass, then refactor to improve design and maintainability.

Quick Start

Describe a feature or bug, write a failing test for it, implement the minimal code to satisfy the test, run tests, and then refactor while keeping all tests green.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is the test-driven development workflow for software engineering?

Test-driven development is a test-first discipline enforcing the Red-Green-Refactor cycle. You write a failing test, implement the minimal code to pass it, then refactor to improve software design and maintainability.

How do I start writing unit tests for a new feature?

To start writing unit tests for a new feature, describe the feature, write a failing test first, implement the simplest code to satisfy the test, run tests, and then refactor while keeping all tests green.

Can I use the red-green-refactor cycle for bug fixes and refactoring?

Yes, the red-green-refactor cycle applies to bug fixes and refactoring. It guides engineers through failing tests and minimal implementations to ensure early failure detection and safer code migrations.

Why does test-first discipline help with software engineering?

Test-first discipline helps software engineering by reducing defects and accelerating learning. It promotes proactive quality assurance and early failure detection during feature work, bug fixes, and migrations.

What is the best way to enforce TDD discipline across code changes?

The best way to enforce TDD discipline across code changes is adopting a consistent workflow that mandates the red-green-refactor cycle, ensuring teams write failing tests before minimal implementations and iterative refactoring.