From 1c9ac0b9417192dedce95e1f770018efcfffc5c6 Mon Sep 17 00:00:00 2001 From: yourname Date: Wed, 8 Apr 2026 08:50:53 +0000 Subject: [PATCH] =?UTF-8?q?sync:=20d8d-prototype=20=E6=96=B0=E5=A2=9E=20St?= =?UTF-8?q?ep=208=20=E8=87=AA=E5=8A=A8=E6=8F=90=E4=BA=A4=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 step-08-commit.md: 技能执行完成后自动 git commit + push - 更新 workflow.md 步骤表: 增加 Step 8,增量路径 [D]/[P]/[A] 指向 step-08 - 更新 step-07/step-05b: 末尾指向 step-08-commit.md Co-Authored-By: Claude Opus 4.6 --- .../steps/step-05b-update-docs.md | 2 +- .../d8d-prototype/steps/step-07-validate.md | 2 +- .../d8d-prototype/steps/step-08-commit.md | 82 +++++++++++++++++++ .claude/skills/d8d-prototype/workflow.md | 7 +- 4 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 .claude/skills/d8d-prototype/steps/step-08-commit.md diff --git a/.claude/skills/d8d-prototype/steps/step-05b-update-docs.md b/.claude/skills/d8d-prototype/steps/step-05b-update-docs.md index 484d810..91b48d4 100644 --- a/.claude/skills/d8d-prototype/steps/step-05b-update-docs.md +++ b/.claude/skills/d8d-prototype/steps/step-05b-update-docs.md @@ -139,4 +139,4 @@ const paths = [ - [ ] server.js 支持 .yaml/.yml MIME 类型 - [ ] 状态文件已更新 -**完成后,向用户展示更新结果和预览地址。** +**完成后,加载 `steps/step-08-commit.md` 执行自动提交与推送。** diff --git a/.claude/skills/d8d-prototype/steps/step-07-validate.md b/.claude/skills/d8d-prototype/steps/step-07-validate.md index 3b5481e..4aef781 100644 --- a/.claude/skills/d8d-prototype/steps/step-07-validate.md +++ b/.claude/skills/d8d-prototype/steps/step-07-validate.md @@ -173,4 +173,4 @@ prompt: 对比参考设计与实际实现,指出差异和问题 - [ ] 验证报告已生成 - [ ] 状态文件 status 已设为 completed -**全部 7 个步骤执行完毕。向用户展示验证报告和预览地址。** +**全部 7 个步骤执行完毕。加载 `steps/step-08-commit.md` 执行自动提交与推送。** diff --git a/.claude/skills/d8d-prototype/steps/step-08-commit.md b/.claude/skills/d8d-prototype/steps/step-08-commit.md new file mode 100644 index 0000000..2e7f44e --- /dev/null +++ b/.claude/skills/d8d-prototype/steps/step-08-commit.md @@ -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 个步骤执行完毕。向用户展示最终报告和预览地址。** diff --git a/.claude/skills/d8d-prototype/workflow.md b/.claude/skills/d8d-prototype/workflow.md index 24fae1b..d97bc16 100644 --- a/.claude/skills/d8d-prototype/workflow.md +++ b/.claude/skills/d8d-prototype/workflow.md @@ -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 | ## 错误处理 -- 2.49.1