Native subagent pr loop

From mindroom-ai/mindroom · View interactive version

Native subagent pr loop is an AI agent skill from the GitHub repository mindroom-ai/mindroom. 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.

How to use this skill

Skill file

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

Do Not Use

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.

  1. 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.

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

Subagents must not edit repository files.

The main thread applies any verified changes.

  1. 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.

  1. 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.

  1. 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.

  1. 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:

Allowed review context:

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

Final Report

Report only current facts:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.