diff --git a/.ai/ai-contract.md b/.ai/ai-contract.md index 20fa8df..336d755 100644 --- a/.ai/ai-contract.md +++ b/.ai/ai-contract.md @@ -10,7 +10,7 @@ MUST read: 2. `.ai/architecture.md` 3. `.ai/domain.md` (+ `domain/domain-map.md` when touching models/API) 4. `.ai/coding.md` -5. Task-relevant: `api.md` / `database.md` / `ui.md` / `security.md` / `product/feature-map.md` +5. Task-relevant: `api.md` / `database.md` / `ui.md` / `security.md` / `product/lexicon.md` + `product/feature-map.md` 6. UI tasks: `design/design-system.md` + `design/component-catalog.md` + `design/platform/*` 7. Relevant ADR under `.ai/adr/` if changing stack or style diff --git a/.ai/architecture.md b/.ai/architecture.md index 37b5472..6bdec66 100644 --- a/.ai/architecture.md +++ b/.ai/architecture.md @@ -1,5 +1,8 @@ # Architecture +Go 包边界(冻结):[architecture/go-services.md](architecture/go-services.md) +Domain / ERD:[domain/domain-map.md](domain/domain-map.md) · [domain/erd.md](domain/erd.md) + ## Allowed call graph ``` diff --git a/.ai/architecture/go-services.md b/.ai/architecture/go-services.md new file mode 100644 index 0000000..7bab592 --- /dev/null +++ b/.ai/architecture/go-services.md @@ -0,0 +1,40 @@ +# Go 服务边界(冻结) + +单二进制 `apps/api`;按包拆分,**禁止**跨层:Handler → Service → Repository。 +详见 [../architecture.md](../architecture.md)。 + +--- + +## Packages under `internal/service/` + +| Package | 职责 | P1 | +|---|---|---| +| `user` | 注册/游客升级/Session | Yes | +| `profile` | 个人档案 CRUD、切换 | Yes | +| `portrait` | 生成个人画像 → GrowthReport | Yes | +| `scale` | 探索测试定义与计分 | Yes | +| `relation` | RelationInsight | Yes **必做** | +| `report` | GrowthReport 读取 + **权益裁剪** | Yes | +| `ask` | Thread/Message;规则或薄 LLM | Skeleton | +| `companion` | SolarTerm 读、Mood 写 | Shell | +| `membership` | 成长会员状态与额度 | Yes | +| `order` | Order + pay-mock + DeepAccess 发放 | Yes | + +`internal/handler/`:每域一组 handler,只做 bind/validate/调用 service。 +`internal/repository/`:SQL;无 business unlock 规则(规则在 service/report + membership)。 + +--- + +## 跨域规则 + +- **权益判定**只在 `report` / `ask` / `membership` service,不在 handler、不在 H5。 +- `portrait` 与 `relation` 写 `growth_reports`;读一律走 `report.Get`(带裁剪)。 +- `ask` 强制校验 `profile` 归属当前 user。 + +--- + +## 禁止 + +- 新建 `decode` / `match` / `unlock` / `fortune` 包名 +- Handler 直连 DB +- 在 JSON 字段名使用 `luck` / `fortune` / `ji_xiong` diff --git a/.ai/design/component-catalog.md b/.ai/design/component-catalog.md index 30bf1d4..847cde9 100644 --- a/.ai/design/component-catalog.md +++ b/.ai/design/component-catalog.md @@ -118,11 +118,11 @@ Surface white, `--radius-lg`, `--shadow-card`. No random card skins. Status: **required** — Explore entry (icon + title + one line). -### ReportCard +### ReportCard(成长报告卡) Status: **required** -Decode / Match summary. Shows free conclusion; locked sections use PaywallLock. Footer disclaimer slot. +Portrait / RelationInsight summary. Free base conclusion; locked sections use PaywallLock(文案用「深度版」). Footer disclaimer. ### MoodCard @@ -138,9 +138,9 @@ Status: **required** Membership plans. Clear price · period · benefits. **MUST NOT** fake countdown / dark patterns. CTA = Primary Button. -### UnlockCard +### DeepAccessCard -Status: **required** — single Report / Match Unlock alternative to VIP. +Status: **required** — 单次深度版成长报告 / 关系理解完整建议(替代 VIP 订阅)。 --- @@ -180,7 +180,7 @@ Status: **required** — Self / Other list; “帮 TA 测” entry. ### ShareCard -Status: **required** — Decode / ScaleResult share visual; brand + one conclusion line; no medical claims. +Status: **required** — 探索结果 / 画像关键词分享;品牌 + 一句结论;无医疗与占卜声称。 ### ScaleQuestion / ScaleResultView diff --git a/.ai/design/design-system.md b/.ai/design/design-system.md index 183e74a..ffe1d97 100644 --- a/.ai/design/design-system.md +++ b/.ai/design/design-system.md @@ -248,7 +248,8 @@ Contrast for body text; touch ≥ 44px; no hover-only essentials; label interact ## 13. Brand Voice 温和、清晰、尊重。禁止恐吓 / 道德绑架 / 虚假倒计时. -Report/Ask: lifestyle disclaimer(非医疗、非算命). Labels follow `.ai/domain.md`. +成长报告 / 问答:生活建议向免责声明(非医疗、非占卜). +**中文命名强制:** `.ai/product/lexicon.md`(无「解码/运势/合盘/解锁」等禁用主文案). --- diff --git a/.ai/domain.md b/.ai/domain.md index 05998e1..9d60cb9 100644 --- a/.ai/domain.md +++ b/.ai/domain.md @@ -1,65 +1,47 @@ # Domain Language — Ubiquitous Terms -Use ONLY these words in code, API, UI copy (Chinese labels noted). -Do not invent synonyms (Customer / Client / Account) unless added here via ADR. +Use ONLY these words in code and API. +**User-facing Chinese:** [product/lexicon.md](product/lexicon.md) +**Feature tree:** [product/feature-map.md](product/feature-map.md) +**Contexts / ER:** [domain/domain-map.md](domain/domain-map.md) · [domain/erd.md](domain/erd.md) -**Bounded contexts / aggregates / ER:** [domain/domain-map.md](domain/domain-map.md) -**Product feature tree:** [product/feature-map.md](product/feature-map.md) +--- -## Identity & access +## Tech → User (frozen) -| Term | Meaning | Not | -|---|---|---| -| **Visitor** | 未登录访客;可有匿名 device id | Guest(勿混用) | -| **User** | 已注册主体(有 user id) | Customer / Client | -| **Member** | 同 User:已注册用户的业务称呼;代码字段优先 `user` | — | -| **VIP** | 付费会员期内的 User(membership active) | Member(勿把所有注册用户叫 VIP) | -| **Session** | 登录态 / token 会话 | — | +| Tech | User CN | +|---|---| +| Profile | 个人档案 | +| Portrait | 个人画像 | +| Scale | 探索测试 | +| ScaleResult / Result | 探索结果 | +| GrowthReport | 成长报告 | +| RelationInsight | 关系理解 | +| Ask | AI成长助手(Tab:问答) | +| Memory | 成长记录 | +| Mood | 心情记录 | +| SolarTerm | 节气生活 | +| Membership | 成长会员 | +| DeepAccess | 深度版 | +| Constitution | 身心探索 | -## Commerce +Deprecated aliases: Decode→Portrait · Match→RelationInsight · Unlock→DeepAccess + +--- + +## Identity | Term | Meaning | |---|---| -| **Subscription** | 会员订阅计划(月/季/年) | -| **Membership** | 用户当前会员权益状态(是否 VIP、到期时间、额度) | -| **Order** | 支付订单(报告解锁或订阅) | -| **Payment** | 一笔支付尝试 / 渠道回调结果 | -| **Refund** | 退款记录 | -| **Unlock** | 对某 Report 的购买解锁(非 VIP 也可单次解锁) | +| **Visitor** | 匿名访客 + device id | +| **User** | 注册主体 | +| **VIP** | Membership active | +| **Session** | token 会话 | -## Profile & content +--- -| Term | Meaning | -|---|---| -| **Profile** | 档案:自己或 TA 的生日等输入 | -| **Self Profile** | relation = self | -| **Other Profile** | relation = other(TA) | -| **Decode** | 愈心解码报告(数字性格 + 体质建议) | -| **Report** | 统称:Decode / Match / 尊享报告等可交付物 | -| **Match** | 双人/家庭契合度报告 | -| **Scale** | 心理量表 | -| **ScaleResult** | 量表作答与计分结果 | +## Core aggregates (names for packages/tables) -## Retention & AI +`user` · `profile` · `portrait` · `scale` · `scale_result` · `growth_report` · `relation_insight` · `ask_thread` · `ask_message` · `mood` · `memory_item` · `subscription` · `membership` · `order` · `payment` · `deep_access` -| Term | Meaning | -|---|---| -| **Companion** | 陪伴域:节气、心情 | -| **SolarTerm** | 二十四节气内容单元 | -| **Mood** | 每日心情打卡 | -| **Ask** | 「问」能力:基于 Profile 的解读对话 | -| **Consult** | 真人顾问咨询(后置) | - -## Platform - -| Term | Meaning | -|---|---| -| **user-h5** | 用户 H5 客户端 | -| **mini-program** | 微信小程序客户端 | -| **api** | Go 后端唯一服务 | -| **Legacy** | 根目录旧静态原型,只读 | - -## Naming in code - -- Go packages / JSON: `user`, `profile`, `report`, `order`, `membership`, `scale` -- Never: `customer`, `client` (except HTTP client), `account` (unless wallet later + ADR) +Never invent: `customer`, `decode`, `horoscope_luck`, `tarot` packages for P1. diff --git a/.ai/domain/README.md b/.ai/domain/README.md index 5344512..40f3fc4 100644 --- a/.ai/domain/README.md +++ b/.ai/domain/README.md @@ -1,6 +1,7 @@ -# Domain docs +# Domain | File | Purpose | |---|---| -| [../domain.md](../domain.md) | Ubiquitous language — terms only | -| [domain-map.md](domain-map.md) | Bounded contexts, aggregates, ER sketch | +| [../domain.md](../domain.md) | Tech ↔ 用户名 | +| [domain-map.md](domain-map.md) | Bounded contexts(冻结) | +| [erd.md](erd.md) | P1 表结构草案(冻结) | diff --git a/.ai/domain/domain-map.md b/.ai/domain/domain-map.md index 8fbe472..e97bc76 100644 --- a/.ai/domain/domain-map.md +++ b/.ai/domain/domain-map.md @@ -1,183 +1,42 @@ -# Domain Map — 愈心谷(DDD 视角) +# Domain Map — 冻结(P1 工程真源) -给后端 / DB / OpenAPI / SDK 用的**能力域与实体图**。 -词汇以 [../domain.md](../domain.md) 为准;产品范围以 [../product/feature-map.md](../product/feature-map.md) 为准。 -竞品能力对照:[../product/cece-feature-map.md](../product/cece-feature-map.md)。 - -AI 生成表结构或 API 时:先落本图中的 Context / Aggregate,再写 migration;禁止发明未列出的聚合根名。 +变更本文件或 ERD 需简短 ADR。词汇:[../domain.md](../domain.md) · ERD:[erd.md](erd.md) · API:`proto/openapi.yaml` · Go 边界:[../architecture/go-services.md](../architecture/go-services.md) --- -## 1. Bounded Contexts +## Bounded Contexts + +| Context | Aggregates | P1 | Owner package | +|---|---|---|---| +| Identity | User, Session, DeviceIdentity | Yes | `internal/service/user` | +| Profile | Profile | Yes | `internal/service/profile` | +| Discovery | Portrait, Scale, ScaleResult, GrowthReport | Yes | `portrait`, `scale`, `report` | +| Relation | RelationInsight | Yes **必做** | `relation` | +| Ask | AskThread, AskMessage, AskQuota | Skeleton | `ask` | +| Companion | Mood, SolarTerm | Shell | `companion` | +| Memory | MemoryItem | P2/P3 | `memory` | +| Commerce | Subscription, Membership, Order, Payment, DeepAccess | Yes mock | `order`, `membership` | +| Consult | — | P3 | — | + +--- + +## Context diagram ``` -┌─────────────┐ ┌──────────────┐ ┌─────────────┐ -│ Identity │──▶│ Profile │──▶│ Discovery │ -│ (User) │ │ Life Archive│ │ Decode/Scale│ -└─────────────┘ └──────┬───────┘ └──────┬──────┘ - │ │ - ▼ ▼ - ┌──────────────┐ ┌─────────────┐ - │ Relationship │ │ Ask │ - │ Match │ │ Companion │ - └──────┬───────┘ └──────┬──────┘ - │ │ - ▼ ▼ - ┌─────────────────────────────────┐ - │ Commerce │ - │ Subscription / Order / Unlock │ - └─────────────────────────────────┘ - │ - ┌──────────────┼──────────────┐ - ▼ ▼ ▼ - ContentFeed GrowthShare Consult(*) - (* later) +Identity → Profile → Discovery(Portrait/Scale/GrowthReport) + ↘ RelationInsight ← P1 双引擎 + ↘ Ask (+ Memory later) + ↘ Companion + ↓ + Commerce(DeepAccess/Membership) ``` -| Context | 职责 | MVP | -|---|---|---| -| **Identity** | Visitor/User/Session | Yes | -| **Profile** | Self/Other 生命档案 | Yes | -| **Discovery** | Decode、Scale、Report 生成 | Yes | -| **Relationship** | Match | Yes | -| **Ask** | 档案上下文对话、额度 | Skeleton | -| **Companion** | SolarTerm、Mood | Skeleton | -| **Commerce** | Subscription、Membership、Order、Unlock、Payment | Yes (mock) | -| **Content** | Feed 配置 | Static OK | -| **Growth** | Share 卡片元数据 | Minimal | -| **Consult** | 真人顾问 Marketplace | No | -| **Recommendation** | 推荐 | V1 rules | - --- -## 2. Aggregates & Entities(命名强制) +## Invariants -### Identity - -| Type | Name | Notes | -|---|---|---| -| Aggregate | **User** | 注册主体 | -| Entity | Session | token 会话 | -| Entity | DeviceIdentity | Visitor 匿名 | - -### Profile(生命档案) - -| Type | Name | Notes | -|---|---|---| -| Aggregate | **Profile** | `relation`: self \| other | -| VO | BirthInput | date;time/place optional later | -| VO | RelationType | partner/family/friend/… | - -### Discovery - -| Type | Name | Notes | -|---|---|---| -| Aggregate | **Report** | type: decode \| match \| … | -| Domain Svc | DecodeEngine | 可复算;结果入 Report | -| Aggregate | **Scale** | 量表定义 | -| Entity | ScaleQuestion | | -| Aggregate | **ScaleResult** | 作答 + 计分 | - -### Relationship - -| Type | Name | Notes | -|---|---|---| -| Aggregate | **Match** | 引用两个 Profile;产出 Report 或嵌入 | - -### Ask / Companion - -| Type | Name | Notes | -|---|---|---| -| Aggregate | **AskThread** | 挂 profile_id | -| Entity | AskMessage | role user/assistant | -| Entity | AskQuota | 与 Membership 联动 | -| Aggregate | **Mood** | 日维度打卡 | -| Read Model | **SolarTerm** | 日历内容;可配置表 | - -### Commerce - -| Type | Name | Notes | -|---|---|---| -| Aggregate | **Subscription** | 计划 SKU | -| Aggregate | **Membership** | 用户权益状态 | -| Aggregate | **Order** | 订阅或 Unlock | -| Entity | Payment | mock / 渠道 | -| Entity | Unlock | order → report 解锁 | - -### Content / Growth(薄) - -| Type | Name | Notes | -|---|---|---| -| Entity | FeedItem | 运营配置 | -| VO | SharePayload | 分享卡字段 | - -### Consult(Later) - -| Type | Name | Notes | -|---|---|---| -| Aggregate | Consultant | | -| Aggregate | ConsultOrder | | -| Entity | ConsultSession | | - ---- - -## 3. 关键关系(ER 草图) - -``` -User 1──* Profile -Profile 1──* Report -Profile 1──* AskThread -User 1──* ScaleResult -User 1──0..1 Membership -User 1──* Order -Order 0..1── Unlock ──▶ Report -Profile ── Match ── Profile -User 1──* Mood -``` - -权益规则:**Membership / Unlock 只由服务端判定**;客户端不可信任。 - ---- - -## 4. Context → 代码落点 - -| Context | Go | H5 | -|---|---|---| -| Identity | `internal/service/user` | login / mine | -| Profile | `service/profile` | decode form, mine | -| Discovery | `service/report`, `service/scale` | decode, explore, report | -| Relationship | `service/match` | match | -| Ask | `service/ask` | ask tab | -| Companion | `service/companion` | companion tab | -| Commerce | `service/order`, `membership` | paywall, mine | - -包名只用 `domain.md` 词汇:`user` `profile` `report` `order` `membership` `scale` `ask` `mood`。 - ---- - -## 5. 测测域 → 愈心谷域 映射 - -| 测测概念 | 愈心谷 | -|---|---| -| 星盘档案 | **Profile**(生日+体质相关输入) | -| 测测 AI | **Ask** | -| 真人 1v1 | **Consult**(后置) | -| MBTI 等 | **Scale** | -| 缘分合盘 | **Match**(合规叙事) | -| 今日运势 | **SolarTerm** + 生活建议(替换) | -| 会员 | **Subscription / Membership** | -| AI 玩法广场 | **[No] MVP** | -| 心情打卡 | **Mood** | -| 沙盘/心情小镇 | **[No]** | - ---- - -## 6. 生成顺序(给 AI) - -1. 改范围 → 更新 `product/feature-map.md` MVP 标记 -2. 新实体 → 本文件 + `domain.md` 词条(若新词) -3. migration → `playbooks/new-table.md` -4. API → `playbooks/add-api.md` + OpenAPI -5. 页面 → `playbooks/new-page.md` + design contract - -下一步可选:单独 `apps/docs/erd.md` 或 migrations 初稿(本任务不强制)。 +1. GrowthReport 完整字段仅当 Membership active **或** DeepAccess 存在。 +2. Ask 必须绑定 `profile_id`(Self 或 Other)。 +3. RelationInsight 引用两个 Profile;禁止无档案的「合婚」式空算。 +4. 客户端不可信任本地「已深度版」标志。 +5. 禁止吉凶/运势类字段名进入 schema(如 `luck_score`)。 diff --git a/.ai/domain/erd.md b/.ai/domain/erd.md new file mode 100644 index 0000000..1fdf2c4 --- /dev/null +++ b/.ai/domain/erd.md @@ -0,0 +1,172 @@ +# ERD — P1 Schema(冻结草案) + +实现时用 migration 落地;列名可微调但**表/聚合关系不得偏离**。 +类型:Postgres。敏感:生日等属 Profile,需可删账号级联。 + +--- + +## Tables + +### users +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| created_at | timestamptz | | +| status | text | active/deleted | + +### device_identities +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| device_key | text unique | Visitor | +| user_id | uuid null FK→users | 升级后绑定 | + +### profiles +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| user_id | uuid FK→users | | +| relation | text | self \| other | +| display_name | text | | +| birth_date | date | required P1 | +| birth_time | time null | optional | +| birth_place | text null | optional | +| gender | text null | | +| relation_type | text null | partner/family/friend… when other | +| created_at | timestamptz | | + +### scales +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| slug | text unique | | +| title | text | 探索测试标题 | +| status | text | published/draft | + +### scale_questions +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| scale_id | uuid FK | | +| sort | int | | +| body | jsonb | 题干与选项 | + +### scale_results +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| user_id | uuid FK | | +| scale_id | uuid FK | | +| profile_id | uuid FK | | +| answers | jsonb | | +| result | jsonb | 探索结果摘要(可公开字段) | +| created_at | timestamptz | | + +### growth_reports +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| user_id | uuid FK | | +| profile_id | uuid FK | | +| type | text | portrait \| relation \| … | +| summary | jsonb | **基础版**,始终可按规则返回 | +| detail | jsonb | **深度版**,服务端按权益剥离 | +| created_at | timestamptz | | + +### relation_insights +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| user_id | uuid FK | | +| profile_a_id | uuid FK | usually self | +| profile_b_id | uuid FK | other | +| summary | jsonb | 对比标签等基础 | +| report_id | uuid null FK→growth_reports | 深度建议所在报告 | +| created_at | timestamptz | | + +### ask_threads +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| user_id | uuid FK | | +| profile_id | uuid FK | 当前解读对象 | +| created_at | timestamptz | | + +### ask_messages +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| thread_id | uuid FK | | +| role | text | user \| assistant | +| content | text | | +| created_at | timestamptz | | + +### memberships +| column | type | notes | +|---|---|---| +| user_id | uuid PK FK→users | | +| plan | text | month/quarter/year | +| status | text | active/expired | +| expires_at | timestamptz | | +| ask_quota_left | int | | + +### orders +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| user_id | uuid FK | | +| kind | text | membership \| deep_access | +| amount_cents | int | | +| status | text | created/paid/failed | +| created_at | timestamptz | | + +### payments +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| order_id | uuid FK | | +| channel | text | mock \| wechat… | +| status | text | | +| raw | jsonb null | | + +### deep_accesses +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| user_id | uuid FK | | +| report_id | uuid FK→growth_reports | | +| order_id | uuid FK | | +| created_at | timestamptz | | + +### moods(P2 可先建表空用) +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| user_id | uuid FK | | +| day | date | | +| score | int null | | +| note | text null | | + +### memory_items(P3) +| column | type | notes | +|---|---|---| +| id | uuid PK | | +| user_id | uuid FK | | +| kind | text | | +| payload | jsonb | | +| created_at | timestamptz | | + +--- + +## Relationship sketch + +``` +users 1──* profiles +users 1──* scale_results +users 1──* growth_reports +users 1──0..1 memberships +users 1──* orders 1──* payments +growth_reports 1──* deep_accesses +profiles ── relation_insights ── profiles +users 1──* ask_threads 1──* ask_messages +``` diff --git a/.ai/file-map.md b/.ai/file-map.md index 2217ac3..ba6a47b 100644 --- a/.ai/file-map.md +++ b/.ai/file-map.md @@ -58,10 +58,14 @@ Rules, ADR, patterns, examples, playbooks, checklists. Not runtime code. | Path | Owns | |---|---| -| `product/feature-map.md` | 愈心谷 L0/L1/L2 + MVP 标记 | -| `product/cece-feature-map.md` | 测测竞品合并 Feature Tree | -| `domain/domain-map.md` | Bounded contexts / aggregates / ER | -| `domain.md` | Ubiquitous terms only | +| `product/lexicon.md` | 产品中文语言契约(最高优先级) | +| `product/user-journey.md` | 转化路径 | +| `product/page-tree.md` | H5 路由冻结 | +| `product/feature-map.md` | 能力树 · 五 Tab 冻结 | +| `product/ENGINEERING-FREEZE.md` | P1 真源索引 | +| `domain/domain-map.md` + `erd.md` | Contexts + 表结构 | +| `architecture/go-services.md` | Go 包边界 | +| `domain.md` | Tech ↔ 用户名 | ### .ai/design/ diff --git a/.ai/playbooks/new-page.md b/.ai/playbooks/new-page.md index b616e22..4fb77a9 100644 --- a/.ai/playbooks/new-page.md +++ b/.ai/playbooks/new-page.md @@ -5,14 +5,15 @@ Use when: “新增页面” ## Steps 1. Confirm IA tab vs secondary page (`.ai/ui.md`) -2. Read `.ai/design/design-system.md` + `component-catalog.md` + `design/platform/h5.md` -3. Reuse catalog components; update catalog if adding a new one -4. Add route in `apps/user-h5/src/router` -5. Add `pages/XxxPage.vue` (PascalCase); tokens only (no raw brand hex) -6. Extract components if file approaches 300–400 lines -7. Data via `src/api` → `@yuxingu/sdk` only -8. Use domain words from `.ai/domain.md` -9. Loading / empty / error states -10. Compliance copy if report-like -11. `npm run build:h5` -12. Review + checklist/feature.md +2. Read `.ai/product/lexicon.md` + `feature-map.md`(文案禁用词) +3. Read `.ai/design/design-system.md` + `component-catalog.md` + `design/platform/h5.md` +4. Reuse catalog components; update catalog if adding a new one +5. Add route in `apps/user-h5/src/router` +6. Add `pages/XxxPage.vue` (PascalCase); tokens only (no raw brand hex) +7. Extract components if file approaches 300–400 lines +8. Data via `src/api` → `@yuxingu/sdk` only +9. Domain terms from `.ai/domain.md`;UI 中文从 lexicon +10. Loading / empty / error states +11. Compliance copy if 成长报告-like +12. `npm run build:h5` +13. Review + checklist/feature.md diff --git a/.ai/product/ENGINEERING-FREEZE.md b/.ai/product/ENGINEERING-FREEZE.md new file mode 100644 index 0000000..84d10f6 --- /dev/null +++ b/.ai/product/ENGINEERING-FREEZE.md @@ -0,0 +1,27 @@ +# Engineering Freeze — 进入 P1 开发前真源 + +以下文件为 **P1 冻结输入**;改动需 ADR 或产品确认。 + +| # | 真源 | 路径 | +|---|---|---| +| 1 | 产品语言 | `product/lexicon.md` | +| 2 | 能力树 + 冻结 IA | `product/feature-map.md` | +| 3 | 用户旅程 | `product/user-journey.md` | +| 4 | H5 页面树 | `product/page-tree.md` | +| 5 | 域词 | `domain.md` | +| 6 | Domain Map | `domain/domain-map.md` | +| 7 | ERD | `domain/erd.md` | +| 8 | API Contract | `proto/openapi.yaml` | +| 9 | Go 服务边界 | `architecture/go-services.md` | +| 10 | Design System | `design/design-system.md` | + +下一步:**按 P1 竖切实现**(Profile → Portrait → RelationInsight → Scale → Commerce mock → Ask 壳),不再横向加功能。 + +## Review 清单(合并前必过) + +1. 用户可见文本是否仅来自 lexicon?有无旧产品词/玄学预测? +2. 路由是否落在 page-tree? +3. Domain / 表名是否符合 domain.md(无 decode/luck 等)? +4. 权益是否只在服务端裁剪? +5. 关系理解是否仍在 P1 路径中(双引擎)? +6. 数据模型是否留有 Memory / Consult 扩展位(不阻塞 P1)? diff --git a/.ai/product/README.md b/.ai/product/README.md index 960f1c5..100cdec 100644 --- a/.ai/product/README.md +++ b/.ai/product/README.md @@ -1,12 +1,13 @@ -# Product docs for AI agents +# Product docs(AI 真源) -| File | Audience | Purpose | -|---|---|---| -| [STRATEGY.md](STRATEGY.md) | All agents | **执行优先级**:先测测 parity,Vision v1 已封存 | -| [feature-map.md](feature-map.md) | PRD / H5 / API | 愈心谷差异化能力树(Design Vision v1) | -| [cece-feature-map.md](cece-feature-map.md) | Competitor / parity | 测测 Feature Tree — 下一版对齐主参考 | -| [../domain/domain-map.md](../domain/domain-map.md) | Backend / DB / OpenAPI | Bounded contexts & entities | -| [../domain.md](../domain.md) | All code | Ubiquitous language (terms only) | +| File | Purpose | +|---|---| +| [ENGINEERING-FREEZE.md](ENGINEERING-FREEZE.md) | **P1 冻结清单** | +| [lexicon.md](lexicon.md) | 产品语言契约(最高优先级) | +| [feature-map.md](feature-map.md) | 能力树 · 五 Tab 冻结 | +| [user-journey.md](user-journey.md) | 转化路径(含关系分享引擎) | +| [page-tree.md](page-tree.md) | H5 路由树 | +| [STRATEGY.md](STRATEGY.md) | 参考模型 ≠ 复制品牌 | +| [cece-feature-map.md](cece-feature-map.md) | 竞品对照(勿抄 UI) | -Product narrative docs (human PRD): `apps/docs/`. -**冲突时:** `STRATEGY.md` 的 parity 执行 > Vision v1 创新项。 +冲突:`lexicon` > `feature-map` / `user-journey` > 历史文档。 diff --git a/.ai/product/STRATEGY.md b/.ai/product/STRATEGY.md index 5d751bc..003451b 100644 --- a/.ai/product/STRATEGY.md +++ b/.ai/product/STRATEGY.md @@ -1,32 +1,26 @@ -# Product Strategy Snapshot +# Product Strategy -## Sealed design (this repo state) +## 原则 -Documented vision: **愈心谷差异化** — 数字性格 + 中医体质 + 关系档案 + 节气,学测测飞轮但替换运势主叙事。 +| 参考竞品 | 愈心谷自己的 | +|---|---| +| 功能模型 | 品牌语言(见 [lexicon.md](lexicon.md)) | +| 用户路径 | 功能命名 | +| 商业模型(测评→档案→AI→会员→咨询) | 叙事:成长 / 认识自己 / 理解他人 | -Canonical docs at seal time: +**不是**竞品复制品。UI/PRD/Ask **禁止**出现:测测(自称)、解码、运势、塔罗、吉凶、命理预测;星盘不作核心叙事。 -- `product/feature-map.md` — 愈心谷能力树(含 MVP 标记) -- `product/cece-feature-map.md` — 测测竞品树 -- `domain/domain-map.md` — 领域模型 -- `apps/docs/prd-mvp.md` · `business-model.md` · `product-roadmap.md` -- `.ai/design/*` — Design System Contract - -Treat the above as **Design Vision v1(已封存)** — 可对照、可回退,不作为下一迭代的强制做完清单。 +封存的差异化长文设计见 git tag `design-vision-v1`(历史参考)。 --- -## Next build direction(执行优先) +## 执行分期(与 feature-map 对齐) -**先出一版和测测结构类似的产品,不要一上来就创新。** +1. **P1** — 档案 · 性格探索/画像 · 人格测评 · 关系理解 · 问答 · 深度版 · 会员 +2. **P2** — 身心探索 · 节气陪伴 · 心情记录 · 成长计划 +3. **P3** — 长期记忆 · 成长数据库 · 真人顾问 -| 原则 | 含义 | -|---|---| -| IA 对齐测测 | 首页发现 · 问(AI)· 在线/咨询位 · 消息或可后置 · 我的 | -| 能力对齐测测漏斗 | 测评拉新 → 档案 → AI 问 → 会员 → 咨询占位 | -| 叙事可先「泛心理 + 星座/性格」 | 体质/节气差异化后置,不阻塞首版 | -| 不做冷启动重资产 | 不做达人双边冷启动、不做硬件、不做 UGC 玩法广场首版 | +冲突时:**lexicon + feature-map > 历史 Vision 文档中的旧命名(解码/Unlock 等)**。 -差异化 Vision v1 在首版跑通测测式漏斗后再渐进引入(Decode 体质、节气陪伴等)。 - -执行时以即将撰写的 **Cece-parity PRD / feature-map-v0** 为准;冲突时:**parity 执行 > Vision v1 创新项**。 +工程冻结清单:[ENGINEERING-FREEZE.md](ENGINEERING-FREEZE.md)。 +P1 双引擎:个人画像 **与** 关系理解,不可只做「我是谁」。 diff --git a/.ai/product/feature-map.md b/.ai/product/feature-map.md index 988fdf6..58f9076 100644 --- a/.ai/product/feature-map.md +++ b/.ai/product/feature-map.md @@ -1,212 +1,210 @@ # 愈心谷 — Product Feature Map -**权威产品能力树**(PRD / 路由 / 竖切范围以此为准)。 -竞品原文树:[cece-feature-map.md](cece-feature-map.md) -领域实体:[../domain/domain-map.md](../domain/domain-map.md) -词汇:[../domain.md](../domain.md) · PRD:`apps/docs/prd-mvp.md` +**权威产品能力树。** 语言以 [lexicon.md](lexicon.md) 为准。 +参考测测的是:**功能模型 · 用户路径 · 商业模型**;品牌叙事与命名必须是愈心谷自己的。 +领域实体:[../domain/domain-map.md](../domain/domain-map.md) · 词汇:[../domain.md](../domain.md) +竞品对照(可含竞品原名):[cece-feature-map.md](cece-feature-map.md) +策略:[STRATEGY.md](STRATEGY.md) -标记:`[MVP]` `[V1]` `[Later]` `[No]` +标记:`[P1]` 第一阶段 · `[P2]` 第二阶段 · `[P3]` 第三阶段 · `[No]` --- -## L0 — App 信息架构 +## 定位 + +愈心谷 = 通过数字性格、身心特征、关系理解与 AI 陪伴,帮助用户更好地认识自己、理解他人的个人成长平台。 + +### 核心飞轮 + +``` +探索自己 → 建立个人档案 → 获得个性化分析 + → AI 持续陪伴 → 会员深入体验 → 长期成长记录 +``` + +--- + +## L0 信息架构(冻结) ``` 愈心谷 -├── 首页 HomeWash:品牌 + Decode + Feed -├── 探索 Scale / Decode / 轻工具 -├── 问 Ask(战略中心 Tab) -├── 陪伴 SolarTerm + Mood -├── 我的 Life Profile 资产 -├── 增长运营(横切) -└── 平台生态(横切 · 后置) +├── 首页 发现与入口中心 +├── 探索 核心功能中心 +├── 问答 AI 成长助手(战略中心 Tab) +├── 陪伴 日常留存 +└── 我的 档案 / 成长报告 / 成长会员 ``` -路径:`发现 → 建档/测评 → 问/陪伴留存 → 会员·解锁 →(后)Consult` +**五 Tab 名称与顺序冻结,未经 ADR 不得改。** +路径见 [user-journey.md](user-journey.md)。 +P1 双引擎:**个人画像 + 关系理解**(不可弱化关系侧)。 --- -## L1 — 产品能力树(合并 IA × Domain) +## 1. 首页(发现与入口中心) -``` -愈心谷 Feature Tree -├── 1. Identity & 生命档案 -├── 2. Self Discovery(自我探索) -├── 3. Relationship(关系) -├── 4. AI Companion(问) -├── 5. Companion Rhythm(陪伴节奏) -├── 6. Human Expert(真人 · 后置) -├── 7. Content & Feed -├── 8. Growth -├── 9. Commerce -└── 10. Data & Recommendation(平台能力) -``` +### 1.1 创建个人档案 `[P1]` + +| 三级 | 内容 | +|---|---| +| 1.1.1 我的信息 | 出生日期;出生时间/地点(可后置);性别 | +| 1.1.2 关系对象 | 伴侣 · 家人 · 朋友 | +| 1.1.3 档案管理 | 编辑 · 删除 · 切换 | + +### 1.2 快捷功能入口(九宫格) + +性格探索 · 人格测试 · 关系分析 · 个人画像 · AI问答 · 身心探索 · 节气陪伴 · 会员中心 · 更多 + +(身心探索 / 节气:`[P1]` 可轻入口,深做在 `[P2]`) + +### 1.3 推荐内容 `[P1]` 静态/运营即可 + +今日推荐 · 热门探索 · 成长文章 · 用户故事 · 精选成长报告 --- -### 1. Identity & 生命档案 +## 2. 探索(核心功能中心) -| 二级 | 三级 | 范围 | +### 2.1 性格探索 `[P1]` + +帮助用户了解行为模式。 + +| 三级 | 内容 | +|---|---| +| 2.1.1 性格测试 | 人格类型 · 行为偏好 · 思维方式 | +| 2.1.2 成长报告 | 免费:基础画像;会员/深度版:完整分析 | +| 2.1.3 分享卡片 | 关键词 · 性格标签 | + +### 2.2 人格测评 `[P1]` + +MBTI 类 · 沟通方式 · 情感模式 · 成长倾向(首版 ≥1 个热门) + +### 2.3 个人画像(成长画像) `[P1]` + +替代竞品「星盘档案」叙事。内容:性格特点 · 兴趣倾向 · 行为模式 · 关系特点 · 生活建议 + +### 2.4 关系理解 `[P1 · 双引擎之一,不可砍]` + +| 三级 | 内容 | +|---|---| +| 2.4.1 创建关系 | 添加 TA | +| 2.4.2 双人分析 | 了解双方差异(沟通/行为标签对比) | +| 2.4.3 相处建议 | 沟通方式 · 互动模式 · 关系维护(深度版) | +| 2.4.4 分享卡 | 「我的方式 vs TA 的方式 → 查看关系理解」 | + +禁止宿命/恐吓文案。增长价值不低于个人画像。 + +### 2.5 身心探索 `[P2]`(差异化,首版可弱入口) + +| 三级 | 内容 | +|---|---| +| 2.5.1 体质倾向 | 了解身体特点 | +| 2.5.2 生活习惯建议 | 饮食 · 作息 · 运动 | +| 2.5.3 节气提醒 | 季节变化 · 生活调整 | + +禁止:治疗、改善疾病、疗效承诺。 + +--- + +## 3. 问答(AI 核心) + +### 3.1 AI 成长助手 `[P1]` + +定位:了解你的智能伙伴。不是占卜,不是预测。 + +| 三级 | 内容 | +|---|---| +| 3.1.1 自我提问 | 性格 · 关系 · 成长 | +| 3.1.2 档案关联回答 | 结合个人档案与探索结果 | +| 3.1.3 深度分析 | 会员 / 深度版 | + +### 3.2 AI 场景入口 `[P1]` + +认识自己 · 理解关系 · 职业探索 · 情绪整理 · 生活建议 + +顶栏:切换「我的档案 / TA 的档案」。可并列「顾问预约」占位(履约 `[P3]`)。 + +--- + +## 4. 陪伴(日常留存)`[P2]` 主做;`[P1]` 可占位壳 + +### 4.1 今日状态 + +心情记录 · 今日感受 · 成长记录 + +### 4.2 节气生活 + +今日节气 · 季节变化 · 日常建议(生活建议,非运势) + +--- + +## 5. 我的(个人中心)`[P1]` + +| 二级 | 内容 | +|---|---| +| 5.1 我的档案 | 个人资料 · 探索记录 · 关系记录 | +| 5.2 我的成长报告 | 已完成探索 · 已购深度版 · 收藏 | +| 5.3 会员中心 | 完整分析 · 高级成长报告 · AI 更多次数 · 专属内容 | + +--- + +## 6. 商业体系(模型参考成熟产品,话术用愈心谷) + +### 6.1 深度版成长报告 `[P1]` + +- 免费:基础结果 / 基础画像 +- 付费:完整分析 · 行为模式 · 关系建议 · 成长方向 + +### 6.2 会员订阅 `[P1]` + +月会员 · 季度会员 · 年度会员(支付可先 mock) + +### 6.3 `[No]` 首版 + +干扰广告 · 塔罗商城主路径 · 达人双边冷启动 · 硬件 + +--- + +## 分期范围 + +### 第一阶段 `[P1]` — 必须 + +用户档案 · 性格探索 · 个人画像 · 关系理解 · AI 问答 · 成长报告深度版 · 会员系统 + +### 第二阶段 `[P2]` + +体质/身心探索 · 节气陪伴 · 心情记录 · 成长计划 + +### 第三阶段 `[P3]` + +长期 AI 记忆 · 个人成长数据库 · 真人咨询 · 专家服务 + +--- + +## L2 路由(冻结 · user-h5) + +| 路径 | 页面 | 说明 | |---|---|---| -| 1.1 注册登录 | 手机 / 微信 / 游客 device / 升级 User | [MVP] 游客+升级;微信 [V1] | -| 1.2 Self Profile | 生日(必填);时辰/地点(可选后置) | [MVP] 生日 | -| 1.3 Other Profile | 伴侣/家人/朋友等关系对象 | [MVP] 基础 Other | -| 1.4 档案管理 | 编辑 · 删除 · 多档案切换 · Ask 关联 | [MVP] | -| 1.5 兴趣标签 | 性格/关系/养生等(非运势标签) | [V1] | -| 1.6 行为资产 | 浏览 · Decode · Scale · Ask · Order 记录 | [MVP] 服务端最小集 | +| `/` | 首页 | 发现入口 | +| `/explore` | 探索 | 探索测试列表等 | +| `/ask` | 问答 | AI成长助手 | +| `/companion` | 陪伴 | 节气/心情 | +| `/mine` | 我的 | 资产总览 | +| `/profile` | 个人档案 | 创建/编辑/切换 Self·Other | +| `/portrait` | 个人画像 | 性格探索结果 | +| `/relation` | 关系理解 | 双人分析 | +| `/membership` | 成长会员 | 套餐与权益 | +| `/scales/:slug` | 探索测试作答 | | +| `/reports/:id` | 成长报告详情 | | -**[No]** 出生地理风水必填、吉凶标签画像。 +兼容重定向:`/decode` → `/portrait`(仅技术兼容,UI 不出现 decode 文案)。 --- -### 2. Self Discovery(获客工具层) +## 护城河(愈心谷) -| 二级 | 三级 | 范围 | -|---|---|---| -| 2.1 Decode | 数字性格 + 体质倾向;简版结论 / 完整原因+方案 | **[MVP] 核心** | -| 2.2 Scale 性格 | MBTI 等热门量表 · 结果页 · 分享 | [MVP] ≥1 热门 | -| 2.3 Scale 情感/心理 | 恋爱人格、情绪压力等 | [V1] | -| 2.4 趣味 Scale | 轻传播向 | [V1] 克制 | -| 2.5 五行/八卦轻解读 | 挂在 Decode 或探索,非运势主叙事 | [V1] | -| 2.6 中医体质系统 | 体质倾向 · 生活建议 · 节气联动 | [MVP] 在 Decode 内;深化 [V1] | - -**[No]** 塔罗默认入口、紫微/抽签主路径、今日运势主 Feed。 -**[Later]** 易经决策系统(合规评审后)。 - ---- - -### 3. Relationship - -| 二级 | 三级 | 范围 | -|---|---|---| -| 3.1 Match | 双人契合分预览 · 解读锁定 | [MVP] | -| 3.2 相处建议 | 基于性格×体质,非合婚吉凶 | [MVP] 简版;[V1] 完整 | -| 3.3 关系管理 | 重要日期、关系笔记 | [Later] | - -**[No]** 八字合婚吉凶、缘分指数恐吓文案。 - ---- - -### 4. AI Companion(问 = AI Life Assistant) - -| 二级 | 三级 | 范围 | -|---|---|---| -| 4.1 Ask 对话 | 性格 / 关系 / 养生路径引导;非运势默认 | [MVP] 规则模板或薄 LLM | -| 4.2 上下文 | 当前 Profile(Self/Other)挂载 | **[MVP]** | -| 4.3 视角切换 | Ask 顶栏显式切换档案 | [MVP] | -| 4.4 结构化回答 | 短答 · 要点 · 免责声明 | [MVP] | -| 4.5 长期记忆 | 跨会话情绪/事件记忆 | [V1+] | -| 4.6 报告生成 | 从 Ask/Decode 生成可 Unlock Report | [V1] | -| 4.7 双轨入口 | Ask ‖ Consult 占位切换 | [MVP] 占位;履约 [Later] | - -**[No]** 多智能体并列品牌(灵犀/小智式)、算命引导语、AI 心情小镇级 3D。 - -人格模式(产品语义,非多 App):陪伴模式 / 解读模式 — [V1]。 - ---- - -### 5. Companion Rhythm(陪伴 Tab) - -| 二级 | 三级 | 范围 | -|---|---|---| -| 5.1 SolarTerm | 今日节气 · 生活方式建议 | [MVP] 可静态 | -| 5.2 Mood | 打卡 · 简史 | [MVP] 最小写 | -| 5.3 情绪分析/练习 | 安抚话术、放松练习 | [V1] | -| 5.4 成长计划 | 目标 · 打卡 · 成长报告 | [Later] | - -**[No]** 运势日历作为陪伴主轴。 - ---- - -### 6. Human Expert(Consult) - -| 二级 | 三级 | 范围 | -|---|---|---| -| 6.1 顾问类型 | 养生顾问 / 关系顾问(合规资质) | [Later] | -| 6.2 流程 | 列表 · 预约 · 支付 · 会话 · 评价 | [Later] | -| 6.3 Marketplace | 达人入驻 · 分佣 | [Later] 非冷启动优先 | - -**[MVP]** 仅「顾问预约」表单占位,不履约。 - ---- - -### 7. Content & Feed - -| 二级 | 三级 | 范围 | -|---|---|---| -| 7.1 首页 Feed | 官方卡片:热门 Scale、Decode、节气 | [MVP] 运营配置/静态 | -| 7.2 文章 | 性格 / 关系 / 养生知识 | [V1] | -| 7.3 社区 UGC | 发帖赞评关注 | **[No] MVP**;[Later] 审慎 | -| 7.4 AI 玩法广场 | UGC Prompt 集市 | **[No] MVP**;[Later] | - ---- - -### 8. Growth - -| 二级 | 三级 | 范围 | -|---|---|---| -| 8.1 分享卡 | Decode / ScaleResult / Match 预览 | [MVP] | -| 8.2 裂变 | 分享 → 建档 → 再测 | [V1] | -| 8.3 激励 | 签到积分勋章 | [Later] | -| 8.4 SEO/内容获客 | Web 落地 | [Later] website | - -**[No]** 干扰广告、虚假紧迫倒计时。 - ---- - -### 9. Commerce - -| 二级 | 三级 | 范围 | -|---|---|---| -| 9.1 Subscription | 月/季/年 | [MVP] mock 支付 | -| 9.2 Membership 权益 | 完整 Decode、Ask 次数、深度节气等 | [MVP] | -| 9.3 Unlock | 单次报告 / Match 解读 | [MVP] | -| 9.4 Order / Payment | 下单 · pay-mock ·(真支付) | [MVP] mock;真支付 [V1] | -| 9.5 课程/商城 | — | [Later] / 低优 | - ---- - -### 10. Data & Recommendation(平台) - -| 二级 | 三级 | 范围 | -|---|---|---| -| 10.1 用户数据 | 行为 · Mood · Scale · Ask(最小化、可删) | [MVP] 基础 | -| 10.2 推荐 | Feed / Scale 推荐 | [V1] 规则即可 | -| 10.3 专家/商品推荐 | — | [Later] | - ---- - -## L2 — 页面 / 路由映射(user-h5) - -| L0 | 路由建议 | 主要能力 | -|---|---|---| -| 首页 | `/` | Decode 入口、Feed | -| 探索 | `/explore` | Scale 列表、工具 | -| 问 | `/ask` | Ask + Consult 占位 | -| 陪伴 | `/companion` | SolarTerm、Mood | -| 我的 | `/mine` | Profiles、Membership、Orders | -| 二级 | `/decode` `/scales/:slug` `/match` `/report/:id` | Discovery / Relationship / Commerce | - -实现约束:`.ai/design/*` · playbook `new-page` / `add-api`。 - ---- - -## 护城河优先级(愈心谷) - -| 梯队 | 能力 | 说明 | -|---|---|---| -| ★★★★★ | 生命档案 Profile · Ask 挂档案 · Relationship Match · Decode(性格×体质) | Memory + 差异化叙事 | -| ★★★★ | Scale · SolarTerm/Mood · Membership/Unlock | 获客与留存与变现 | -| ★★ | Feed 运营 · 分享裂变 | 增长 | -| ★ / No | UGC 广场 · 达人市场 · 硬件 · 塔罗主路径 | 明确后置或不做 | - ---- - -## 竖切顺序(与 roadmap 对齐) - -1. **Phase A** — Identity + Decode + Commerce mock -2. **Phase B** — Scale + Match + Share -3. **Phase C** — Ask 骨架 + Companion -4. **Phase D** — 真支付 · 小程序 · Consult 试点 - -详见 `apps/docs/product-roadmap.md`。 +| 梯队 | 能力 | +|---|---| +| ★★★★★ | 个人档案 · 问答挂档案 · 关系理解 · 个人画像(性格×身心) | +| ★★★★ | 人格测评 · 会员/深度版 · 陪伴节奏 | +| ★★ | 推荐 Feed · 分享裂变 | +| 后置/不做 | UGC 玩法广场 · 达人市场冷启动 · 塔罗主路径 · 运势主 Feed | diff --git a/.ai/product/lexicon.md b/.ai/product/lexicon.md new file mode 100644 index 0000000..2584708 --- /dev/null +++ b/.ai/product/lexicon.md @@ -0,0 +1,101 @@ +# 愈心谷产品语言契约(Mandatory) + +所有 PRD、UI 文案、运营文案、Ask 引导语、错误提示必须遵守。 +竞品分析(`cece-feature-map.md`)可保留竞品原名;**用户可见文本不得出现禁用词。** + +--- + +## Product Lexicon Rules + +1. **所有用户可见文本必须来自本文件的推荐词或「核心命名」表。** +2. AI 生成文案前必须先读本文件;不得按公开竞品习惯自动套词。 +3. 数据库注释、OpenAPI `summary`/`description`(对外)、H5/小程序文案同规则。 +4. 代码标识符用英文域词(见下表);中文 UI 用「用户名」列。 +5. 不确定时:**ASK**,不要发明近义词(如「开运」「解盘」)。 + +### 禁止(含近义) + +- 运势 / 今日运势 / 开运 +- 吉凶 / 祸福 / 命中注定 +- 预测未来 / 预知 / 改命 +- 算命 / 解盘 / 合婚(恐吓或宿命叙事) +- 命盘(作核心产品名)/ 合盘 / 缘分合盘 +- 解码 / 愈心解码(产品主文案) +- 解锁(付费墙主按钮文案;技术日志可用 deep_access) +- 治疗 / 改善疾病 / 疗效承诺 +- 塔罗(主路径入口) +- 以「测测」自称或对用户说「像某某 App」 + +### 推荐 + +- 了解 · 探索 · 分析 · 建议 +- 关系理解 · 成长方向 · 成长报告 · 深度版 +- 个人档案 · 个人画像 · 探索测试 · 探索结果 +- AI 成长助手 · 心情记录 · 成长记录 · 成长会员 +- 生活建议 / 今日建议(替代运势) + +--- + +## 定位一句话 + +愈心谷 = 通过数字性格、身心特征、关系理解与 AI 陪伴,帮助用户更好地认识自己、理解他人的个人成长平台。 + +--- + +## 技术名 → 用户名(冻结) + +| 技术名 | 用户名 | 说明 | +|---|---|---| +| Profile | 个人档案 | Self / Other | +| Portrait | 个人画像 | 性格探索产出的成长画像 | +| Scale | 探索测试 | 含 MBTI 类等 | +| ScaleResult / Result | 探索结果 | 测评产出 | +| GrowthReport / Report | 成长报告 | 可含基础版/深度版字段 | +| RelationInsight | 关系理解 | 双人差异与相处建议 | +| Ask | AI成长助手 | Tab 文案可用「问答」 | +| Memory | 成长记录 | P2/P3 跨会话沉淀 | +| Mood | 心情记录 | | +| SolarTerm | 节气生活 | | +| Membership | 成长会员 | | +| DeepAccess | 深度版 | 单次完整分析 | +| Constitution | 身心探索 | 体质倾向等,非医疗 | + +**Deprecated code aliases(勿用于新 UI):** Decode→Portrait · Match→RelationInsight · Unlock→DeepAccess + +--- + +## 禁用 → 使用(速查) + +| 不使用 | 使用 | +|---|---| +| 解码 | 性格探索 / 个人画像 | +| 测算 | 分析 | +| 测试结果(主文案) | 探索结果 | +| 运势 | 生活建议 / 今日建议 | +| 命盘 / 星盘档案(核心) | 个人画像 | +| 合盘 | 关系理解 | +| 解锁(主按钮) | 查看深度版 / 完整分析 | +| 算命 | 自我探索 | +| 预测未来 | 了解趋势 / 认识模式 | +| 改命 | 成长改善 | +| 会员(若需品牌感) | 成长会员(权益页标题优先) | + +星盘:探索内可选维度,禁止作家园主标题/品牌 slogan。 + +--- + +## Ask 人设 + +- 是:了解你的智能伙伴 +- 不是:占卜、预测、算命 + +场景:认识自己 · 理解关系 · 职业探索 · 情绪整理 · 生活建议 + +--- + +## 付费墙话术 + +- 免费:基础画像 / 基础探索结果 +- 付费:完整分析 · 行为模式 · 关系建议 · 成长方向 → **深度版** +- 订阅标题:**成长会员** +- 禁止:虚假倒计时、恐吓、道德绑架 diff --git a/.ai/product/page-tree.md b/.ai/product/page-tree.md new file mode 100644 index 0000000..0cae2db --- /dev/null +++ b/.ai/product/page-tree.md @@ -0,0 +1,41 @@ +# H5 页面树(冻结) + +App: `apps/user-h5` +IA Tab 冻结:首页 · 探索 · 问答 · 陪伴 · 我的 +旅程:[user-journey.md](user-journey.md) + +--- + +## Tree + +``` +/ HomePage 发现入口 · 建档/探索 CTA +/explore ExplorePage 探索测试 · 入口聚合 +/ask AskPage AI成长助手 +/companion CompanionPage 节气生活 · 心情记录 +/mine MinePage 资产总览 → profile/reports/membership +/profile ProfilePage 个人档案管理 +/portrait PortraitPage 个人画像(基础/深度版) +/relation RelationPage 关系理解 +/membership MembershipPage 成长会员 +/scales/:slug ScalePage 探索测试作答(P1 建) +/reports/:id ReportPage 成长报告详情(P1 建) +``` + +Redirect only: `/decode` → `/portrait` + +--- + +## Tab ↔ 非 Tab + +| Tab 内 | 二级(无底栏或隐藏底栏) | +|---|---| +| `/` `/explore` `/ask` `/companion` `/mine` | `/profile` `/portrait` `/relation` `/membership` `/scales/*` `/reports/*` | + +--- + +## 组件优先(catalog) + +HomeWash · Portrait 表单 · ReportCard · PaywallLock · DeepAccessCard · SubscriptionCard · ChatThread · ShareCard · ProfileSwitcher + +文案:lexicon。Journey CTA:每页标明上/下一步。 diff --git a/.ai/product/user-journey.md b/.ai/product/user-journey.md new file mode 100644 index 0000000..debd947 --- /dev/null +++ b/.ai/product/user-journey.md @@ -0,0 +1,80 @@ +# User Journey — 愈心谷(冻结给 AI 写页用) + +页面不是孤立的;必须服务下列转化路径之一。 +语言:[lexicon.md](lexicon.md) · 能力:[feature-map.md](feature-map.md) + +--- + +## New User Journey(P1 主漏斗) + +``` +Entry: 首页(分享卡 / 自然访问) + → Step 1 创建个人档案(生日等) + → Step 2 完成性格探索 / 探索测试 + → Step 3 查看个人画像(基础结果免费) + → Step 4 邀请 TA · 建立关系 · 关系理解 + → Step 5 AI成长助手(问答)持续使用 + → Step 6 深度版 和/或 成长会员 +``` + +| Step | 路由 | 成功标准 | +|---|---|---| +| Entry | `/` | 看到品牌 + 建档/探索入口 | +| 1 | `/profile`(创建)或首页表单 | Self Profile 落库 | +| 2–3 | `/portrait` · `/explore` · `/scales/:slug` | 基础画像或探索结果可见 | +| 4 | `/relation` | Other Profile + 关系理解概览 | +| 5 | `/ask` | 挂档案上下文的一轮有效问答 | +| 6 | `/membership` · 报告内深度版 CTA | mock/真支付成功后权益生效 | + +--- + +## 双增长引擎(P1 均不可弱化) + +### A. 我是谁 — Portrait + +分享卡示例字段:我的关键词 · 沟通/行为标签 · 引导「查看完整成长报告」 + +### B. 我和 TA — RelationInsight(传播主力) + +分享卡示例(文案须过 lexicon): + +``` +我的沟通方式:理性型 +TA 的沟通方式:感受型 +了解彼此 → 查看关系理解 +``` + +比单独探索测试结果更易裂变;P1 必须上线概览分/标签 + 深度建议付费墙。 + +--- + +## Returning User Journey + +``` +打开 App → 陪伴(节气/心情,P2 加深)或 问答 + → 我的:成长报告 / 成长会员 / 个人档案 + → 可选:再测 / 再加关系对象 +``` + +--- + +## Paywall Journey + +``` +基础结果页 + → CTA「查看深度版」或「开通成长会员」 + → /membership 或订单确认 + → pay-mock / 支付 + → 回到成长报告完整态(服务端裁剪解除) +``` + +禁止:恐吓、宿命、倒计时话术。 + +--- + +## AI 写页检查 + +- [ ] 本页落在哪条 Journey Step? +- [ ] 上一步 / 下一步 CTA 是否存在? +- [ ] 文案是否 100% 符合 lexicon? +- [ ] 关系理解是否被当成二等公民删掉? diff --git a/.ai/ui.md b/.ai/ui.md index 871a232..7073aaa 100644 --- a/.ai/ui.md +++ b/.ai/ui.md @@ -1,64 +1,39 @@ -# UI — Product chrome + pointer to Design Contract +# UI — Product chrome -**Visual / component rules:** `.ai/design/design-system.md` (mandatory before UI work). -**Catalog:** `.ai/design/component-catalog.md` -**Platform:** `.ai/design/platform/h5.md` (default) · `mini-program.md` · `website.md` · `flutter.md` +**语言:** `.ai/product/lexicon.md`(强制) +**视觉:** `.ai/design/design-system.md` + `component-catalog.md` +**平台:** `.ai/design/platform/h5.md`(默认) +**IA:** `.ai/product/feature-map.md` --- -## Brand (summary) +## Tabs -- Primary `#E54D42` → `--color-primary` / `--yxg-pri` -- Atmosphere: peach wash → white sheet -- Mobile-first; user column ~430px -- Unicode symbols over emoji in chrome +首页 / 探索 / **问答** / 陪伴 / 我的 + +问答为战略中心 Tab(视觉可突出)。 --- -## H5 structure +## Brand summary -``` -apps/user-h5/src/ - pages/ - components/ - layouts/ - hooks/ - api/ - stores/ - router/ - assets/ -``` - -No raw `fetch` in `pages/`. Tokens from `packages/ui`. - ---- - -## Tabs (product IA) - -Home / Explore / **Ask** / Companion / Mine. -Ask is the strategic center tab. +- Primary `#E54D42`;桃色 wash → 白 sheet +- 移动优先 ~430px +- Unicode 符号优先于 emoji --- ## Copy / compliance -- No medical cure claims -- No 吉凶祸福 -- Report screens include disclaimer -- Brand voice: see design-system §13 +- 用:探索结果、个人画像、关系理解、深度版、生活建议、成长报告 +- 不用:解码、运势、合盘、解锁(主文案)、算命、吉凶、治疗承诺 +- 成长报告页脚免责声明 --- -## Interaction +## H5 structure -- One job per section -- Home first viewport: brand, decode entry, then content sheet -- Loading / empty / error required for network views +`apps/user-h5/src/{pages,components,layouts,hooks,api,stores,router}` +无 raw `fetch`;tokens 来自 `packages/ui`。 ---- - -## Mini program - -- Own `components/`; share tokens from `packages/ui`, not Vue SFCs -- Pages → `services/*` only -- See `design/platform/mini-program.md` +首页首屏:品牌 · 建档/性格探索入口 · 再内容,勿堆仪表盘。 diff --git a/.cursor/rules/engineering-freeze.md b/.cursor/rules/engineering-freeze.md new file mode 120000 index 0000000..c36df2f --- /dev/null +++ b/.cursor/rules/engineering-freeze.md @@ -0,0 +1 @@ +../../.ai/product/ENGINEERING-FREEZE.md \ No newline at end of file diff --git a/.cursor/rules/lexicon.md b/.cursor/rules/lexicon.md new file mode 120000 index 0000000..6b650b4 --- /dev/null +++ b/.cursor/rules/lexicon.md @@ -0,0 +1 @@ +../../.ai/product/lexicon.md \ No newline at end of file diff --git a/.cursor/rules/user-journey.md b/.cursor/rules/user-journey.md new file mode 120000 index 0000000..6abb311 --- /dev/null +++ b/.cursor/rules/user-journey.md @@ -0,0 +1 @@ +../../.ai/product/user-journey.md \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md index 1d014ad..378d732 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,7 +13,7 @@ This file is for AI agents. 5. `.ai/forbidden.md` 6. `.ai/file-map.md` + `.ai/workflow.md` 7. Task rules: `.ai/coding.md` / `api.md` / `database.md` / `ui.md` / `security.md` / … -8. **Product scope / PRD slicing:** `.ai/product/feature-map.md` (竞品对照: `product/cece-feature-map.md`) +8. **Product scope:** `.ai/product/lexicon.md` + `feature-map.md` + `user-journey.md` + `page-tree.md`(冻结见 `ENGINEERING-FREEZE.md`) 9. **Any UI work:** `.ai/design/design-system.md` + `component-catalog.md` + matching `design/platform/*.md` (H5 default) 10. Matching **ADR** in `.ai/adr/` before changing stack or API style 11. Prefer **patterns/** + **examples/** + **playbooks/** over inventing structure @@ -41,4 +41,5 @@ Do not invent Phase 2/3 folders (graph/mcp/skills/anti-patterns/…) unless `ROA ## Product one-liner -Birthday → Profile (digital personality + constitution) → Companion / Ask retention → Membership & Report unlock → Consult later. Compliant lifestyle wording only. +档案 → 性格探索/个人画像 → 关系理解 → 问答陪伴 → 会员/深度版 →(后)顾问。 +语言契约:`.ai/product/lexicon.md`。参考竞品模型,不用竞品品牌词与运势/解码叙事。 diff --git a/apps/docs/README.md b/apps/docs/README.md index cca8676..c4e8e49 100644 --- a/apps/docs/README.md +++ b/apps/docs/README.md @@ -8,14 +8,12 @@ ## 阅读顺序(产品重设计) -1. [analysis/cece-teardown.md](analysis/cece-teardown.md) — 测测拆解 → 愈心谷映射 -2. [`.ai/product/cece-feature-map.md`](../../.ai/product/cece-feature-map.md) — 测测 Feature Map(IA × 能力域) -3. [`.ai/product/feature-map.md`](../../.ai/product/feature-map.md) — 愈心谷 Feature Map + MVP -4. [prd-mvp.md](prd-mvp.md) — MVP 目标、IA、用户故事、API 切片、验收 -5. [business-model.md](business-model.md) — 三层收入与飞轮 -6. [product-roadmap.md](product-roadmap.md) — Phase A→D 竖切计划 +1. [`.ai/product/ENGINEERING-FREEZE.md`](../../.ai/product/ENGINEERING-FREEZE.md) — P1 真源索引 +2. [lexicon](../../.ai/product/lexicon.md) · [user-journey](../../.ai/product/user-journey.md) · [feature-map](../../.ai/product/feature-map.md) · [page-tree](../../.ai/product/page-tree.md) +3. [prd-mvp.md](prd-mvp.md) · [business-model.md](business-model.md) · [product-roadmap.md](product-roadmap.md) +4. 工程:[erd](../../.ai/domain/erd.md) · [openapi](../../proto/openapi.yaml) · [go-services](../../.ai/architecture/go-services.md) -域词汇:[`.ai/domain.md`](../../.ai/domain.md) · 领域图:[`.ai/domain/domain-map.md`](../../.ai/domain/domain-map.md) +竞品对照勿抄 UI:`analysis/cece-teardown.md` --- diff --git a/apps/docs/analysis/cece-teardown.md b/apps/docs/analysis/cece-teardown.md index 778352b..0747a8a 100644 --- a/apps/docs/analysis/cece-teardown.md +++ b/apps/docs/analysis/cece-teardown.md @@ -1,11 +1,10 @@ # 竞品拆解:测测 → 愈心谷映射 来源:[测测 App 深度体验报告(人人都是产品经理)](https://www.woshipm.com/evaluating/6391148.html) -下游:[PRD MVP](../prd-mvp.md) · [商业模式](../business-model.md) · [产品路线图](../product-roadmap.md) · [文档索引](../README.md) +下游:[语言契约](../../../.ai/product/lexicon.md) · [Feature Map](../../../.ai/product/feature-map.md) · [PRD](../prd-mvp.md) -原则:学结构,不抄神秘学主叙事;愈心谷差异 = **数字性格 + 中医体质 + 关系档案 + 节气陪伴**(合规:无疗效、无吉凶)。 - -域词汇以 [`.ai/domain.md`](../../../.ai/domain.md) 为准。 +原则:学**功能模型 / 路径 / 商业**,不抄品牌词与运势叙事。愈心谷 UI 禁用「解码/运势/合盘/吉凶」等,见 lexicon。 +本文可保留竞品原名;落地命名以愈心谷 lexicon 为准。 --- diff --git a/apps/docs/business-model.md b/apps/docs/business-model.md index d1f0f26..dd9e71b 100644 --- a/apps/docs/business-model.md +++ b/apps/docs/business-model.md @@ -1,90 +1,39 @@ # 愈心谷商业模式 -关联:[PRD MVP](prd-mvp.md) · [测测拆解](analysis/cece-teardown.md) · [产品路线图](product-roadmap.md) +关联:[PRD](prd-mvp.md) · [Feature Map](../../.ai/product/feature-map.md) · [语言契约](../../.ai/product/lexicon.md) --- -## 1. 一句话 +## 一句话 -用「数字性格 + 中医体质」做**可复算、可对照**的自我认知入口,以**订阅为主、报告/契合为辅、咨询为远期高客单**,承接测测式漏斗,但避开算命与医疗承诺。 +用「性格探索 + 个人画像 + 关系理解 + AI 问答」做低摩擦自我认知入口;**订阅为主、深度版成长报告为辅、真人顾问远期**。叙事是个人成长,不是占卜。 --- -## 2. 价值主张 - -| 对用户 | 对产品 | -|---|---| -| 知道「我是谁 / 我缺什么 / 怎么相处」 | 低摩擦获客(生日 / 量表) | -| 比泛星座更「有结构」、比纯心理量表更「东方语境」 | 差异化:体质 × 性格 × 关系档案 | -| 节气与日更内容形成回访理由 | 订阅续费钩子 | - ---- - -## 3. 收入三层(对齐测测,本地化) +## 收入三层(模型成熟、话术自有) ``` -L1 免费获客 Decode 简版 / Scale / 分享卡 +L1 免费获客 基础画像 / 人格测评 / 分享卡 ↓ -L2 订阅留存 Membership:Ask 次数、完整报告、SolarTerm 深度、Mood 复盘 +L2 订阅留存 会员:问答次数、完整分析、专属内容、陪伴深化 ↓ -L3 高 ARPU Unlock 单次报告/Match ·(远期)Consult +L3 高 ARPU 深度版单次成长报告 ·(P3)顾问 ``` -| 层级 | 产品 | 定价方向(可调) | 备注 | -|---|---|---|---| -| L1 | 简版 Decode、热门 Scale | 0 | 结论可见 | -| L2 | 月/季/年 VIP | 参考测测档位,偏下探试价 | 主收入 | -| L2.5 | Unlock 完整报告 / Match 解读 | 单次低客单 | 不愿订也可转化 | -| L3 | Consult | 远期 | 需履约与合规,非 MVP | - -**不做:** 侵入式广告、诱导抽奖、伪医疗售卖。 +不做:干扰广告、恐吓倒计时、伪医疗售卖。 --- -## 4. 飞轮 +## 飞轮 -```mermaid -flowchart LR - Share[分享卡/社交] --> Free[免费测评] - Free --> Profile[档案沉淀] - Profile --> Paywall[原因与方案付费墙] - Paywall --> VIP[订阅] - VIP --> Ask[问 / 陪伴回访] - Ask --> Share - Profile --> Match[关系档案] - Match --> Unlock[单次解锁] - Unlock --> VIP -``` - -关键:Profile 越多 → Match/Ask 越有用 → 续费与解锁越高。 +探索自己 → 档案沉淀 → 个性化分析 → 问答陪伴 → 会员 → 成长记录 → 分享再获客 --- -## 5. 单位经济(假设,待校验) +## 与「成熟同业」的差异(商业叙事) -| 指标 | MVP 观测 | +| 同业常见 | 愈心谷 | |---|---| -| 免费完成率 | Decode 简版 / Scale 完成率 | -| 付费转化 | 简版→Unlock 或 VIP | -| ARPU | 订阅为主,Unlock 为辅 | -| 留存 | D1/D7;节气打开率 | -| 合规成本 | 客服投诉 / 违规文案拦截率 | - -付费与权益**只信服务端**(见 `.ai/security.md`)。 - ---- - -## 6. B2B / 扩展(非 MVP) - -企业 EAP、线下门店引流、内容授权——在 C 端漏斗跑通后再开。平台扩展路径:H5 → 小程序(同一 `packages/sdk`)。 - ---- - -## 7. 与测测的差异化(商业) - -| 测测 | 愈心谷 | -|---|---| -| 星盘+心理+社交玩法宽 | 数字性格+体质窄而深 | -| 强娱乐/玄学氛围 | 可复算、生活建议、免责声明 | -| 咨询达人网络 | 先模板 Ask,后 Consult | -| UGC 广场 | 暂不做,避免内容治理成本 | +| 运势/合盘主叙事 | 个人画像 · 关系理解 · 生活建议 | +| 咨询达人网络先做 | 先会员与深度版,顾问 P3 | +| UGC 玩法广场 | 首版不做 | diff --git a/apps/docs/prd-mvp.md b/apps/docs/prd-mvp.md index 4b86c3b..57268f7 100644 --- a/apps/docs/prd-mvp.md +++ b/apps/docs/prd-mvp.md @@ -1,128 +1,118 @@ -# 愈心谷 MVP PRD +# 愈心谷 P1 PRD(首版) -关联:[测测拆解映射](analysis/cece-teardown.md) · [商业模式](business-model.md) · [产品路线图](product-roadmap.md) -Feature Map:[`.ai/product/feature-map.md`](../../.ai/product/feature-map.md) · 竞品树:[`.ai/product/cece-feature-map.md`](../../.ai/product/cece-feature-map.md) -域词汇:[`.ai/domain.md`](../../.ai/domain.md) · 领域图:[`.ai/domain/domain-map.md`](../../.ai/domain/domain-map.md) -实现约束:[`.ai/architecture.md`](../../.ai/architecture.md) · playbooks: `add-api` / `new-page` / `payment` +关联:[Feature Map](../../.ai/product/feature-map.md) · [语言契约](../../.ai/product/lexicon.md) · [商业模式](business-model.md) · [路线图](product-roadmap.md) +域:[`.ai/domain.md`](../../.ai/domain.md) · [domain-map](../../.ai/domain/domain-map.md) --- -## 1. 目标 / 非目标 +## 1. 定位 -### 目标(MVP Done) +通过数字性格、身心特征、关系理解与 AI 陪伴,帮助用户认识自己、理解他人的个人成长平台。 -在 **user-h5 + api** 上跑通: - -1. Visitor 输入生日 → 创建 **Self Profile** → 生成 **Decode** 简版(结论可见) -2. 付费墙:Unlock 完整 Decode **或** 开通 **Subscription**(可模拟支付) -3. 至少一个热门 **Scale**(如 MBTI)作答 → **ScaleResult** → 分享卡 -4. 可创建 **Other Profile**,生成 **Match** 预览(分数可见,解读锁定) -5. 底栏 5 Tab 可用;Ask / Companion 允许规则模板占位,但入口与文案就位 -6. 服务端可复算报告;客户端不信任本地解锁 - -### 非目标 - -- Consult 履约 / 达人双边 -- mini-program 业务页 -- UGC「玩法广场」 -- 真实微信支付(用 `PAYMENT_MODE=mock`) -- 长记忆多智能体 / 心情小镇级沉浸 +飞轮:探索自己 → 个人档案 → 个性化分析 → AI 陪伴 → 会员深入 → 成长记录。 --- -## 2. 用户与场景 +## 2. P1 目标 / 非目标 -| 画像 | 场景 | 成功指标 | +### 目标 + +在 **user-h5 + api** 跑通: + +1. 创建 **Self Profile**(生日等)→ 生成 **Portrait** 基础画像(可见) +2. 付费墙:购买 **DeepAccess** 完整分析 **或** 开通 **Subscription**(可 mock) +3. ≥1 个热门 **Scale** → **ScaleResult(探索结果)** → 分享卡 +4. 创建 **Other Profile** → **RelationInsight**(差异可见,深度建议需 DeepAccess/VIP) +5. 五 Tab:首页 / 探索 / **问答** / 陪伴 / 我的;问答挂档案;陪伴可占位 +6. 成长报告字段由服务端按权益裁剪 + +### 非目标(P1) + +- 真人顾问履约、达人双边 +- 小程序业务页 +- UGC 玩法广场 +- 真微信支付(`PAYMENT_MODE=mock`) +- 长期记忆、运势/塔罗入口、疗效承诺文案 + +--- + +## 3. 信息架构 + +| Tab | 路由 | 内容 | |---|---|---| -| P2 泛测评年轻女性 | 社交看到分享 → 测自己 | 完成 Decode 简版或 Scale | -| P1 养生决策者 | 要「适合自己的调理参考」 | 查看完整 Decode 体质方案段 | -| 关系困扰 | 帮 TA 测 / 看契合 | 创建 Other Profile + Match 预览 | +| 首页 | `/` | 档案入口 + 九宫格 + 推荐 | +| 探索 | `/explore` | 人格测评、性格探索、关系理解入口 | +| 问答 | `/ask` | AI 成长助手;顾问预约占位 | +| 陪伴 | `/companion` | 节气/心情占位或静态 | +| 我的 | `/mine` | 档案、成长报告、会员 | + +二级:`/portrait` `/scales/:slug` `/relation` `/reports/:id` + +文案禁止词见 lexicon(无「解码/运势/解锁」等主文案)。 --- -## 3. 信息架构(5 Tab) +## 4. 用户故事 -| Tab | 路由建议 | 内容 | -|---|---|---| -| 首页 | `/` | 品牌 + Decode 输入 + 热门 Feed + 宫格 | -| 探索 | `/explore` | Scale 列表、Decode 入口;星镜/数字心理轻入口 | -| 问 | `/ask` | Ask:基于当前 Profile;Tab 旁路「顾问预约」占位 | -| 陪伴 | `/companion` | 今日 SolarTerm + Mood 打卡(可静态内容) | -| 我的 | `/mine` | Profiles、Membership、Orders、设置 | +### US1 性格探索 / 个人画像 -二级:`/decode` `/scales/:slug` `/match` `/report/:id` +- 输入生日 → Profile + GrowthReport(Portrait) +- 免费:基础画像 + 1 条生活建议 +- 深度版:完整分析 + 行为模式 + 成长方向 +- 页脚免责声明(非医疗、非占卜) + +### US2 人格测评 + +- 列表 API → 作答 → 服务端计分 → 探索结果 + 分享 + 引导问答/画像 + +### US3 关系理解 + +- 添加 TA → 双人差异概览 → 相处建议深度版锁定 + +### US4 会员 + +- 套餐 → mock 支付 → Membership;问答次数与深度版权益服务端扣减 --- -## 4. 关键用户故事 +## 5. 付费原则 -### US1 Decode - -- 输入 year/month/day → API 校验 → 落 Profile + Report(Decode) -- 简版:性格一句话 + 体质倾向一句话 + 1 条生活建议 -- 完整:原因拆解 + 方案列表;需 Unlock 或 VIP -- 文案禁疗效 / 吉凶;页脚免责声明 - -### US2 Scale - -- 列表来自 API;作答进度可本地缓存;提交服务端计分 -- 结果页:类型/分数 + 分享 + 引导 Decode/Ask - -### US3 Other + Match - -- 「帮 TA 测」创建 Other Profile -- Match:展示契合分;解读段落锁定至 Unlock - -### US4 Membership(mock) - -- 套餐展示;下单 → mock 支付成功 → Membership active -- Ask/完整报告次数按权益扣减(服务端) +免费给基础结论;付费给完整分析与方案(称「深度版」)。VIP 与单次 DeepAccess 二选一可达。 --- -## 5. 付费墙原则 - -**免费给结论,付费给原因 + 方案。** -VIP 与单次 Unlock 二选一可达完整内容。 - ---- - -## 6. API 切片(MVP) - -统一信封见 `.ai/api.md`。最小集合: +## 6. API 切片(P1) | Method | Path | 说明 | |---|---|---| -| POST | `/api/v1/profiles` | 创建 Self/Other Profile | -| GET | `/api/v1/profiles` | 列表 | -| POST | `/api/v1/reports/decode` | 生成 Decode(简/全由权益决定) | -| GET | `/api/v1/reports/:id` | 报告详情 | -| GET | `/api/v1/scales` | 量表列表 | -| GET | `/api/v1/scales/:slug` | 题目 | -| POST | `/api/v1/scales/:slug/result` | 提交作答 | -| POST | `/api/v1/match` | 契合度预览/完整 | -| POST | `/api/v1/orders` | 创建订单 | +| POST/GET | `/api/v1/profiles` | 档案 | +| POST | `/api/v1/reports/portrait` | 生成个人画像(简/全按权益) | +| GET | `/api/v1/reports/:id` | 成长报告详情 | +| GET | `/api/v1/scales` | 测评列表 | +| GET/POST | `/api/v1/scales/:slug` … `/result` | 题目与提交 | +| POST | `/api/v1/relation/insight` | 关系理解 | +| POST | `/api/v1/orders` | 下单 | | POST | `/api/v1/orders/:id/pay-mock` | 模拟支付 | -| GET | `/api/v1/membership/me` | 当前权益 | -| GET | `/api/v1/solar-terms/today` | 今日节气 | -| POST | `/api/v1/moods` | 心情打卡(可后置) | +| GET | `/api/v1/membership/me` | 权益 | +| GET | `/api/v1/solar-terms/today` | 今日节气(可静态) | +| POST | `/api/v1/moods` | 心情(可 P2) | -Auth:Visitor 可用 device token;注册后升级 User(见 ADR-0004)。 +兼容:旧路径 `/reports/decode` 若存在应重定向/别名到 `portrait`,勿在新客户端写 decode。 --- -## 7. 验收(QA) +## 7. 验收 -- [ ] 未付费看不到完整 Decode 原因段(抓包改本地也不生效) -- [ ] 模拟支付后同一 Report 可完整查看 -- [ ] Other Profile + Match 预览分数、解读锁定 -- [ ] Scale 提交返回稳定计分 -- [ ] 文案无疗效/吉凶;有免责声明 -- [ ] `go test ./...` 与 `npm run build:h5` 通过 -- [ ] `/api/v1/healthz` OK +- [ ] 未付费看不到完整分析段(改本地无效) +- [ ] mock 支付后同一报告可看深度版 +- [ ] 关系理解:概览可见、深度建议锁定 +- [ ] Scale 计分稳定 +- [ ] UI 无禁用词;有免责声明 +- [ ] `go test` / `npm run build:h5` 通过 --- -## 8. 实现顺序(竖切) +## 8. 实现顺序 -按 [product-roadmap.md](product-roadmap.md) Phase A→B→C;每刀走 `.ai/playbooks/add-api.md` + `new-page.md`。 +P1 竖切:Profile → Portrait → Commerce mock → Scale → RelationInsight → Ask 壳 → Companion 壳。 +Playbook:`add-api` / `new-page` / `payment`。语言先读 `lexicon.md`。 diff --git a/apps/docs/product-roadmap.md b/apps/docs/product-roadmap.md index b6de749..430db04 100644 --- a/apps/docs/product-roadmap.md +++ b/apps/docs/product-roadmap.md @@ -1,78 +1,11 @@ # 产品分期路线图 -关联:[PRD MVP](prd-mvp.md) · [商业模式](business-model.md) · [`.ai/ROADMAP.md`](../../.ai/ROADMAP.md)(工程体系分期) +关联:[Feature Map](../../.ai/product/feature-map.md) · [PRD](prd-mvp.md) · [lexicon](../../.ai/product/lexicon.md) -实现一律竖切:API → types → H5;playbook:`add-api` / `new-page` / `payment`。 - ---- - -## Phase A — 解码闭环(当前下一刀) - -**目标:** Visitor 生日 → Profile → Decode 简/全权益 → mock Unlock/VIP - -| 交付 | Playbook | Done | -|---|---|---| -| Profile CRUD API | add-api | | -| Decode 生成 + Report 读取(服务端裁剪字段) | add-api | | -| H5 首页表单接真 API + 报告页 | new-page | | -| Order + pay-mock + Membership | payment | | -| 免责声明与文案禁区 | review checklist | | - -**退出标准:** PRD §7 中 Decode + Membership 相关项打勾。 - ---- - -## Phase B — 量表与关系 - -| 交付 | Playbook | +| Phase | 交付 | |---|---| -| Scales 列表/题目/计分 API + 1 个热门量表 | add-api + new-page | -| Other Profile + Match 预览/锁定 | add-api + new-page | -| 分享卡(静态图或 canvas) | new-page | -| 探索 Tab 接真数据 | new-page | +| **P1** | 档案 · Portrait · Scale · RelationInsight · Ask 壳 · DeepAccess/会员 mock | +| **P2** | 身心探索 · 节气 · 心情 · 成长计划 | +| **P3** | 长期记忆 · 成长库 · Consult | -**退出标准:** PRD US2/US3 验收通过。 - ---- - -## Phase C — 问与陪伴骨架 - -| 交付 | 说明 | -|---|---| -| Ask:规则模板 + 权益次数 | 非 LLM 亦可;接口形状稳定 | -| SolarTerm 今日内容 API + 陪伴页 | 可先静态 CMS JSON | -| Mood 打卡最小写 | 可选 | -| 「顾问预约」占位页 | 不履约 | - -**退出标准:** 5 Tab 均有真实或稳定占位数据;无死链。 - ---- - -## Phase D — 增长与平台(post-MVP) - -- 真实支付通道(微信支付等) -- Auth 升级、多端登录 -- mini-program 适配(`packages/sdk`) -- Consult 试点(合规评审后) -- 内容运营后台(admin-h5)最小可用 - ---- - -## 不做清单(直到明确开闸) - -- UGC 玩法广场 / 达人市场 -- GraphQL / 微服务拆分 -- 长记忆多智能体陪伴 -- 根目录遗留 HTML 继续加功能(见 `LEGACY.md`) - ---- - -## 与工程路线对齐 - -| 产品 Phase | 工程侧重 | -|---|---| -| A–B | `apps/api` + `apps/user-h5` + Postgres | -| C | Redis 仍可延迟;Ask 限流按需 | -| D | 支付真通道、小程序、admin | - -工程体系 Phase 2/3(anti-patterns、metrics、mcp…)见 `.ai/ROADMAP.md`,不阻塞产品 A–C。 +竖切 playbook:`add-api` / `new-page` / `payment`。UI 文案先过 lexicon。 diff --git a/apps/user-h5/src/components/TabBar.vue b/apps/user-h5/src/components/TabBar.vue index 819997a..6f975f8 100644 --- a/apps/user-h5/src/components/TabBar.vue +++ b/apps/user-h5/src/components/TabBar.vue @@ -20,7 +20,7 @@ const route = useRoute() const items = [ { to: '/', icon: '⌂', label: '首页' }, { to: '/explore', icon: '◎', label: '探索' }, - { to: '/ask', icon: '问', label: '问', ask: true }, + { to: '/ask', icon: '问', label: '问答', ask: true }, { to: '/companion', icon: '♡', label: '陪伴' }, { to: '/mine', icon: '◍', label: '我的' }, ] diff --git a/apps/user-h5/src/pages/AskPage.vue b/apps/user-h5/src/pages/AskPage.vue index 71d6018..a7f982a 100644 --- a/apps/user-h5/src/pages/AskPage.vue +++ b/apps/user-h5/src/pages/AskPage.vue @@ -1,8 +1,11 @@ diff --git a/apps/user-h5/src/pages/CompanionPage.vue b/apps/user-h5/src/pages/CompanionPage.vue index d6d018b..86c4b4a 100644 --- a/apps/user-h5/src/pages/CompanionPage.vue +++ b/apps/user-h5/src/pages/CompanionPage.vue @@ -1,8 +1,8 @@ diff --git a/apps/user-h5/src/pages/ExplorePage.vue b/apps/user-h5/src/pages/ExplorePage.vue index 25972ce..5597430 100644 --- a/apps/user-h5/src/pages/ExplorePage.vue +++ b/apps/user-h5/src/pages/ExplorePage.vue @@ -1,11 +1,12 @@ @@ -15,4 +16,5 @@ h1{font-size:22px} .sub{color:var(--yxg-sub);font-size:13px;margin:6px 0 16px} .list{background:#fff;border-radius:16px;padding:8px 16px;line-height:2.2;font-size:14px;color:#555} +.list a{color:inherit;text-decoration:none} diff --git a/apps/user-h5/src/pages/HomePage.vue b/apps/user-h5/src/pages/HomePage.vue index 949a55b..5c10614 100644 --- a/apps/user-h5/src/pages/HomePage.vue +++ b/apps/user-h5/src/pages/HomePage.vue @@ -2,12 +2,12 @@
-

