tdd

Enforce test-driven development through a strict RED-GREEN-REFACTOR cycle.

Updated Mar 17, 2026
One-click install
npx skills add https://github.com/steven-3/supermind --skill tdd-steven-3
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/steven-3/supermind/tree/main/skills/tdd
Command: npx skills add https://github.com/steven-3/supermind --skill tdd-steven-3

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents production bugs and regressions by forcing a strict test-first workflow: write a failing test before writing any production code.

Core Features & Use Cases

  • Strict RED-GREEN-REFACTOR cycle: enforce a failing test, minimal code to pass, then refactor while staying green.
  • Scope detection & setup: identifies the project’s test framework (e.g., Jest/Vitest/Pytest/Mocha) and ensures the framework exists before implementation.
  • TDD-first execution: applies to new features, bug fixes, refactors, and behavior changes to ensure each behavior is proven by an automated test.

Example Use Case: You need to change how a function handles invalid input; write one behavior-focused test for the expected error/response, implement the minimum behavior to satisfy it, then refactor without breaking the established contract.

Quick Start

Ask your AI to apply TDD by writing a single failing test for the next behavior you want, implementing the minimum code to make it pass, and then refactoring only after the test stays green.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I enforce strict test-driven development when writing new features?

To enforce test-driven development, the workflow requires writing a failing test before any production code, then implementing minimal code to pass it, and finally refactoring while keeping tests green. This strict cycle prevents regressions and proves each new behavior.

Does test-driven development work with my existing Jest, Vitest, or Pytest frameworks?

Yes, test-driven development applies to existing codebases using common frameworks like Jest, Vitest, Pytest, and Mocha. The workflow first detects the project's test framework to ensure proper setup before running tests to verify expected failure and success.

What's the best way to fix bugs using test-first methodology?

Using test-first methodology to fix bugs involves writing a failing test that reproduces the specific behavior issue, implementing the minimum code to make the test pass, and then refactoring safely. This ensures the bug is proven fixed by an automated test.

How does the RED-GREEN-REFACTOR cycle actually work in practice?

The RED-GREEN-REFACTOR cycle works by first writing a failing test (RED), implementing the minimum code to make it pass (GREEN), and then refactoring the code while keeping tests green. This ensures minimal code and verified behavior at every step.

Can I use test-driven development for refactoring behavior in an existing codebase?

Yes, test-driven development applies to refactoring behavior in existing codebases. By writing a failing test for the expected behavior change, implementing the minimum code to pass, and refactoring while tests stay green, you ensure the established contract remains unbroken.