test-driven-development

Enforces test-first development using the red-green-refactor cycle before writing implementation code.

Updated Jul 23, 2026
One-click install
npx skills add https://github.com/shrek-abaper/sap-nexus-agent --skill test-driven-development-shrek-abaper
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/shrek-abaper/sap-nexus-agent/tree/main/.comet/skills/skills/test-driven-development
Command: npx skills add https://github.com/shrek-abaper/sap-nexus-agent --skill test-driven-development-shrek-abaper

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents untested production code by requiring a failing test before any implementation, eliminating the false confidence of tests written after the fact. ## Core Features & Use Cases - Red-Green-Refactor Workflow: Guides writing a failing test, verifying the failure, implementing minimal code, and refactoring while keeping tests green. - Anti-Rationalization Rules: Counters common excuses like "test after" or "too simple to test" with concrete rebuttals and red-flag checklists. - Testing Anti-Pattern Reference: Companion document covering mock misuse, test-only production methods, incomplete mocks, and over-mocking. - Use Case: When fixing a bug where empty emails are accepted, write a failing test asserting the rejection, watch it fail, then implement the minimal validation to pass. ## Quick Start Ask the assistant to implement a new feature or bugfix using strict test-driven development with a failing test written first.

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 that passes. Refactor only after all tests are green, and repeat the cycle for each behavior.

How do I write a failing test for a bug fix?▼

Write a test that reproduces the bug by asserting the correct expected behavior, then run it to confirm it fails. Implement the minimal fix until the test passes, which proves the fix works and prevents regression.

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 and rewritten test-first.

What are common mocking mistakes in unit tests?▼

Common mistakes include asserting on mock existence 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.