tdd

Guide RED-GREEN-REFACTOR test-first workflows for software projects.

1|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/ImBIOS/swarm-tools --skill tdd-imbios
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/ImBIOS/swarm-tools/tree/main/.opencode/skill/tdd
Command: npx skills add https://github.com/ImBIOS/swarm-tools --skill tdd-imbios

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill codifies the Test-Driven Development workflow (RED-GREEN-REFACTOR) and distills best practices from Kent Beck, Michael Feathers, and John Ousterhout to guide teams in writing tests first and designing safer, maintainable code.

Core Features & Use Cases

  • TDD workflow guide: defines steps to write failing tests, implement minimal code, and refactor.
  • Language-agnostic adoption: applicable across languages and project types with consistent patterns.
  • Use Case: when starting a new feature, bug fix, or API design, teams can follow the RED-GREEN-REFACTOR cycle to confirm behavior incrementally.

Quick Start

Write a failing test for a new feature, implement the minimal code to pass, and then refactor.

Frequently Asked Questions about tdd

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

FAQPage Schema
How does the red-green-refactor cycle work in test-driven development?

The red-green-refactor cycle dictates writing a failing test first, implementing minimal code to pass it, and then refactoring safely. This workflow improves design quality and ensures maintainable software.

What is the best way to start unit testing for a new feature?

Start unit testing for a new feature by writing a failing test that defines the expected behavior. Implement the minimal code required to pass the test before refactoring. This ensures reliable design and faster feedback loops.

Can I apply test-driven development to any programming language?

Yes, test-driven development is language-agnostic and applicable across languages and project types. It provides consistent patterns for feature development, bug fixes, and API design to achieve maintainable code.

When should I use test-first practices instead of testing after implementation?

Use test-first practices when you need safer design and faster feedback loops during feature development or bug fixes. This approach codifies behavior confirmation incrementally, leading to more reliable and maintainable software.

How do I fix my code refactoring process to avoid breaking existing features?

Fix your refactoring process by adopting a test-first workflow that ensures failing tests are written and passed before code changes. This incremental confirmation prevents breaking existing behavior during structural improvements.