agentleFS
bjcoombsbjcoombs/ai-native-toolkit/skills/fix-pr/SKILL.md

fix-pr

Skill32 starsChanged 32 days agoApache-2.0View on GitHub

Autonomous PR fixing loop - iterates on CI failures and review comments until green

15 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use rebase, review-pr and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • raineSkill

    rebase

    Rebase the current branch with smart conflict resolution.

    Also in 3 projects that use this

  • DockerSkill

    review-pr

    Review one or more incoming Docker documentation pull requests as a maintainer. Independently validate technical claims, assess editorial fit and information architecture, choose a verdict, and draft exact inline or PR-wide feedback behind a confirmation gate. Use for requests such as "review PR 123", "is this PR correct?", "does this information belong here?", "validate this PR", or "help review backlog PRs". Do not use to maintain or fix a PR you own; use maintain-pr for that.

    Also in 4 projects that use this

  • SentrySkill

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 4 projects that use this

  • MicrosoftSkill

    release

    Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the pr-review-merge skill: it owns the 6 ready criteria, thread-resolution rules, shell pitfalls, base-sync-first, and the background …

    line 19
  2. Distinctive:

    After 5+ iterations with no progress

    line 41
  3. Distinctive:

    Sync base branch FIRST: every iteration - prevents cascade conflicts

    line 101
  4. Distinctive:

    Stop criteria: ALL 6 criteria green (not just CI + comments)

    line 102

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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-failed

Important

  • 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)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.