code-review-preflight
Skill0 starsChanged 5 months agoMITView on GitHub
Use when the user asks for a pre-PR review or self-review of code they've written. Triggers on phrases like "review my changes", "check before I push", "self-review this PR", "what would a reviewer flag here", or when the user pastes a diff or branch summary asking for feedback.
In this repository7 other files it gives its agents.
- api-docs-from-openapiSkill
- changelog-writerSkill
- csv-cleanerSkill
- json-schema-from-sampleSkill
- meeting-notes-summarizerSkill
- regex-builderSkill
- sql-from-questionSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Run the checks a senior reviewer would catch before they catch them.
- Very specific: line 12
Get the diff: If not provided, ask: which branch vs which base?
- Distinctive: line 40
Inconsistent quote style, semicolons, etc: if the project has a linter, defer to that
≈ “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
Code Review Preflight
Run the checks a senior reviewer would catch before they catch them.
Process
- Get the diff. If not provided, ask: which branch vs which base? If the user is in a git repo, prefer
git diff origin/main...HEADovergit diffso context is correct. - Pass through this checklist in order. Report findings as you go, severity-tagged.
Critical (blocks PR)
- Secrets: any string matching
sk-,ghp_,xoxb-,xoxp-,AKIA,eyJfollowed by long base64. Even in tests. Even in comments. - SQL string concatenation with user input. Anywhere
f"...{...}"or+ user_value +appears in a SQL context, flag it. - Disabled tests (
.skip,xit,@pytest.mark.skip) without an attached issue link or comment explaining why. TODO/FIXMEintroduced in this diff. Old TODOs are someone else's problem. New ones are this PR's.- Unhandled
awaitrejection paths (no try/catch, no.catch(), no caller that handles it). - Logging of sensitive fields:
password,token,secret,key,email(when in a security-sensitive context) appearing inside log/print calls.
Important (request changes)
- Untested code paths. New function or new branch with no test in the same diff. Exception: pure rendering / pure type changes.
- Off-by-one risks: ranges with
<=vs<, slice indexing, pagination math. - Mutating shared state (module-level dicts/lists, default mutable arguments in Python).
- Magic numbers / strings without a constant (anything that looks like a configuration value).
- Catch-all exception handlers that don't re-raise or log.
- Imports that are now unused.
- Functions over ~50 lines without an obvious reason; suggest splitting.
Style (comment, don't block)
- Naming: unclear single-letter names outside of loop counters
- Repeated code blocks that could be a helper function (3+ occurrences)
- Comments that restate the code without adding intent
- Inconsistent quote style, semicolons, etc. if the project has a linter, defer to that
- Output format:
CRITICAL (N findings)
file.py:42 Hardcoded API key in test fixture
...
IMPORTANT (N findings)
file.ts:88 New function `parseRange` has no test
...
STYLE (N suggestions)
file.go:23 Consider extracting magic number 86400 as `secondsPerDay`
...
OK to merge once Critical and Important are addressed.What NOT to do
- MUST NOT rewrite the code unsolicited. List findings; let the author decide.
- MUST NOT invent issues to look thorough. If the diff is clean, say so.
- MUST NOT repeat lints the project's linter already catches (assume CI runs them).
- MUST NOT comment on style preferences that are subjective unless the project has an explicit style guide.
Calibration
A 100-line PR usually has 2-5 Important findings. If you're returning 20+ findings on a 100-line PR, you're being noisy. Reduce.
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.

