/fix-pr
Autonomous PR fixing loop - iterates on CI failures and review comments until green
$ npx -y skills add bjcoombs/ai-native-toolkit --skill fix-pr --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/fix-pr
Context preview
The summary Claude sees to decide when to auto-load this skill.
Autonomous PR fixing loop - iterates on CI failures and review comments until green
SKILL.md
fix-pr.SKILL.mdname: fix-pr
disable-model-invocation: true
description: "Autonomous PR fixing loop - iterates on CI failures and review comments until green"
argument-hint: "[pr-number] (optional - derives from current branch if omitted)"
Fix PR Autonomously
Enter autonomous PR review loop for the current branch's PR. Loops until the PR is merge-ready across ALL criteria, not just CI.
---
What this does
Drive the current branch's PR to merge-ready across all six criteria, then stop for human review (this command does not auto-merge).
Use the pr-review-merge skill: it owns the 6 ready criteria, thread-resolution rules, shell pitfalls, base-sync-first, and the background CI watcher. Pass the current PR number (`gh pr view --json number --jq '.number'`) and the base branch (`gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'`), plus any bot rules from the project's Marathon Configuration.
---
Protocol
1. **Autonomous Loop** (DO NOT ask for permission between iterations):
- Sync base branch, check all 6 criteria, fix issues, push
- Report: "Iteration N: Fixed X issues" or "Iteration N: Waiting for CI"
- Loop until all green
2. **Stop when ALL 6 criteria met**:
- Report: "PR #X: All criteria met, ready for human review"
- Include status footer
- STOP
3. **Only ask for help if**:
- Genuinely blocked (ambiguous merge conflict, unclear review feedback)
- After 5+ iterations with no progress
- Need design decision from user
Example Output
🔄 Iteration 1: Checking PR #123...
⚠️ Merge conflict with base branch in App.tsx — resolving (accept both sides)
❌ CI: TypeScript errors in user.service.ts
❌ CodeRabbit: 2 unresolved threads (missing error handling)
Fixing...
🔄 Iteration 2: Checking PR #123...
✅ In sync with base branch
✅ CI passing
❌ CodeRabbit: 1 remaining thread (async pattern)
Fixing...
🔄 Iteration 3: Checking PR #123...
✅ In sync with base branch
✅ CI passing
✅ All threads resolved
✅ No unaddressed comments
✅ PR #123: All 6 criteria met, ready for your review!
---
## 📍 Current Work
🔗 **PR**: #123 - Add payment processing
https://github.com/org/repo/pull/123
📊 **Latest**: All criteria met after 3 iterations
Commands Reference
# Get PR info
gh pr view --json number,title,statusCheckRollup
# CI failures
gh pr checks <number> --json name,conclusion | jq '.[] | select(.conclusion == "FAILURE")'
# Unresolved threads (GraphQL — most reliable)
gh api graphql -f query='...'
# Inline comments (REST fallback)
gh api repos/{owner}/{repo}/pulls/<number>/comments | jq '[.[] | select(.user.login | test("bot"; "i"))]'
# Conversation
gh pr view <number> --comments
# Failed CI logs
gh run view <run-id> --log-failedImportant
- **NO permission needed** between iterations - keep looping autonomously
- **Sync base branch FIRST** every iteration - prevents cascade conflicts
- **Stop criteria**: ALL 6 criteria green (not just CI + comments)
- **Max iterations**: 10 (ask for help after that)
Read more
name: fix-pr disable-model-invocation: true description: "Autonomous PR fixing loop - iterates on CI failures and review comments until green" argument-hint: "[pr-number] (optional - derives from current branch if omitted)"
Fix PR Autonomously
Enter autonomous PR review loop for the current branch's PR. Loops until the PR is merge-ready across ALL criteria, not just CI.
---
What this does
Drive the current branch's PR to merge-ready across all six criteria, then stop for human review (this command does not auto-merge).
Use the pr-review-merge skill: it owns the 6 ready criteria, thread-resolution rules, shell pitfalls, base-sync-first, and the background CI watcher. Pass the current PR number (`gh pr view --json number --jq '.number'`) and the base branch (`gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'`), plus any bot rules from the project's Marathon Configuration.
---
Protocol
1. **Autonomous Loop** (DO NOT ask for permission between iterations):
- Sync base branch, check all 6 criteria, fix issues, push
- Report: "Iteration N: Fixed X issues" or "Iteration N: Waiting for CI"
- Loop until all green
2. **Stop when ALL 6 criteria met**:
- Report: "PR #X: All criteria met, ready for human review"
- Include status footer
- STOP
3. **Only ask for help if**:
- Genuinely blocked (ambiguous merge conflict, unclear review feedback)
- After 5+ iterations with no progress
- Need design decision from user
Example Output
🔄 Iteration 1: Checking PR #123... ⚠️ Merge conflict with base branch in App.tsx — resolving (accept both sides) ❌ CI: TypeScript errors in user.service.ts ❌ CodeRabbit: 2 unresolved threads (missing error handling) Fixing... 🔄 Iteration 2: Checking PR #123... ✅ In sync with base branch ✅ CI passing ❌ CodeRabbit: 1 remaining thread (async pattern) Fixing... 🔄 Iteration 3: Checking PR #123... ✅ In sync with base branch ✅ CI passing ✅ All threads resolved ✅ No unaddressed comments ✅ PR #123: All 6 criteria met, ready for your review! --- ## 📍 Current Work 🔗 **PR**: #123 - Add payment processing https://github.com/org/repo/pull/123 📊 **Latest**: All criteria met after 3 iterations
Commands Reference
# Get PR info
gh pr view --json number,title,statusCheckRollup
# CI failures
gh pr checks <number> --json name,conclusion | jq '.[] | select(.conclusion == "FAILURE")'
# Unresolved threads (GraphQL — most reliable)
gh api graphql -f query='...'
# Inline comments (REST fallback)
gh api repos/{owner}/{repo}/pulls/<number>/comments | jq '[.[] | select(.user.login | test("bot"; "i"))]'
# Conversation
gh pr view <number> --comments
# Failed CI logs
gh run view <run-id> --log-failedImportant
- **NO permission needed** between iterations - keep looping autonomously
- **Sync base branch FIRST** every iteration - prevents cascade conflicts
- **Stop criteria**: ALL 6 criteria green (not just CI + comments)
- **Max iterations**: 10 (ask for help after that)
A Claude Code plugin - and a set of standalone skills for any AI assistant: skills and agents for AI-native development. In Claude Code it runs locally against your own codebase using whichever model you already pay for.
Repo: bjcoombs/ai-native-toolkit
Other skills on ai-native-toolkit.
ab-equivalence
Compare two versions of an LLM-directed document - an original (teacher) and a candidate…
assess-findings
Renders the /assess report from the deterministic run-context.json and the layer scorecard -…
assess-pr
The /assess end-of-run offers - open a PR with the report, track the Top 3 Actions in the…
assess
Assess a codebase's readiness for AI agent contributors using the layered contract model, and…

