test-driven-development

Implements code changes using the red-green-refactor test-driven development loop.

3|Updated Jul 28, 2026
One-click install
npx skills add https://github.com/marcmarti9/agentit --skill test-driven-development-marcmarti9
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/marcmarti9/agentit/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/marcmarti9/agentit --skill test-driven-development-marcmarti9

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 workflow where a failing test is written before any implementation, so every behavior change carries proof that it works. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Write a failing test first, implement the minimum code to pass it, then refactor with tests green. - Prove-It Pattern for Bug Fixes: Reproduce any reported bug with a failing test before attempting a fix, guaranteeing the fix actually resolves the issue. - Stack Discovery and Test Quality Guidance: Detect the repository's own test commands and frameworks, and apply practices like the test pyramid, DAMP over DRY, state-based assertions, and preferring real implementations over mocks. - Use Case: A bug report says completing a task does not set its timestamp. Write a test asserting completedAt is set, watch it fail, implement the fix, watch it pass, then run the full suite to confirm no regressions. ## Quick Start Use test-driven development to implement this feature, starting with a failing test before writing any implementation 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 when fixing a bug?▼

Write a test that reproduces the bug first and confirm it fails, then implement the fix and confirm the test passes. Finish by running the full test suite to verify no regressions were introduced.

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

Inspect the 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 finally interaction mocks. Reserve mocks for dependencies that are too slow, non-deterministic, or have 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 tests that pass on the first run indicate a problem?▼

A test that passes immediately proves nothing about the new behavior, since it may not exercise the code you think it does. The RED step requires confirming the test fails before writing the implementation.