Install
$ agentstack add skill-xinyiai0724-tools-write-requirement-prd ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Skill: write-requirement-prd
类型: 需求期 Skill(requirement/ 组) 调用时机: requirement-authoring pipeline 第 2 节点
用途
在已创建的 CR worktree 内,根据用户提供的需求信息编写完整 PRD,落盘到 change-requests/{CR-ID}/prd.md。PRD 通过 engineering-docs skill 保证 frontmatter 合规。
> ⚠️ 路径约定:PRD 写入 change-requests/{CR-ID}/prd.md,不写入 specs/(specs/ 在回写期才更新)。
参数
| 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | cr_id | string | ✅ | 目标 CR-ID(如 CR-2026-003) | | source | string | ❌ | 规划报告路径或其他输入来源,用于内容提炼 | | review_feedback | object | ❌ | 来自 review-requirement 的 blockers、repair-instructions;存在时进入自修复模式 | | self_repair_attempt | number | ❌ | 当前自动修复轮次,由 pipeline reviewLoop 注入 |
执行步骤
Step 1 — 前置校验
- 确认
change-requests/{cr_id}/cr.md存在且status: drafting - 确认 knowledge-base worktree
.xinyiai-worktrees/knowledge-base/requirement/{cr_id}存在(若不存在,停止并提示先执行 requirement-register)
Step 2 — 读取上下文
- 读取
change-requests/{cr_id}/cr.md获取 title / summary / target-version / source / owners.requirement - 若
source指向规划报告路径,读取报告中对应功能的规划建议 - 读取
change-requests/_config.yml获取 PRD 模板约定 - 若存在
review_feedback,读取上一轮review-annotations/requirement.yml中的 blockers、repair-instructions 与 reviewer 摘要
Step 3 — 生成 PRD
若存在 review_feedback,先进入自修复模式:
- 逐条处理
review_feedback.blockers,按repair-instructions修订同一份prd.md。 - 保持已确认的 title、target-version、owner 和需求范围不被无关改写。
- 对每条修复增加可核查证据,例如新增/修改的 FR、AC、NFR 或范围说明。
- 输出 fixed-blockers,供下一轮
review-requirement校验。
PRD 结构遵循 engineering-docs 规范:
---
id: {cr_id}-prd
type: PRD
cr-ref: {cr_id}
title: {cr.md.title}
target-version: {target_version}
owner: {cr.md owners.requirement.id}
owner-role: requirement
status: draft
created: {YYYY-MM-DDTHH:mm:ss+08:00}
updated: {YYYY-MM-DDTHH:mm:ss+08:00}
---
章节:
- 概述 — 问题陈述与解决方案摘要
- 用户故事 — US-* 列表(角色 + 行为 + 价值)
- 功能需求 — FR-* 列表(必须可量化 / 可测试)
- 非功能需求 — 性能 / 安全 / 兼容性
- 验收标准 — AC-* 列表(对应每条 FR)
- 成功指标 — 上线后如何度量成功
- 范围排除 — 明确不做的内容
Step 4 — 落盘
落盘到当前 knowledge-base worktree(.xinyiai-worktrees/knowledge-base/requirement/{cr_id})的 change-requests/{cr_id}/prd.md。
Commit:feat({cr_id}): draft PRD - {title}
Step 5 — 更新 _backlog.yml
将 change-requests/_backlog.yml 中 {cr_id} 条目的 prd-path 字段更新为 change-requests/{cr_id}/prd.md。
Step 6 — 输出摘要
✅ PRD 已生成
文件 : change-requests/{cr_id}/prd.md
FR 数 : {N}
US 数 : {N}
下一步 : 执行 review-requirement 或 push-progress
错误处理
| 错误 | 处理 | |------|------| | CR status 非 drafting | 停止执行,提示 CR 当前状态与预期不符 | | worktree 不存在 | 停止执行,要求先运行 requirement-register | | prd.md 已存在 | 进入编辑模式(追加/修改),不覆盖已有内容;若存在 review_feedback,则优先按 blocker 定点修复 |
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: xinyiai0724
- Source: xinyiai0724/tools
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.