drift-pr-review-loop
Skill14 starsChanged 7 months agoMITView on GitHub
Drives a GitHub PR through an automated agent review loop using drift pr-loop. Covers preconditions, command usage, exit code interpretation, escalation handling, and dry-run workflows. Trigger words: pr-loop, review loop, agent review, automated review, PR review loop Before running drift pr-loop, verify: When exit code is 1 (ESCALATED): - A PR comment has been posted listing all unresolved comments/verdicts - The state file is saved to work_artifacts/pr-loop-<PR_NUMBER>.json - Do not force-merge — notify the human maintainer - Inspect the JSON…
- Commits and pushes
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- llms.txtllms.txt
- brainstormingSkill
- drift-adr-workflowSkill
- drift-agent-prompt-authoringSkill
- drift-commit-pushSkill
- drift-dependency-updateSkill
- drift-docs-gap-fixSkill
- drift-evidence-artifact-authoringSkill
- drift-finding-message-authoringSkill
- drift-ground-truth-fixture-developmentSkill
- drift-mcp-repo-ops-usageSkill
- drift-pr-reviewSkill
- drift-releaseSkill
- drift-risk-audit-artifact-updatesSkill
- drift-security-triageSkill
- drift-session-handover-authoringSkill
- drift-signal-development-full-lifecycleSkill
- fix-failing-actionsSkill
- grill-meSkill
- guard-src-drift-apiSkill
- guard-src-drift-commandsSkill
- guard-src-drift-ingestionSkill
- guard-src-drift-outputSkill
- guard-src-drift-signalsSkill
- guard-src-driftSkill
- improve-codebase-architectureSkill
- prd-to-issuesSkill
- self-improving-agentSkill
- simplify-and-hardenSkill
- skill-creatorSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- tddSkill
- test-driven-developmentSkill
- verification-before-completionSkill
- workspace-automation-orchestratorSkill
- write-a-prdSkill
- writing-plansSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Before running drift pr-loop, verify:
- Very specific: line 69
When exit code is 1 (ESCALATED):
- Very specific: line 82
Before running in production, use --dry-run to verify the loop logic:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Skill: drift-pr-review-loop
Description
Drives a GitHub PR through an automated agent review loop using drift pr-loop.
Covers preconditions, command usage, exit code interpretation, escalation handling,
and dry-run workflows.
Trigger words: pr-loop, review loop, agent review, automated review, PR review loop
Preconditions
Before running drift pr-loop, verify:
- gh CLI authenticated:
gh auth statusmust succeed. If not, rungh auth login. - drift.yaml has pr_loop section: Minimum required config:
pr_loop: reviewers: - github-copilot[bot] max_rounds: 5 poll_interval_seconds: 60 poll_timeout_seconds: 600 - On a feature branch: The command pushes fix commits; ensure you are not on
main/master.
Step 1: Run the loop
drift pr-loop <PR_NUMBER> [OPTIONS]Options:
| Option | Default | Purpose |
--repo owner/repo | auto-detected | Override GitHub repo |
--config PATH | drift.yaml | Config file path |
--format rich|json | rich | Output format |
--dry-run | false | No GitHub side-effects |
--exit-zero | false | Always exit 0 |
Example:
drift pr-loop 42 --dry-run # Verify without side-effects
drift pr-loop 42 # Full run
drift pr-loop 42 --format json | jq .status # Machine-readableStep 2: Exit Code Interpretation
| Exit Code | Meaning | Agent Action |
0 | APPROVED — all reviewers approved | Proceed to merge or close loop |
1 | ESCALATED — max rounds reached or unresolved conflict | Notify maintainer, do not merge |
2 | ERROR — loop failed unexpectedly | Check logs, fix root cause, re-run |
3 | Precondition failed | Run gh auth login or add pr_loop: to drift.yaml |
Step 3: Escalation Handling
When exit code is 1 (ESCALATED):
- A PR comment has been posted listing all unresolved comments/verdicts
- The state file is saved to
work_artifacts/pr-loop-<PR_NUMBER>.json - Do not force-merge — notify the human maintainer
- Inspect the JSON state for
escalation_reason:cat work_artifacts/pr-loop-42.json | jq .escalation_reason
Step 4: Dry-Run Verification
Before running in production, use --dry-run to verify the loop logic:
drift pr-loop 42 --dry-run --format jsonNo gh pr comment, git push, or gh pr request-reviewers calls will be made.
State is NOT written to work_artifacts/.
References
- Spec:
specs/004-agent-pr-review-loop/spec.md(FR-001–FR-013) - Config schema:
drift.schema.json→pr_loopsection - State artifact:
work_artifacts/pr-loop-<PR_NUMBER>.json - Engine:
src/drift/pr_loop/_engine.py - Side-effects:
src/drift/pr_loop/_gh.py
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.

