test-driven-development

Enforces red-green-refactor test-driven development workflow for features and bugfixes.

2|Updated Aug 15, 2025
One-click install
npx skills add https://github.com/Grupo-6-ADS-B/FittNutri --skill test-driven-development-grupo-6-ads-b
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/Grupo-6-ADS-B/FittNutri/tree/main/.claude/skills/test-driven-development
Command: npx skills add https://github.com/Grupo-6-ADS-B/FittNutri --skill test-driven-development-grupo-6-ads-b

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing code before tests leads to unverified implementations, biased tests written after the fact, and regressions discovered only in production. This Skill enforces a strict test-first discipline so every behavior change is proven by a failing test before any production code exists. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full TDD cycle with mandatory verification that each test fails for the right reason before implementation, and passes after minimal code is written. - Rationalization Detection: Lists common excuses for skipping TDD (such as "too simple to test" or "I'll test after") with concrete rebuttals, plus red flags that trigger a restart of the cycle. - Testing Anti-Pattern Reference: A companion reference covers testing mock behavior, test-only methods in production classes, incomplete mocks, and mocking without understanding dependencies. - Use Case: When fixing a bug where an empty email is accepted, write a failing test asserting the rejection, watch it fail, implement the minimal validation, verify it passes, then refactor. ## Quick Start Use the test-driven-development skill to implement this feature by writing a failing test first, then the minimal code 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 practice test-driven development on a new feature?

Write one minimal failing test describing the desired behavior, run it to confirm it fails for the right reason, then write the simplest code to make it pass. After it passes, refactor while keeping tests green, and repeat for the next behavior.

How do I fix a bug using TDD?

Write a failing test that reproduces the bug first, then implement the minimal fix until the test passes. This proves the fix works and creates a regression test that prevents the bug from returning.

Why should tests be written before implementation code?

Tests written after code pass immediately, which proves nothing about whether they test the right behavior. Watching a test fail first confirms it actually exercises the missing feature rather than a typo or existing behavior.

When is it acceptable to skip test-driven development?

Exceptions are limited to throwaway prototypes, generated code, and configuration files, and only with explicit approval from your human partner. Exploration is allowed, but the exploratory code must be discarded before restarting with TDD.

What are common testing anti-patterns with mocks?

Common anti-patterns include asserting on mock elements instead of real behavior, adding test-only methods to production classes, mocking without understanding side effects, and creating incomplete mocks missing fields downstream code uses.