Python Review Router
Use this skill first for Python code review. Orient on context, then load only
the focused skills that match the changed code.
Before Reviewing: Orient
Check Python version from pyproject.toml, setup.cfg, tox.ini, CI, or README.
- If
>=3.10: load all relevant core skills, but apply each rule only when its Python/tool caveat matches.
- If
3.8-3.9: skip syntax rules requiring >=3.10.
- If unknown: assume minimum 3.10, but phrase version-sensitive findings conservatively.
Classify project maturity.
- Active/greenfield: full rule set is appropriate.
- Mature legacy/maintenance-only: prioritize CRITICAL and HIGH findings.
- Automation/scripts: prioritize safety, correctness, resource handling, and clear errors.
Check toolchain.
- If the project uses
pyright, do not recommend mypy-specific config.
- If the project uses
ruff, defer style/import findings to its configuration.
- If no tool is configured, make tool suggestions low-severity unless the issue is correctness-related.
Read the exact changed files before flagging issues.
- For an uncommitted review, inspect
git status --short, the unstaged diff,
the staged diff (git diff --cached), and every relevant untracked file.
Plain git diff omits untracked files.
- Before treating a failed command as a code finding, separate repository
behavior from reviewer-environment limits such as sandbox permissions,
unavailable network access, or an unwritable temporary directory. Compare
existing tests and configured CI when the failure may be environmental.
- Cite file and line for every finding.
- Do not issue generic findings without local evidence.
- A rule match is a signal, not a verdict.
Routing
| Changed code touches... |
Load |
Skip when... |
annotations, Any, casts, generics, protocols, public APIs |
py-type-safety |
change is trivial and has no typed surface |
| exceptions, validation, cleanup, retries, batch failures |
py-error-handling |
no failure path changed |
| defaults, config, resource use, ORM/API boundaries, mixed I/O/business logic |
py-anti-patterns |
change is docs/config only |
async def, event loops, FastAPI/httpx/aio*, tasks, cancellation |
py-async-patterns |
project/change is sync-only |
| formatting, names, imports, docstrings, lint/type config |
py-code-style |
tool output already covers it or review requested correctness only |
Portability Note
The "Load" column tells you which focused skill's rules to apply for each
change type. How you access those rules depends on your agent runtime:
- Dynamic loading: If your agent supports activating skills mid-session,
make the named skill discoverable and activate it when the routing table
signals its scope.
- Static checklist: Read the focused skill's
SKILL.md file directly
from the skills directory and apply its rules as a review checklist.
Both approaches produce the same review outcome. The routing table is the
decision tree; the focused skill provides the rule set.
Review Output
Lead with bugs and behavioral risks. Keep style-only findings behind correctness
findings. For legacy code, prefer actionable high-impact issues over broad
modernization advice.
Review Budget
Default to one discovery pass and one post-fix verification pass.
- The discovery pass identifies concrete findings from the complete changed
surface.
- The verification pass checks the applied fixes and looks for regressions
introduced by those fixes.
- Continue beyond those two passes only when verification exposes a new,
concrete behavioral risk. Do not repeat an unchanged review merely to seek
more confidence.
- Record commands that could not run because of reviewer-environment limits;
do not spend another review pass retrying the same unavailable capability.
Sensitive Evidence Safety
If changed code or tool output reveals a suspected credential, token, private
key, secret-bearing URL, or other sensitive value, do not quote or reproduce the
value. Report only its existence and location. Treat filename and pattern checks
as heuristic evidence, not proof that a repository is secret-free.
If the exposure appears credible, make it the first finding, stop lower-priority
review, and recommend revocation or rotation. Never place sensitive values in
reports, generated examples, or commit subjects or bodies.
1---2name: py-review3description: Route Python code review to focused skills for type safety, error handling, anti-patterns, async behavior, and code style. Use before or during Python code review to orient on project version, maturity, toolchain, changed files, and which py-* review skills should be loaded.4---56# Python Review Router78Use this skill first for Python code review. Orient on context, then load only9the focused skills that match the changed code.1011## Before Reviewing: Orient12131. Check Python version from `pyproject.toml`, `setup.cfg`, `tox.ini`, CI, or README.14 - If `>=3.10`: load all relevant core skills, but apply each rule only when its Python/tool caveat matches.15 - If `3.8-3.9`: skip syntax rules requiring `>=3.10`.16 - If unknown: assume minimum 3.10, but phrase version-sensitive findings conservatively.17182. Classify project maturity.19 - Active/greenfield: full rule set is appropriate.20 - Mature legacy/maintenance-only: prioritize CRITICAL and HIGH findings.21 - Automation/scripts: prioritize safety, correctness, resource handling, and clear errors.22233. Check toolchain.24 - If the project uses `pyright`, do not recommend `mypy`-specific config.25 - If the project uses `ruff`, defer style/import findings to its configuration.26 - If no tool is configured, make tool suggestions low-severity unless the issue is correctness-related.27284. Read the exact changed files before flagging issues.29 - For an uncommitted review, inspect `git status --short`, the unstaged diff,30 the staged diff (`git diff --cached`), and every relevant untracked file.31 Plain `git diff` omits untracked files.32 - Before treating a failed command as a code finding, separate repository33 behavior from reviewer-environment limits such as sandbox permissions,34 unavailable network access, or an unwritable temporary directory. Compare35 existing tests and configured CI when the failure may be environmental.36 - Cite file and line for every finding.37 - Do not issue generic findings without local evidence.38 - A rule match is a signal, not a verdict.3940## Routing4142| Changed code touches... | Load | Skip when... |43|-------------------------|------|--------------|44| annotations, `Any`, casts, generics, protocols, public APIs | `py-type-safety` | change is trivial and has no typed surface |45| exceptions, validation, cleanup, retries, batch failures | `py-error-handling` | no failure path changed |46| defaults, config, resource use, ORM/API boundaries, mixed I/O/business logic | `py-anti-patterns` | change is docs/config only |47| `async def`, event loops, FastAPI/httpx/aio*, tasks, cancellation | `py-async-patterns` | project/change is sync-only |48| formatting, names, imports, docstrings, lint/type config | `py-code-style` | tool output already covers it or review requested correctness only |4950## Portability Note5152The "Load" column tells you which focused skill's rules to apply for each53change type. How you access those rules depends on your agent runtime:5455- **Dynamic loading**: If your agent supports activating skills mid-session,56 make the named skill discoverable and activate it when the routing table57 signals its scope.58- **Static checklist**: Read the focused skill's `SKILL.md` file directly59 from the skills directory and apply its rules as a review checklist.6061Both approaches produce the same review outcome. The routing table is the62decision tree; the focused skill provides the rule set.6364## Review Output6566Lead with bugs and behavioral risks. Keep style-only findings behind correctness67findings. For legacy code, prefer actionable high-impact issues over broad68modernization advice.6970## Review Budget7172Default to one discovery pass and one post-fix verification pass.7374- The discovery pass identifies concrete findings from the complete changed75 surface.76- The verification pass checks the applied fixes and looks for regressions77 introduced by those fixes.78- Continue beyond those two passes only when verification exposes a new,79 concrete behavioral risk. Do not repeat an unchanged review merely to seek80 more confidence.81- Record commands that could not run because of reviewer-environment limits;82 do not spend another review pass retrying the same unavailable capability.8384## Sensitive Evidence Safety8586If changed code or tool output reveals a suspected credential, token, private87key, secret-bearing URL, or other sensitive value, do not quote or reproduce the88value. Report only its existence and location. Treat filename and pattern checks89as heuristic evidence, not proof that a repository is secret-free.9091If the exposure appears credible, make it the first finding, stop lower-priority92review, and recommend revocation or rotation. Never place sensitive values in93reports, generated examples, or commit subjects or bodies.