This file defines repo-specific guidance for AI coding tools and copilots.
Help developers adapt this template to any full-stack product with minimal edits to core platform components.
Treat these as platform core and avoid changing them unless explicitly requested:
app/main.pymiddleware and API bootstrappingapp/oauth2.pyauth token lifecycleapp/oauth_external.pyOAuth provider lifecycleapp/errors.pyRFC 7807 error contractapp/rate_limit.py,app/redis_client.pyruntime protection controlsapp/observability.pytelemetry hooks
Prefer adding product-specific behavior in extension paths:
app/domains/<domain_name>/...app/domains/<domain_name>/router.pywithrouter = APIRouter(...)tests/...domain-focused tests
Routers under app/domains/*/router.py are auto-discovered and mounted under /api/v1.
When building new product features:
- Add new API routes in a domain router package.
- Add/extend domain data models and Alembic migrations if persistence changes.
- Keep auth, rate limiting, and error document behavior consistent with core.
- Preserve environment-driven configuration (no hardcoded secrets).
- Add tests that validate expected behavior, not just current implementation.
Before concluding work, run:
make lintmake typecheckmake audit-securitymake test
Coverage for app/ must remain at 100%.
For new domains, use:
make scaffold-domain NAME=orders
When behavior or setup changes, update:
README.mdARCHITECTURE.mdAI_CHANGE_CHECKLIST.md