regression-test-generator

regression-test-generator is a skill for Claude Code from marcusgoll/Spec-Flow. It costs 45 tokens per session (2,903 once invoked), scanned A, original, MIT.

A testing helper that creates a test for a bug after the bug has been found. The test is designed to fail before the fix, proving that it covers the reported problem.

In plain words
What is it for?
It helps create regression tests in frameworks such as Jest, Vitest, pytest, and Playwright, using the project's existing patterns.
Why use it?
It prevents fixed bugs from returning and keeps a record linking each test to its error report.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit It helps create regression tests in frameworks such as Jest, Vitest, pytest, and Playwright, using the project's existing patterns.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/marcusgoll/spec-flow/regression-test-generator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add marcusgoll/Spec-Flow --skill regression-test-generator
Clone the repo
git clone --depth 1 https://github.com/marcusgoll/Spec-Flow

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for regression-test-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/marcusgoll/spec-flow/regression-test-generator/github.svg)](https://agentmods.dev/skills/marcusgoll/spec-flow/regression-test-generator)
Your own site
<a href="https://agentmods.dev/skills/marcusgoll/spec-flow/regression-test-generator"><img src="https://agentmods.dev/badge/skills/marcusgoll/spec-flow/regression-test-generator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for regression-test-generator

Your own site · 80×15
<a href="https://agentmods.dev/skills/marcusgoll/spec-flow/regression-test-generator"><img src="https://agentmods.dev/badge/skills/marcusgoll/spec-flow/regression-test-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,903 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00045 $0.02903
Opus 5.5 $0.00018 $0.01161
Sonnet 5.5 $0.00009 $0.00581
Haiku 4.5 $0.00005 $0.00290

Measured 1mo ago against content hash 151735d418ff, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

regression-test-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/regression-test-generator/SKILL.md · 415 lines

How it starts

The opening of the file, as written. The whole thing — 415 lines — stays where its author put it; the contents beside it link to each section on GitHub.

<quick_start> Generate regression test for a bug:

  1. Collect bug details: error ID, symptoms, root cause, affected component
  2. Detect test framework from project (Jest, Vitest, pytest, Playwright)
  3. Generate test file following project patterns
  4. Present to user for review: [A] Save [B] Edit [C] Skip
  5. Save test to tests/regression/ and update error-log.md

Key principle: Tests should FAIL before the fix is applied (proves bug exists). </quick_start>

Check error-log.md to avoid duplicate tests for same error.

Extract from debug context:

  • Error ID: ERR-XXXX from error-log.md (or generate new)
  • Title: Brief description (e.g., "Dashboard timeout due to missing pagination")
  • Symptoms: Observable behavior (error message, incorrect output)
  • Root cause: Why the bug occurred (from 5 Whys analysis)
  • Component: Affected file/function (e.g., StudentProgressService.fetchExternalData)
  • Reproduction steps: How to trigger the bug

Example:

error_id: ERR-0042
title: Dashboard timeout due to missing pagination
symptoms: Dashboard fails to load, timeout after 30s
root_cause: Missing pagination parameter causes over-fetching
component: src/services/StudentProgressService.ts:fetchExternalData
reproduction:
  - Navigate to /dashboard/student/123
  - Click "Load Data" button
  - Observe timeout error

Check project configuration (in priority order):

  1. docs/project/tech-stack.md (if exists):

    grep -i "test\|jest\|vitest\|pytest\|playwright" docs/project/tech-stack.md
    
  2. package.json (JavaScript/TypeScript):

    # Check devDependencies
    grep -E '"(jest|vitest|@playwright/test|mocha)"' package.json
    
  3. pyproject.toml / requirements.txt (Python):

    grep -E "(pytest|unittest|nose)" pyproject.toml requirements.txt
    
  4. Existing test file patterns:

    # JavaScript patterns
    find . -name "*.test.ts" -o -name "*.spec.ts" | head -1
    
    # Python patterns
    find . -name "*_test.py" -o -name "test_*.py" | head -1
    
  5. Defaults:

    • JavaScript/TypeScript: Jest
    • Python: pytest
    • Document assumption in test file comment

Output: Framework name and test file extension (e.g., Jest → .test.ts)

Find appropriate location:

  1. Check if tests/regression/ exists → use it
  2. Check project test structure:
    • tests/ directory → tests/regression/
    • __tests__/ directory → __tests__/regression/
    • Co-located tests (same dir as source) → src/__tests__/regression/
  3. Create tests/regression/ if no pattern found

File naming:

  • Format: regression-ERR-{ID}-{slug}.{ext}
  • Slug: lowercase kebab-case from title
  • Examples:
    • regression-ERR-0042-dashboard-timeout.test.ts
    • test_regression_err_0042_dashboard_timeout.py

Use framework-appropriate template from references/framework-templates.md.

Structure (Arrange-Act-Assert):

Header: Error ID, title, description, root cause, link to error-log

describe/class: "Regression: ERR-XXXX - {title_short}"
  test: "should {expected} when {condition}"
    ARRANGE: Set up bug scenario (data, mocks, state)
    ACT: Execute action that caused bug
    ASSERT: Verify correct behavior (would have failed before fix)

Read the full file on GitHub · 415 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 415 lines · 45 tokens per session scan A 151735d418ff

Subscribe to this mod's changes

regression-test-generator is a skill published in the GitHub repository marcusgoll/Spec-Flow (96 stars, last pushed 23d ago), licensed MIT. It adds 45 tokens to every session and 2,903 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.