bugfix

A regression-test-first workflow for fixing software bugs. It reproduces the problem, adds a test, applies a fix, and checks that the test passes without causing new failures.

In plain words
What is it for?
Use it for bug fixes in a codebase, especially when the project may also use SpecSwarm, SpecTest, or browser debugging tools.
Why use it?
It proves that the reported bug is real and that the fix addresses it, while protecting the same behaviour from breaking again later.

Command

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.

agentmods
npx agentmods add commands/martybonacci/specswarm/bugfix
Clone the repo
git clone --depth 1 https://github.com/MartyBonacci/specswarm
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 7,924 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00015 $0.07924
Opus 5 $0.00008 $0.03962
Sonnet 5 $0.00003 $0.01585
Haiku 4.5 $0.00002 $0.00792

Measured 2d ago against content hash 165481309061, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bugfix 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 2d 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.

plugins/ss/commands/bugfix.md · 1,109 lines

How it starts

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

User Input

$ARGUMENTS

You MUST consider the user input before proceeding (if not empty).

Goal

Execute regression-test-first bug fixing workflow to ensure bugs are fixed correctly and prevent future regressions.

Key Principles:

  1. Test First: Write regression test before fixing
  2. Verify Failure: Confirm test reproduces bug
  3. Fix: Implement solution
  4. Verify Success: Confirm test passes
  5. No Regressions: Validate no new bugs introduced

Coverage: Addresses ~40% of development work (bug fixes)


Smart Integration Detection

Before starting workflow, detect available plugins for enhanced capabilities:

# Get repository root and plugin directory
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PLUGIN_DIR="$(dirname "$SCRIPT_DIR")"

# Check for SpecSwarm (tech stack enforcement)
SPECSWARM_INSTALLED=$(claude plugin list | grep -q "specswarm" && echo "true" || echo "false")

# Check for additional SpecSwarm features
SPECSWARM_EXTRAS_AVAILABLE="false"

# Check for web project and Chrome DevTools MCP (web debugging enhancement)
if [ -f "$PLUGIN_DIR/lib/web-project-detector.sh" ]; then
  source "$PLUGIN_DIR/lib/web-project-detector.sh"

  # Determine if Chrome DevTools should be used
  if should_use_chrome_devtools "$REPO_ROOT"; then
    CHROME_DEVTOOLS_MODE="enabled"
    echo "🌐 Web Project Detected: $WEB_FRAMEWORK"
    echo "🎯 Chrome DevTools MCP: Available for enhanced browser debugging"
  elif is_web_project "$REPO_ROOT"; then
    CHROME_DEVTOOLS_MODE="fallback"
    echo "🌐 Web Project Detected: $WEB_FRAMEWORK"
    echo "📦 Using Playwright fallback (Chrome DevTools MCP not available)"
  else
    CHROME_DEVTOOLS_MODE="disabled"
    # Non-web project - no message needed
  fi
else
  CHROME_DEVTOOLS_MODE="disabled"
fi

# Configure workflow based on detection
if [ "$SPECSWARM_INSTALLED" = "true" ]; then
  EXECUTION_MODE="sequential"
  ENABLE_TECH_VALIDATION=true
  echo "🎯 Smart Integration: SpecSwarm detected (tech stack enforcement enabled)"
else
  EXECUTION_MODE="sequential"
  echo "ℹ️  Running in basic mode (install SpecSwarm/SpecTest for enhanced capabilities)"
fi

Read the full file on GitHub · 1,109 lines

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. 2d ago First seen · 1,109 lines · 15 tokens per session scan A 165481309061

Subscribe to this mod's changes

bugfix is a command published in the GitHub repository MartyBonacci/specswarm (65 stars, last pushed 1mo ago), licensed MIT. It adds 15 tokens to every session and 7,924 once invoked, about $0.0001 per session on Opus 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-08-30.