Backend Engineering Playbook
Goal
Deliver backend changes that are predictable, testable, and production-safe.
Default Stack (Unless User Overrides)
- •Python 3.10+
- •FastAPI
- •Pydantic v2
- •SQLAlchemy + Alembic
- •uv + ruff + pytest
Workflow
- •Confirm scope, API contract, and assumptions.
- •Design by layers: API -> service -> repository -> domain.
- •Keep handlers thin and push business logic into services.
- •Implement explicit validation, error handling, and transaction boundaries.
- •Add or update tests for happy path and edge cases.
- •Run verification before completion claim.
Quality Checklist
- •Uses typed request/response models.
- •Avoids secret leakage in logs.
- •Includes stable error responses.
- •Updates migration/docs if schema or behavior changed.
Verification
bash
uv run ruff check . uv run ruff format --check . uv run pytest