test-driven-development

Enforces test-first development using the red-green-refactor cycle for features and bugfixes.

2|Updated May 30, 2026
One-click install
npx skills add https://github.com/virahitvin8/crafty-gis --skill test-driven-development-virahitvin8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/virahitvin8/crafty-gis/tree/main/GIT_STAR/assignment-generator/antigravity-skills-main/antigravity-skills-main/skills/test-driven-development
Command: npx skills add https://github.com/virahitvin8/crafty-gis --skill test-driven-development-virahitvin8

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developers often write code before tests, producing tests that pass immediately and prove nothing about correctness. This Skill enforces a strict test-first workflow so every behavior is verified by a test that was watched failing before implementation. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides writing a failing test, verifying the failure, writing minimal code to pass, and refactoring while staying green. - Anti-Rationalization Guardrails: Counters common excuses like "I'll test after" or "deleting code is wasteful" with concrete reasoning and red-flag checklists. - Testing Anti-Pattern Reference: Covers mock behavior testing, test-only production methods, incomplete mocks, and over-mocking via the bundled testing-anti-patterns.md reference. - Use Case: When fixing a bug where an empty email is accepted, write a failing test asserting the rejection error, watch it fail, implement the minimal validation, and confirm all tests pass. ## 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 pass. Refactor only while tests stay green, then repeat for the next behavior.

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

Write a test that reproduces the bug, such as asserting that an empty email returns an error, and run it to watch it fail. Then implement the minimal fix and confirm the test passes along with all existing tests.

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 fine, but the exploratory code should be discarded and rewritten test-first.

Why should I delete code written before tests instead of keeping it?

Code written before tests was never verified by a failing test, so keeping it as reference biases you toward testing the implementation rather than the requirement. Deleting it and rewriting test-first produces tests that actually prove behavior.

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.