tdd

Enforce test-driven development with failing tests before implementation.

Updated Feb 23, 2026
One-click install
npx skills add https://github.com/cheafi/Trading-bot-CC --skill tdd-cheafi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/cheafi/Trading-bot-CC/tree/main/.github/skills/tdd
Command: npx skills add https://github.com/cheafi/Trading-bot-CC --skill tdd-cheafi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The tdd skill helps teams avoid brittle development by forcing clear, failing tests to define behavior before implementing logic, reducing regressions and unclear requirements.

Core Features & Use Cases

  • Red-Green-Refactor workflow: Guides you to write a failing test, implement the minimum code to pass, then clean up without breaking tests.
  • Atomic, behavior-first test design: Encourages single-behavior tests with specification-like naming to improve clarity and maintainability.
  • Practical framework guidance: Provides quick references for common testing stacks and common failure modes.

Quick Start

Activate the tdd mode to implement the specified feature by writing a failing test first, then adding only the minimum code required to make it pass, and finally refactoring while keeping the 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 practice test-driven development for a new feature?

Test-driven development requires writing a failing test before implementing behavior. You write a failing test, add the minimum code to pass, then refactor while keeping the suite green.

What is the red green refactor cycle in unit testing?

The red green refactor cycle is a unit testing workflow. Red means writing a failing test, green means implementing minimum logic to pass, and refactor means cleaning up without breaking tests.

How do I write effective specification tests for behavior-first development?

Specification tests use single-behavior test design with descriptive naming. This avoids oversized tests and improves clarity by defining one deterministic behavior per test case.

Why does my test suite keep breaking during feature development?

Your test suite breaks when tests are untriangulated or oversized. Enforce test-driven development by writing specification-style tests with single-behavior focus to reduce regressions.

Do I need to maintain a green test suite after every code change?

Yes, maintaining a green test suite after each change is required. The red-green-refactor workflow mandates passing tests before refactoring to ensure safe code shipping.

When should I not use the test-first approach?

Avoid test-driven development for non-deterministic behaviors or exploratory logic lacking clear specifications. It requires deterministic, behavior-focused test cases across red-green-refactor iterations.