agentleFS
davidemastriccidavidemastricci/skills/pr-loop/SKILL.md

pr-loop

Skill1 starsChanged 5 months agoMITView on GitHub

Iteratively improve a pull request until it earns a self-assessed Confidence Score of 5/5. Computes the score locally with the make-pr rubric (no external review bot), auto-fixes the binding axis (code/tests), commits and pushes, refreshes the PR body, and repeats. Stops at 5/5, on a plateau, when a judgment call needs a human, or after a max-iteration cap. Use when the user wants to drive a PR to a clean, merge-ready state.

  • Commits and pushes

4 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. EtanHey/golems★ 0same name
    2. pablomanjarres/redline★ 0same name
    3. pedrosatin/skills★ 0same name
    4. shahrukh-hack/vibe-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep each fix scoped to the binding issue.

    line 74
  2. Very specific:

    Write a descriptive, imperative commit message about the real change (e.g.

    line 85
  3. Distinctive:

    If it stopped short:

    line 119

“Common” is measured: kept by at least 6 in 10 of the 4 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

pr-loop

A self-assessed cousin of greploop. Where greploop drives an external bot's score by pushing every round, pr-loop computes the score locally with the make-pr rubric — so it can iterate fast and only touch the network to publish each improvement.

The score is self-assessed, so the anti-gaming guards are load-bearing:

  • The score comes from make-pr's executed gates (real pytest/tsc/eslint runs) — the loop cannot raise the number by editing prose; it must make the checks actually pass.
  • Stage 2 is weakest-link — one weak axis caps the score, so the loop fixes the real problem.
  • Stopping short of 5/5 is honest by design (see exit conditions) — the loop reports "stuck at 4/5 because X" rather than inflating to 5/5 to terminate.

Inputs

  • PR number (optional): default to the PR for the current branch.

Procedure

1. Identify the PR

gh pr view --json number,headRefName,baseRefName -q '{number,headRefName,baseRefName}'

Switch to the PR branch if not already on it. Abort with a clear message if there is no PR for the branch (suggest running make-pr to create one first).

2. Loop — max 5 iterations

A. Score

Invoke the make-pr skill to compute the current Confidence Score and the binding axis, applying make-pr/references/rubric.md. This runs the repo's gates (tests/build/typecheck/lint) and evaluates the five judgment axes. Record score and binding_axis for this iteration.

Do not re-derive the rubric here — make-pr owns it. If make-pr is not installed, stop and tell the user to install it.

B. Check exit conditions — stop if any hold

  1. Success: score == 5. → Refresh the PR body (step E) and exit reporting success.
  2. Cap: this was iteration 5. → Stop, report current state + remaining blockers.
  3. Plateau: score did not improve for 2 consecutive iterations. → Stop, report what it's stuck on.
  4. Needs human: the binding axis is a judgment fork the loop must not settle alone — typically Safety/blast-radius or Scope discipline that would require a design decision, a risky deletion, reverting someone's intentional change, or an irreducible risk that simply cannot be a 5. → Stop and surface the decision: "stuck at N/5 on <axis> because X; raising it needs you to decide Y." Do not guess, and do not inflate the score to escape.

C. Fix the binding axis

Make a real change that addresses the lowest axis — not the prose:

  • Tests adequacy → add meaningful tests for the uncovered behaviour-critical path.
  • Correctness → fix the bug / handle the edge case the axis flagged.
  • PR hygiene → update the doc/decision-record; clean up commit hygiene.
  • Build/typecheck/lint gate red → fix the failing check until it is genuinely green.

Keep each fix scoped to the binding issue. If fixing it would itself require a judgment fork, treat that as exit condition B.4 instead of guessing.

D. Commit and push

git add -A
git commit -m "<short imperative message describing the actual fix>"
git push

Write a descriptive, imperative commit message about the real change (e.g. add citation dedup test for multi-page sources), not a generic "loop iteration N". Honor the repo's commit conventions from its CLAUDE.md/AGENTS.md — including no AI-authorship trailer where the repo forbids it.

E. Refresh the PR body

Re-run make-pr in update mode so the PR body's Confidence Score, files table, and diagram reflect the new state. Then return to step A.

3. Report

Summarize like greploop:

FieldValue
PR#N
IterationsN
Final scoreX/5
Fixes appliedN (one-line each)
Stop reason5/5 / cap / plateau / needs-human
Remaining blockersthe binding axis + what would raise it, if < 5/5

Output format

pr-loop complete.
  PR:            #123
  Iterations:    2
  Final score:   5/5
  Fixes:         add citation-dedup test; handle empty-retrieval edge case
  Stop reason:   reached 5/5

If it stopped short:

pr-loop stopped (needs-human).
  PR:            #123
  Iterations:    3
  Final score:   4/5
  Binding axis:  Safety/blast-radius
  Why:           schema migration is not reversible without data loss
  To raise it:   decide whether a backfill + down-migration is in scope for this PR

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.