forge-fix

A focused workflow for fixing a known software bug: investigate possible causes, apply a test-driven fix, verify it independently, and repeat if needed. TDD means writing a failing test first, then changing the code until the test passes.

In plain words
What is it for?
Use it for a reported bug, an error log, or a file path that needs repair. It supports a quick route for simple bugs and repeated fix-and-check cycles for harder ones.
Why use it?
It gives a bug its own investigation and verification cycle instead of requiring the full product-development process. It helps with intermittent failures by testing competing explanations.

Skill for Claude CodeCodex

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 skills/xrensiu/claude-code-forge/fix-bug-loop
Any agent
npx skills add XRenSiu/claude-code-forge --skill fix-bug-loop
Clone the repo
git clone --depth 1 https://github.com/XRenSiu/claude-code-forge

Made for: Claude Code, Codex.

Per session 134 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,620 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.00134 $0.04620
Opus 5 $0.00067 $0.02310
Sonnet 5 $0.00027 $0.00924
Haiku 4.5 $0.00013 $0.00462

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

Security

Grade A, and why

forge-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/forge-teams/skills/fix-bug-loop/SKILL.md · 511 lines

How it starts

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

Forge Fix - 独立 Bug 修复

描述 bug → 对抗调试定位根因 → TDD 修复 → 独立验证 → 循环直到修好。

这是 forge-teams 的独立 bug 修复入口。复用已有的对抗调试引擎(hypothesis-investigator、devils-advocate、evidence-synthesizer、issue-fixer),但提供独立编排、快速路径分流和三层迭代控制。

Announce at start: "I'm using the forge-fix skill to create an agent team that will locate and fix this bug through adversarial debugging and TDD."

前置条件: 需要启用 Agent Teams 实验性功能。 在 settings.json 中添加: "env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" }

用法

/forge-fix <bug-description> [options]

参数说明

参数 说明 默认值
<bug-description> bug 描述(文本、文件路径、或错误日志) 必填
--loop <N> 最大修复-验证循环次数 3
--quick 快速路径:跳过对抗调试,直接用 issue-fixer 修复(适用于简单 bug) 不启用
--team-size <size> 假设调查团队规模(small=3 假设, medium=4, large=5) medium
--no-verify 修复后跳过独立验证(不推荐) 启用验证

示例

# 直接描述 bug
/forge-fix "支付回调间歇性超时,大约每10次失败2次"

# 简单 bug,快速路径
/forge-fix "登录页面 CSS 错位" --quick

# 复杂 bug,加大团队 + 增加循环
/forge-fix "高并发下 Redis 连接池泄漏" --team-size large --loop 5

# 从错误日志修复
/forge-fix "npm test 报错: TypeError: Cannot read property 'id' of undefined at src/user.ts:42"

输出目录

docs/forge-fix/
└── [bug-slug]-[timestamp]/
    ├── intake.md              # 问题信息收集
    ├── hypotheses.md          # 假设列表(非 quick 模式)
    ├── debate-log.md          # 对抗辩论记录(非 quick 模式)
    ├── verdict.md             # 根因判定
    ├── fix-report.md          # TDD 修复报告
    ├── verification.md        # 独立验证报告
    └── summary.md             # 最终修复摘要

Quick vs Full Path Decision (快速路径分流)

用户描述 bug
    │
    ├── --quick 指定 → 快速路径
    │
    └── 未指定 → Lead 评估复杂度
        │
        ├── 简单信号 → 建议快速路径(用户确认)
        │   - 单文件、单函数问题
        │   - 错误信息直接指向根因(如 TypeError at file:line)
        │   - 纯 UI/CSS 问题
        │   - typo 或明显逻辑错误
        │
        └── 复杂信号 → 完整对抗调试路径
            - 间歇性故障
            - 多个可能根因
            - 涉及并发/状态/竞态
            - 跨模块/跨服务
            - "时有时无"、"偶尔"、"不稳定"

Quick Path (快速路径)

Read the full file on GitHub · 511 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 · 511 lines · 134 tokens per session scan A 5f7b39f6d699

Subscribe to this mod's changes

forge-fix is a skill published in the GitHub repository XRenSiu/claude-code-forge (2 stars, last pushed 1mo ago), licensed MIT. It adds 134 tokens to every session and 4,620 once invoked, about $0.0007 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.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

agent-host-chat-contributions

Build and review cross-cutting agent-host chat behavior through lifecycle contributions. Use when adding turn lifecycle side effects, prompt or context injection, restored-history transformation, protocol-action observation, or when reviewing changes that add code to AgentSideEffects or AgentService.

microsoft/vscode · 56 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens