backend-engineering-playbook
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.
Verification
bash
uv run ruff check . uv run ruff format --check . uv run pytest