test-driven-development

Guide the Red-Green-Refactor cycle for new logic and bug fixes.

84.9k|9.1k|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/addyosmani/agent-skills --skill test-driven-development-addyosmani
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/addyosmani/agent-skills/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/addyosmani/agent-skills --skill test-driven-development-addyosmani

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures code reliability and maintainability by enforcing a rigorous testing methodology, preventing bugs, and providing a safety net for future changes.

Core Features & Use Cases

  • TDD Cycle Enforcement: Guides the Red-Green-Refactor workflow for new development.
  • Prove-It Pattern: Ensures bugs are reproduced with failing tests before fixes are applied.
  • Use Case: When implementing a new feature, use this Skill to write a failing test first, then write the minimal code to pass, and finally refactor. For any bug report, first write a test that fails due to the bug, then implement the fix.

Quick Start

Use the test-driven-development skill to implement the new createTask function following the TDD cycle.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I implement test-driven development for writing robust code?

Test-driven development is implemented by following the Red-Green-Refactor cycle, where you write a failing test first, implement minimal code to pass it, and then refactor for maintainability.

What is the best way to fix bugs using the TDD methodology?

The best way to fix bugs in TDD is using the Prove-It pattern, which involves writing a failing test that reproduces the bug first, then applying the fix to ensure code correctness and prevent regressions.

How does the Red-Green-Refactor cycle work for new software features?

The Red-Green-Refactor cycle works by first writing a failing unit test for a new feature, then writing the minimal code required to make that test pass, and finally refactoring the code to improve quality.

Do I need to write unit, integration, and E2E tests for TDD?

Yes, TDD ensures code correctness through a hierarchy of unit, integration, and E2E tests, providing a comprehensive safety net that validates individual components and overall system behavior.

When should I use test-driven development during software development?

You should use test-driven development when implementing new logic or fixing bugs, as it enforces a rigorous testing methodology that prevents bugs and provides a safety net for future code changes.

Why does refactoring play a key role in the TDD cycle?

Refactoring plays a key role in TDD because it allows developers to improve code quality and maintainability after achieving passing tests, ensuring robust code without altering external behavior.