test-driven-development

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

10|1|Updated Jul 29, 2026
One-click install
npx skills add https://github.com/flowing-abyss/obsidian-local-fonts --skill test-driven-development-flowing-abyss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/flowing-abyss/obsidian-local-fonts/tree/main/.ai/skills/test-driven-development
Command: npx skills add https://github.com/flowing-abyss/obsidian-local-fonts --skill test-driven-development-flowing-abyss

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing code before tests leads to unverified behavior, biased tests written after the fact, and regressions that slip into production. This Skill enforces a strict test-driven development discipline so every feature and bugfix is proven by a failing test before any implementation code exists. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full TDD cycle with mandatory verification steps, including watching each test fail for the right reason before writing minimal code to pass. - Anti-Rationalization Guardrails: Catalogs common excuses for skipping TDD (such as "I'll test after" or "too simple to test") and explains why each one fails, keeping the workflow honest. - Testing Anti-Pattern References: Companion references cover 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 while keeping tests green. ## 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 and watch it fail for the expected reason, then write the simplest code that makes it pass. After it passes, refactor while keeping all tests green, and repeat for the next behavior.

How do I write a failing test before implementation code exists?

Write the test against the API you wish existed, with a clear name describing one behavior and a hand-derived expected value. Run it to confirm it fails because the feature is missing, not because of a typo or error, before writing any implementation.

When is it acceptable to skip test-driven development?

The skill allows exceptions only for throwaway prototypes, generated code, and configuration files, and only with explicit approval from your human partner. Exploration is fine, but the exploratory code must be discarded and rewritten test-first.

Why should I avoid asserting on mocks in unit tests?

Asserting on a mock only verifies the mock exists, not that the component behaves correctly. Test the real component's behavior instead, mock only slow or external dependencies at the lowest level, and mirror the complete real data structure in mock responses.

What should I do if I already wrote code before the test?

Delete the implementation and start over with a failing test. Keeping it as reference or adapting it while writing tests amounts to testing after the fact, which never proves the test can catch the bug it targets.