test-driven-development

Enforce Red-Green-Refactor cycles for production code with failing tests first.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/smrik/ai-fund --skill test-driven-development-smrik
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/smrik/ai-fund/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/smrik/ai-fund --skill test-driven-development-smrik

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill eliminates technical debt and unreliable code by enforcing a strict Red-Green-Refactor cycle, ensuring that every feature is verified by a failing test before implementation begins.

Core Features & Use Cases

  • Red-Green-Refactor Enforcement: Provides a structured workflow to ensure production code is only written to satisfy a pre-existing failing test.
  • Anti-Pattern Mitigation: Includes a comprehensive guide to identifying and avoiding common testing pitfalls like mocking behavior instead of real logic.
  • Use Case: When implementing a complex financial calculation, use this skill to define the expected output for edge cases first, ensuring the final implementation is robust and regression-proof.

Quick Start

Apply the test-driven-development skill to guide the implementation of the new valuation module by writing the failing test case first.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is the Red-Green-Refactor cycle in test-driven development?▼

The Red-Green-Refactor cycle is a test-driven development workflow requiring a failing test first, writing production code to pass it, and then refactoring. It enforces high-quality, regression-proof code by prohibiting implementation without a preceding test.

How do I enforce test-driven development for complex feature implementation?▼

Enforce test-driven development by applying a strict Red-Green-Refactor cycle to define expected outputs and edge cases via a failing test before writing any production code, ensuring robust and regression-proof feature implementation.

Does strict test-driven development work for bug fixes and code refactoring?▼

Strict test-driven development works for bug fixes and refactoring within the software lifecycle. It requires defining a failing test that captures the bug or desired refactoring outcome before altering production code, mitigating technical debt.

What's the best way to avoid common unit testing anti-patterns?▼

The best way to avoid common unit testing anti-patterns is using a strict test-driven development methodology that provides a comprehensive guide to identifying and avoiding testing pitfalls like mocking behavior instead of verifying real logic.

Why does writing production code before tests increase technical debt?▼

Writing production code before tests increases technical debt because it bypasses the test-driven development cycle, producing unreliable code that lacks regression verification and is vulnerable to edge cases during feature development.