test-driven-development

Enforce the RED-GREEN-REFACTOR cycle for test-first development workflows.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/hicucu/forge --skill test-driven-development-hicucu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/hicucu/forge/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/hicucu/forge --skill test-driven-development-hicucu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the risk of unreliable, regression-prone code that comes from writing production logic before tests, which leads to hard-to-debug failures and accumulating technical debt that slows down future development.

Core Features & Use Cases

  • Strict TDD Cycle Enforcement: Mandates the RED-GREEN-REFACTOR workflow for all feature implementation, bug fixes, and refactoring tasks, with mandatory verification of test failure before any production code is written.
  • Anti-Pattern Guardrails: Provides explicit rules and examples to avoid common testing mistakes like validating mock behavior instead of real code, adding test-only methods to production classes, and writing tests after implementation.
  • Use Case: When building a new user notification system, use this Skill to write failing tests for edge cases like empty recipient lists first, then implement the minimal code to pass those tests, ensuring no edge cases are missed and future changes to the notification logic won't break existing functionality.

Quick Start

Use the test-driven-development skill to implement the new payment processing validation feature by first writing a failing test for the invalid card number detection logic before writing any production code.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How does test-driven development prevent regressions and technical debt?

Test-driven development prevents regressions by mandating the RED-GREEN-REFACTOR cycle, requiring verification of test failure before writing minimal production code to eliminate untested logic.

How do I implement a new feature using the test-first development workflow?

Implement features using test-first development by writing a failing test for edge cases like empty inputs, verifying the failure, then writing only the minimal code required to pass that test.

What are common unit testing anti-patterns I should avoid during refactoring?

Common unit testing anti-patterns to avoid include validating mock behavior instead of real code, adding test-only methods to production classes, and writing tests after implementation.

Can I apply test-driven development to bug fixes and refactoring tasks?

Yes, test-driven development applies to bug fixes and refactoring tasks across any software development stack, enforcing the same test-first cycle to ensure reliable code changes.

Why do I need to verify test failure before writing production code?

Verifying test failure before writing production code ensures the test checks the intended logic, serving as a mandatory guardrail against untested code that causes hard-to-debug failures.

When should I not use mock validation in unit testing?

Avoid mock validation when it replaces checking real code execution, as this testing anti-pattern leads to unreliable tests and unmanageable technical debt instead of verifying actual logic.