{ "module": "prd", "version": "1.0", "purpose": "Dashboard 'H 需求' tab 展示产品需求文档 (PRD.md) 内容,包含产品目标、功能需求、交付标准等。", "ui_location": "Principles 菜单 → H 需求 tab", "human_help": { "title": "H 需求 — 产品需求", "description": [ "本 tab 展示 PRD.md(产品需求文档)的完整内容,包含产品的核心目标、功能需求、验收标准等。", "PRD 文档通过 git 版本管理,历史版本可通过下方的「历史版本」折叠区查看。", "H 需求与 G 规范构成双轨制:H 描述「做什么」,G 描述「怎么做」。" ], "usage": [ "1. 查看产品的核心目标和功能需求", "2. 了解各需求的验收标准和优先级", "3. 点击「历史版本」折叠区查看 PRD 的变更历史", "4. 如需修改 PRD:编辑 docs/PRD.md → git commit → git push → 刷新本页" ], "troubleshooting": [ "如果 PRD 内容不显示:检查 docs/PRD.md 文件是否存在", "如果历史版本不显示:确认 PRD.md 已在 git 跟踪中且有提交记录" ], "related": "G 规范 tab 展示开发规范 (dev-spec.md),G+H 构成双轨规范体系" }, "ai_spec": { "apis": [ {"method": "GET", "path": "/api/prd", "returns": "{ok, content, path} — PRD.md 全文"}, {"method": "GET", "path": "/api/prd/history", "returns": "{ok, count, log} — git log 条目"} ], "dependencies": [ "docs/PRD.md 文件必须存在且在 git 跟踪中", "git 历史依赖 git log 命令可用", "PRD 通过 dev-spec.md 内容中的 'PRD' 前缀部分加载 — 或由 /api/prd 端点单独加载" ], "constraints": [ "文档展示在子 tab 中,通过 fill('prd', html) 渲染", "内容通过内置 mdRender() 函数转换 Markdown 到 HTML", "历史版本折叠区默认收起", "PRD 文档的修改应符合双轨原则:H 聊做什么,G 聊怎么做" ], "tests": [ {"id": "PRD01", "name": "/api/prd 返回 PRD.md 内容", "endpoint": "GET /api/prd"}, {"id": "PRD02", "name": "/api/prd/history 返回 git log", "endpoint": "GET /api/prd/history"}, {"id": "PRD03", "name": "H tab 展示 PRD 的 Markdown 渲染内容", "endpoint": "n/a (frontend check)"} ], "related_files": [ "docs/PRD.md — 被展示的需求文档", "gateway/scripts/dashboard.py — /api/prd, /api/prd/history", "gateway/scripts/templates/dashboard.html — fH() 渲染函数", "gateway/scripts/specs/prd.json — 本 spec 文件" ] } }