feature:bugfix

A step-by-step workflow for investigating and fixing bugs in existing features. It includes code analysis, solution research, design review, phased implementation, regression testing, and documentation updates.

In plain words
What is it for?
Use it to investigate a reported bug, confirm its details, research possible solutions, design a fix, implement it in phases, and verify that existing behavior still works.
Why use it?
It reduces the risk of changing code before understanding the existing behavior and its edge cases. Review gates and testing help check the fix as it is developed.

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/ronileor/specweaver/feature-bugfix
Clone the repo
git clone --depth 1 https://github.com/RoniLeor/specWeaver
Per session 45 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,572 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.00045 $0.06572
Opus 5 $0.00023 $0.03286
Sonnet 5 $0.00009 $0.01314
Haiku 4.5 $0.00005 $0.00657

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

Security

Grade A, and why

feature: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/specweaver/commands/feature-bugfix.md · 1,159 lines

How it starts

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

Bug Fix Command: Systematic Bug Resolution Workflow

This command provides a structured approach to investigating and fixing bugs in existing features through deep code analysis, solution research, and phased implementation with review gates.

Command Structure

The bugfix workflow follows these phases:

  • Phase 0: Bug Investigation (Parallel Analysis)
  • Phase 1: Bug Clarification (User Confirmation)
  • Phase 2: Solution Research (4 Parallel Web Searches)
  • Phase 3: Solution Design (User Approval Required)
  • Phase 3.5: Design Review (code-reviewer)
  • Phase 4: Phased Implementation (Review Gates)
  • Phase 5: Regression Testing (User Verification)
  • Phase 6: Documentation Update (After Fix Confirmed)

Core Principle

⚠️ CRITICAL: Read the code carefully before designing new solutions - the existing implementation often already handles edge cases. Understanding what's already there prevents duplicate solutions and unnecessary complexity.

Spec File Structure

All specifications are stored in:

.claude/specs/bugfix-{feature-name}/
├── 00-investigation.md          # Bug investigation findings
├── 01-bug-report.md             # User-confirmed bug details
├── 02-research.md               # Solution research findings
├── 03-solution-design.md        # Fix strategy and phases
├── 03-design-review.md          # Design review feedback
├── phase-{X}-{name}.md          # Atomic fix phase specs
└── phase-{X}-{name}-review.md   # Phase implementation reviews

Phase Execution

Phase 0: Bug Investigation (Parallel Analysis)

CRITICAL: This phase uses PARALLEL execution for efficiency.

Execute in SINGLE message with TWO Task tool calls:

Task 1: Deep Code Analysis

Task tool with subagent_type: "code-reviewer"
Prompt: "Analyze the {feature-name} feature to identify potential bugs.

ANALYSIS REQUIREMENTS:
1. Code Design Understanding:
   - Break down code into atomic components
   - Understand intended design and architecture
   - Map dependencies and data flow
   - Identify critical execution paths

2. Line-by-Line Investigation:
   - Analyze each function for logic errors
   - Check error handling and edge cases
   - Verify type safety and null checks
   - Look for race conditions and timing issues
   - Check resource management (memory, files, connections)

3. Common Bug Patterns:
   - Off-by-one errors
   - Null/undefined references
   - Type mismatches
   - Incorrect conditionals
   - Missing error handling
   - Resource leaks
   - Concurrency issues

4. Potential Bug Locations:
   - Identify suspicious code sections
   - Flag code smells and anti-patterns
   - Note areas with high complexity
   - Highlight recent changes (if in git history)

Return DETAILED findings with:
- File paths and line numbers
- Code snippets of suspicious sections
- Explanation of potential issues
- Severity rating (Critical/High/Medium/Low)"

Read the full file on GitHub · 1,159 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,159 lines · 45 tokens per session scan A f8a4906a5142

Subscribe to this mod's changes

feature:bugfix is a command published in the GitHub repository RoniLeor/specWeaver (3 stars, last pushed 10mo ago), licensed MIT. It adds 45 tokens to every session and 6,572 once invoked, about $0.0002 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-31.