test-driven-development

Enforce red-green-refactor test-first workflows before production code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents you from writing production code before you have proof that the behavior is correct, reducing bugs, rework, and fragile implementations.

Core Features & Use Cases

  • Test-first workflow: Create a failing test before implementation, then write the smallest amount of code needed to pass.
  • Red-green-refactor guidance: Move through clear steps for adding features, fixing bugs, and improving existing code without losing coverage.
  • Testing quality guardrails: Avoid common mistakes like testing mock behavior, over-mocking dependencies, or adding test-only production methods.
  • Use case: When adding a new API endpoint or repairing a regression, use this Skill to define expected behavior first and keep the fix protected by repeatable tests.

Quick Start

Ask for help implementing your change with a failing test first, then have the assistant guide the minimal code needed to make that 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 test-driven development for a new API endpoint?

Test-driven development for a new API endpoint starts by writing a minimal failing unit test that defines the intended behavior, then writing the smallest amount of production code needed to make that test pass.

What is the red green refactor cycle in software engineering?

The red green refactor cycle is a disciplined testing workflow where you write a failing test, write minimal code to pass it, then safely improve the implementation without losing test coverage.

How do I fix bugs using unit tests without over-mocking dependencies?

Fix bugs using unit tests by creating a failing test that reproduces the regression, then repairing the code to pass while avoiding mock-driven implementations or adding test-only production methods.

Does test-driven development work for refactoring existing code?

Test-driven development works for refactoring existing code by using repeatable unit tests to define current behavior, ensuring code improvements maintain coverage and preventing regressions during structural changes.

Why does my test-driven development workflow result in fragile implementations?

Test-driven development workflows result in fragile implementations when tests validate mock behavior instead of real code, or when test-only production methods are introduced, bypassing intended behavior verification.