愈见自己 · 遇见更好

+

认识自己 · 理解他人

-
-

愈心解码

-

一个生日,读懂你的身与心

+
+

性格探索

+

填写生日,生成你的成长画像

@@ -15,15 +15,15 @@ - +

{{ err }}

-

认识自己

全部
+

快捷入口

全部
- +
{{ t.icon }}
{{ t.label }}
@@ -50,14 +50,17 @@ const day = ref('') const err = ref('') const apiStatus = ref('检测中…') -const tests = [ - { to: '/decode', icon: '△', label: '愈心解码', bg: '#FFF3D6', fg: '#C8923A' }, - { to: '/explore', icon: '◆', label: '性格测评', bg: '#E3EEFF', fg: '#4A90E2' }, - { to: '/ask', icon: '问', label: '愈心问答', bg: '#FFE4E4', fg: '#E54D42' }, +const entries = [ + { to: '/portrait', icon: '△', label: '性格探索', bg: '#FFF3D6', fg: '#C8923A' }, + { to: '/explore', icon: '◆', label: '人格测评', bg: '#E3EEFF', fg: '#4A90E2' }, + { to: '/relation', icon: '◇', label: '关系理解', bg: '#FFE8D6', fg: '#E8985A' }, + { to: '/ask', icon: '问', label: 'AI问答', bg: '#FFE4E4', fg: '#E54D42' }, { to: '/companion', icon: '☯', label: '节气陪伴', bg: '#E0F6E4', fg: '#5CB85C' }, + { to: '/profile', icon: '◍', label: '个人档案', bg: '#F0F4F8', fg: '#5A6A7A' }, + { to: '/membership', icon: '◇', label: '成长会员', bg: '#F5F0FF', fg: '#8B5CF6' }, ] -function goDecode() { +function goPortrait() { const y = Number(year.value) const m = Number(month.value) const d = Number(day.value) @@ -67,7 +70,7 @@ function goDecode() { return } err.value = '' - router.push({ path: '/decode', query: { y: String(y), m: String(m), d: String(d) } }) + router.push({ path: '/portrait', query: { y: String(y), m: String(m), d: String(d) } }) } onMounted(async () => { @@ -86,11 +89,11 @@ onMounted(async () => { .word{font-size:28px;font-weight:700;letter-spacing:.18em} .word span{color:var(--yxg-pri)} .tag{font-size:12px;color:rgba(0,0,0,.38);margin-top:6px;letter-spacing:.12em} -.decode-card{ +.portrait-card{ background:#fff;border-radius:20px;padding:18px 14px;text-align:center; box-shadow:0 8px 28px rgba(229,77,66,.12); } -.decode-card h2{font-size:17px;color:var(--yxg-gold);letter-spacing:.1em} +.portrait-card h2{font-size:17px;color:var(--yxg-gold);letter-spacing:.1em} .sub{font-size:12px;color:#aaa;margin:4px 0 14px} .row{display:flex;gap:6px;align-items:center;justify-content:center;flex-wrap:wrap} .row input{ @@ -106,7 +109,7 @@ onMounted(async () => { .head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px} .head h3{font-size:16px} .head a{font-size:12px;color:#bbb} -.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px 8px} +.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px 8px} .cell{display:flex;flex-direction:column;align-items:center;gap:8px;font-size:11px;color:#555} .icon{ width:52px;height:52px;border-radius:18px;display:flex;align-items:center;justify-content:center;font-size:20px; diff --git a/apps/user-h5/src/pages/MembershipPage.vue b/apps/user-h5/src/pages/MembershipPage.vue new file mode 100644 index 0000000..7c66c5e --- /dev/null +++ b/apps/user-h5/src/pages/MembershipPage.vue @@ -0,0 +1,18 @@ + + + diff --git a/apps/user-h5/src/pages/MinePage.vue b/apps/user-h5/src/pages/MinePage.vue index 3b654c2..4728827 100644 --- a/apps/user-h5/src/pages/MinePage.vue +++ b/apps/user-h5/src/pages/MinePage.vue @@ -1,8 +1,13 @@ @@ -10,5 +15,6 @@ .page{padding:24px 16px} h1{font-size:22px} .sub{color:var(--yxg-sub);font-size:13px;margin:6px 0 16px} -.card{background:#fff;border-radius:16px;padding:18px;font-size:14px;color:#666;line-height:1.6} +.list{background:#fff;border-radius:16px;padding:8px 16px;line-height:2.2;font-size:14px;color:#555} +.list a{color:inherit;text-decoration:none} diff --git a/apps/user-h5/src/pages/DecodePage.vue b/apps/user-h5/src/pages/PortraitPage.vue similarity index 78% rename from apps/user-h5/src/pages/DecodePage.vue rename to apps/user-h5/src/pages/PortraitPage.vue index bfe225f..d10760b 100644 --- a/apps/user-h5/src/pages/DecodePage.vue +++ b/apps/user-h5/src/pages/PortraitPage.vue @@ -1,13 +1,13 @@ diff --git a/apps/user-h5/src/pages/ProfilePage.vue b/apps/user-h5/src/pages/ProfilePage.vue new file mode 100644 index 0000000..c3e211f --- /dev/null +++ b/apps/user-h5/src/pages/ProfilePage.vue @@ -0,0 +1,20 @@ + + + diff --git a/apps/user-h5/src/pages/RelationPage.vue b/apps/user-h5/src/pages/RelationPage.vue new file mode 100644 index 0000000..2bae126 --- /dev/null +++ b/apps/user-h5/src/pages/RelationPage.vue @@ -0,0 +1,18 @@ + + + diff --git a/apps/user-h5/src/router/index.ts b/apps/user-h5/src/router/index.ts index a821e4e..fe6813d 100644 --- a/apps/user-h5/src/router/index.ts +++ b/apps/user-h5/src/router/index.ts @@ -8,7 +8,11 @@ const router = createRouter({ { path: '/ask', name: 'ask', component: () => import('../pages/AskPage.vue'), meta: { tab: true } }, { path: '/companion', name: 'companion', component: () => import('../pages/CompanionPage.vue'), meta: { tab: true } }, { path: '/mine', name: 'mine', component: () => import('../pages/MinePage.vue'), meta: { tab: true } }, - { path: '/decode', name: 'decode', component: () => import('../pages/DecodePage.vue'), meta: { tab: false } }, + { path: '/profile', name: 'profile', component: () => import('../pages/ProfilePage.vue'), meta: { tab: false } }, + { path: '/portrait', name: 'portrait', component: () => import('../pages/PortraitPage.vue'), meta: { tab: false } }, + { path: '/relation', name: 'relation', component: () => import('../pages/RelationPage.vue'), meta: { tab: false } }, + { path: '/membership', name: 'membership', component: () => import('../pages/MembershipPage.vue'), meta: { tab: false } }, + { path: '/decode', redirect: (to) => ({ path: '/portrait', query: to.query }) }, ], }) diff --git a/proto/openapi.yaml b/proto/openapi.yaml index d506713..981689f 100644 --- a/proto/openapi.yaml +++ b/proto/openapi.yaml @@ -1,13 +1,28 @@ openapi: 3.0.3 info: title: YuXinGu API - version: 0.1.0 - description: 愈心谷 HTTP API(脚手架) + version: 0.2.0 + description: | + 愈心谷 P1 API 契约(冻结草案)。 + 用户可见文案遵循 .ai/product/lexicon.md。 + 统一信封:{ code, message, data };code=0 成功。 servers: - url: http://127.0.0.1:8080 +tags: + - name: system + - name: profile + - name: portrait + - name: scale + - name: relation + - name: report + - name: ask + - name: companion + - name: commerce + paths: /api/v1/healthz: get: + tags: [system] summary: Liveness responses: '200': @@ -16,22 +31,263 @@ paths: application/json: schema: $ref: '#/components/schemas/Envelope' + /api/v1/ping: get: + tags: [system] summary: Ping responses: '200': description: OK + + /api/v1/profiles: + get: + tags: [profile] + summary: 列出个人档案 + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope' + post: + tags: [profile] + summary: 创建个人档案 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateProfileRequest' + responses: + '200': + description: OK + + /api/v1/profiles/{id}: + patch: + tags: [profile] + summary: 更新个人档案 + parameters: + - $ref: '#/components/parameters/Id' + responses: + '200': + description: OK + delete: + tags: [profile] + summary: 删除个人档案 + parameters: + - $ref: '#/components/parameters/Id' + responses: + '200': + description: OK + + /api/v1/reports/portrait: + post: + tags: [portrait] + summary: 生成个人画像成长报告 + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [profile_id] + properties: + profile_id: { type: string, format: uuid } + responses: + '200': + description: 返回 GrowthReport(detail 按权益裁剪) + + /api/v1/relation/insight: + post: + tags: [relation] + summary: 生成关系理解 + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [profile_a_id, profile_b_id] + properties: + profile_a_id: { type: string, format: uuid } + profile_b_id: { type: string, format: uuid } + responses: + '200': + description: RelationInsight + 可选 report_id + + /api/v1/reports/{id}: + get: + tags: [report] + summary: 获取成长报告(权益裁剪) + parameters: + - $ref: '#/components/parameters/Id' + responses: + '200': + description: OK + + /api/v1/scales: + get: + tags: [scale] + summary: 探索测试列表 + responses: + '200': + description: OK + + /api/v1/scales/{slug}: + get: + tags: [scale] + summary: 探索测试题目 + parameters: + - name: slug + in: path + required: true + schema: { type: string } + responses: + '200': + description: OK + + /api/v1/scales/{slug}/result: + post: + tags: [scale] + summary: 提交探索测试并计分 + parameters: + - name: slug + in: path + required: true + schema: { type: string } + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [profile_id, answers] + properties: + profile_id: { type: string, format: uuid } + answers: { type: object } + responses: + '200': + description: 探索结果 + + /api/v1/ask/threads: + post: + tags: [ask] + summary: 创建问答线程(须绑定 profile) + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [profile_id] + properties: + profile_id: { type: string, format: uuid } + responses: + '200': + description: OK + + /api/v1/ask/threads/{id}/messages: + post: + tags: [ask] + summary: 发送消息(扣额度) + parameters: + - $ref: '#/components/parameters/Id' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [content] + properties: + content: { type: string } + responses: + '200': + description: assistant 回复 + + /api/v1/solar-terms/today: + get: + tags: [companion] + summary: 今日节气生活建议 + responses: + '200': + description: OK + + /api/v1/moods: + post: + tags: [companion] + summary: 心情记录(P2 可完善) + responses: + '200': + description: OK + + /api/v1/membership/me: + get: + tags: [commerce] + summary: 当前成长会员权益 + responses: + '200': + description: OK + + /api/v1/orders: + post: + tags: [commerce] + summary: 创建订单(membership | deep_access) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOrderRequest' + responses: + '200': + description: OK + + /api/v1/orders/{id}/pay-mock: + post: + tags: [commerce] + summary: 模拟支付成功 + parameters: + - $ref: '#/components/parameters/Id' + responses: + '200': + description: OK + components: + parameters: + Id: + name: id + in: path + required: true + schema: { type: string, format: uuid } + schemas: Envelope: type: object + required: [code, message] properties: - code: - type: integer - example: 0 - message: - type: string - example: success - data: - type: object + code: { type: integer, example: 0 } + message: { type: string, example: success } + data: { type: object } + + CreateProfileRequest: + type: object + required: [relation, birth_date] + properties: + relation: { type: string, enum: [self, other] } + display_name: { type: string } + birth_date: { type: string, format: date } + birth_time: { type: string, nullable: true } + birth_place: { type: string, nullable: true } + gender: { type: string, nullable: true } + relation_type: { type: string, nullable: true } + + CreateOrderRequest: + type: object + required: [kind] + properties: + kind: { type: string, enum: [membership, deep_access] } + plan: { type: string, description: month|quarter|year when membership } + report_id: { type: string, format: uuid, description: when deep_access }