agentleFS
qiaoshouqingqiaoshouqing/skills/pr-review-loop/SKILL.md

pr-review-loop

Skill1 starsChanged 4 months agoMITView on GitHub

Submit or monitor a GitHub pull request with a short polling loop that waits for automated review, fixes actionable feedback, pushes updates, and stops only when the PR has no unresolved review feedback and is merge-ready. Use when the user asks to create a PR and keep checking AI or GitHub code review suggestions every few minutes.

18 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 22

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Use this skill to turn "submit a PR and keep watching review feedback" into a closed loop.

    line 13
  2. Distinctive:

    Use the current agent's native scheduling or automation feature when it exists.

    line 21
  3. Distinctive:

    If the agent has no persistent scheduling capability, run a bounded polling loop only while the current session is active, or tell the user …

    line 22
  4. Distinctive:

    Do not pretend the agent will keep checking after the session ends unless a real persistent monitor was created.

    line 23
  5. Distinctive:

    Do not require platform-specific metadata files.

    line 24
  6. Very specific:

    When documenting or configuring monitors, use generic names like pr-review-loop, the repo, PR number, branch, stop condition, and …

    line 25
  7. Distinctive:

    If a PR number or URL is provided, use it directly.

    line 30
  8. Distinctive:

    If no PR exists yet, create one from a clean branch after committing only the task-related files.

    line 31
  9. Very specific:

    If the current agent exposes an automation, reminder, scheduled task, or heartbeat registry, inspect it for the PR number, branch name, and …

    line 69
  10. Distinctive:

    Update an existing matching monitor instead of creating another one.

    line 72
  11. Distinctive:

    Start a recurring monitor when the user asks for polling.

    line 74
  12. Distinctive:

    Prefer the current agent's native recurring monitor, heartbeat, scheduled task, reminder, or automation feature for minute-level polling.

    line 75
  13. Distinctive:

    Use a 3-minute cadence by default unless the user asks for a different interval.

    line 76
  14. Very specific:

    If the current runtime uses RRULE schedules, FREQ=MINUTELY;INTERVAL=3 represents the default cadence.

    line 77
  15. Distinctive:

    If no persistent monitor feature exists, run a bounded in-session polling loop only when practical and clearly report that it will not …

    line 78
  16. Distinctive:

    If the PR is closed or merged, stop the monitor and report the terminal state.

    line 82
  17. Distinctive:

    If automated review or checks are still pending, report a short waiting status and keep the monitor active.

    line 83
  18. Distinctive:

    If a review check failed because of infrastructure, quota, session limit, or timeout, rerun the latest failed review check when the current …

    line 84
  19. Distinctive:

    If unresolved actionable review feedback exists, implement the fix, run targeted verification, commit, push, and keep monitoring for the …

    line 85
  20. Distinctive:

    If comments are informational or ambiguous, report them separately instead of forcing a code change.

    line 86
  21. Distinctive:

    If there are no unresolved actionable threads, no blocking checks, and the PR is clean or mergeable, stop the monitor and report that it is …

    line 87
  22. Distinctive:

    Keep every code change traceable to a review thread or top-level reviewer request.

    line 92
  23. Very specific:

    Prefer small commits with imperative messages, for example Fix ellipsis normalization in English uploads.

    line 93
  24. Distinctive:

    Do not force push, bypass failing checks, resolve threads on GitHub, or merge without explicit user permission.

    line 94
  25. Distinctive:

    After pushing a fix, request a new automated review if the repository does not automatically review new commits.

    line 95
  26. Distinctive:

    Stop the loop only when one of these is true:

    line 112

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

Overview

Use this skill to turn "submit a PR and keep watching review feedback" into a closed loop. The loop should keep Git history clean, handle automated review latency, implement actionable review comments, and stop itself when there is no unresolved feedback left.

The default cadence is every 3 minutes unless the user gives a different interval.

This skill is agent-agnostic. Its core workflow relies on GitHub, git, gh, and repo-native verification commands. Persistent background monitoring is optional and depends on the current AI agent/runtime.

Agent Compatibility

  • Use the current agent's native scheduling or automation feature when it exists.
  • If the agent has no persistent scheduling capability, run a bounded polling loop only while the current session is active, or tell the user that background monitoring is not available in this environment.
  • Do not pretend the agent will keep checking after the session ends unless a real persistent monitor was created.
  • Do not require platform-specific metadata files. Keep the skill portable unless this repository intentionally adds adapter files for every supported agent.
  • When documenting or configuring monitors, use generic names like pr-review-loop, the repo, PR number, branch, stop condition, and verification commands. Avoid hard-coding one vendor unless it is the current runtime.

