/beagle-python:fastapi-code-reviewfrom beagle-python
Reviews FastAPI code for routing patterns, dependency injection, validation, async handlers, and common pitfalls. Includes checklists and context-sensitive rules for APIRouter, Depends(), response models, and non-blocking I/O.
Ships in beagle-python. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
| Issue Type | Reference |
|---|---|
| APIRouter setup, response_model, status codes | references/routes.md |
| Depends(), yield deps, cleanup, shared deps | references/dependencies.md |
| Pydantic models, HTTPException, 422 handling | references/validation.md |
| Async handlers, blocking I/O, background tasks | references/async.md |
response_model for type safetyDepends() not manual callsasync defrequests, time.sleep, open())except in route handlersThese are idiomatic FastAPI patterns that may appear problematic but are correct:
Depends(), not passed as function argumentsresponse_model is setOnly flag issues when the context warrants it:
Depends() with an auth dependencyRun once per FastAPI-related finding, after you can anchor file:line for the handler (see review-verification-protocol) and before the finding text ships. If a step’s pass condition is not met, do not assert the finding as written—gather evidence, withdraw, downgrade severity, or rephrase as a question.
| Step | Action | Pass condition |
|---|---|---|
| 1a | Open the handler’s route decorator in the repo (not from memory). | file:line for @router.* / @app.* (or the site that registers this handler). |
| 1b | Record HTTP method, response_model=, and status_code= on that decorator (or note they are absent). | Snippet from that line or explicit absent with the same file:line. |
| Step | Action | Pass condition |
|---|---|---|
| 2a | Read the full handler body. | file:line range covering the body. |
| 2b | If claiming blocking I/O: name each blocking call (e.g. requests., open(, time.sleep, sync DB/ORM). | Each call has file:line, or withdraw the finding if none after the read. |
| Step | Action | Pass condition |
|---|---|---|
| 3a | List parameters: Depends / Annotated[..., Depends], Pydantic models, Body/Query/Path, Request/Response. | Names + mechanism tied to file:line on the signature. |
| 3b | If claiming missing auth: search the handler file (and its APIRouter module if separate) for Depends, Security, HTTPBearer, or project auth dependencies. | Citation to an existing hook, or search result: paths searched + N matches (zero is allowed). |
| 3c | If claiming missing validation: confirm the argument is not already a Pydantic model or constrained Query/Path/Body. | Type/source with file:line, or withdraw if validation already applies. |
FastAPI + Pydantic handle many concerns automatically:
Before flagging "missing" functionality, verify FastAPI isn't handling it.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub existential-birds/beagle --plugin beagle-python7 skills in this plugin
/postgres-code-reviewReviews PostgreSQL code for indexing strategies, JSONB operations, connection pooling, and transaction safety. Use when reviewing SQL queries, database schemas, JSONB usage, or connection management./pytest-code-reviewReviews pytest test code for async patterns, fixtures, parametrize, and mocking. Use when reviewing test_*.py files, checking async test functions, fixture usage, or mock patterns./python-code-reviewReviews Python code for type safety, async patterns, error handling, and common mistakes. Use when reviewing .py files, checking type hints, async/await usage, or exception handling.Other plugins' skills for the same job