fix

A command for fixing software bugs through a test-and-check workflow, with optional regression tests and a faster path for production issues.

In plain words
What is it for?
Use it for ordinary bug fixes, test-first fixes with --regression-test, urgent fixes with --hotfix, and final preparation for the ss shipping workflow.
Why use it?
It provides a repeatable way to verify that a bug is fixed and retry when the first fix does not work, while regression tests help prevent the bug from returning.

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/fix
Clone the repo
git clone --depth 1 https://github.com/MartyBonacci/specswarm
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,768 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.00018 $0.05768
Opus 5 $0.00009 $0.02884
Sonnet 5 $0.00004 $0.01154
Haiku 4.5 $0.00002 $0.00577

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

Security

Grade A, and why

fix 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/fix.md · 745 lines

How it starts

The opening of the file, as written. The whole thing — 745 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

Fix bugs using a test-driven approach with automatic retry logic for failed fixes.

Purpose: Streamline bug fixing by combining bugfix workflow with retry logic and optional regression testing.

Workflow:

  • Standard: Bugfix → Verify → (Retry if needed)
  • With --regression-test: Create Test → Verify Fails → Bugfix → Verify Passes
  • With --hotfix: Expedited workflow for production issues

User Experience:

  • Single command instead of manual bugfix + validation
  • Automatic retry if fix doesn't work
  • Test-first approach ensures regression prevention
  • Ready for final merge with /ss:ship

Pre-Flight Checks

# Parse arguments
BUG_DESC=""
REGRESSION_TEST=false
HOTFIX=false
MAX_RETRIES=2
BACKGROUND_MODE=false
NOTIFY_ON_COMPLETE=false
COORDINATE_MODE=false

# Extract bug description (first non-flag argument)
for arg in $ARGUMENTS; do
  if [ "${arg:0:2}" != "--" ] && [ -z "$BUG_DESC" ]; then
    BUG_DESC="$arg"
  elif [ "$arg" = "--regression-test" ]; then
    REGRESSION_TEST=true
  elif [ "$arg" = "--hotfix" ]; then
    HOTFIX=true
  elif [ "$arg" = "--max-retries" ]; then
    shift
    MAX_RETRIES="$1"
  elif [ "$arg" = "--background" ]; then
    BACKGROUND_MODE=true
  elif [ "$arg" = "--notify" ]; then
    NOTIFY_ON_COMPLETE=true
  elif [ "$arg" = "--coordinate" ]; then
    COORDINATE_MODE=true
  fi
done

# Validate bug description
if [ -z "$BUG_DESC" ]; then
  echo "❌ Error: Bug description required"
  echo ""
  echo "Usage: /ss:fix \"bug description\" [options]"
  echo ""
  echo "Options:"
  echo "  --regression-test  Create failing test first (TDD approach)"
  echo "  --hotfix           Expedited workflow for production issues"
  echo "  --max-retries N    Maximum fix retry attempts (default 2)"
  echo "  --coordinate       Multi-bug orchestrated debugging"
  echo "  --background       Run fix in background mode"
  echo ""
  echo "Examples:"
  echo "  /ss:fix \"Login fails with special characters in password\""
  echo "  /ss:fix \"Cart total incorrect with discounts\" --regression-test"
  echo "  /ss:fix \"Production API timeout\" --hotfix"
  echo "  /ss:fix \"Memory leak in dashboard\" --regression-test --max-retries 3"
  echo "  /ss:fix \"navbar broken, sign-out fails, like button error\" --coordinate"
  exit 1
fi

# Get project root
if ! git rev-parse --git-dir > /dev/null 2>&1; then
  echo "❌ Error: Not in a git repository"
  exit 1
fi

REPO_ROOT=$(git rev-parse --show-toplevel)
cd "$REPO_ROOT"

# Create session tracking for background mode
mkdir -p .specswarm/sessions

# Prune old sessions (keep last 20)
SESSION_COUNT=$(find .specswarm/sessions -name "*.json" -type f 2>/dev/null | wc -l)
if [ "$SESSION_COUNT" -gt 20 ]; then
  find .specswarm/sessions -name "*.json" -type f -printf '%T@ %p\n' | \
    sort -n | head -n $(( SESSION_COUNT - 20 )) | cut -d' ' -f2- | \
    xargs rm -f 2>/dev/null
fi

SESSION_ID="fix-$(date +%Y%m%d-%H%M%S)"

cat > ".specswarm/sessions/${SESSION_ID}.json" << EOF
{
  "type": "fix",
  "session_id": "$SESSION_ID",
  "bug_description": "$BUG_DESC",
  "started_at": "$(date -Iseconds 2>/dev/null || date -u +"%Y-%m-%dT%H:%M:%S%z")",
  "status": "running",
  "regression_test": $REGRESSION_TEST,
  "hotfix": $HOTFIX,
  "max_retries": $MAX_RETRIES,
  "current_retry": 0,
  "background_mode": $BACKGROUND_MODE,
  "notify_on_complete": $NOTIFY_ON_COMPLETE,
  "coordinate_mode": $COORDINATE_MODE
}
EOF

# If background mode, show session info
if [ "$BACKGROUND_MODE" = true ]; then
  echo ""
  echo "🔄 Fix started in background mode"
  echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
  echo ""
  echo "Session ID: $SESSION_ID"
  echo "Bug: $BUG_DESC"
  echo ""
  echo "Track progress with:"
  echo "  /ss:status $SESSION_ID"
  echo ""
  if [ "$NOTIFY_ON_COMPLETE" = true ]; then
    echo "You will be notified when complete."
  fi
  echo ""
fi

Read the full file on GitHub · 745 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 · 745 lines · 18 tokens per session scan A 3afc76606e5e

Subscribe to this mod's changes

fix is a command published in the GitHub repository MartyBonacci/specswarm (65 stars, last pushed 1mo ago), licensed MIT. It adds 18 tokens to every session and 5,768 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.