pr-preflight
Skill2 starsChanged 22 days agoMITView on GitHub
Run the pre-open gates, size check, self-critique, and minimum sufficient risk-routed independent review before opening a draft PR.
- Commits and pushes
2 other projects use a version of this.
Adopted by
Most recently taken up by
- liaohch3/claude-taptheir own version, first seen Oct 25, 2026
- arndvs/ctrlshfttheir own version, first seen Oct 15, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- liaohch3/claude-tap★ 3.3ksame name
- arndvs/ctrlshft★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- capture-agent-usageSkill
- add-bean-profileSkill
- captureSkill
- pre-roast-preflightSkill
- register-roastSkill
- roast-reviewSkill
- triage-prSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
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 6
Run this on the PR branch before gh pr create.
- Distinctive: line 29
Run the gates for every surface the diff touches:
- Distinctive: line 59
Keep data, fixtures, snapshots, generated output, and research separate from logic when independently reviewable.
- Distinctive: line 76
Before relying on a reviewer, verify that its CLI or service is authenticated and usable.
- Distinctive: line 83
After any gate or review finding changes the tree:
- Distinctive: line 91
Do not push a fold that has not completed this loop.
- Very specific: line 102
Before ready authorization or merge, inspect all CodeQL checks.
- Very specific: line 105
Verify the github-advanced-security CodeQL result reports no new alerts.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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
Run this on the PR branch before gh pr create. D158 replaces the former fixed
Claude-reviewer roster plus mandatory local-Codex pass with the risk-routed
procedure below. The GitHub exact-head Claude approval, ready-head Codex review
and wait, conversation resolution, CI, CodeQL handling, and Codecov rules in
AGENTS.md remain unchanged.
0. Orient
Before using HEAD-based size or review evidence, run git status --porcelain; it must be empty so staged, unstaged, or untracked work cannot be omitted. Otherwise stop, reconcile and commit intended work, then restart preflight from the new HEAD. This does not replace the stricter fresh-worktree plus ignored-file admission check before worker delegation in AGENTS.md.
Record the branch, merge base, and current head:
git branch --show-current
git merge-base origin/main HEAD
git rev-parse HEAD
git diff --stat origin/main...HEADConfirm the story has a ratified story-planner contract and a PR-slice plan.
1. Deterministic gates
Run the gates for every surface the diff touches:
- Python:
.venv/bin/python -m ruff check .,.venv/bin/python -m ruff format --check .,.venv/bin/python -m pyright; run the route selected in the AGENTS.md Validation routes table and record the current-head route assessment. - Python coverage for full routes:
.venv/bin/python -m pytest --cov=roastpilot_agent --cov=scripts --cov=.agents/skills/capture-agent-usage/scripts --cov-branch --cov-report=term-missing; cover every changed line and branch. Never label a focused pass a full gate. Use# pragma: no coveronly for a demonstrably unreachable path and record why. - Web: from
web/, runnpm run lint,npm run typecheck,npm test, andnpm run build. - Cross-boundary contract changes: run both Python and web gates and regenerate affected contract fixtures before opening.
- Recorded-data ingestion or replay changes: validate against a real, non-committed store or log and put only a sanitised result summary in the PR.
Fix failures and rerun the affected gates before continuing.
2. Size and change-shape check
- Measure from the merge base. Target about 400 changed logic lines; exclude tests and separately committed data, fixtures, generated output, and prose. Agent, skill, and workflow definitions are executable logic, not prose.
- More than 600 changed test lines triggers
qa. - Split unrelated or independently shippable responsibilities at the ratified slice boundary. Explain a cohesive logic diff that materially exceeds the target; re-plan an unexplained one.
- Keep data, fixtures, snapshots, generated output, and research separate from logic when independently reviewable.
3. Adversarial self-critique
Inspect the diff for edge cases, failure direction, behavioural coverage,
observability gaps, dead code, debug residue, and the architecture invariants in
AGENTS.md. Check docs/recent-fixes.md. When a finding is one instance of a
class, sweep the repository and fix the class rather than only the symptom.
4. Minimum sufficient independent review
The Codex parent selects one independent, diff-focused review and adds only the
contract- or diff-triggered lenses in AGENTS.md. A contract-predicted reviewer
may be added to by the actual diff, never removed. Do not run the full Claude
roster or duplicate deterministic gates with model review.
Before relying on a reviewer, verify that its CLI or service is authenticated
and usable. If it is unavailable, stop and ask the operator; do not silently
substitute self-review or another same-family lens. Give the reviewer only the
ratified contract, relevant diff and tests, and minimum context for its lens.
The lead or pr-triage, never the author implementer, adjudicates substantive
findings before turning them into lead-authored repair instructions.
After any gate or review finding changes the tree:
- Apply the adjudicated repair and commit it.
- Rerun the affected deterministic gates on that commit.
- Rerun every triggered reviewer whose evidence the change invalidated.
- Repeat until the committed tree is clean and the review evidence names the
current
HEAD.
Do not push a fold that has not completed this loop.
5. Draft and ready-head handoff
Push only the clean, reviewed commit, open the PR as a draft, and record its head
SHA. Before ready authorization can be exercised, verify local HEAD matches
the current PR head, the current-head required draft checks have finished green,
and every draft-phase runner, Claude, and reviewer finding has been independently
triaged and resolved. A head-moving repair re-enters steps 1 and 4 before it is
pushed.
Before ready authorization or merge, inspect all CodeQL checks. Verify the
CodeQL workflow run headSha equals the current PR head and that its Analyze
actions, Analyze javascript-typescript, and Analyze python jobs succeeded.
Verify the github-advanced-security CodeQL result reports no new alerts; any
alert requires independent triage before ready or merge. Use gh pr checks to
inspect PR checks and gh run view <run-id> --json headSha,jobs to verify the
workflow run and Analyze jobs.
Move the PR to ready only when the task or operator authorizes it. The ready
transition starts the GitHub Codex review; a draft-phase verdict does not satisfy
that post-ready wait. Before merge, follow the full PR Merge Policy in
AGENTS.md, including:
- exact-current-head Claude approval;
- a current-head Codex verdict, with one
@codex reviewtrigger only after the final later push when required by the documented lifecycle; - green required CI and
codecov/patch; - independent disposition and resolution of every review thread; and
- branch-protection and privileged-change rules without bypass.
Opening a draft runs Claude review and its findings remain substantive even though its diagnostic status is not itself required. Never treat a trigger, green CI, or elapsed time as review evidence.
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.

