test-driven-development

Enforce a Red-Green-Refactor cycle by writing failing tests before production code.

1|Updated Nov 4, 2018
One-click install
npx skills add https://github.com/ryanmoran/workspace --skill test-driven-development-ryanmoran
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/ryanmoran/workspace/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/ryanmoran/workspace --skill test-driven-development-ryanmoran

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TDD provides a disciplined approach to software development by ensuring tests drive design and verify behavior before production code.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write a failing test first, implement minimal code to pass, then refactor while keeping tests green.
  • Regression safety: prevents regressions by requiring tests for new features and bug fixes.
  • Design guidance: encourages modular, testable interfaces and clearer requirements.

Quick Start

Start by writing a small failing test for a simple behavior, implement just enough code to pass it, then refactor to improve structure while keeping 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 test-driven development and how does the red-green-refactor cycle work?

Test-driven development is a software testing discipline where you write a failing test first, implement minimal code to pass it, then refactor to improve structure while keeping tests green. This cycle ensures correct behavior and maintainable code.

How do I start writing tests before production code for a new feature?

Start test-driven development by writing a small failing test for a simple behavior. Implement just enough production code to make it pass, then refactor the implementation while keeping the tests green.

When should I use test-first development for bug fixes and behavioral changes?

Use test-first development during bug fixes and behavioral changes to prevent regressions. Writing a failing test before coding verifies the corrected behavior and provides automated regression protection across software projects.

Does test-driven development require specific testing frameworks or dependencies?

No specific testing frameworks or dependencies are required. Test-driven development provides a discipline-agnostic methodology applicable across software projects and teams requiring automated regression protection and modular design.

How does writing tests first improve software design and maintainability?

Writing tests first improves software design by encouraging modular, testable interfaces and clearer requirements. This test-driven approach ensures production code is guided by behavior verification, resulting in maintainable software.