test-driven-development

Enforce the RED-GREEN-REFACTOR cycle with failing tests before production code.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/TomazWang/agent-toolkit --skill test-driven-development-tomazwang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/TomazWang/agent-toolkit/tree/main/plugins/tdd-workflow/skills/test-driven-development
Command: npx skills add https://github.com/TomazWang/agent-toolkit --skill test-driven-development-tomazwang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces Test-Driven Development discipline by ensuring a failing test is created before production code and guiding its workflow from RED to GREEN to REFACTOR.

Core Features & Use Cases

  • Red-Green-Refactor process guidance for feature development.
  • Integrated prompts with the workflow plugin to generate and validate tests.
  • Guardrails and feedback to prevent early refactoring before tests pass.

Quick Start

Instruct the AI to begin TDD by writing a failing test first, then implement the minimal production code to pass.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I enforce the Red-Green-Refactor cycle during feature development?

To enforce the Red-Green-Refactor cycle, you must write a failing test before any production code. This discipline is guided by requiring a failing test first, then implementing minimal code to pass, and preventing early refactoring before tests pass.

What is test-driven development workflow integration for generating tests?

Test-driven development workflow integration connects feature implementation with the workflow plugin to automatically generate, run, and validate tests. This ensures the Red-Green-Refactor process is strictly followed from writing a failing test to the final refactor.

How do I start a new feature using TDD discipline?

To start a new feature using TDD discipline, trigger the workflow via the /tdd:start command or mention test cues. This initiates the process by requiring a failing test before you write any production code.

Can I refactor code before my tests pass in TDD?

No, you cannot refactor code before tests pass in TDD. Guardrails and feedback prevent early refactoring, ensuring you only enter the refactor phase after your minimal production code successfully passes the failing test in the Green stage.

Does the TDD workflow require external dependencies or plugins?

The TDD workflow integrates with the workflow plugin to generate and validate tests, but requires no external dependencies. It operates independently to enforce the Red-Green-Refactor cycle during feature implementation.

Why write a failing test before writing production code?

Writing a failing test before production code ensures the test actually validates the new feature. This TDD discipline guarantees code quality by enforcing the Red-Green-Refactor cycle and preventing early refactoring before tests pass.