test-driven-development

Guides test-first development using the red-green-refactor cycle across any language or test framework.

Updated Aug 15, 2026
One-click install
npx skills add https://github.com/jacksonlee-tw/mystock-vue --skill test-driven-development-jacksonlee-tw
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/jacksonlee-tw/mystock-vue/tree/main/mystock-vue/.agents/skills/test-driven-development
Command: npx skills add https://github.com/jacksonlee-tw/mystock-vue --skill test-driven-development-jacksonlee-tw

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code changes made without tests ship unverified behavior, and bug fixes without reproduction tests leave regressions unguarded. This Skill enforces a disciplined test-first workflow so every behavior change is proven by a failing-then-passing test. ## Core Features & Use Cases - Red-Green-Refactor Loop: Write a failing test first, implement the minimum code to pass, then refactor with tests green. - Prove-It Pattern for Bugs: Reproduce any reported bug with a failing test before attempting a fix, guaranteeing the fix actually works. - Stack Discovery: Detects the repository's own test commands (npm, Gradle, pytest, Cargo, Go) instead of assuming defaults. - Use Case: A bug report says completing a task doesn't set its timestamp. Write a failing test that asserts completedAt is set, watch it fail, implement the fix, and confirm the test passes with the full suite 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 bug fix?▼

Write a test that reproduces the bug first and confirm it fails, then implement the fix and confirm the test passes. This Prove-It Pattern guarantees the bug existed, the fix works, and a regression guard remains in the suite.

How do I find the right test command for a repository?▼

Inspect the project's build files such as package.json, pom.xml, pyproject.toml, go.mod, or Cargo.toml, and prefer checked-in wrappers like ./gradlew or make test. README, CONTRIBUTING, and CI workflows show the commands that actually gate merges.

Should I use mocks or real implementations in unit tests?▼

Prefer real implementations first, then fakes, stubs, and mocks last. Mock only when the real dependency is too slow, non-deterministic, or has uncontrollable side effects like external APIs or email sending.

When should I not use test-driven development?▼

Skip TDD for pure configuration changes, documentation updates, or static content changes with no behavioral impact. Any change that alters logic or could break existing behavior warrants a test-first approach.

Why do my tests break every time I refactor code?▼

Tests that verify internal method calls instead of outcomes break on any refactor. Test state and behavior through inputs and outputs rather than interaction-based assertions on implementation details.