reviewer-python
Skill0 starsChanged 55 days agoMITView on GitHub
Review Python code (.py): data pipelines, build and asset tools, small servers and their tests. Use when reviewing changes to Python files, or when the user types /reviewer-python. Catches syntax newer than the Python that actually runs it, undeclared third-party imports, encoding and CSV mistakes, Unicode comparison bugs, non-deterministic output, unsafe subprocess and deserialization, missing network timeouts, and untested logic. Part of the reviewer bundle.
In this repository15 other files it gives its agents.
- ai-scaffoldingSkill
- comment-hygieneSkill
- microfrontendsSkill
- reviewer-cloudflareSkill
- reviewer-dataSkill
- reviewer-docsSkill
- reviewer-godotSkill
- reviewer-readabilitySkill
- reviewer-shellSkill
- reviewer-toolingSkill
- reviewer-unitySkill
- reviewer-webSkill
- reviewerSkill
- startup-scriptSkill
- typed-blocksSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 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.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Run the project's tests (python3 -m unittest discover …, pytest) and any linter it configures (ruff, flake8, mypy).
- Very specific: line 14
Run a changed script's --help or dry-run mode when it has one.
- Very specific: line 26
Use the csv module, not split(",").
- Very specific: line 75
Use the reviewer format: [severity] path:line — problem, then failure: (the concrete input, state or platform → wrong result) and fix: (the …
≈ “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
Python reviewer
Scope: *.py. Find the Python that runs the code (CI setup, shebang, python3 --version locally, macOS system Python is 3.9) and the dependencies it may use (requirements*.txt, pyproject.toml, or stdlib only).
Before reviewing
- Run the project's tests (
python3 -m unittest discover …,pytest) and any linter it configures (ruff,flake8,mypy). - Run a changed script's
--helpor dry-run mode when it has one.
Checklist
Runtime compatibility
- Syntax and APIs must exist in the lowest Python that runs the code. On 3.9: no
match, noX | Yin runtime annotations withoutfrom __future__ import annotations, nozip(strict=), notomllib. - A new third-party import in a stdlib-only project, or one missing from the requirements, breaks on a clean machine.
Files and text
open()passesencoding="utf-8". CSV files also passnewline="". Spreadsheet exports may start with a BOM: read them withutf-8-sig.- Use the
csvmodule, notsplit(","). Check the header namesDictReaderexpects. - Compare text after
unicodedata.normalize("NFC", …). Usecasefold()for case-insensitive matching. - Large inputs (JSONL dumps) are streamed line by line, not loaded whole.
- Paths come from
pathlibrelative to__file__, not the current directory. - Outputs other tools read are written atomically: a temp file, then
os.replace.
Determinism
- Generated files are byte-stable across runs: sort sets and dict keys before writing, and seed randomness. Otherwise every run produces a noisy diff.
- Each rejected or dropped item gets a reason, when the pipeline has an audit file.
Correctness traps
- Mutable default arguments (
def f(x=[])). - Closures created in a loop capture the variable, not its value.
isused to compare strings or numbers.- A bare
except:, orexcept Exception: pass, swallows real errors. Catch the specific exception, and keep or log the message. - Generators consumed twice.
Security and safety
subprocessgets a list of arguments, notshell=Truewith interpolated input. Usecheck=Truewhen failure matters.- No
eval,execorpickleon untrusted data. Useyaml.safe_load. - Network calls have a timeout. Downloaded data is treated as untrusted (run with
python -Iwhen reading a downloaded directory). - Dev servers bind
127.0.0.1and send the right MIME types (application/wasm,text/javascript).
Tests
- New logic has a test. Tests are hermetic: no network, tiny fixtures, no dependence on the current directory.
Conventions
- PEP 8 names; docstrings and type hints where the project uses them;
if __name__ == "__main__":for scripts that are also imported.
Readability
Apply reviewer-readability to the same files (names, structure, dead code, and whether comments are true, needed and well-shaped), plus:
- Docstrings are the first statement of public functions, classes and modules, in the form the project uses. Type hints where the project uses them.
- Comprehensions stay one level deep; anything longer becomes a loop or a named helper.
# noqaand# type: ignorecarry a reason.
Not findings
- Missing type hints in a project that doesn't use them.
- Formatting a formatter would fix.
Report
Use the reviewer format: [severity] path:line — problem, then failure: (the concrete input, state or platform → wrong result) and fix: (the smallest change). Most severe first. Prove each finding before reporting it, and say No findings with what you checked when there are none.
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.

