test-driven-development

Enforce test-first development through the red-green-refactor cycle.

1|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/kegbi/monica-companion --skill test-driven-development-kegbi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/kegbi/monica-companion/tree/main/.codex/skills/test-driven-development
Command: npx skills add https://github.com/kegbi/monica-companion --skill test-driven-development-kegbi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Promotes writing tests before code to prevent regressions and clarify expected behavior during feature development and bug fixes.

Core Features & Use Cases

  • Enforces the Red-Green-Refactor cycle to guide implementation.
  • Requires a failing test before production code; implement the smallest code to pass the test.
  • Provides guidance on test naming, scope, and avoiding unnecessary mocks or over-engineering.

Quick Start

Start by writing a failing test that captures the required behavior, then implement the smallest code to make the test 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 writing unit tests before code using the red-green-refactor cycle?

To start test-driven development, write a failing RED test capturing the required behavior, implement the minimal production code to turn it GREEN, then refactor safely. This enforces strict test-first discipline for new features and bug fixes.

What is the test-driven development process for fixing bugs without introducing regressions?

The test-driven development process for bug fixes requires writing a failing test that reproduces the bug, writing the smallest code to make it pass, and refactoring to ensure regression safety while clarifying expected behavior.

Does test-driven development require writing a failing test before any production code?

Yes, strict test-driven development requires a mandatory failing test before writing production code. This ensures you implement only the minimal code necessary to pass the test and avoid over-engineering the solution.

Can I use test-driven development across any feature in my existing codebase?

You can apply test-driven development across any feature or bugfix in codebases using the TDD approach. It guides developers through the cycle regardless of the specific feature being implemented.

When should I avoid using mocks during the test-driven development cycle?

You should avoid mocks when inappropriate during test-driven development to prevent over-engineering and maintain regression safety. The cycle provides guidance on test scope and avoiding unnecessary mocks to ensure accurate behavior verification.

What's the best way to name tests during test-driven development?

The best way to name tests during test-driven development is to follow the provided guidance on test naming and scope, ensuring names clearly capture the required behavior and clarify expected outcomes for the feature being implemented.