agentleFS
mindroom-aimindroom-ai/mindroom/.claude/skills/native-subagent-pr-loop/SKILL.md

native-subagent-pr-loop

Skill319 starsChanged 57 days agoApache-2.0View on GitHub

Use when the user asks for native Codex sub-agents, parallel PR review agents, unbiased re-review loops, or main-thread fixes after agent findings in the MindRoom repository.

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    Distinctive · estimate

    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:

    After each fix, use fresh read-only reviewers with neutral prompts.

    line 12
  2. Very specific:

    Read repo instructions, check git status --short --branch, identify base/head, and keep the active branch unless a separate branch is …

    line 29
  3. Distinctive:

    Do not use git add ., amend, or force-push unless the user explicitly asks.

    line 33
  4. Distinctive:

    Use task subagents only for bounded, non-overlapping analysis or review.

    line 34
  5. Very specific:

    After each pushed step, start two fresh native Codex PR-review agents.

    line 37
  6. Very specific:

    Use read-only prompts, attach pr-review when reviewing merge readiness, and tell them not to edit, commit, push, or inspect CI if the user …

    line 38
  7. Distinctive:

    Treat findings as claims. Verify each finding against current code before editing.

    line 39
  8. Distinctive:

    Verify each finding against current code before editing.

    line 40
  9. Distinctive:

    Commit and push the main-thread fix, close old reviewers, then launch fresh reviewers against the new head.

    line 46
  10. Distinctive:

    After every third review round that still finds many issues or a new major bug class, stop patching and reconsider the design before …

    line 47
  11. Distinctive:

    Stop only when both fresh reviewers approve the same head, or when every remaining finding on that head is declined with a recorded reason.

    line 48
  12. Distinctive:

    Do not bias review agents with:

    line 53
  13. Distinctive:

    Read-only requirement and exact output format.

    line 66
  14. Distinctive:

    Wait for both reviewers before declaring the loop clean.

    line 93
  15. Very specific:

    If any reviewer says CHANGES REQUIRED, verify the claim before editing.

    line 95
  16. Distinctive:

    If the claim is a realistic, in-scope issue, fix it in the main thread, run focused verification, commit, push, and start a new review loop.

    line 96
  17. Distinctive:

    If the claim is stale or wrong, record the reason and continue evaluating the other findings.

    line 97

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “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

Native Subagent PR Loop

Core Rule

The main thread owns all repository mutations. Native subagents provide bounded analysis or review, but review findings are untrusted until the main thread verifies them against current code. After each fix, use fresh read-only reviewers with neutral prompts.

Use When

  • The user asks for native Codex agents, native sub-agents, parallel review agents, or a review loop.
  • The user wants fixes made inline in the main thread after agent findings.
  • The work is on a PR or branch where commits and pushes should remain inspectable.

Do Not Use

  • The user explicitly asks for agent-cli, tmux supervision, or another external agent runner.
  • The task has no useful independent subtask or review surface.
  • A reviewer must use private context, CI state, or browser state unavailable to a fresh subagent.

Main Loop

  1. Pin context. Read repo instructions, check git status --short --branch, identify base/head, and keep the active branch unless a separate branch is clearly safer. In this repo, never create codex/... branches.
  2. Implement in the main thread. The main thread edits, verifies, stages targeted files only, commits, and pushes. Do not use git add ., amend, or force-push unless the user explicitly asks.
  3. Use task subagents only for bounded, non-overlapping analysis or review. Subagents must not edit repository files. The main thread applies any verified changes.
  4. After each pushed step, start two fresh native Codex PR-review agents. Use read-only prompts, attach pr-review when reviewing merge readiness, and tell them not to edit, commit, push, or inspect CI if the user excluded CI.
  5. Treat findings as claims. Verify each finding against current code before editing. Fix only real, in-scope issues in the main thread. Classify stale, incorrect, overreaching, or duplicate findings instead of patching blindly. Decline edge cases, as pr-review defines them, with a one-line reason. Record out-of-scope findings as pr-review describes and do not fix them in this PR.
  6. Repeat after any fix. Commit and push the main-thread fix, close old reviewers, then launch fresh reviewers against the new head. After every third review round that still finds many issues or a new major bug class, stop patching and reconsider the design before another patch round.
  7. Stop only when both fresh reviewers approve the same head, or when every remaining finding on that head is declined with a recorded reason. Confirm the worktree is clean and the remote branch matches the local head.

Bias Firewall

Do not bias review agents with:

  • Prior findings or expected bugs.
  • Claims that the PR should now be clean.
  • A desired verdict.
  • A narrowed scope such as "only check the previous failure."
  • Defenses of the implementation.

Allowed review context:

  • Repo path, PR number or URL, base ref, head ref, exact head SHA, and diff command.
  • User constraints, such as "CI/tests already passing; do not inspect CI."
  • Required skill, such as pr-review.
  • Read-only requirement and exact output format.

Mention prior findings only when the user explicitly asks reviewers to re-check those exact items.

Neutral Review Prompt Template

Use the attached pr-review skill.
Native Codex sub-agent only; do not use agent-cli.

Review PR <owner/repo#number> in repo <absolute repo path>.
Latest local HEAD is <sha> on branch <branch>.
Base is <base ref>; review the real diff <base ref>...HEAD.

Do not edit files, commit, push, or inspect CI.
<User constraint if any, for example: CI/tests are already passing.>

Output only:
- Verdict: APPROVE or CHANGES REQUIRED
- Findings with exact file/line, the realistic scenario for bug or security findings, and required fix
- Edge cases (not blocking) and Out of scope, if any

If there are no blocking findings, say APPROVE; the non-blocking lists may still follow.

Handling Reviewer Results

  • Wait for both reviewers before declaring the loop clean.
  • One approval is not enough if the other reviewer is still running.
  • If any reviewer says CHANGES REQUIRED, verify the claim before editing.
  • If the claim is a realistic, in-scope issue, fix it in the main thread, run focused verification, commit, push, and start a new review loop.
  • If the claim is stale or wrong, record the reason and continue evaluating the other findings.
  • Close completed subagents after their results are no longer needed.

Final Report

Report only current facts:

  • Branch and pushed head SHA.
  • Commits made.
  • Verification run.
  • Review loop outcome, including each declined finding and its one-line reason.
  • Out-of-scope findings and where they were recorded.
  • Any skipped verification and why.

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.