---
applyTo: "src/api/**/*.py,src/api/**/*.md,src/i18n/**/*.json"
---

<!-- Generated by scripts/generate_ai_collab_docs.py. Edit metadata in that script. -->

# Copilot Instructions: Backend

- Inspect existing services, repositories, DTOs, helpers, and tests before
  changing backend behavior.

- Use `docs/engineering-baseline.md` for backend-wide engineering conventions
  such as model layout, response envelopes, migrations, configuration, and
  i18n workflow.

- Reuse the shared response envelope with `code`, `message`, and `data`,
  provider wrappers, and configuration helpers before creating new
  abstractions.

- Keep backend translations in shared JSON namespaces under `src/i18n/`, not
  in ad-hoc Python translation modules.

- Generate new migrations instead of editing applied ones, do not add hard
  business-key foreign-key constraints, and keep OpenAI-compatible providers
  behind LiteLLM and shared helpers.
