# AI Contract Highest operational contract for every agent session. ## Before coding MUST read: 1. `.ai/constitution.md` 2. `.ai/architecture.md` 3. `.ai/domain.md` (+ `domain/domain-map.md` when touching models/API) 4. `.ai/definition-of-done.md`(完成标准;开始前知道何谓 Done) 5. `.ai/coding.md` 6. Task-relevant: `api.md` / `database.md` / `ui.md` / `security.md` / `testing.md` / `product/lexicon.md` + `product/feature-map.md` + **`product/feature-design.md`** + **`product/feature-spec/.md`**(该功能 Spec;§4 User Flow、§7 Rules、§9 API、§12 Acceptance 必须非空) 7. Run/dev tasks: `environment.md` + `development.md`(部署/镜像任务才读 `deployment.md` / `docker.md`) 8. UI tasks: `design/design-system.md` + `design/component-catalog.md` + `design/platform/*` 9. Competitor / reverse-engineering tasks: `design/reverse-engineering-spec.md`(STEP 1–18 · Evidence First;禁止 Demo 式省略) 10. Relevant ADR under `.ai/adr/` if changing stack or style ## After coding MUST: 1. Verify `.ai/definition-of-done.md` — **Done ≠ Code Complete** 2. Run / follow `.ai/review.md` and print **Review Report**(DoD §7) 3. Use matching checklist under `.ai/checklists/` 4. Prefer verifying with `.ai/commands.md` (build/test/health) 5. If P1 scope: update or respect labels in `product/p1-status.md`(当前为 **P1 Complete**;扩行为须新 Spec) ## Never - Guess API shape - Guess DB schema - Guess product requirement - Code new/changed feature behavior without Feature Spec(`product/feature-design.md`) - Invent endpoints, tables, or domain words not in `.ai/domain.md` / OpenAPI / task - Silently reverse an Accepted ADR - Default local workflow to full-stack Docker / rebuild app images on every code change ## If unclear **ASK FIRST.** Do not invent. Do not “assume and continue”.