test-driven-development

Write failing tests before production code to enforce correct software behavior.

Updated Apr 19, 2026
One-click install
npx skills add https://github.com/OnClickListener2048/confluence-mcp --skill test-driven-development-onclicklistener2048
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/OnClickListener2048/confluence-mcp/tree/main/.claude/skills/test-driven-development
Command: npx skills add https://github.com/OnClickListener2048/confluence-mcp --skill test-driven-development-onclicklistener2048

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces writing tests before production code to ensure correct behavior, reduce regression risk, and guide design decisions during feature development and bug fixes.

Core Features & Use Cases

  • 红-绿-重构循环:通过失败测试驱动实现、通过测试并进行重构,确保代码随时间保持正确性与可维护性。
  • 最小实现原则:仅编写足以通过测试的生产代码,避免过早优化和无用实现。
  • 行为驱动工作流:在功能添加、缺陷修复和重构中维持高信心和清晰的设计边界。

Quick Start

先为期望行为编写一个失败的测试,然后实现最小的生产代码以通过测试,最后进行重构。

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is test-driven development and how does the red-green-refactor cycle work?

Test-driven development is a test-first workflow where you write a failing test, implement minimal production code to pass it, then refactor. This red-green-refactor cycle enforces correct behavior and reduces regression risk during feature development and bug fixes.

How do I start writing tests before production code for a new feature?

Start writing tests before production code by defining a failing test for the expected behavior, then write the minimal implementation required to pass that test, and finally refactor the code while ensuring the test stays green.

Does test-driven development help with refactoring and reducing regression risk?

Yes, test-driven development helps with refactoring by providing strong validation. The failing tests define expected behavior, ensuring predictable refactors and reducing regression risk when modifying or extending existing software.

What is the minimal implementation principle in test-driven development?

The minimal implementation principle in test-driven development means writing only enough production code to pass the test. This avoids premature optimization and unused implementations, guiding design decisions and maintaining clear boundaries.

Can I use test-driven development for both bug fixes and feature additions?

You can use test-driven development for both bug fixes and feature additions. It drives behavior-focused workflows by writing failing tests that define the correct behavior, ensuring robust and maintainable code across all development tasks.