chore: seal Design Vision v1 and monorepo scaffold

Archive the differentiated YuXinGu product docs, AI engineering system,
design contract, and Go/Vue scaffold. Next execution prioritizes Cece-parity
over early innovation (see .ai/product/STRATEGY.md).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-02 16:00:44 +08:00
co-authored by Cursor
parent 2686866376
commit 2fb1dfee14
193 changed files with 8854 additions and 1851 deletions
+35 -50
View File
@@ -1,64 +1,49 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
愈心谷 is an **AI-first** Monorepo. Treat `.ai/` as the executable engineering system.
## Project overview
## On every task
愈心谷 (YuXinGu) — a digital mental health platform. The codebase is a collection of standalone, mobile-first HTML pages with no build step, no framework, no package.json, and no JavaScript dependencies.
1. Read [AGENTS.md](AGENTS.md) (load order is authoritative).
2. Especially: `.ai/ai-contract.md`, `constitution.md`, `architecture.md`, `domain.md`, `forbidden.md`.
3. Prefer `patterns/` + `examples/` + `playbooks/` over free-form invention.
4. Finish with Review + DoD + matching checklist.
The product vision is detailed in `立项文档.md` (Chinese): combine digital psychology (numerology-based personality analysis) with TCM constitution theory (中医体质) to create a "test → report → subscribe → consult" funnel. Target audience is Chinese-speaking; all UI text is Chinese (zh-CN).
## Layout
## Running the app
| Path | Role |
|---|---|
| `.ai/` | AI Engineering System (source of truth for rules) |
| `apps/api` | Go API |
| `apps/user-h5` | Vue3 user H5 |
| `apps/mini-program` | Mini-program scaffold |
| `packages/*` | sdk / types / utils / ui |
| `apps/docs/` | Human PRD / business docs (not a substitute for `.ai/`) |
## Commands
```bash
python3 server.py [port] # default port 8001
export GOPROXY=https://goproxy.cn,direct # if needed
cd apps/api && go run ./cmd/server
npm install && npm run dev:h5
```
The server serves static files from the project root and exposes two JSON API endpoints:
## Legacy
- `GET /load` — returns mindmap data from `mindmap_data.json`
- `POST /save` — persists mindmap data to `mindmap_data.json` (validates JSON before writing)
Root `yuxingu.html`, `pages/`, `server.py` = prototype. Do not extend. See [LEGACY.md](LEGACY.md).
There are no tests, no linters, and no build pipeline. To verify changes, run the server and open the relevant HTML file in a browser.
## Skill routing
## File map
When the user's request matches an available skill, invoke it. When in doubt, invoke the skill.
| File | Purpose |
|---|---|
| `index.html` | Landing page linking to all sections |
| `yuxingu.html` | Main app shell — hero, service cards, activity center, bottom nav |
| `shuzi.html` | Digital psychology calculator — life-number triangle, bagua, liuren, zodiac, wuxing modules |
| `mindmap.html` | Canvas-based mind-map editor with multi-map management |
| `yangsheng.html` | AI Eastern wellness — bazi/wuxing constitution analysis, weekly/daily reports |
| `manual.html` | Static "life manual" poster with pyramid triangle charts rendered via inline SVG |
| `yuxingu_v1.html` | Earlier iteration of the main page (kept for reference, not linked from index) |
| `server.py` | Minimal HTTP server (Python stdlib, no dependencies) |
| `立项文档.md` | Product requirements doc — market analysis, business model, pricing, MVP scope |
### Unrelated files
These files are not part of the 愈心谷 app — they belong to a separate crypto trading visualization project that happens to share the repo:
- `link_regime_chart.html` — LINK token HMM regime K-line chart
- `l2_LINK_*.json` (3 files) — market data and signals for the above
## Architecture notes
- **Every HTML file is self-contained.** All CSS and JS are embedded in `<style>` / `<script>` tags. There are no shared `.js` or `.css` files.
- **Mobile-first design** with `max-width: 430px500px` containers, `user-scalable=no`, and `env(safe-area-inset-bottom)` for notched phones.
- **CSS custom properties** define the brand palette: `--pri: #E54D42` (primary red), with per-page accent colors (gold, blue, green, orange).
- **Emoji are deliberately avoided** in the main UI — icons use CSS shapes, Unicode text symbols (△, ☯, ◈), or inline SVG.
- **Google Analytics** (`G-LVVXH3TL04`) is embedded in every HTML page via a `<script>` block in `<head>`.
- **Static assets**: `logo.png`, `logo.jpg`, `cube.jpg`. The logo is referenced from multiple pages but lives at the project root.
### Page-specific details
**`mindmap.html`** — Uses `<canvas>` for rendering with hand-rolled hit-testing, drag-to-pan, and inline text editing. Dual persistence: primary store is `localStorage` (key `yuxingu_maps`), with secondary server sync via `POST /save` and `GET /load`. The sidebar lists multiple named maps; each map is a tree with colored nodes. Data format is an array of `{name, tree: {id, text, color, children}}` objects.
**`shuzi.html`** — Full numerology engine in embedded JS: digit reduction, triangle calculation, joint codes, missing-number detection. Includes a custom base64-embedded font (`TriangleDigits`) for styled number rendering. Tabbed panels for 梅花易数, 小六壬, 大六壬, 奇门遁甲, 星座, and 五行八卦 with content rendered dynamically. Also includes a 3D bagua scene rendered on canvas.
**`yangsheng.html`** — Computes bazi (八字), five elements (五行), organ-meridian mapping, and wuyun-liuqi (五运六气) from a birth date. Weekly/daily panels use the current date to generate time-appropriate health advice. Builds on the same numerological engine concepts as `shuzi.html` but oriented toward TCM wellness rather than personality analysis.
**`manual.html`** — A static reference poster. Uses inline SVG to draw pyramid triangle charts for life-number interpretation. Different aesthetic (serif fonts, paper-like colors) from the rest of the app.
**`server.py`** — Thin wrapper around `http.server.SimpleHTTPRequestHandler`. Disables caching for HTML and JSON responses. Adds `/save` + `/load` routes. No database, no auth. Single-threaded with a 30-second socket timeout. Binds to `127.0.0.1` only (no external network access).
- Product ideas/brainstorming → `/office-hours`
- Strategy/scope → `/plan-ceo-review`
- Architecture → `/plan-eng-review`
- Design → `/design-consultation` or `/plan-design-review`
- Full review pipeline → `/autoplan`
- Bugs/errors → `/investigate`
- QA → `/qa` or `/qa-only`
- Code review → `/review`
- Ship/PR → `/ship` or `/land-and-deploy`
- Save/resume context → `/context-save` / `/context-restore`
- Spec/issue → `/spec`