test-driven-development

Enforce the Red-Green-Refactor cycle with failing tests before production code.

1|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/raybird/telenexus --skill test-driven-development-raybird
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/raybird/telenexus/tree/main/skills/tao-of-opencode/references/superpowers/test-driven-development
Command: npx skills add https://github.com/raybird/telenexus --skill test-driven-development-raybird

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill eliminates the uncertainty of untested code by enforcing a strict Red-Green-Refactor cycle, ensuring that every feature and bug fix is verified by a failing test before implementation.

Core Features & Use Cases

  • Strict TDD Enforcement: Prevents the common pitfall of writing production code before tests.
  • Anti-Pattern Mitigation: Provides clear guidance on avoiding mock-testing and test-only production code.
  • Use Case: When tasked with fixing a recurring bug, use this skill to first write a test that reproduces the failure, then implement the minimal fix to pass the test, ensuring the bug is permanently resolved without regressions.

Quick Start

Apply the test-driven-development skill to guide the implementation of the new user authentication module by writing the failing test case first.

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 when writing unit tests?

Test-driven development ensures bug-free refactoring by enforcing the Red-Green-Refactor cycle, which requires writing a failing test before implementing production code. This prevents regressions by verifying every code change against strict testing principles without relying on mock-testing.

How do I fix recurring bugs without introducing regressions?

Fix recurring bugs without regressions by first writing a failing test that reproduces the specific failure, then implementing the minimal production code fix to pass that test. This test-driven approach permanently resolves bugs while preventing future regressions.

Why should I avoid mock-testing in test-driven development?

Avoid mock-testing in test-driven development because it creates anti-patterns that obscure real production code behavior and reduce test reliability. Strict testing principles require verifying actual code execution paths rather than isolated mock-testing implementations to ensure genuine quality assurance.

How do I start feature development using test-driven development?

Start feature development using test-driven development by writing a failing test case that defines the expected behavior before writing any production code. This ensures the new feature is verified by a failing test first, then implemented with minimal code to pass that test.

What are the limitations of strict test-driven development for refactoring?

A limitation of strict test-driven development for refactoring is the required avoidance of test-only production methods and mock-testing. Adhering strictly to the Red-Green-Refactor cycle demands high discipline and comprehensive test coverage, which may slow down initial feature development speed.