tdd

Enforce the Red-Green-Refactor workflow for implementing and fixing software.

Updated May 3, 2026
One-click install
npx skills add https://github.com/david-nossebro/agent-commons --skill tdd-david-nossebro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/david-nossebro/agent-commons/tree/main/shared/skills/tdd
Command: npx skills add https://github.com/david-nossebro/agent-commons --skill tdd-david-nossebro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents shipping code without verification by enforcing a strict Test-Driven Development flow, so each production change is justified by a failing test and proven green before refinement.

Core Features & Use Cases

  • Canonical TDD cycle: Red (write a failing test), Green (make minimal code pass), Refactor (clean up while staying green).
  • Test design heuristics: Encourages isolated, fast, behavior-focused tests that cover edge cases and drive design.
  • Bug-fix protocol: Uses a permanent regression test to reproduce, fix minimally, confirm, and then refactor safely.
  • Use cases: Adding features, fixing bugs, refactoring, and reviewing diffs or pull requests with confidence in correctness.

Quick Start

Apply the tdd skill when you are about to implement or refactor a behavior, and ask it to guide you through writing a failing test first, then the minimal code to make it pass, and finally a safe refactor.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I implement test-driven development for new software features?

Test-driven development for new features requires writing a failing test first, then writing the minimal code required to make it pass, and finally refactoring while ensuring the test stays green.

What is the best way to fix bugs using regression tests?

Fix bugs using regression tests by first writing a permanent test that reproduces the failure, applying a minimal code fix to make it pass, and then safely refactoring the implementation.

When should I use the Red-Green-Refactor workflow?

Use the Red-Green-Refactor workflow when implementing new features, fixing bugs, or refactoring code where software behavior must remain correct and continuously verified throughout the process.

How do I write effective unit tests for behavior-driven development?

Effective unit tests for behavior-driven development should be isolated, fast, focused on specific behaviors rather than implementations, and designed to cover edge cases to drive software design.

Can I use test-driven development for safe code refactoring?

Test-driven development supports code refactoring by requiring full test runs to verify that existing behavior remains correct and continuously green while you clean up and improve the internal structure.

What are common test-driven development anti-patterns to avoid?

Common test-driven development anti-patterns include writing tests after implementation, over-engineering the Green phase, and skipping full test runs during refactoring, which risks shipping unverified code changes.