Read-only pre-production audit of a FastAPI + PostgreSQL + SQLAlchemy 2.0 (async) + Alembic backend. Runs zero-dependency Python AST, migration, and security scans followed by mandatory semantic code verification and writes BACKEND_REPORT.md and findings.json with a clear verdict (NOT READY / ALMOST READY / READY). Use when asked to review, audit, or check if a FastAPI backend is ready for production.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Backend Review?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tuvatechvalley-backend-review)
---
name: backend-review
description: Read-only pre-production audit of a FastAPI + PostgreSQL + SQLAlchemy 2.0 (async) + Alembic backend. Runs zero-dependency Python AST, migration, and security scans followed by mandatory semantic code verification and writes BACKEND_REPORT.md and findings.json with a clear verdict (NOT READY / ALMOST READY / READY). Use when asked to review, audit, or check if a FastAPI backend is ready for production.
---
# Backend review (read-only)
Goal: give the user an evidence-backed pre-production verdict (`❌ NOT READY` / `⚠️ ALMOST READY` / `✅ READY`) with exact `file:line` references, explaining what will break under multi-user load, lock PostgreSQL during deploy, or leak user data. Talk to the user in their language; write the report in English.
**Read-only.** Do not modify, add, format, or delete any project code, config, or dependencies. Write only the report files.
This skill uses the scripts and guides in **fastapi-prod-ready** installed next to this folder: `<kit>` = `<this skill's folder>/../fastapi-prod-ready`. If `<kit>` is missing, instruct the user to install the full repository (all four skills) and stop.
Follow-ups belong to sibling skills: fixing findings -> **fastapi-prod-ready**; deep live concurrency proof -> **concurrency-check**; migration-only review -> **migration-review**.
## Where the report goes
Write to `<project>/reports/backend-review/` when `reports/` is git-ignored (or if the user specifies a folder). Otherwise write to a sibling folder outside the project (e.g., `../backend-review-<project>`) and report its exact path.
## 1. Run the automated AST + migration + security scan
```sh
python <kit>/scripts/backend_report.py <project> --out <report_dir> --no-fail
```
This runs `ast_audit.py`, `migration_audit.py`, and `check_forbidden.py` using Python 3.11+ stdlib only and writes `BACKEND_REPORT.md`, `findings.json`, and `MIGRATION_REPORT.md`.
## 2. Mandatory semantic code verification
AST checks eliminate string/comment noise, but business intent still requires reading the cited code. Inspect in order:
1. **Every ❌ blocking finding** — open `file:line`; confirm it, re-grade it, or drop false alarms with a one-line reason.
2. **Concurrency & data integrity (`<kit>/CONCURRENCY-AND-ASYNC.md`)** — check balance/stock/booking/coupon updates for missing row locks or atomic updates, and critical `POST` endpoints for double-click idempotency.
3. **Authorization / IDOR (`<kit>/SECURITY-AND-OPS.md`)** — inspect every `/{id}` route to confirm the caller cannot read or mutate another user's or tenant's records.
4. **Async SQLAlchemy & transaction scope (`<kit>/SQLALCHEMY-AND-POSTGRES.md`)** — verify session boundaries, `expire_on_commit=False`, `lazy="raise"`, eager loading on list endpoints, and no external HTTP calls inside DB transactions.
5. **Migrations (`<kit>/MIGRATIONS-ZERO-DOWNTIME.md`)** — inspect recent `alembic/versions/*.py` for table locks, missing timeouts, and reversible `downgrade()`.
6. **Secrets & operations** — confirm no hardcoded credentials, safe error handlers, explicit HTTP timeouts, non-root `Dockerfile`, and `/healthz` vs DB-checked `/readyz`.
## 3. Write the reviewed report
Update `<report_dir>/BACKEND_REPORT.md` following `<kit>/AUDIT-AND-REPORTING.md`:
1. **Verdict first:** `❌ NOT READY` / `⚠️ ALMOST READY` / `✅ READY`.
2. **Every finding:** what is wrong, exact `file:line`, why it fails in production, and concrete fix.
3. **"Changes to automated findings" section:** list every automated finding dropped or re-graded (with reason) plus manual findings discovered by reading code.
4. Never print secret values, tokens, passwords, or database credentials in the report.
In chat, reply in the user's language in 3–6 lines: verdict, top blockers, single next step, and report path.
## Never
- Edit project files, install dependencies, or run database migrations.
- Present an automated finding as confirmed without opening the cited file.
- Claim tests or live probes passed if they were not executed.