test-driven-development

Write failing tests first, then implement minimal code to pass them.

383|15|Updated Oct 19, 2026
Ready to run
npx skills add https://github.com/Innei/ryugi --skill test-driven-development-innei
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/Innei/ryugi/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/Innei/ryugi --skill test-driven-development-innei

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? This Skill eliminates the uncertainty of untested code by enforcing a discipline where tests drive implementation. It catches bugs before commit, prevents regressions when refactoring, and ensures every line of production code has a corresponding test that watched it fail first. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Write a failing test, implement minimal code to pass it, then safely refactor while staying green. - Regression Prevention: Automated tests run the same way every time, catching regressions that manual testing misses. - Design Validation: Hard-to-test code signals design problems; listening to test friction improves the interface before shipping. - Use Case: You need to fix a bug where empty emails are accepted. Write a test asserting the form rejects empty email, watch it fail, implement the validation, verify it passes, then refactor if needed. ## Quick Start Before writing any implementation code, write a minimal failing test that names the exact behavior you want, run it to confirm it fails for the right reason, then write just enough 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
Why must I watch the test fail before writing code?▼

Watching the test fail proves it can actually catch the bug. Tests written after pass immediately against existing code, proving nothing about whether they would have caught a break. Only a test you watched fail first has earned the right to pass.

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

Delete the code. No exceptions. Keeping it as reference or adapting it while writing tests is still testing-after. Delete means delete, then implement fresh from the test.

When can I skip TDD?▼

Throwaway prototypes, generated code, and configuration files are exceptions. For everything else—new features, bug fixes, refactoring—TDD applies. Ask your human partner before skipping.

How do I know if my test is good?▼

Name the production change that would make it fail before writing it. If you cannot name a specific bug or missing feature, the test is a change detector, not a behavior validator. Assert on real code behavior, use literals for expectations, and avoid mocking unless the dependency is slow or external.

What if the test is hard to write?▼

Hard tests signal hard-to-use code. Write the API you wish existed, write the assertion first, then design the code around it. The friction is feedback about your design.

Does TDD slow down development?▼

TDD catches bugs before commit and prevents regressions on refactor, eliminating debugging cycles. Skipping tests moves the cost to production, not eliminating it. TDD is the pragmatic path.