test-driven-development

Write failing tests first and run red-green-refactor cycles for software changes.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Proactively prevents unverified production changes by enforcing a test-first workflow that starts with a failing test and ends with green code.

Core Features & Use Cases

  • Test-first validation: Write a test that defines the expected behavior before writing implementation.
  • Red-Green-Refactor cycle: Follow the minimal pass approach, then refactor safely.
  • Guardrails against non-TDD approaches: Prevent production changes without tests, avoid code with no test coverage.
  • Real-world workflows: Use during feature additions, bug fixes, and refactors to ensure behavior is verified.

Quick Start

Write a failing test for the desired behavior, run the tests to observe the failure, then implement the minimal production code to make the test pass.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is the red-green-refactor cycle in TDD?

The red-green-refactor cycle in TDD involves writing a failing test, implementing the minimal production code to make it pass, and then refactoring safely. This approach guarantees code is well-tested before refactoring.

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

Yes, test-driven development can be applied to bug fixes and refactoring across software projects. Writing a failing test first verifies the bug or expected behavior before delivering minimal, well-tested production code.

What's the best way to start writing tests before implementation?

The best way to start is to write a failing test for the desired behavior, run the tests to observe the failure, then implement the minimal production code to make the test pass. This test-first validation prevents code with no test coverage.

When should I not use a test-first workflow?

You should not use a test-first workflow when you need to make production changes without tests. TDD includes guardrails against non-TDD approaches, actively preventing code with no test coverage from being implemented.