Commit 415e14dffd87e50d420fe83ed46a912d6db0372c

Authored by zichun
1 parent 88f6dc2d

align docs with A0 auto-install + drop dangling soft-rule ref

- README (A0 row + prerequisites): dep check now auto-installs missing tools (was: print guide + halt, no auto-install), matching project-init SKILL
- project-init SKILL: fix typo 失败失败 -> 失败
- CLAUDE template rule #5: inline cross-module 留痕 requirement (soft-rule S2 table was removed)
README.md
... ... @@ -119,7 +119,7 @@ erp-workflow-plugin/
119 119  
120 120 | # | Skill | 作用 | 流程中谁调用 |
121 121 |---|---|---|---|
122   -| A0 | `project-init` | • **依赖检查**:检测 git / mysql / node 是否在 PATH,缺失则按 OS(darwin/win32/linux)打印安装指引并 halt(**不自动 brew/apt 安装**)<br>• 空目录初始化:用 Read/Write/Glob 工具拷模板创建 CLAUDE.md / docs/01/index.md / docs/08<br>• `git init` | `plan-start` |
  122 +| A0 | `project-init` | • **依赖检查**:检测 git / mysql / node 是否在 PATH,缺失则按 OS 自动安装,装不上再停下提示用户<br>• 空目录初始化:用 Read/Write/Glob 工具拷模板创建 CLAUDE.md / docs/01/index.md / docs/08<br>• `git init` | `plan-start` |
123 123 | A1 | `scope-lock` | • 引导填项目概述 / 技术栈 / 需求索引<br>• 按 `docs/01-需求清单/<module>/{_module.md, REQ-*.md}` 子目录结构生成 REQ 卡片(CC 据 index.md 填 `{{req_id/title/goal/rules/constraints/acceptance}}` 6 个占位,模板其余内容含输入/输出示例字段表原样复制)<br>• **A1 终结校验**:REQ 6 个占位均填真实数据、无 `{{` 残留、`config-vars.yaml` **全部配置**(包名 / 端口 / 初始账号 + DB 凭据 / 密钥占位)已锁、各 stack 的 build/lint/unit/e2e 命令写入 docs/04 § 零;缺失则在此(Plan 期)用 `AskUserQuestion` 问清(敏感凭据由用户自填,不进会话)<br>• 据模板直接 `Write` 生成 `_module.md` / `REQ-*.md`<br>• 终结校验通过后**自动**调用 `Skill(skeleton-gen)` 进入 A2(不停下) | A0 |
124 124 | A2 | `skeleton-gen` | • 生成架构文档:docs/04 § 一+ / docs/07 / docs/09<br>• 生成跨平台工具脚本:`scripts/*.mjs`(**无 chmod**;凭据 / 配置统一在 A1 产出的 config-vars.yaml)<br>• 创建 `sql/migrations/` 空目录(Flyway 准备)<br>• 用 `node ${CLAUDE_PLUGIN_ROOT}/lib/merge-gitignore.mjs` 合并 .gitignore(逐行判重) | `plan-start` |
125 125 | A3 | `db-design-gen` | • A3 起始用 `AskUserQuestion` 确认 ERP 约定(主键策略 / 租户列 / 列前缀规则,默认值可覆盖),结果写 docs/04 + CLAUDE.md<br>• 从 docs/01 REQ 卡片正向设计 `docs/03-数据库设计文档.md`(schema SSoT)<br>• 回填 REQ 卡片依赖表(`TBD(A3 自动补)` → 实际表名)<br>• **停下**等人工审阅 docs/03,审阅完毕用 `/plan-start` 续进 A4 | A2 |
... ... @@ -164,7 +164,7 @@ erp-workflow-plugin/
164 164  
165 165 ## 前置依赖
166 166  
167   -- **Node.js ≥ 18**:`lib/*.mjs` 助手 + 生成进目标项目的 `scripts/*.mjs` 为 Node ESM;`workflows/coding.mjs` 是 Claude Workflow 运行时脚本(由 `Workflow` 工具执行,不作为普通 `node` CLI 入口)。A0 `project-init` 检测 git / mysql / node 在 PATH,缺失则按 OS 打印安装指引并 halt(不自动安装)
  167 +- **Node.js ≥ 18**:`lib/*.mjs` 助手 + 生成进目标项目的 `scripts/*.mjs` 为 Node ESM;`workflows/coding.mjs` 是 Claude Workflow 运行时脚本(由 `Workflow` 工具执行,不作为普通 `node` CLI 入口)。A0 `project-init` 检测 git / mysql / node 在 PATH,缺失则按 OS 自动安装,装不上再停下提示用户
168 168 - **MySQL 8.x** 实例已就绪(host / 库名 / 凭据取自 `config-vars.yaml` 的 `database:` 段,由你填写并完全信任——`setup-test-db.mjs` 会按该值无条件 DROP+CREATE,请确保 schema 指向测试库而非生产库)
169 169 - **`mysql2`(目标项目侧)**:A4 `db-init` 经 `lib/apply-ddl.mjs` 用 mysql2 连接 + 解析 config-vars.yaml `database:` 段 apply V1;生成的 `scripts/setup-test-db.mjs` 在测试闸门前后 drop+create 空库
170 170 - **Spring Boot + Flyway**(**必需**):pom.xml 声明 `flyway-core` + `flyway-mysql`;Spring 启动时自动 apply `sql/migrations/V*.sql`。本插件生成的 `setup-test-db.mjs` 只清库,schema 必须由 Flyway 应用
... ...
skills/plan/project-init/SKILL.md
... ... @@ -23,7 +23,7 @@ allowed-tools: Read Write Glob Edit Skill Bash(node *) Bash(git init) Bash(git r
23 23  
24 24 ### B. 依赖检查
25 25  
26   -检测 git/mysql/node 是否在 PATH; 缺失则自动安装;如果安装失败失败再停下并提示用户.
  26 +检测 git/mysql/node 是否在 PATH; 缺失则自动安装;如果安装失败再停下并提示用户.
27 27  
28 28 完成后,在 `docs/08-模块任务管理.md` 中勾选:
29 29 - ` - [ ] 依赖检查通过`
... ...
skills/plan/project-init/templates/CLAUDE-template.md
... ... @@ -21,7 +21,7 @@
21 21 2. **严格遵循** `docs/09-项目目录结构.md`——文件放对位置
22 22 3. **每个后端接口** 必须先在 `docs/05-API接口契约.md` 定义,再编码实现
23 23 4. **每个功能可追溯到 `REQ-XXX-NNN`**——commit tag + 代码注释(如 `// REQ-SYS-001: 用户登录`)+ plan/spec 文件名均用此 tag
24   -5. **遇到跨模块改动**(动到非当前模块的代码)——按 § 🟡 软规则 **S2** 执行(允许改,但必须留痕)
  24 +5. **遇到跨模块改动**(动到非当前模块的代码)——允许改,但必须在《模块完成报告》记录原因 / 影响评估(留痕)
25 25  
26 26 ### 你禁止做的 🚫
27 27  
... ...