test-driven-development

Enforce a red-green-refactor workflow by writing failing tests before production code.

8|5|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/axiomantic/spellbook --skill test-driven-development-axiomantic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/axiomantic/spellbook/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/axiomantic/spellbook --skill test-driven-development-axiomantic

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development forces explicit behavioral specifications before writing production code, reducing regression risk and clarifying expectations for features and fixes.

Core Features & Use Cases

  • Guided workflow: Enforces the discipline of writing a failing test prior to implementation.
  • Iterative validation: Supports the red-green-refactor cycle to verify behavior with minimal, focused code.
  • Use Case: When integrating a new feature or fixing a bug, start by defining the test, watch it fail, implement just enough to pass, and refactor as needed.

Quick Start

Begin by writing a failing test that specifies the desired behavior, then implement only enough code to pass and repeat.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How does test-driven development prevent software regressions?

Test-driven development prevents regressions by enforcing the discipline of writing a failing test that specifies desired behavior before writing any production code. This ensures explicit behavioral validation occurs prior to implementation across features and refactors.

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

The red-green-refactor cycle is an iterative TDD workflow where you write a failing test defining expected behavior, implement minimal code to pass that test, and then refactor the code while keeping the test green to verify behavior.

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

To start writing tests before code for a new feature, begin by writing a failing test that specifies the desired behavior, watch it fail, implement just enough production code to pass, and refactor as needed.

Can I apply TDD discipline when fixing bugs and refactoring?

Yes, you can apply TDD discipline when fixing bugs and refactoring. Start by defining a test that captures the expected fix or behavior, watch it fail, and implement minimal changes to verify the corrected behavior.

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

You should avoid a test-first development workflow when reliable validation is not required or the codebase lacks infrastructure to support iterative test execution. TDD focuses on explicit behavioral specification which may not suit exploratory prototyping.