iterate-pr
关于
This Claude Skill automates the iterative process of fixing CI failures and addressing review feedback in a pull request. It continuously pushes fixes and checks statuses until all CI checks pass, handling the feedback-fix-push-wait cycle. It requires GitHub CLI and prioritizes resolving pending CI checks before proceeding with other feedback.
快速安装
Claude Code
推荐/plugin add https://github.com/davila7/claude-code-templatesgit clone https://github.com/davila7/claude-code-templates.git ~/.claude/skills/iterate-pr在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
Iterate on PR Until CI Passes
Continuously iterate on the current branch until all CI checks pass and review feedback is addressed.
Requires: GitHub CLI (gh) authenticated and available.
Process
Step 1: Identify the PR
gh pr view --json number,url,headRefName,baseRefName
If no PR exists for the current branch, stop and inform the user.
Step 2: Check CI Status First
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/seer- Any linter or code analysis checks
These bots may post additional feedback comments once their checks complete. Waiting avoids duplicate work.
Step 3: Gather Review Feedback
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.
Step 4: Investigate Failures
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.
Step 5: Validate Feedback
For each piece of feedback (CI failure or review comment):
- Read the relevant code - Understand the context before making changes
- Verify the issue is real - Not all feedback is correct; reviewers and bots can be wrong
- Check if already addressed - The issue may have been fixed in a subsequent commit
- Skip invalid feedback - If the concern is not legitimate, move on
Step 6: Address Valid Issues
Make minimal, targeted code changes. Only fix what is actually broken.
Step 7: Commit and Push
git add -A
git commit -m "fix: <descriptive message of what was fixed>"
git push
Step 8: Wait for CI
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")'
Step 9: Repeat
Return to Step 2 if:
- Any CI checks failed
- New review feedback appeared
Continue until all checks pass and no unaddressed feedback remains.
Exit Conditions
Success:
- All CI checks are green (
bucket: pass) - No unaddressed human review feedback
Ask for Help:
- Same failure persists after 3 attempts (likely a flaky test or deeper issue)
- Review feedback requires clarification or decision from the user
- CI failure is unrelated to branch changes (infrastructure issue)
Stop Immediately:
- No PR exists for the current branch
- Branch is out of sync and needs rebase (inform user)
Tips
- Use
gh pr checks --requiredto focus only on required checks - Use
gh run view <run-id> --verboseto see all job steps, not just failures - If a check is from an external service, the
linkfield in checks JSON provides the URL to investigate
GitHub 仓库
相关推荐技能
content-collections
元Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。
sglang
元SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。
evaluating-llms-harness
测试该Skill通过60+个学术基准测试(如MMLU、GSM8K等)评估大语言模型质量,适用于模型对比、学术研究及训练进度追踪。它支持HuggingFace、vLLM和API接口,被EleutherAI等行业领先机构广泛采用。开发者可通过简单命令行快速对模型进行多任务批量评估。
llamaguard
其他LlamaGuard是Meta推出的7-8B参数内容审核模型,专门用于过滤LLM的输入和输出内容。它能检测六大安全风险类别(暴力/仇恨、性内容、武器、违禁品、自残、犯罪计划),准确率达94-95%。开发者可通过HuggingFace、vLLM或Sagemaker快速部署,并能与NeMo Guardrails集成实现自动化安全防护。
