test-driven-development

Write failing tests before implementing code using the red-green-refactor cycle.

2|1|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/GACLove/feishu-aily-skills --skill test-driven-development-gaclove
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/GACLove/feishu-aily-skills/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/GACLove/feishu-aily-skills --skill test-driven-development-gaclove

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers often write code without proper tests, leading to hidden bugs, regression, and low confidence in changes.

Core Features & Use Cases

  • TDD Workflow Guidance: Detailed steps for Red‑Green‑Refactor, including verification checkpoints.
  • Anti‑Pattern Reference: Identifies common testing mistakes and how to avoid them.
  • Checklists & Rules: Ensures tests fail first, code stays minimal, and refactoring is safe.
  • Use Cases: New feature development, bug fixing, refactoring, and behavior changes in any software project.

Quick Start

Write a failing test describing the desired behavior, run it to see it fail, then implement the minimal code to make it pass.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I apply test-driven development to catch bugs early in a new feature?

To apply test-driven development, write a failing test describing the desired behavior, run it to verify it fails, then implement the minimal code to make it pass. This enforces the red-green-refactor cycle to catch bugs early in new features.

What is the red-green-refactor cycle in software testing?

The red-green-refactor cycle is a test-driven development workflow where you write a failing test, implement minimal code to pass it, then safely refactor. It includes strict verification checkpoints to ensure code quality and test-first validation.

How do I use test-first validation when fixing bugs or refactoring code?

Use test-first validation for bug fixes and refactoring by writing a test that reproduces the bug or verifies behavior changes, confirming it fails, then implementing the code fix. This ensures tests fail first and refactoring remains safe.

What are common test-driven development anti-patterns and how do I avoid them?

Common test-driven development anti-patterns include writing code without proper tests and skipping the failing test verification step. You can avoid these mistakes by following checklists and rules that enforce test-first validation and minimal code implementation.

When should I use test-driven development in my development workflow?

You should use test-driven development during new feature development, bug fixing, refactoring, and behavior changes within any software project. It ensures code quality by catching hidden bugs and regressions early through strict test-first validation.

Do I need specific testing frameworks to start writing tests before implementing code?

No specific testing frameworks are required to start writing tests before implementing code. The test-driven development workflow applies to any software project by enforcing the red-green-refactor cycle with strict verification steps and checklists.