- Readable English names:
user_documentsnotud - Boolean:
is_active,has_permission,can_edit - Constants: UPPER_SNAKE_CASE in config.py
- Single responsibility: one function = one thing
- Max 30 lines per function
- All public functions have docstrings
- Type hints everywhere (Python 3.11+ style)
- Specific exceptions, never bare
except: - Custom exceptions in src/rag_engine/exceptions.py
- structlog for structured logs, never print()
- Log levels: debug/info/warning/error
- Pydantic v2 for all request/response models
- Settings via pydantic-settings + .env
- uv for package management (not pip)
- pyproject.toml (not setup.py)
- ruff for linting + formatting