agentleFS
BiswaVirajBiswaViraj/agent-skills/skills/reviewloop/SKILL.md

reviewloop

Skill0 starsChanged 5 months agoMITView on GitHub

Use when a PR has feedback from MORE than one reviewer — any mix of bots (Greptile, CodeRabbit, Copilot, linters) and human teammates — and the user wants every reviewer driven to a clear state, not just one specific bot. Use when the user says "clear all the reviews", "address every reviewer", "loop until the PR is clean", or wants bot reviews re-triggered and re-checked automatically.

  • Commits and pushes

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. ankitvgupta/exo★ 497same name
    2. fabianboth/autonomous-review-loop★ 2same name
    3. mrdulasolutions/AOS-Mail★ 2same 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

7 rules. 1 is common, 5 are distinctive, and 1 is very specific to this project.

  • 1

    Common

    Most of the 3 edited versions we read keep these.

  • 5

    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:

    No uniform code path covers all reviewers.

    line 36
  2. Distinctive:

    Stop the loop when all hold:

    line 104
  3. Very specific:

    Every bot reviewer is at its done-condition (table) and its checks are success.

    line 105
  4. Common:

    Read the file and understand the comment in context.

    line 114
  5. Distinctive:

    If actionable, make the fix.

    line 116
  6. Distinctive:

    Treat human comments with the same rigor as bot comments.

    line 118
  7. Distinctive:

    If stopped at max iterations, list remaining unresolved threads per reviewer and suggest next steps.

    line 190

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

Reviewloop

Drive a PR to all-clear across every reviewer — each bot AND each human — then loop until nothing actionable remains.

Core principle: A bot is a pure function you can re-invoke (re-trigger → poll → read verdict). A human is async and uncontrollable. So bots loop; humans get one pass and then you hand back. Never block the loop waiting on a person.

When to use

  • A PR has comments from several reviewers and you want them all resolved in one driven pass.
  • The reviewers are a mix you can't name up front — "address whatever's on the PR."
  • You want bot reviews re-triggered after each fix, not just read once.

When NOT to use: You just want a one-shot read of what's outstanding with no loop and no re-triggering — that's a plain review-check, not this.

The reviewer registry (the spine)

No uniform code path covers all reviewers. Each needs four things — detect it, re-trigger it, read its verdict, know when it's done:

ReviewerDetect (by login)Re-triggerRead verdictDone-condition
Greptilegreptile-apps (CI check + bot review)comment @greptile reviewN/5 confidence in PR body / its review5/5 and its threads resolved and check success
CodeRabbitcoderabbitaicomment @coderabbitai full reviewwalkthrough + inline actionable comments (no score)zero unresolved actionable CodeRabbit threads
Copilotcopilot-pull-request-reviewer / Copilotgh pr edit <PR> --add-reviewer @copilot (gh ≥ 2.88.0) — NOT a comment, NOT the REST reviewers APIinline suggestions/commentszero unresolved Copilot threads on latest head
Other bot (__typename: Bot)any login, structurally a botunknown — do not guess a command; report itread its check run / commentsits check success / its threads resolved
Human (__typename: User)any non-bot logingh pr edit <PR> --add-reviewer <login> to re-request — then hand backinline + summary review (CHANGES_REQUESTED / COMMENTED / APPROVED)actionable threads resolved + replied + re-review requested → stop, do not wait

Detection is structural, not an allowlist. Classify every reviewer by GitHub's __typename (Bot vs User) first; only then look up known bots in the table for their re-trigger command. An unknown bot is still handled (read + report) — it is never silently skipped.

Inputs

  • PR number (optional): default to the PR for the current branch.
  • --max-iterations N (optional, default 5): cap on the bot loop.

The loop

0. Identify the PR

gh pr view --json number,headRefOid -q '{number: .number, sha: .headRefOid}'

Switch to the PR branch if not already on it. Capture <PR> and <HEAD_SHA>.

1. Enumerate reviewers (one query — the heart of the skill)

Pull verdicts, inline threads, and each author's __typename in a single GraphQL call:

