test-driven-development

Enforce a test-first workflow with red, green, and refactor phases.

112|26|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/Wide-Moat/open-computer-use --skill test-driven-development-wide-moat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/Wide-Moat/open-computer-use/tree/main/skills/public/test-driven-development
Command: npx skills add https://github.com/Wide-Moat/open-computer-use --skill test-driven-development-wide-moat

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you avoid shipping unverified changes by enforcing a test-first workflow so bugs are caught before production code is committed.

Core Features & Use Cases

  • TDD workflow discipline: Write a failing test, make minimal changes to go green, then refactor without adding behavior.
  • Quality requirements for tests: Ensures tests are behavior-focused (not mock existence), named clearly, and fail for the right reason.
  • Common test anti-pattern prevention: Warns against testing mock behavior, adding test-only methods to production, and skipping “watch it fail.”

Quick Start

Use the test-driven-development skill when you start implementing a feature or fixing a bug by first writing a minimal test that fails for the missing behavior.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I start test-driven development when implementing a new feature?

To start test-driven development, write a minimal behavior-focused test that fails for the expected missing-feature reason. Then, implement the minimal production code required to make that failing test pass, and finally refactor the code while ensuring the entire test suite stays green.

What is the red green refactor cycle in TDD?

The red green refactor cycle is the core TDD workflow: red means writing a test that fails for the right reason, green means implementing minimal code to satisfy the test, and refactor means cleaning up the code without changing its behavior or breaking the test suite.

How do I write good unit tests that fail for the right reason?

Write good unit tests by focusing on actual behavior rather than mock existence. Ensure tests are named clearly, watch them fail to verify they target the missing feature, and avoid adding test-only methods to your production code to prevent common testing anti-patterns.

Can I use a test-first workflow for bugfixes and refactoring?

Yes, you can apply a test-first workflow to bugfixes and refactoring. For a bugfix, write a failing test that reproduces the bug. For refactoring, rely on the existing passing test suite to verify that your structural changes do not alter the software's behavior.

What are common test anti-patterns to avoid in unit testing?

Common test anti-patterns include testing mock behavior instead of real outcomes, adding test-only methods to production code, and skipping the watch it fail step. These practices lead to false confidence and obscure whether your unit tests actually verify the target behavior.