Skip to main content
← Back to the Skill directory

Test-Driven Development

Follow a red, green, refactor workflow to add regression coverage for new features and bug fixes.

Testing & debuggingobra/superpowersMITSources checked: 2026-10-21

Features

  • Start with a failing test for the desired behavior, then implement enough code to pass it.
  • Work through red, green and refactor stages, retaining executable regression checks.

When to use it

Useful for adding business behavior, fixing known defects or refactoring modules whose behavior must stay consistent.

Before you start

The project needs a runnable test command. This skill guides the development process and does not supply a universal test framework.

Usage example

Follow this illustrative workflow, replacing file names and goals with your own project details.

Add validation for pagination parameters

What to prepare
An existing project, its parameter validation layer and a runnable test command.
Workflow
Write failing tests for defaults and invalid inputs, implement validation, then refactor.
Expected deliverables
A validator, red-to-green execution notes and repeatable regression tests.

Recommended prompts

Replace the bracketed placeholders, then paste into an AI tool with this skill installed. Prompts follow the interface language; copying preserves the full text and line breaks.

Start the task
Use the test-driven-development skill to add pagination validation in [project path]. Test command: [test command]. Rules: page defaults to 1 and pageSize to 20. Both must be positive integers; reject pageSize above 100. Write and run failing tests first, implement the minimum code, then refactor while tests remain green. Cover defaults, boundaries, non-integers and invalid inputs, and report actual execution.

Review the result
Check that the tests expose previously missing behavior rather than mirror implementation details. Verify success and failure paths, defaults and boundaries, then run the relevant tests and report results. Clearly label checks you did not run.

Supported AI tools

The original project documents plugins for Claude Code, Codex and Cursor. These methods install the full Superpowers plugin, including this skill.

Installation

Install and sign in to your AI tool first. Its version must support plugins.

Run in: Chat input in the AI tool

Install Superpowers from the official Claude Code plugin marketplace.

Command 1
/plugin install superpowers@claude-plugins-official

Restart the tool or open a new session, then mention this skill when describing your task.

Check the official setup guide

Source and license

This guide summarizes the original skill definition, README and setup documentation. Models, accounts and external services are provided by their respective tools.

Test-Driven Development · Skill · SpaceYew