test-driven-development

Enforce a failing test before any production change across languages.

2|Updated Aug 4, 2025
One-click install
npx skills add https://github.com/zhu327/go-clean-arch --skill test-driven-development-zhu327
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/zhu327/go-clean-arch/tree/main/.cursor/skills/test-driven-development
Command: npx skills add https://github.com/zhu327/go-clean-arch --skill test-driven-development-zhu327

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you avoid shipping unverified behavior by insisting on a failing test before any production change, which reduces regressions and makes requirements explicit.

Core Features & Use Cases

  • Red-Green-Refactor Workflow: Guides you through writing the smallest failing test, making the minimal code change, and then improving the design safely.
  • Behavior-Focused Testing: Encourages tests that verify observable outcomes instead of implementation details, mocks used only when necessary, and complete fixtures that match real contracts.
  • Bug Fixes and Refactors: Ideal for regression tests, feature additions, refactoring existing code, and choosing the right validation commands from the repository itself.

Quick Start

Use the test-driven-development skill to plan the next behavior change by writing the smallest failing test first, then implement only what is needed 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 start test-driven development for a new feature?

Test-driven development starts by writing the smallest failing test that proves the desired behavior is missing, making the minimal production code change to pass it, and then safely refactoring the design. This red-green-refactor workflow reduces regressions and makes requirements explicit.

What is the red-green-refactor workflow in TDD?

The red-green-refactor workflow in TDD requires writing a failing test first, implementing only the minimal code needed to make that test pass, and then improving the code design safely. It prevents production changes from being added before behavior is verified.

Can I use TDD for bug fixes and refactoring existing code?

TDD is ideal for bug fixes and refactoring existing code. It guides you to write a failing regression test proving the bug exists, implement the fix to make it pass, and refactor safely with confidence that observable behavior remains correct.

How do I write behavior-focused tests instead of testing implementation details?

Behavior-focused testing encourages verifying observable outcomes rather than implementation details. It uses mocks only when necessary and requires complete fixtures matching real contracts, ensuring your tests validate actual behavior and remain resilient during refactoring.

Does test-driven development work with any programming language and test framework?

Test-driven development applies to feature work, bug fixes, refactors, and behavior changes across any language or test framework. It requires discovering repository-specific test commands to execute your red-green-refactor workflow regardless of your stack.