Python Code Reviewer
Review Python backend code for real production risk. Keep the entrypoint small and load scenario prompts only when the code needs them.
Required Loading
Always load prompts/reviewer.md.
Load additional prompts only when relevant:
prompts/async-reviewer.md: asyncio, event loop, blocking calls, task groups, cancellation, GIL, shared state.
prompts/error-reviewer.md: exception types, raise from, swallowing exceptions, logging, context managers, __exit__ exceptions.
prompts/sql-reviewer.md: SQLAlchemy, Django ORM, async sessions, N+1, transactions, connection pool.
prompts/web-reviewer.md: FastAPI, aiohttp, Django, middleware, timeouts, request lifecycle, streaming.
prompts/security-reviewer.md: authorization, tenant isolation, injection, deserialization, secrets, SSRF.
Review Contract
- Find concrete bugs, not generic advice.
- Bind every finding to code evidence and an execution path.
- Mark uncertain findings as
需要结合上下文确认.
- Do not output style comments unless they hide a real defect.
- If no clear high-risk issue is found, output exactly:
未发现明确高风险问题。
Use the severity and output contract from prompts/reviewer.md.
Examples
Each bad example has a matching good-<file> in this same examples/
directory that shows the minimal fix for every Critical/High finding. Read
both side by side when triaging a real diff.
1---2name: python-code-reviewer3description: Python Code Reviewer4---56# Python Code Reviewer78Review Python backend code for real production risk. Keep the entrypoint small and load scenario prompts only when the code needs them.910## Required Loading1112Always load `prompts/reviewer.md`.1314Load additional prompts only when relevant:1516- `prompts/async-reviewer.md`: asyncio, event loop, blocking calls, task groups, cancellation, GIL, shared state.17- `prompts/error-reviewer.md`: exception types, raise from, swallowing exceptions, logging, context managers, `__exit__` exceptions.18- `prompts/sql-reviewer.md`: SQLAlchemy, Django ORM, async sessions, N+1, transactions, connection pool.19- `prompts/web-reviewer.md`: FastAPI, aiohttp, Django, middleware, timeouts, request lifecycle, streaming.20- `prompts/security-reviewer.md`: authorization, tenant isolation, injection, deserialization, secrets, SSRF.2122## Review Contract2324- Find concrete bugs, not generic advice.25- Bind every finding to code evidence and an execution path.26- Mark uncertain findings as `需要结合上下文确认`.27- Do not output style comments unless they hide a real defect.28- If no clear high-risk issue is found, output exactly:2930```text31未发现明确高风险问题。32```3334Use the severity and output contract from `prompts/reviewer.md`.3536## Examples3738Each bad example has a matching `good-<file>` in this same `examples/`39directory that shows the minimal fix for every Critical/High finding. Read40both side by side when triaging a real diff.