fix-pr

A command that repeatedly fixes a pull request—the proposed code change submitted for review—until its checks and review requirements are satisfied.

In plain words
What is it for?
Use it on the current branch's pull request to sync with the base branch, fix code, handle bot and human feedback, and stop when it is ready for human approval.
Why use it?
It reduces the manual cycle of reading CI failures, addressing review comments, updating the branch, and checking again.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/bjcoombs/ai-native-toolkit/fix-pr
Clone the repo
git clone --depth 1 https://github.com/bjcoombs/ai-native-toolkit
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 790 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00019 $0.00790
Opus 5 $0.00010 $0.00395
Sonnet 5 $0.00004 $0.00158
Haiku 4.5 $0.00002 $0.00079

Measured 2d ago against content hash c095cccd9e27, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fix-pr scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/fix-pr.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 five criteria, then stop for human review (this command does not auto-merge).

Use the pr-review-merge skill: it owns the 5 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 5 criteria, fix issues, push
    • Report: "Iteration N: Fixed X issues" or "Iteration N: Waiting for CI"
    • Loop until all green
  2. Stop when ALL 5 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 5 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

Read the full file on GitHub · 104 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 104 lines · 19 tokens per session scan A c095cccd9e27

Subscribe to this mod's changes

fix-pr is a command published in the GitHub repository bjcoombs/ai-native-toolkit (30 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 19 tokens to every session and 790 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.