by sickn33
拉取请求修复通常需要多次迭代,因为 CI 失败和审查反馈。此技能自动化整个反馈-修复-推送-等待循环,让您专注于编写代码,同时它负责检查状态、收集反馈和推送修复。
1. 打开 Claude 聊天界面
2. 点击下方 "📋 复制" 按钮
3. 粘贴到 Claude 聊天框中并发送
4. 输入 "使用 iterate-pr 技能" 开始使用
=== iterate-pr 技能 === 作者: sickn33 描述: 拉取请求修复通常需要多次迭代,因为 CI 失败和审查反馈。此技能自动化整个反馈-修复-推送-等待循环,让您专注于编写代码,同时它负责检查状态、收集反馈和推送修复。 使用方法: 1. 调用技能: "使用 iterate-pr 技能" 2. 提供相关信息: 根据技能要求提供必要参数 3. 查看结果: 技能会返回处理结果 示例: "使用 iterate-pr 技能,帮我分析一下这段代码"
这种方法适用于所有 Claude 用户,不需要安装额外工具。
devops
safe
Continuously iterate on the current branch until all CI checks pass and review feedback is addressed.
Use this skill when:
Requires: GitHub CLI (gh) authenticated and available.
gh pr view --json number,url,headRefName,baseRefName
If no PR exists for the current branch, stop and inform the user.
Always check CI/GitHub Actions status before looking at review feedback:
gh pr checks --json name,state,bucket,link,workflow
The bucket field categorizes state into: pass, fail, pending, skipping, or cancel.
Important: If any of these checks are still pending, wait before proceeding:
sentry / sentry-iocodecovcursor / bugbot / seerThese bots may post additional feedback comments once their checks complete. Waiting avoids duplicate work.
Once CI checks have completed (or at least the bot-related checks), gather human and bot feedback:
Review Comments and Status:
gh pr view --json reviews,comments,reviewDecision
Inline Code Review Comments:
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments
PR Conversation Comments (includes bot comments):
gh api repos/{owner}/{repo}/issues/{pr_number}/comments
Look for bot comments from: Sentry, Codecov, Cursor, Bugbot, Seer, and other automated tools.
For each CI failure, get the actual logs:
# List recent runs for this branch
gh run list --branch $(git branch --show-current) --limit 5 --json databaseId,name,status,conclusion
# View failed logs for a specific run
gh run view <run-id> --log-failed
Do NOT assume what failed based on the check name alone. Always read the actual logs.
For each piece of feedback (CI failure or review comment):
Make minimal, targeted code changes. Only fix what is actually broken.
git add -A
git commit -m "fix: <descriptive message of what was fixed>"
git push origin $(git branch --show-current)
Use the built-in watch functionality:
gh pr checks --watch --interval 30
This waits until all checks complete. Exit code 0 means all passed, exit code 1 means failures.
Alternatively, poll manually if you need more control:
gh pr checks --json name,state,bucket | jq '.[] | select(.bucket != "pass")'
Return to Step 2 if:
Continue until all checks pass and no unaddressed feedback remains.
Success:
bucket: pass)Ask for Help:
Stop Immediately:
gh pr checks --required to focus only on required checksgh run view <run-id> --verbose to see all job steps, not just failureslink field in checks JSON provides the URL to investigateView Count
0
Download Count
0
Favorite Count
0
Quality Score
72