Files
digital-psychology/.ai/product/feature-spec/companion.md
T
jackyu66gitandCursor bd22d9dddd feat: P1 合盘/星座/问答与测测完整设计包及模拟器取证工具
落地 synastry/star/ask API 与 H5 页面,补齐 cece-frontend-re complete-design 证据文档,并加入 Android 模拟器截图抓取脚本。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 11:37:53 +08:00

148 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Feature Spec: 陪伴(节气壳)
> Status: `Active`(壳) · Map: `§4 陪伴 [P2 主做;P1 可占位]` · Phase: `P1 Shell / P2`
> 规范:[../feature-design.md](../feature-design.md)
---
## 1. 功能定义
| 字段 | 内容 |
|---|---|
| Name | 陪伴 |
| Purpose | 日常留存:节气生活建议与心情记录 |
| Business Goal | Tab 占位完整;P2 做深留存 |
| InP1 壳) | OutP1 |
|---|---|
| 今日节气展示(本地/轻 API) | 完整心情 OS |
| 生活建议(非运势) | 疗效承诺 |
| 路由与 Tab 可达 | 强制日记社交 |
| InP2 | |
|---|---|
| 心情记录落库、成长记录 | |
---
## 2. 用户价值
1. **为何需要:** 需要轻量每日触达,不只是一次性测试。
2. **P1 获得:** 今日节气与建议壳。
3. **付费:** N/AP1)。
---
## 3. 用户角色
| Actor | P1 |
|---|---|
| Visitor | 可打开陪伴页看节气壳 |
---
## 4. 用户流程
```text
Tab 陪伴 → /companion
展示今日节气 + 生活建议文案
P2)记录心情 → POST /moods
```
---
## 5. 页面设计
| 路由 | 页面 |
|---|---|
| `/companion` | CompanionPage |
---
## 6. 页面状态规范
| 状态 | UI |
|---|---|
| Loading | 拉节气 |
| Normal | 节气 + 建议 |
| Error | 降级本地文案或重试 |
---
## 7. Business Rules
| ID | Rule |
|---|---|
| R1 | 文案为「生活建议 / 节气」,禁止「今日运势」 |
| R2 | P1 不宣称完整陪伴 OS 已交付 |
| R3 | 心情 API 若暴露须鉴权;P1 可不接 UI |
| R4 | 扩行为前必须把本 Spec Phase 与 In Scope 升为 P2 并补验收 |
---
## 8. 数据模型影响
| 表 | P1 | P2 |
|---|---|---|
| solar term | 只读 API/本地 | |
| `moods` | 可有 API | UI 写入 |
---
## 9. API 需求
| Method | Path | 意图 |
|---|---|---|
| GET | `/api/v1/solar-terms/today` | 今日节气 |
| POST | `/api/v1/moods` | P2 心情 |
---
## 10. 权限设计
| 能力 | Visitor |
|---|---|
| 看节气壳 | ✓ |
| 写心情 | P2 |
---
## 11. 埋点
| Event | 触发 |
|---|---|
| `companion_viewed` | 打开 |
| `mood_saved` | P2 |
---
## 12. 测试验收标准
**Given** P1
**When** 打开陪伴
**Then** 页面可达且无运势禁用词;不因未做心情而崩溃
**Given** 要将心情做进 P1
**When**
**Then** **禁止**在未改 Spec/map 分期前实现
---
## 13. AI 开发前检查
- [x] 壳范围已标明 · 禁止超 scope
---
## 14. Implementation Notes
| 项 | 内容 |
|---|---|
| Packages | `CompanionPage` · `internal/companion` · moods 表 |
| 实现 | GET `/solar-terms/today` · POST `/moods` · GET `/moods/today` · H5 心情 UI |
| Gaps | 成长计划、推送、心情趋势 |
| Label | 陪伴 P2 心情已接;真支付仍后置 |
| Process Review | 2026-08-02 [P1-PROCESS-REVIEW](P1-PROCESS-REVIEW.md) · 心情已按产品「其他先做」落地 |