test-driven-development

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Code written before tests often ships untested or with tests that pass immediately and prove nothing. This Skill enforces a strict test-first workflow so every behavior change is backed 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. - Rationalization Detection: Lists common excuses for skipping TDD ("too simple to test", "I'll test after") and counters each with concrete reasoning. - Test Quality Rules: A companion reference defines how to write honest tests — naming the break each test catches, asserting real behavior instead of mocks, and running a mutation check. - Use Case: When fixing a bug like an empty email being accepted, write a failing test reproducing it first, verify it fails for the right reason, then implement the minimal validation fix. ## Quick Start Ask the AI to implement a new feature or bugfix using strict test-driven development with a failing test written and verified before 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 step by step?

Follow the red-green-refactor cycle: write one minimal failing test, run it and confirm it fails for the expected reason, write the simplest code that passes, verify all tests stay green, then refactor. Repeat for each new behavior.

How do I write a good failing test before implementation?

Name the production change that should make the test fail, derive expected values by hand as literals rather than reusing code under test, and assert on real behavior instead of mock interactions. One test should cover one behavior with a clear descriptive name.

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. Exploratory coding is allowed if the exploration is discarded and the real work restarts with TDD.

Should tests assert on mocks or real components?

Assert on real component behavior, never on the mock itself. Mock only slow or external dependencies after learning their side effects, mirror the complete real data structure, and switch to integration tests when mock setup outweighs the test logic.

Why does a test passing immediately indicate a problem?

A test that passes before implementation is testing existing behavior or testing nothing meaningful. It never proved it can catch the bug, so you must fix the test until it fails for the right reason — the missing feature, not a typo.