test-driven-development

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

Updated Aug 19, 2026
One-click install
npx skills add https://github.com/Base-Analitica/mouse-hub --skill test-driven-development-base-analitica
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/Base-Analitica/mouse-hub/tree/main/.jcode/skills/test-driven-development
Command: npx skills add https://github.com/Base-Analitica/mouse-hub --skill test-driven-development-base-analitica

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? It prevents untested or over-engineered production code by requiring a failing test before any implementation, ensuring every behavior is verified and regressions are caught early. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Guides writing a failing test, verifying the failure, implementing minimal code, and refactoring while keeping tests green. - Rationalization Detection: Lists common excuses for skipping TDD and the red flags that mean code should be deleted and restarted test-first. - Test Quality Rules: A companion reference defines how to write honest tests that assert real behavior instead of mocks, with a mutation check to confirm tests catch realistic bugs. - Use Case: When fixing a bug like an empty email being accepted, write a failing test reproducing it, watch it fail, implement the minimal validation fix, and confirm the suite stays green. ## Quick Start Ask the agent to implement a new feature or bug fix 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 when writing new code?▼

Write one minimal failing test describing the desired behavior, run it to confirm it fails for the right reason, then write the simplest code that passes. Refactor only while all tests stay green, and repeat the cycle for each new behavior.

How do I write good unit tests that catch real bugs?▼

Name the production change each test should catch, derive expected values by hand rather than from the code under test, and assert real behavior instead of mock interactions. Finish with a mutation check: mentally break the code and confirm a test fails.

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. Exploration is allowed, but the exploratory code must be discarded and the real implementation restarted test-first.

Should I use mocks in unit tests?▼

Use mocks only for slow or external dependencies, after learning the real method's side effects. Never assert on the mock itself, mirror the complete real data structure, and prefer integration tests with real components when mock setup grows large.

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 is effectively testing after the fact, which cannot prove the test catches the intended bug.