test-driven-development

Enforces red-green-refactor test-driven development workflow before writing implementation code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Code written before tests often ships with unverified behavior, hidden bugs, and tests that pass immediately without proving they catch anything. This Skill enforces a strict test-first discipline so every feature and bugfix is backed by a test that was watched failing before implementation. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Guides writing one minimal failing test, verifying it fails for the right reason, then writing the simplest code to pass. - Rationalization Detection: Lists common excuses for skipping TDD ("too simple to test", "I'll test after") and explains why each fails. - Test Quality Rules: A companion reference defines how to write honest tests that name the break they catch, avoid mock assertions, and derive expectations independently. - 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 validation, and confirm the suite stays green. ## Quick Start Ask the AI 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 test describing the desired behavior, run it and watch it fail for the expected reason, then write the simplest code that makes it pass. Refactor only after the test is green, and repeat the cycle for the next behavior.

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

Red means writing a failing test, green means writing minimal code to pass it, and refactor means cleaning up while keeping tests green. Verifying the failure and the pass at each step is mandatory, never skipped.

Should I write tests before or after implementation code?▼

Write tests before implementation. Tests written after pass immediately, which proves nothing about whether they catch the right bug. If code was written first, delete it and reimplement from the failing test.

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

Only for throwaway prototypes, generated code, or configuration files, and only after asking your human partner. Exploration is fine, but the exploratory code must be discarded and the real work restarted with TDD.

Why do my tests pass immediately without any code changes?▼

An immediately passing test means you are testing existing behavior, not the new feature. Fix the test so it fails because the feature is missing, then implement until it passes.

How do I write good tests that actually catch bugs?▼

Name the production change that would make the test fail before writing it, derive expected values by hand rather than with the code under test, and assert on real behavior instead of mocks. Run a mental mutation check before finishing.