add-regression-test

Add regression tests that fail pre-fix and pass post-fix.

22|3|Updated Jul 28, 2024
One-click install
npx skills add https://github.com/webdevcody/go-mailing-list --skill add-regression-test-webdevcody
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-regression-test
Source: https://github.com/webdevcody/go-mailing-list/tree/main/.claude/skills/add-regression-test
Command: npx skills add https://github.com/webdevcody/go-mailing-list --skill add-regression-test-webdevcody

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents bugs from silently returning by ensuring you add a regression test that truly fails before the fix and passes after it, proving the test is not just a confidence check.

Core Features & Use Cases

  • Bug-to-test identification: Captures the exact input shape and externally observable outcome from the fix diff or commit.
  • Reproducible pre-fix verification: Forces a failing-state run by stashing, reverting via temporary worktree, or checking out the pre-fix hunks.
  • Durable test construction: Requires asserting on observable behavior (HTTP/DB/UI/output) and naming tests after the bug symptom for long-term maintainability.
  • Fit-to-project wiring: Places the test in the nearest project test-file convention and verifies the full suite is green.

Quick Start

Ask the skill: add a regression test for my recent bug fix, and include the failing input and expected outcome so it can prove the test was red before the fix and green after.

Frequently Asked Questions about add-regression-test

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

FAQPage Schema
How do I add a regression test that proves a bug fails before the fix and passes after?

A regression test proves a bug exists by failing on pre-fix code and passing on post-fix code. This Skill derives the exact bug input and observable outcome from your fix diff, then uses safe reproduction modes like stashing or temporary worktrees to verify the red and green states.

What is the best way to write a regression test for a recent git commit?

Writing a regression test for a git commit requires extracting the failing input from the commit diff, asserting on externally observable behavior, and verifying the test runs red on the pre-fix state and green on the post-fix state before wiring it into your project conventions.

Can I use a temporary git worktree to verify a failing test before applying a fix?

Yes, you can use a temporary git worktree to reproduce the pre-fix state. This Skill selects safe reproduction modes like stashing, reverting via worktree, or checking out pre-fix hunks to force a failing-state run and confirm the test is red before the fix.

Does regression testing work with staged changes and squashed commits?

Regression testing works with working trees, staged changes, local commits, and squashed commits. The Skill targets code fixes across these git states by selecting an appropriate reproduction mode to verify the test fails before and passes after the fix.

Why does my regression test pass even when the bug is still present in the code?

Your regression test passes when the bug is present because it is not asserting on the correct externally observable outcome. A true regression test must assert on observable behavior like HTTP, DB, UI, or command output, and be verified red on the pre-fix code.

How do I name and place a regression test to fit my project conventions?

To fit regression tests into project conventions, name the test after the specific bug symptom for long-term maintainability and place it in the nearest project test-file convention. Run the full test suite after wiring it in to ensure everything is green.