gatekeep-prs
Skill2 starsChanged 13 days agoApache-2.0View on GitHub
Operate a single integration queue for agent-authored GitHub pull requests, ordering ready work by priority then FIFO, checking reviews, CI, and conflicts, posting deduplicated diagnostics, and merging only when authorized. Use when the user asks for a PR gatekeeper, merge shepherd, integration controller, PR queue scan, or conflict/CI bounce-back. Do not fix contributor code or merge without explicit authorization.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- code-reviewSkill
- diagnosing-bugsSkill
- orchestrate-agentsSkill
- shape-goalSkill
- to-ticketsSkill
- wayfinderSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Read bounce-back.md before commenting on blocked PRs.
- Distinctive: line 26
every required check is successful.
- Distinctive: line 30
Use read-only conflict prediction such as git merge-tree when local refs are available.
- Distinctive: line 36
If checks fail or conflicts exist, do not edit the branch.
≈ “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
Gatekeep Pull Requests
Read bounce-back.md before commenting on blocked PRs.
Scan
- Query fresh state with
gh pr listandgh pr view; do not rely on cached session state. - Exclude drafts, closed PRs, and PRs missing required ownership metadata.
- Sort by
agent-priority:p0top3, then creation time FIFO. Use FIFO alone when priority labels are absent. - Process one integration at a time. Do not occupy the session polling pending checks; report
PENDINGand revisit on the next pass or event.
Gate
Capture an immutable identity record before any integration action: PR number, remote head ref and OID, base ref and OID, local branch when present, authorized mutation set, and intended merge or push mode. Treat any unapproved change as BLOCKED.
For the first eligible PR, verify:
- the linked issue and source branch are current;
- the linked bead is current when the repository uses Beads;
- required reviews and repository policy pass;
- every required check is successful;
- mergeability is clean against the current base;
- the PR still satisfies its acceptance conditions.
Use read-only conflict prediction such as git merge-tree when local refs are available. Re-fetch immediately before merge.
Do not rename the remote head of an open PR without an explicitly approved migration plan. After an authorized history rewrite, require an exact lease tied to the recorded remote OID, then verify local, remote, and PR head OIDs are equal. Never use a broad force push.
Bounce back
If checks fail or conflicts exist, do not edit the branch. Create or update one comment containing the marker from [bounce-back.md], exact failed checks or conflict files, a small relevant excerpt, reproduction command, and ownership return. Deduplicate by marker.
Merge
Merge only when the user explicitly authorized this gatekeeper run and all gates pass. Re-fetch and compare the identity record immediately before mutation; if the head or base changed, restart the gate. Follow repository merge policy. Never use an administrator override unless separately and explicitly authorized.
Return exactly one status per PR: MERGED, BLOCKED, PENDING, or APPROVE, followed by the PR URL and one-line evidence. Record the result on the linked bead when present. GitHub remains authoritative for PR checks, reviews, mergeability, and the merge itself.
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.

