fix-bug
Skill273 starsChanged 54 days agoApache-2.0View on GitHub
在独立 worktree 中排查并修复 bug:按证据定 P 级(P0 停止汇报;P1 由 explorer 确认并写 spec/issues 后交给 coder 修复;P2/P3 主 agent 一次性修复),验证后提交 GitHub PR,并等待 CI 与 CodeRabbit,失败自动修复重推最多 3 轮。默认不合并 PR,仅在用户明确授权时用 squash 合并。用户通过 /fix-bug 主动调用。
- Commits and pushes
50 other projects use a version of this.
Adopted by
Most recently taken up by
- BG-Software-LLC/SuperiorSkyblock2their own version, first seen Nov 30, 2026
- pierrebelin/claude-code-toolkittheir own version, first seen Nov 29, 2026
- cano721/ai-harnesstheir own version, first seen Nov 29, 2026
- awcameron/skillstheir own version, first seen Nov 29, 2026
- rmstdope/cerebrotheir own version, first seen Nov 26, 2026
- mgiovani/ai-arsenaltheir own version, first seen Nov 22, 2026
Used with
Projects with it also use improvement, build-feature and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
kiminmonacoSkillimprovement
Guide for making improvements to existing ClaudeBar functionality using TDD. Use this skill when: (1) Enhancing existing features (not adding new ones) (2) Improving UX, performance, or code quality (3) User asks "improve X", "make Y better", or "enhance Z" (4) Small enhancements that don't require full architecture design For NEW features, use implement-feature skill instead.
Also in 4 projects that use this
sirakinbSkillbuild-feature
Autonomous task loop that picks ready tasks, implements them, updates progress.txt, commits, and repeats. Use when asked to 'build feature', 'run the loop', or 'implement these tasks'.
Also in 7 projects that use this
kiminmonacoSkillimplement-feature
Guide for implementing features in ClaudeBar following architecture-first design, TDD, rich domain models, and Swift 6.2 patterns. Use this skill when: (1) Adding new functionality to the app (2) Creating domain models that follow user's mental model (3) Building SwiftUI views that consume domain models directly (4) User asks "how do I implement X" or "add feature Y" (5) Implementing any feature that spans Domain, Infrastructure, and App layers
Also in 10 projects that use this
SentrySkillwrite-tests
Write tests following project conventions. Use when adding new tests or modifying existing ones.
Also in 6 projects that use this
DockerSkillreview-changes
Review uncommitted or recently committed documentation changes for correctness, coherence, and style compliance. Use before creating a PR to catch issues. "review my changes", "review the diff", "check the fix before submitting", "does this look right".
Also in 4 projects that use this
JasonPaffSkillimplement-plan
Execute implementation plan with structured tracking and validation using subagent architecture
Also in 3 projects that use this
Other versions50 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 50
- remix-run/react-router★ 57ksame name
- ktorio/ktor★ 15ksame name
- JetBrains/Exposed★ 9.3ksame name
- bytebase/dbhub★ 4ksame name
- The-OpenROAD-Project/OpenROAD★ 3.3ksame name
- tddworks/ClaudeBar★ 1.6ksame name
- Harry-kp/vortix★ 807same name
- Doist/todoist-ai★ 568same name
- torrust/torrust-tracker★ 539same name
- tddworks/asc-cli★ 405same name
40 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- advisor-consultationSkill
- agent-behavior-researchSkill
- auto-devflowSkill
- codebase-indexSkill
- dogfood-user-personaSkill
- langfuseSkill
- learn-from-historySkill
The file
Files
Fix Bug
本 skill 由用户主动调用(/fix-bug)。主 agent 是唯一控制者与验收人。按 WORKTREE → 检查 → 定级 → 修复 → 验证 → PR → 等待 顺序执行;P0 在定级处终止。
0. 输入与基线
- 从参数提取:现象、期望、复现步骤、报错/日志、相关 issue。只问阻塞复现的信息。
- 读仓库
AGENTS.md/CLAUDE.md、docs/standards/与模块指引,确认验证命令、提交规范和分支约定。 - 运行
git status --short --branch,记录既有 dirty 文件。本流程不得 stash、reset、clean 或顺手提交这些改动。 - 生成小写英文 slug(如
session-admission-inode),分支与 worktree 都使用它。
1. WORKTREE
所有读写与命令都在 worktree 内执行;主 checkout 只用于 git worktree 管理。
- 默认先
git fetch --prune origin(清理远端已删除的跟踪分支,避免基于陈旧 ref),再无条件对选定的 base 显式 fetch:git fetch origin "+refs/heads/<base>:refs/remotes/origin/<base>"。只执行默认 fetch 时,若remote.origin.fetch未覆盖该分支,origin/<base>可能仍是旧值,worktree 会基于陈旧 ref 创建。默认使用远端 base,fetch 失败必须停止并汇报,不能因为本地已有origin/main缓存就继续。仅当用户明确指定本地基线,或git ls-remote --exit-code origin <base>确认远端分支不存在时,才允许跳过该显式 fetch 并改用本地<base>;汇报中写明实际 base 的来源。随后把选定的 worktree 路径存入$WT:默认"$PWD/.worktrees/<slug>",.worktrees/未被忽略时改用"$PWD/../<repo>-worktrees/<slug>",避免污染git status。从远程最新目标分支创建:通常为origin/main,用户指定 base 时改用origin/<base>。
不要直接基于本地git fetch --prune origin git fetch origin "+refs/heads/<base>:refs/remotes/origin/<base>" # 显式刷新 base,main 也要执行 WT="$PWD/.worktrees/<slug>" # .worktrees/ 未被忽略时改为 "$PWD/../<repo>-worktrees/<slug>" git worktree add --no-track -b fix/<slug> "$WT" origin/<base> # 本地 base 例外:跳过第二条 fetch,改用 # git worktree add --no-track -b fix/<slug> "$WT" <base>main或其它可能过期的本地分支创建:过期基线会带入已合并的旧改动,增加冲突和无关 diff。只有用户明确指定本地基线或git ls-remote --exit-code origin <base>确认远端分支不存在时才改用本地 base,并在汇报中写明 base 来源(本地/远端)。 - 核对:
git -C "$WT" status --short --branch不得显示[origin/main];若显示,执行git -C "$WT" branch --unset-upstream。 - 在汇报中写明实际 worktree 路径、base(本地/远端)与 commit(
git -C "$WT" log -1 --oneline)。
完成标准:worktree 存在、分支未跟踪 main、主 checkout 无新增改动。
2. 检查问题
- 优先运行时复现。不能复现时用测试、日志或代码证据,并标注"未运行时复现"。
- 记录:触发条件、实际/期望、影响面、首次出现版本(必要时
git bisect)、相关日志。 - 写出根因链:
触发 → 机制 → 用户可见后果,区分观察与推断。 - 搜索同一根因或同一模式的其它调用点,按"修复一类问题"确定范围。
- 涉及依赖行为的关键假设(hook 执行顺序、坐标变换、生命周期)必须读实际版本的依赖源码核对,不能只信本仓库注释;注释可能滞后于依赖升级。
完成标准:根因链每步有代码、日志或复现证据;范围清单完整。
3. 定级
| 级别 | 判据 | 动作 |
| P0 | 数据丢失/损坏、安全漏洞或密钥泄露、崩溃/panic/无法启动、核心流程完全不可用且无规避 | 立即停止,向用户汇报 |
| P1 | 核心功能错误或明确回归、可稳定复现、影响主要路径但有临时规避 | explorer 确认 → 写本地 issue → coder 修复 |
| P2 | 非核心功能错误、边界条件、明显性能退化、错误提示/日志缺失 | 主 agent 一次性修复 |
| P3 | 轻微文案/格式、低影响边界、可维护性 | 与 P2 同批修复 |
判不准时取更高级别;P0/P1 有争议按 P0 汇报。定级依据写入最终汇报。
4. P0:汇报并停止
- 汇报:现象、确认证据、影响面、可能原因、建议选项。
- 保留 worktree 与证据,不建 issue、不修复、不 commit。
- 等待用户指示;用户明确要求继续后才进入修复。
5. P1:确认 → issue → coder 修复
- 派
explorer(同步、只读)确认:复现路径、根因证据、影响面、修复边界、回归测试建议。要求返回文件位置与证据,不给结论性猜测。 - 主 agent 逐条核对仓库事实。结论被否认或降级时,回到第 3 步重新定级并说明原因。
- 写
spec/issues/YYYY-MM-DD-p1-<slug>.md,使用 P1 issue 模板,状态写"已确认,待修复"。 - 派
coder(同步),给出:issue 路径、worktree 绝对路径、允许编辑的文件清单、验证命令、测试要求。要求不改无关文件、不 commit,返回改动/命令/失败/残留风险。 - 主 agent 审 diff 并跑目标检查;不通过则 resume 同一 coder 修复。
Subagent 的 cwd 不能切到 worktree,必须在 prompt 中给出绝对路径,并明确"只能编辑该 worktree 内的文件"。
完成标准:issue 文件落盘、diff 只含允许文件、目标检查通过。
6. P2/P3:主 agent 一次性修复
- 同一根因或同一模式的问题一次修完,补回归测试。
- 不新建 issue;改动范围写入最终汇报。
- 需要产品决策、数据库 schema 变更或跨模块重构时,先问用户。
7. 验证
- 先验证用户可观察行为,再按风险补回归、失败路径与生命周期测试。TUI 坐标类问题按 真实复现方法 在真实终端中对照修复前后。
- 跑仓库约定的目标测试、lint、format、build;Peri 仓库优先
./scripts/check-changed.sh。 - 运行
git diff --check;报告必须引用命令真实输出,不以"应该可以"代替。 - 任何失败先修;环境/网络失败与产品失败分开记录。
- P1 修复完成后,回填
spec/issues/YYYY-MM-DD-p1-<slug>.md的"验证记录",并把状态改为"已修复"。
完成标准:所有改动文件被目标检查覆盖,无未解释失败。
8. 提交与 PR
- 只暂存本任务文件;审查
git diff --cached,不打包无关 WIP。 - 提交信息用
fix(<scope>): <summary>;hook 正常运行,不跳过。 git push -u origin HEAD;禁止 force push。- 按 PR 模板与等待命令 写正文后:
目标分支默认gh pr create --base main --title "fix(<scope>): <summary>" --body-file <file>main;用户或仓库约定另有要求时按其执行。 - 用
gh pr view --json url,baseRefName,headRefName核对 PR。 - 默认不合并 PR,交付停在"可合并"状态等待用户。只有用户明确授权合并时才执行
gh pr merge <PR> --squash;禁止 merge commit(--merge)与--rebase合并,远端分支保留与否按用户指示。
完成标准:PR 已创建,URL、目标分支、head 分支正确;未合并(除非用户明确授权)。
9. 等待 CI 与 CodeRabbit
按 等待与失败处理 执行:
- 轮询 CI 直到无 pending;失败时读取
gh run view <id> --log-failed。 - 等待
coderabbitai[bot]对当前 head 的 review 或 comment;review 的commit_id必须等于 PR head,不能只看时间。 - 默认最长等待 30 分钟;超时汇报当前状态,不无限等待。
- CI 失败或 CodeRabbit blocking 意见成立时:修复 → 本地验证 → commit → push,重新等待,最多 3 轮。
- 意见不成立时在对应 thread 回复证据;不静默忽略。
- 3 轮后仍失败:停止并汇报失败项、已尝试修复、PR 当前状态。
结束前必须确认 CI 与 CodeRabbit 处于终态;不得只输出"继续等待"而没有实际等待动作。
完成标准:CI 全部 pass(非阻塞 skip 需说明);CodeRabbit 已产生实质 review(或明确记录限流/未启用),blocking 意见已处理或已回复。CodeRabbit 的绿色 check 不等于评审完成,必须核对 review 的 commit_id 与 PR head。
10. 最终汇报
按有序列表输出,少字:
- P 级别与依据
- worktree、分支、PR URL
- 改动文件
- 验证命令与结果
- CI / CodeRabbit 状态
- 遗留风险、未覆盖项、需要用户决定的事项
红线
- P0 必须停止汇报,不得自行修复或提交。
- 不修改数据库 schema、不 force push、不跳过 hook、不 stash/reset/clean 用户改动。
- 不把环境或网络故障当成产品 bug;无法复现必须标注证据等级。
- PR、commit、日志中不得出现密钥、token、连接串或完整环境变量。
- 默认不合并 PR;仅在用户明确授权时合并,且必须用 squash(
gh pr merge --squash),不得使用 merge commit 或 rebase 合并。 - 同类修复只做一次;需要产品决策或扩大范围时先问用户。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

