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.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/mindroom-docs/references/llms-full.txtllms.txt
- skills/mindroom-docs/references/llms.txtllms.txt
- address-pr-review-commentsSkill
- agent-cli-devSkill
- agent-cli-tmux-supervisionSkill
- code-debateSkill
- docs-reviewSkill
- duplication-auditSkill
- live-testSkill
- pr-reviewSkill
- mindroom-docsSkill
- open-knowledge-formatSkill
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
- Distinctive: line 12
After each fix, use fresh read-only reviewers with neutral prompts.
- Very specific: line 29
Read repo instructions, check git status --short --branch, identify base/head, and keep the active branch unless a separate branch is …
- Distinctive: line 33
Do not use git add ., amend, or force-push unless the user explicitly asks.
- Distinctive: line 34
Use task subagents only for bounded, non-overlapping analysis or review.
- Very specific: line 37
After each pushed step, start two fresh native Codex PR-review agents.
- Very specific: line 38
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 …
- Distinctive: line 39
Treat findings as claims. Verify each finding against current code before editing.
- Distinctive: line 40
Verify each finding against current code before editing.
- Distinctive: line 46
Commit and push the main-thread fix, close old reviewers, then launch fresh reviewers against the new head.
- Distinctive: line 47
After every third review round that still finds many issues or a new major bug class, stop patching and reconsider the design before …
- Distinctive: line 48
Stop only when both fresh reviewers approve the same head, or when every remaining finding on that head is declined with a recorded reason.
- Distinctive: line 53
Do not bias review agents with:
- Distinctive: line 66
Read-only requirement and exact output format.
- Distinctive: line 93
Wait for both reviewers before declaring the loop clean.
- Very specific: line 95
If any reviewer says CHANGES REQUIRED, verify the claim before editing.
- Distinctive: line 96
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.
- Distinctive: line 97
If the claim is stale or wrong, record the reason and continue evaluating the other findings.
≈ “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.
Files
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
- 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 createcodex/...branches. - 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. - Use task subagents only for bounded, non-overlapping analysis or review. Subagents must not edit repository files. The main thread applies any verified changes.
- After each pushed step, start two fresh native Codex PR-review agents.
Use read-only prompts, attach
pr-reviewwhen reviewing merge readiness, and tell them not to edit, commit, push, or inspect CI if the user excluded CI. - 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-reviewdefines them, with a one-line reason. Record out-of-scope findings aspr-reviewdescribes and do not fix them in this PR. - 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.
- 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.
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
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.

