test-driven-development

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

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/jeremybrasher/grokbot-skills --skill test-driven-development-jeremybrasher
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/jeremybrasher/grokbot-skills/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/jeremybrasher/grokbot-skills --skill test-driven-development-jeremybrasher

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents shipping production code without a failing test first, stopping tests-after-the-fact, green suites that encode the wrong requirement, and rationalized shortcuts that leave behavior unverified. ## Core Features & Use Cases - Strict TDD cycle enforcement: Requires intake of a named required behavior, a RED failing test verified for the right reason, minimal GREEN code, and REFACTOR only after green. - HOLD conditions and refusal rules: Returns an explicit gap statement instead of inventing tests when the requirement, observable surface, or human confirmation is missing. - Test quality guidance: Companion reference covers naming the break a test catches, avoiding mock assertions, and running a mutation check before finishing. - Use Case: When asked to fix a bug where empty emails are accepted, write a failing test asserting the rejection, watch it fail, implement the minimal validation, and confirm the suite stays green. ## Quick Start Use test-driven development to implement this feature, starting with a failing test for the required behavior before writing any production code.

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?▼

Name the required behavior first, write one minimal failing test, watch it fail for the right reason, then write the smallest code that passes. Refactor only after green, and repeat with the next behavior.

What is the red-green-refactor cycle in TDD?▼

RED writes a failing test for missing behavior, GREEN adds the minimal code to pass it, and REFACTOR cleans up duplication while keeping tests green. Each phase is verified by actually running the test suite.

When is it acceptable to skip test-driven development?▼

Only for throwaway prototypes, generated code, or configuration files, and only with explicit approval from your human partner. Skipping on your own judgment is treated as rationalization, not an exception.

Why should tests not be written after the implementation?▼

Tests written after pass immediately, which proves nothing about whether they catch bugs. They tend to verify the code you already wrote rather than the behavior that should exist, missing edge cases you forgot.

Should I use mocks in TDD unit tests?▼

Prefer real dependencies over mocks, and never assert on mock behavior itself. Mock only slow or external operations after understanding their side effects, and mirror the complete real data structure in mock responses.