test-first

Guide developers through the Red-Green-Refactor cycle for Test-Driven Development.

Updated Feb 22, 2026
One-click install
npx skills add https://github.com/jpeggdev/buildwithjpegg --skill test-first-jpeggdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-first
Source: https://github.com/jpeggdev/buildwithjpegg/tree/main/plugins/development-workflow/skills/test-first
Command: npx skills add https://github.com/jpeggdev/buildwithjpegg --skill test-first-jpeggdev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces Test-Driven Development (TDD) to ensure code quality, prevent regressions, and create robust, well-documented software by requiring tests to be written and fail before any implementation code is written.

Core Features & Use Cases

  • Enforces TDD Workflow: Guides users through the Red-Green-Refactor cycle.
  • Prevents Regressions: Ensures new code is validated against failing tests, catching bugs early.
  • Improves Code Design: Writing tests first often leads to cleaner, more modular code.
  • Use Case: When developing a new feature, this Skill ensures you write a test that fails for the new behavior, then write the minimal code to pass it, followed by refactoring.

Quick Start

Use the test-first skill to implement a new feature by writing a failing test before writing any implementation code.

Frequently Asked Questions about test-first

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

FAQPage Schema
What is the Red-Green-Refactor cycle in Test-Driven Development?

The Red-Green-Refactor cycle in Test-Driven Development mandates writing a failing test first, implementing minimal code to pass it, and then refactoring to ensure code quality and prevent regressions.

How do I write tests before code to prevent regressions?

To write tests before code, you create an executable specification that fails for the new behavior, write the minimal implementation to pass it, and refactor to prevent regressions and document behavior.

Why does writing tests first improve code design?

Writing tests first improves code design because it forces you to define behavior through executable specifications beforehand, naturally leading to cleaner, more modular code that is easier to refactor.

Can I use TDD for bug fixes and verification?

Yes, you can use TDD for bug fixes and verification by providing clear guidelines to write a failing test that reproduces the bug before writing the implementation code to fix it.

When should I not use Test-Driven Development?

You should reconsider Test-Driven Development when facing common rationalizations against it, though the process is designed to address these concerns and ensure robust, well-documented software through executable specifications.

Do I need a specific testing framework to start TDD?

No specific testing framework is required to start TDD. The process focuses on writing failing tests before implementation code, allowing you to use your existing environment to validate behavior and prevent regressions.