test-driven-development

Guide test-first workflows by writing failing tests before production code.

Updated Oct 29, 2025
One-click install
npx skills add https://github.com/hmps/skills --skill test-driven-development-hmps
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/hmps/skills/tree/main/test-driven-development
Command: npx skills add https://github.com/hmps/skills --skill test-driven-development-hmps

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of unreliable code, missed edge cases, and time-consuming debugging by enforcing a rigorous, test-first development methodology. It ensures every piece of code is verified against a failing test, preventing regressions and building trust in your codebase.

Core Features & Use Cases

  • Red-Green-Refactor Cycle: Guides you through writing a failing test, implementing minimal code to pass, and then refactoring, ensuring robust and clean code.
  • Bug Prevention: Catches bugs at the earliest stage of development, significantly reducing debugging time and costs.
  • Use Case: When implementing a new user authentication feature, use this Skill to guide you to write tests for valid/invalid credentials, edge cases like empty inputs, and then implement the code, ensuring the feature is solid from the start.

Quick Start

Use the test-driven-development skill to guide me through implementing the new user registration feature. I will start by writing a failing test for valid email input.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How does test-driven development prevent bugs in my code?

Test-driven development prevents bugs by requiring you to write a failing test before implementing code, ensuring every feature is verified against expected behavior from the start. This catches edge cases and regressions early, reducing debugging time and building confidence in your codebase.

What is the Red-Green-Refactor cycle and how do I use it?

Red-Green-Refactor is a three-step discipline: write a failing test (red), implement minimal code to pass it (green), then clean up the code without breaking the test (refactor). This cycle ensures your code is correct, minimal, and maintainable across new features, bug fixes, and refactoring.

Can I apply test-driven development to existing codebases?

Yes, test-driven development applies to new features, bug fixes, refactoring, and behavior changes across diverse codebases. Start by writing tests for the specific change you're making, then implement code to pass those tests, enforcing the rule that no production code ships without a failing test first.

How do I get started writing tests before implementation?

Begin by identifying the behavior you want to implement, write a test that fails because the code doesn't exist yet, then write the minimal code to make that test pass. This test-first workflow guides your implementation and ensures every line serves a verified purpose.

What edge cases does test-driven development help me catch?

Test-driven development catches edge cases like invalid inputs, empty values, boundary conditions, and unexpected states by forcing you to think through requirements upfront. Writing tests for valid and invalid scenarios ensures your code handles the full range of inputs safely.