Files
digital-psychology/.ai/product/feature-spec/explore-test.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

193 lines
4.5 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: `2.2 人格测评 [P1]` · Phase: `P1`
> 规范:[../feature-design.md](../feature-design.md)
---
## 1. 功能定义
| 字段 | 内容 |
|---|---|
| Name | 探索测试 |
| Purpose | 通过短量表帮助用户了解沟通方式、情感模式等偏好 |
| Business Goal | 丰富探索中心;结果导流关系理解与问答;可分享 |
| In | Out |
|---|---|
| 已发布量表列表、答题、计分、丰富结果 | 伪 MBTI 版权侵权内容 |
| ≥1 热门测试(P1:沟通方式 + 情感模式) | 医疗量表诊断 |
| 分享结果卡 | 未定义的「深度付费层」若未实现则标 Gap |
---
## 2. 用户价值
1. **为何需要:** 比生日画像更场景化的自我标签。
2. **完成后获得:** 风格标签、概述、维度、建议、话术、成长计划。
3. **付费:** P1 结果全量返回(免费);深度会员导流为软转化(非强制锁结果)。`Gap:` 若产品后续要对部分结果上锁,须先更新本 Spec。
---
## 3. 用户角色
| Actor | 能力 |
|---|---|
| Visitor | 浏览列表;提交需 Self Profile |
| 无档案 | 可看题,提交前引导建档 |
---
## 4. 用户流程
```text
/explore 测试列表
进入 /scales/:slug
加载题目
逐题作答(须全部完成)
无 Self → 引导建档
POST result → 展示丰富结果
分享 / 去关系理解 / 去问答
```
### 子能力展开
| 子能力 | P1 |
|---|---|
| 测试入口(探索 Tab) | ✓ |
| 测试列表 | ✓ |
| 问题流程 | ✓ |
| 答题保存(服务端结果落库) | ✓ |
| 中断恢复 | ✓ localStorage 草稿(`scaleDraft`);提交后清除 |
| 结果生成(丰富结构) | ✓ |
| 免费层 | ✓ 全量 result |
| 深度层 | N/A(当前不锁) |
| 分享 | ✓ ShareSheet |
| AI 解释 | 软链 `/ask` |
| 数据统计 | 埋点名定义;SDK `Gap` |
| 验收标准 | §12 |
---
## 5. 页面设计
| 路由 | 页面 |
|---|---|
| `/explore` | ExplorePage |
| `/scales/:slug` | ScalePage |
```text
/scales/:slug
├── Loading(题目)
├── Normal(答题中)
├── Empty/NeedProfile(提交前无档案)
├── Error
└── Result(完成后)
```
---
## 6. 页面状态规范
| 状态 | UI |
|---|---|
| Loading | 加载题目 |
| Error | 重试 |
| Normal | 进度 + 单选题 |
| NeedProfile | 引导首页 |
| Result | ReportRich 结构展示 |
---
## 7. Business Rules
| ID | Rule |
|---|---|
| R1 | 仅 `published` 量表可列表/作答 |
| R2 | 提交前答案覆盖全部题目 |
| R3 | 必须绑定用户 Self `profile_id` |
| R4 | 计分:多数选项 → style;结果文案 lexicon 安全 |
| R5 | result 含 label/summary/overview/dimensions/tips/scripts/growth_plan/faq |
| R6 | 结果「不是固定标签」需在文案中提示 |
| R7 | 作答过程写入本地草稿(按 slug);提交成功后清除;刷新可恢复未提交答案 |
---
## 8. 数据模型影响
| 表 | 备注 |
|---|---|
| `scales` / `scale_questions` | seed |
| `scale_results` | answers + result jsonb |
---
## 9. API 需求
| Method | Path | 意图 |
|---|---|---|
| GET | `/api/v1/scales` | 列表 |
| GET | `/api/v1/scales/{slug}` | 题目 |
| POST | `/api/v1/scales/{slug}/result` | 提交计分 |
---
## 10. 权限设计
| 能力 | Visitor 无档案 | Visitor 有 Self |
|---|---|---|
| 看列表/题目 | ✓ | ✓ |
| 提交结果 | ✗ | ✓ |
---
## 11. 埋点
| Event | 触发 |
|---|---|
| `scale_list_viewed` | 探索列表 |
| `scale_started` | 进入作答 |
| `scale_completed` | 出结果 |
| `scale_share_clicked` | 分享 |
| `scale_cta_relation` / `scale_cta_ask` | 导流 |
---
## 12. 测试验收标准
**Given** published 量表与 Self
**When** 答完提交
**Then** 返回 label 与 overview/tips 等丰富字段
**Given** 未答完
**When** 提交
**Then** 前端拦截;不成功落库
**Given** 无 Self
**When** 提交
**Then** 引导建档
---
## 13. AI 开发前检查
- [x] Spec 齐全 · 子能力已展开 · map · lexicon · OpenAPI · 可测
---
## 14. Implementation Notes
| 项 | 内容 |
|---|---|
| Packages | `internal/scale` · `service/scale` · `ExplorePage` · `ScalePage` |
| Seeds | communication-style · emotion-pattern |
| Gaps | 结果付费墙若要做须先改 Spec;全量 §11 埋点未挂(核心漏斗见 analytics) |
| Tests | score/result L1`scaleDraft.spec`Scale 流程组件测 |
| Process Review | 草稿恢复已实现 · P1 收口 |