spec-coding-skills/README.md
zfc cf8b98c024 fix: Correct repository URL in README
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 11:27:38 +08:00

170 lines
4.2 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.

# Spec Coding Skills
一套 Claude Code Skills支持产品文档工作流的完整生命周期管理。
## 功能概览
```
RequirementsDoc ──▶ PRD ──▶ FeatureSummary ──▶ DevelopmentPlan ──▶ UIDesign ──▶ tasks
│ │ │ │ │ │
/rr /rp /rf /rd /ru /rt ← Review
/mr /mp /mf /md /mu /mt ← Modify
/wp /wf /wd /wu /wt ← Write
```
### Skills 列表
| 类型 | 命令 | 描述 |
|------|------|------|
| **Review** | `/rr` | 评审 RequirementsDoc.md |
| | `/rp` | 评审 PRD.md |
| | `/rf` | 评审 FeatureSummary.md |
| | `/rd` | 评审 DevelopmentPlan.md |
| | `/ru` | 评审 UIDesign.md |
| | `/rt` | 评审 tasks.md |
| **Write** | `/wp` | 从 RequirementsDoc 生成 PRD |
| | `/wf` | 从 PRD 生成 FeatureSummary |
| | `/wd` | 从 FeatureSummary 生成 DevelopmentPlan |
| | `/wu` | 从 DevelopmentPlan 生成 UIDesign |
| | `/wt` | 从 DevelopmentPlan 生成 tasks |
| **Modify** | `/mr` | 增量修改 RequirementsDoc |
| | `/mp` | 增量修改 PRD自动读取评审报告 |
| | `/mf` | 增量修改 FeatureSummary |
| | `/md` | 增量修改 DevelopmentPlan |
| | `/mu` | 增量修改 UIDesign |
| | `/mt` | 增量修改 tasks |
| **辅助** | `/iter` | 迭代变更入口Bug/功能/重构) |
| | `/up` | 文档升级迁移 |
## 安装方式
### 方式 1Git Submodule推荐
```bash
# 在你的项目根目录执行
git submodule add https://git.internal.intelligrow.cn/zhangfucai/spec-coding-skills.git .spec-coding-skills
# 创建符号链接
mkdir -p .claude
ln -s ../.spec-coding-skills/.claude/skills .claude/skills
# 提交变更
git add .gitmodules .spec-coding-skills .claude/skills
git commit -m "Add spec-coding-skills as submodule"
```
### 方式 2直接复制
```bash
# 克隆仓库
git clone https://git.internal.intelligrow.cn/zhangfucai/spec-coding-skills.git /tmp/spec-coding-skills
# 复制 skills 到你的项目
mkdir -p .claude
cp -r /tmp/spec-coding-skills/.claude/skills .claude/
# 清理
rm -rf /tmp/spec-coding-skills
```
## 更新 Skills
### Submodule 方式
```bash
# 更新到最新版本
git submodule update --remote .spec-coding-skills
git add .spec-coding-skills
git commit -m "Update spec-coding-skills"
```
### 直接复制方式
重新执行复制命令覆盖即可。
## 使用示例
### 0-1 阶段:从需求到开发
```bash
# 1. 创建需求文档
# 手动编写 doc/RequirementsDoc.md
# 2. 生成 PRD
/wp
# 3. 评审 PRD
/rp
# 4. 根据评审修改 PRD
/mp
# 5. 生成后续文档
/wf # → FeatureSummary
/wd # → DevelopmentPlan
/wu # → UIDesign
/wt # → tasks
```
### 1-100 阶段:持续迭代
```bash
# 发现问题或需要新功能
/iter
# 按提示描述问题AI 会:
# 1. 调研分析
# 2. 向你澄清确认
# 3. 更新 PRD 和 tasks
```
## 文档定位
| 文档 | 定位 | 受众 |
|------|------|------|
| PRD | 「价值主张」- 业务语言描述产品价值 | 产品、业务、管理层 |
| FeatureSummary | 「功能契约」- 精确定义功能边界 | 产品与开发的桥梁 |
| DevelopmentPlan | 「执行蓝图」- 技术方案和排期 | 开发团队 |
| UIDesign | 「界面蓝图」- ASCII 原型图 | 前端开发 |
| tasks | 「任务清单」- 可执行的开发任务 | 开发执行 |
## 目录结构
```
your-project/
├── .claude/
│ └── skills/ # ← Skills 安装位置
│ ├── rr/
│ ├── rp/
│ ├── ...
│ └── iter/
├── doc/ # ← 文档输出位置
│ ├── RequirementsDoc.md
│ ├── PRD.md
│ ├── FeatureSummary.md
│ ├── DevelopmentPlan.md
│ ├── UIDesign.md
│ └── tasks.md
└── ...
```
## 标记规范
Skills 使用注释标记追踪文档变更:
```markdown
<!-- NEW START -->
新增内容...
<!-- NEW END -->
<!-- MODIFIED: 原内容为 "xxx" -->
修改后的内容
<!-- ITER: 2024-01-23 - 修复登录验证漏洞 -->
迭代变更内容
```
## License
MIT