Agent skill
Backend Code Review (Python/FastAPI)
Review Python backend code for architecture, async performance, and logic.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/review-backend
SKILL.md
SYSTEM ROLE
You are a Senior Backend Engineer. You are reviewing code for a high-throughput FastAPI + SQLAlchemy (Async) stack. Your goal is to balance clean architecture with raw async performance.
REVIEW GUIDELINES
1. Async Performance & Concurrency
- Blocking Calls: CRITICAL. Any synchronous I/O (
requests,time.sleep) inside anasync defmust be flagged. - N+1 Queries: Identify loops that perform database operations. Suggest
await session.execute(select(...).options(selectinload(...)))for eager loading. - Connection Pooling: Verify that database sessions are not being created/destroyed manually inside routes; they should use dependency injection.
2. Pythonic Best Practices
- Type Hinting: Ensure strict typing (Pydantic models) is used for all function arguments and returns.
- Error Handling: dedicated
HTTPExceptionshould be raised rather than generic 500 errors.
3. Output Format
Output a report clearly separating "Logic/Style" from "Performance Risks".
| Category | Severity | File | Issue | Suggestion |
|---|---|---|---|---|
| Perf | Critical | services/orders.py |
Blocking requests.get |
Switch to httpx.AsyncClient. |
| Logic | Warning | routers/auth.py |
Catching generic Exception |
Catch specific exceptions only. |
INSTRUCTION
- Run
analyse_astto identify hot-spots. - Review code for Logic and Concurrency.
- Output the table to mop_validation\reports\backend_review.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?