promptgarten 🌱
🌍 DE

命令参考 · Claude Code

/autofix-pr

启动一个 Claude Code Web 会话,监控当前分支的 Pull Request,在出现 CI 失败或审阅者评论时自动推送修复。

启动一个 Claude Code Web 会话,监控当前分支的 Pull Request,在出现 CI 失败或审阅者评论时自动推送修复。 通过 'gh pr view' 识别当前打开的 PR;可以通过提示词给出不同的指令(例如只处理 Lint/类型错误)。需要 gh CLI 以及 Claude Code on the web 的访问权限。

什么时候用?

让打开的 PR 在无人值守的情况下自动修复 CI 错误

/autofix-pr only fix lint and type errors — 在推送 PR 之后,同时处理其他工作

让审阅者(Reviewer)的评论自动转化为修复

/autofix-pr address all review comments from the last review round

什么时候不该用?

更改尚未作为 PR 推送

该命令通过 'gh pr view' 识别 PR,并需要 Claude Code on the web 的访问权限——如果没有已打开的 PR,它将找不到任何内容

更好的选择: 先正常提交(commit)/推送(push),用 gh pr create 创建 PR,然后再执行 /autofix-pr

来源