test-driven-development

Guide test-driven development with failing tests before code changes.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/jankneumann/agentic-assistant --skill test-driven-development-jankneumann
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/jankneumann/agentic-assistant/tree/main/.agents/skills/test-driven-development
Command: npx skills add https://github.com/jankneumann/agentic-assistant --skill test-driven-development-jankneumann

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents regressions and unreliable behavior by forcing you to specify expected outcomes with a failing test before implementing changes.

Core Features & Use Cases

  • Follows the TDD Cycle (RED → GREEN → REFACTOR): Write a test that fails, implement the minimum code to pass, then clean up without changing behavior.
  • Enables the Prove-It Pattern for bug fixes: Reproduce a reported bug with a test before writing the fix, so correctness is proven rather than assumed.
  • Improves test quality and maintainability: Uses practical guidance like test pyramids, state-based assertions, and clear, descriptive test naming.
  • Best-fit scenarios: New logic, behavioral changes, bug fixes, and edge-case handling where confidence and repeatability matter.

Quick Start

Tell the agent to use TDD to implement the requested behavior change by first writing a failing test, then making the smallest code change needed to pass it, and finally refactoring while keeping all tests green.

Frequently Asked Questions about test-driven-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use test-driven development to fix a bug without causing regressions?▼

Test-driven development fixes bugs by first writing a failing test that reproduces the reported issue, proving the bug exists before implementing the fix to prevent future regressions.

What is the RED-GREEN-REFACTOR workflow in TDD?▼

The RED-GREEN-REFACTOR workflow in TDD involves writing a failing test to capture intended behavior, implementing the minimum code to pass it, and then cleaning up without changing behavior.

How do I write tests first when adding new features in pytest or Jest?▼

Writing tests first for new features in pytest or Jest involves specifying expected outcomes with a failing test, implementing the logic to pass it, and running targeted and full test suites for verification.

Can I use TDD for refactoring existing code safely?▼

TDD supports refactoring by requiring you to write behavioral tests that pass before changing code, ensuring your refactoring maintains existing functionality while keeping all tests green.

Does test-driven development work with both Jest and Vitest frameworks?▼

Test-driven development works with Jest, Vitest, and pytest by guiding the test-first workflow across these frameworks to capture intended behavior and guard against regressions during implementation.

Why should I avoid skipped or vague tests when doing regression testing?▼

Avoiding skipped or vague tests during regression testing ensures your test suite reliably verifies behavior changes, providing actual confidence that new logic and bug fixes work as expected.