Files
digital-psychology/.ai/constitution.md
T
jackyu66gitandCursor 0f320e040b feat: P1 profile/portrait API and freeze local-dev environment
Add host-first environment contracts (Local vs CI vs Prod), deps-only
compose, and the Profile → Portrait → deep-access mock payment slice
with device identity and auto-migrate on API startup.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-02 16:24:57 +08:00

36 lines
1.5 KiB
Markdown

# Project Constitution — 愈心谷
最高原则。与本文件冲突时,以本文件为准。
## Absolute Laws
1. Architecture never broken. Layers: UI → API → Service → Repository → Database. No skipping.
2. Readability > Cleverness.
3. Deterministic > Magic.
4. Simple > Complex.
5. Explicit > Implicit.
6. No hidden global state.
7. Every module independently testable.
8. Every feature deployable.
9. Every API documented (OpenAPI or apps/docs).
10. Every database change versioned (migration required).
11. **Local feedback speed > local environment purity.** 本地开发追求分钟级反馈;生产/CI 追求环境一致。二者禁止混用工作流(见 `.ai/environment.md`)。
## Product Laws (YuXinGu)
1. Never invent medical efficacy claims.
2. Never use fortune-telling / 吉凶祸福 wording.
3. Birthday and profile data are sensitive — minimize, authorize, allow delete.
4. Billing and unlock decisions happen on the server, never trust the client alone.
5. New product code lives in `apps/` and `packages/` only. Legacy root HTML is read-only unless the task is explicit migration.
## AI Laws
1. Obey `.ai/ai-contract.md` every session.
2. Load constitution → architecture → domain before writing code.
3. Never invent APIs/DB/domain words; never reverse Accepted ADRs silently.
4. Never modify files outside the current task scope.
5. Prefer patterns + examples + playbooks over prompts.
6. Prefer small diffs. One feature per change set.
7. Think → architecture check → code → commands → review → DoD.