Pdlc prd
创建 PRD 文档(自动化生成 + 自检 + handoff)From its SKILL.md
npx -y skills add kanfu-panda/pdlc-skills --skill pdlc-prdAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 10 stars10 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.4 KB, as published. Nobody here has run it
创建 PRD 文档
根据用户提供的需求描述或已有需求文档,在 docs/01_requirements/prd/ 目录下创建一份完整的 PRD(产品需求文档)。
段一:生成 PRD
1.1 输入解析(必须执行)
从 $ARGUMENTS 中判断输入类型:
-
检测是否为文件路径:匹配以下模式之一即视为文件输入:
- 以
/、./、../、~开头 - 以
.md、.txt、.docx、.pdf、.doc结尾 - 包含
docs/或requirements/路径片段 - 是一个实际存在的文件路径
- 以
-
文件输入处理:
- 读取文件内容(支持 Markdown、纯文本、PDF)
- 若为飞书文档链接,通过飞书 API 获取
- 从内容提取:功能名称、范围、用户故事、验收标准
- 保留原文档核心内容,仅补充和结构化,不重写
- 在 PRD 中添加:
<!-- 来源文档: <原始路径> -->
-
文本输入处理:按描述推断功能需求
核心原则:文件输入是「基于已有内容结构化」,文本输入是「从零生成」。
1.2 功能ID分配
<!-- @include templates/prompts/feature-id.md -->1.3 生成 PRD 文档
- 阅读
templates/prd-template.md获取模板格式 - 阅读
docs/00_standards/coding/获取编码规范(若存在;查找未命中 → 在报告里提示consider /pdlc-standard add coding/<topic>) - 文件名格式:
<功能ID>-<功能名>-prd.md - 文档顶部加 PDLC 追溯头:
- 文档必须包含:背景与目标、目标用户、功能需求(含优先级)、非功能需求、验收标准
- 用户故事使用标准格式:"作为[角色],我希望[功能],以便[收益]"
1.4 关系检测(RFC#6)
从输入检测 feature 关系信号:
- 关键词扫描:输入含「基于 / 扩展 / 增强 / based on / extends / 依赖 / 替代 / 修复缺陷」等 → 存在关系
- 扫描现有 feature:读
docs/.pdlc-state/*.json列已有 feature 名,判断本 PRD 是否 extends/depends_on 其一 - 填 §6.1 关系表:识别到的关系填入模板「6.1 关系」表(类型/目标ID/目标名/原因)。无则留空
- 类型语义见
relations.md
Phase 2:本步从"被动检测"升级为"主动提示用户确认关系"。
1.5 核心流程挂钩(若项目已启用质量闸门)
若存在 docs/00_standards/quality-targets.yml:本 PRD 里标为 P0 / P1 的流程,
逐条比对该文件的 core_flows,在 handoff 里提示补齐尚未收录的流程及其 E2E 映射。
为什么在这里提示:
core_flows清单若靠"事后有人记得改"来维护必然腐烂, 而腐烂的清单会让质量报告产出 false-green(新增核心流没进清单 → 覆盖矩阵照样全绿)。 PRD 是这些流程的上游真源,在产出时就挂钩,比事后补救可靠。/pdlc-quality每次运行还会再做一次强制对账兜底。
段二:自检(强制)
<!-- @include templates/prompts/self-audit.md -->PRD 自检清单(必须全部检查)
完整性:
- 背景与目标:清晰说明为什么做、业务价值是什么
- 目标用户:至少一类用户角色定义明确
- 用户故事:≥ 3 条且符合标准格式
- 功能清单:每条有 P0/P1/P2 优先级标注
- 验收标准:可度量、可验证(有具体数值或明确通过/不通过条件)
- 非功能需求:至少覆盖性能、安全、可用性中的两项
一致性:
- PDLC 追溯头所有字段齐全且日期是今天实际日期
- 功能ID 格式正确(F<YYYYMMDD>-<HHMMSS>,兼容旧 F<日期>-<NN>)
- 文件路径符合规范
段三:修复(单次,不递归)
<!-- @include templates/prompts/loop-prevention.md -->针对自检清单中未通过项:
- 可自动修复 → 直接补齐/修正
- 修复后再读一遍确认修复项现在通过
- 无法自动修复 → 记录到自审报告,继续段四
段四:更新状态机 + 交接
<!-- @include templates/prompts/state-update.md -->本阶段状态机更新:
current_stage:requirements—— 仅当本阶段成功时才这样写。ok=false(含 blocked)时按state-update.md规则 5:current_stage保持原值不变、advanced_to=null、写blocked_reason。- 追加 history:
{ "stage": "requirements", "done_at": "<ISO8601>", "produced": ["docs/01_requirements/prd/<...>-prd.md"], "self_audit": { "passed": <N>, "failed": <N>, "manual": <N> } } next_step:pdlc-design
本命令的 handoff 输出:
✅ PRD 已创建:docs/01_requirements/prd/<feature-id>-<feature-name>-prd.md
📊 自检:<pass>/<total> 通过
📦 状态快照:docs/.pdlc-state/<feature-id>.json
👉 下一步:/pdlc-design <feature-id>
目标需求: $ARGUMENTS
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most product spec skills give
Counted across 483 of the 502 authors here whose files we hold, read 2026-09-06
- Write the PRD using the templatein 39 of 483, across 36 files
- Ask one question at a timein 24 of 483
- Write acceptance criteria in Given-When-Then formatin 24 of 483
- Write user stories with acceptance criteriain 22 of 483, across 21 files
- Respect ADRs in areas you touchin 21 of 483, across 17 files
- Use the domain glossary vocabulary throughout the PRDin 20 of 483, across 16 files
- Explore the repo to understand the current codebasein 19 of 483, across 15 files
- Provide testable acceptance criteriain 19 of 483, across 17 files
- Publish the PRD to the issue trackerin 18 of 483, across 14 files
- Apply the ready-for-agent triage labelin 15 of 483, across 13 files
- Prefer existing seams over new onesin 14 of 483, across 12 files
- Save the PRD as a markdown filein 14 of 483, across 9 files
Said here and by no other author read
- Detect whether input is a file path or free text
- Preserve source document content, only supplement and structure
- Add PDLC traceability header at document top
- Include background, users, prioritized requirements, non-functional needs, acceptance criteria
- Detect feature relations and fill the relation table
- Flag P0/P1 flows missing from quality targets in handoff
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.