tdd

Guide behavior-driven development through red-green-refactor TDD loops with vertical tracer-bullet iterations.

14|1|Updated May 24, 2026
One-click install
npx skills add https://github.com/DoraemonHugU/oh-my-harness --skill tdd-doraemonhugu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/DoraemonHugU/oh-my-harness/tree/main/plugin/skills/tdd
Command: npx skills add https://github.com/DoraemonHugU/oh-my-harness --skill tdd-doraemonhugu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It solves the problem of building features or fixing bugs without a reliable way to prove behavior, by guiding you to write tests first and then implement only what the tests require.

Core Features & Use Cases

  • Red-Green-Refactor loop: Iterate from failing tests to minimal passing code, then refactor safely while keeping tests green.
  • Behavior-first integration testing: Prefer public interfaces and end-to-end behavior over mocks of internal collaborators.
  • Vertical slicing (tracer bullets): Create one test → one implementation per cycle to avoid horizontal bulk writing of tests or code.
  • Planning alignment: Uses the current Implementation Plan as the task boundary; if acceptance criteria are unclear, return to the harness to refine scope.

Use case example: You need to fix a bug and ensure it doesn’t regress; you write an integration-style test that captures the expected user-visible behavior, implement the smallest change to pass it, then refactor with confidence.

Quick Start

Load the tdd skill with your current Implementation Plan and repeatedly write one failing behavior test, implement the minimal code to make it pass, and refactor while keeping the full test suite green.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I implement behavior-driven software using red-green-refactor TDD?

To implement behavior-driven software using red-green-refactor TDD, you write one failing behavior test, implement the minimal code to pass it, and then refactor safely while keeping the full test suite green. This vertical slice approach ensures observable behavior is verifiable through public interfaces.

What is the best way to write integration tests without mocking internal collaborators?

The best way to write integration tests without mocking internal collaborators is to verify behavior through public interfaces and end-to-end behavior. You should limit mocking strictly to boundaries, ensuring your tests capture actual user-visible behavior rather than internal implementation details.

When should I use vertical slice testing for feature development and bug fixing?

You should use vertical slice testing for feature development and bug fixing when you need to prove specific acceptance criteria through observable behavior. By creating one test and one implementation per cycle, you avoid horizontal bulk writing and ensure each change is reliably validated against expected user-visible outcomes.

Can I refactor code before reaching green in the TDD loop?

No, you cannot refactor before reaching green in the TDD loop. Safe refactoring must only occur after your minimal implementation passes the failing test, ensuring you maintain a green test suite while improving code structure without altering verified behavior.

What should I do if acceptance criteria are unclear during the TDD process?

If acceptance criteria are unclear during the TDD process, you should return to your implementation plan to refine the scope. The TDD loop requires alignment with an existing implementation plan to define task boundaries, ensuring your behavior tests accurately reflect expected outcomes.