Workflow

  1. Resolve the PR and repository.
    • If a PR number or URL is provided, use it directly.
    • If no PR exists yet, create one from a clean branch after committing only the task-related files.
    • In a dirty checkout, use a fresh worktree from the PR branch or from origin/main; do not reset or stage unrelated user changes.
  2. Inspect current state before starting a monitor.
    • Check gh pr view <number> --repo <owner>/<repo> --json number,url,state,isDraft,mergeStateStatus,reviewDecision,statusCheckRollup,headRefName,baseRefName,title.
    • Fetch thread-aware review state with GraphQL, not only flat PR comments:
gh api graphql \
  -f owner=<owner> \
  -f name=<repo> \
  -F number=<number> \
  -f query='query($owner:String!, $name:String!, $number:Int!) {
    repository(owner:$owner, name:$name) {
      pullRequest(number:$number) {
        reviewThreads(first: 100) {
          nodes {
            isResolved
            isOutdated
            path
            line
            comments(first: 20) {
              nodes { author { login } body createdAt }
            }
          }
        }
        reviews(first: 50) {
          nodes { author { login } state body submittedAt }
        }
        comments(first: 50) {
          nodes { author { login } body createdAt }
        }
      }
    }
  }'
  1. Avoid duplicate monitors.
    • If the current agent exposes an automation, reminder, scheduled task, or heartbeat registry, inspect it for the PR number, branch name, and pr-review-loop name.
    • For Codex environments, this may include $CODEX_HOME/automations/*/automation.toml.
    • For other agents, use their native registry or skip this step if no persistent monitor system exists.
    • Update an existing matching monitor instead of creating another one.
  2. Start a recurring monitor when the user asks for polling.
    • Prefer the current agent's native recurring monitor, heartbeat, scheduled task, reminder, or automation feature for minute-level polling.
    • Use a 3-minute cadence by default unless the user asks for a different interval.
    • If the current runtime uses RRULE schedules, FREQ=MINUTELY;INTERVAL=3 represents the default cadence.
    • If no persistent monitor feature exists, run a bounded in-session polling loop only when practical and clearly report that it will not continue after the session ends.
    • The monitor prompt must name the repo, PR number, branch, stop condition, and test commands.
  3. On every poll, choose exactly one path.
    • If the PR is closed or merged, stop the monitor and report the terminal state.
    • If automated review or checks are still pending, report a short waiting status and keep the monitor active.
    • If a review check failed because of infrastructure, quota, session limit, or timeout, rerun the latest failed review check when the current tools support it, then keep monitoring.
    • If unresolved actionable review feedback exists, implement the fix, run targeted verification, commit, push, and keep monitoring for the next review.
    • If comments are informational or ambiguous, report them separately instead of forcing a code change.
    • If there are no unresolved actionable threads, no blocking checks, and the PR is clean or mergeable, stop the monitor and report that it is ready to merge. Do not merge unless the user explicitly asked for merge.

Fixing Feedback

  • Cluster review comments by behavior or file before editing.
  • Keep every code change traceable to a review thread or top-level reviewer request.
  • Prefer small commits with imperative messages, for example Fix ellipsis normalization in English uploads.
  • Do not force push, bypass failing checks, resolve threads on GitHub, or merge without explicit user permission.
  • After pushing a fix, request a new automated review if the repository does not automatically review new commits. Use the repository's actual trigger phrase or integration, such as a configured bot command, only when the user has asked for an automated review loop.

Verification

Choose the smallest checks that cover the changed surface. Prefer repo-native commands from package scripts, CI config, README, or nearby tests. Common examples include:

npm test -- --run __tests__/upload-material-routing.test.ts
npm run lint -- <changed files>
npx prisma generate
npx tsc --noEmit --pretty false

Report exactly what passed, what was skipped, and why.

Stop Conditions

Stop the loop only when one of these is true:

  • The PR is merged or closed.
  • The PR has no unresolved actionable review threads, review checks are complete, required checks are passing, and mergeStateStatus is clean or otherwise mergeable.
  • The same external blocker repeats across three consecutive polls and cannot be fixed without user action; report it as blocked instead of polling silently forever.

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.