gh api graphql -f query='
query($owner:String!,$repo:String!,$pr:Int!,$cursor:String) {
  repository(owner:$owner, name:$repo) {
    pullRequest(number:$pr) {
      reviews(first:50) { nodes { author { login __typename } state submittedAt body } }
      reviewThreads(first:100, after:$cursor) {
        pageInfo { hasNextPage endCursor }
        nodes {
          id isResolved isOutdated
          comments(first:1) { nodes { author { login __typename } path body } }
        }
      }
    }
  }
}' -F owner=OWNER -F repo=REPO -F pr=<PR>

Paginate reviewThreads via endCursor until hasNextPage is false. Also fetch:

  • Bot summaries / scores (Greptile score, CodeRabbit walkthrough) — issue comments and PR body:
    gh pr view <PR> --json body -q .body
    gh api repos/{owner}/{repo}/issues/<PR>/comments
  • CI-based bots (Greptile and others run as checks):
    gh api repos/{owner}/{repo}/commits/<HEAD_SHA>/check-runs --jq '.check_runs[] | {name, status, conclusion}'

Now build the work list: for each reviewer present, classify (known bot / unknown bot / human) and collect its unresolved threads (isResolved == false) and verdict.

2. Check the exit condition

Stop the loop when all hold:

  • Every bot reviewer is at its done-condition (table) and its checks are success.
  • Zero unresolved actionable threads from any reviewer (bot or human).
  • The human pass (step 6) has been completed once this run.

Or when max iterations is hit (report remaining state).

3. Fix actionable comments

For each unresolved thread, across all reviewers:

  1. Read the file and understand the comment in context.
  2. Decide actionable (code change) vs informational / false positive.
  3. If actionable, make the fix. If not, note why — you'll still resolve/reply.

Treat human comments with the same rigor as bot comments; do not down-prioritize them.

4. Resolve threads

Resolve every thread you've addressed (and informational ones), batching with GraphQL aliases. For the exact resolveReviewThread mutation and thread-fetch pagination, see references/github-mechanics.md. For human threads, prefer a brief reply explaining the fix before resolving.

5. Commit, push, re-trigger bots

git add -A
git commit -m "address review feedback (reviewloop iteration N)"
git push
sleep 5

Then re-trigger each bot reviewer by its registry command — but only if it isn't already running (guard on check-runs status / its last comment timestamp first; see references/github-mechanics.md):

# Greptile (only if its check isn't already PENDING/IN_PROGRESS)
gh pr comment <PR> --body "@greptile review"
# CodeRabbit
gh pr comment <PR> --body "@coderabbitai full review"
# Copilot
gh pr edit <PR> --add-reviewer @copilot

For an unknown bot, do not invent a command — log "no known re-trigger for <login>; left as-is" and carry its current verdict forward.

6. Handle humans — ONE pass, then hand back

For each human reviewer with outstanding feedback:

  1. Fix their actionable comments (step 3) and reply + resolve threads (step 4).
  2. Re-request their review: gh pr edit <PR> --add-reviewer <login>.
  3. Do not poll or wait for them. Record them as "waiting on @<login>" and continue.

The loop's job for humans ends at "addressed + re-requested." Blocking on a person is out of scope.

7. Poll bot completion, then loop

Poll each re-triggered bot's check run / review to a terminal state (the check-run polling loop is in references/github-mechanics.md). When all bots are terminal, go back to step 1.

Common mistakes

MistakeFix
Re-triggering Copilot with a comment (@copilot review)Copilot has no comment command — use gh pr edit <PR> --add-reviewer @copilot.
Filtering reviewers by a hardcoded name listDetect bot-ness by __typename == "Bot"; the name list is only for re-trigger lookup.
Skipping an unrecognized botRead and report it; only its re-trigger is unknown, not its feedback.
Blocking the loop until a human approvesHumans get one pass; hand back and report.
Spamming @coderabbitai full review every iterationOne full review per push is enough; guard on whether it's already running.
Resolving a human thread with no replyReply with the fix first, then resolve — humans read the thread.

Report

Reviewloop complete.
  PR:             #5876
  Iterations:     3
  Bots cleared:   greptile-apps (5/5), coderabbitai (0 open), Copilot (0 open)
  Humans:         re-requested @neeraj-lightwork-ai (was CHANGES_REQUESTED)
  Resolved:       11 threads
  Remaining:      0 bot / waiting on 1 human

If stopped at max iterations, list remaining unresolved threads per reviewer and suggest next steps.

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.