sync: d8d-prototype 新增 Step 8 自动提交推送步骤 #9
@@ -139,4 +139,4 @@ const paths = [
|
||||
- [ ] server.js 支持 .yaml/.yml MIME 类型
|
||||
- [ ] 状态文件已更新
|
||||
|
||||
**完成后,向用户展示更新结果和预览地址。**
|
||||
**完成后,加载 `steps/step-08-commit.md` 执行自动提交与推送。**
|
||||
|
||||
@@ -173,4 +173,4 @@ prompt: 对比参考设计与实际实现,指出差异和问题
|
||||
- [ ] 验证报告已生成
|
||||
- [ ] 状态文件 status 已设为 completed
|
||||
|
||||
**全部 7 个步骤执行完毕。向用户展示验证报告和预览地址。**
|
||||
**全部 7 个步骤执行完毕。加载 `steps/step-08-commit.md` 执行自动提交与推送。**
|
||||
|
||||
82
.claude/skills/d8d-prototype/steps/step-08-commit.md
Normal file
82
.claude/skills/d8d-prototype/steps/step-08-commit.md
Normal file
@@ -0,0 +1,82 @@
|
||||
# Step 8: 自动提交与推送
|
||||
|
||||
**Progress: Step 8 of 8** — 最终步骤
|
||||
|
||||
## STEP GOAL
|
||||
|
||||
将所有 prototype/ 目录下的变更自动提交到 git 并推送到远程仓库。
|
||||
|
||||
## 执行序列
|
||||
|
||||
### 8.1 检查工作区状态
|
||||
|
||||
```bash
|
||||
git status --porcelain prototype/
|
||||
```
|
||||
|
||||
- 如果**无输出**(无变更):跳过提交,向用户报告"无变更需要提交"
|
||||
- 如果**有输出**:继续 8.2
|
||||
|
||||
### 8.2 暂存变更文件
|
||||
|
||||
```bash
|
||||
git add prototype/
|
||||
```
|
||||
|
||||
### 8.3 生成提交消息
|
||||
|
||||
根据执行路径自动选择消息模板:
|
||||
|
||||
| 触发场景 | 消息模板 |
|
||||
|---------|---------|
|
||||
| 全量生成(step-07 后) | `feat(prototype): 生成 {project_name} 原型 — {N} 个后台 + {M} 个前台页面` |
|
||||
| 更新文档中心(step-05b 后) | `chore(prototype): 更新文档中心 — 扫描 _bmad-output 新增 {N} 个文档` |
|
||||
| 更新特定页面(增量 [P]) | `fix(prototype): 更新 {页面名} 原型页面` |
|
||||
| 全部更新(增量 [A]) | `chore(prototype): 全量更新原型 — 文档 + 页面` |
|
||||
|
||||
**消息格式**:遵循 conventional commits (`type(scope): description`)
|
||||
|
||||
**信息来源**:
|
||||
- `{project_name}` 从状态文件 `project_name` 字段获取
|
||||
- `{N}/{M}` 从状态文件 `page_counts` 字段计算
|
||||
- 页面名从 `current_page_index` 和页面清单推断
|
||||
|
||||
### 8.4 执行提交
|
||||
|
||||
```bash
|
||||
git commit -m "消息内容"
|
||||
```
|
||||
|
||||
### 8.5 推送到远程
|
||||
|
||||
```bash
|
||||
git push
|
||||
```
|
||||
|
||||
如果 push 失败:
|
||||
- 向用户报告错误
|
||||
- 提示用户检查网络或权限
|
||||
- 不阻塞后续流程
|
||||
|
||||
### 8.6 更新状态文件
|
||||
|
||||
- 将 `step-08-commit` 加入 `completed_steps`(含 evidence 描述提交了什么)
|
||||
- 更新 `last_updated`
|
||||
|
||||
### 8.7 向用户报告
|
||||
|
||||
展示:
|
||||
- 提交的文件数量和列表摘要
|
||||
- commit hash(`git rev-parse --short HEAD`)
|
||||
- push 结果(成功/失败)
|
||||
|
||||
## 完成标志
|
||||
|
||||
- [ ] git 工作区已检查
|
||||
- [ ] 变更文件已暂存
|
||||
- [ ] commit 已创建(或无变更已跳过)
|
||||
- [ ] push 已执行(或已报告失败原因)
|
||||
- [ ] 状态文件已更新
|
||||
- [ ] 用户已收到报告
|
||||
|
||||
**全部 8 个步骤执行完毕。向用户展示最终报告和预览地址。**
|
||||
@@ -116,9 +116,9 @@ page_counts:
|
||||
→ 询问用户:
|
||||
[R] 重新生成(删除状态文件,从头开始)
|
||||
[U] 增量更新 — 选择更新范围:
|
||||
[D] 更新文档中心 — 重新扫描 _bmad-output/,更新 docs-index.html + view-doc.html
|
||||
[P] 更新特定页面 — 选择前台/后台/特定页面重新生成
|
||||
[A] 全部更新 — 文档 + 页面一起更新
|
||||
[D] 更新文档中心 — 重新扫描 _bmad-output/,更新 docs-index.html + view-doc.html → 加载 step-08-commit.md
|
||||
[P] 更新特定页面 — 选择前台/后台/特定页面重新生成 → 加载 step-08-commit.md
|
||||
[A] 全部更新 — 文档 + 页面一起更新 → 加载 step-08-commit.md
|
||||
[V] 查看当前原型(启动服务器)
|
||||
```
|
||||
|
||||
@@ -146,6 +146,7 @@ for page in page_list:
|
||||
| 5 | `steps/step-05-generate-docs.md` | 项目文档列表 | docs-index.html + view-doc.html |
|
||||
| 6 | `steps/step-06-generate-server.md` | - | server.js |
|
||||
| 7 | `steps/step-07-validate.md` | 所有已生成文件 | 验证报告 |
|
||||
| 8 | `steps/step-08-commit.md` | 所有已生成文件 + 状态文件 | git commit + push |
|
||||
|
||||
## 错误处理
|
||||
|
||||
|
||||
Reference in New Issue
Block a user