Commit 27fae3767a86111db382b12d1eaa21651c8d8aac
1 parent
8a8e65a9
Maven 修改成 Gradle
Showing
6 changed files
with
13 additions
and
13 deletions
README.md
| @@ -169,9 +169,9 @@ erp-workflow-plugin/ | @@ -169,9 +169,9 @@ erp-workflow-plugin/ | ||
| 169 | - **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 自动安装,装不上再停下提示用户 | 169 | - **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 自动安装,装不上再停下提示用户 |
| 170 | - **MySQL 8.x** 实例已就绪(host / 库名 / 凭据取自 `config-vars.yaml` 的 `database:` 段,由你填写并完全信任;本项目只面向开发/沙盒环境,`setup-test-db.mjs` 会按该值 DROP+CREATE) | 170 | - **MySQL 8.x** 实例已就绪(host / 库名 / 凭据取自 `config-vars.yaml` 的 `database:` 段,由你填写并完全信任;本项目只面向开发/沙盒环境,`setup-test-db.mjs` 会按该值 DROP+CREATE) |
| 171 | - **`mysql2`(目标项目侧)**:A4 `db-init` 经 `lib/apply-ddl.mjs` 用 mysql2 连接 + 解析 config-vars.yaml `database:` 段 apply V1;生成的 `scripts/setup-test-db.mjs` 在测试闸门前后 drop+create 空库 | 171 | - **`mysql2`(目标项目侧)**:A4 `db-init` 经 `lib/apply-ddl.mjs` 用 mysql2 连接 + 解析 config-vars.yaml `database:` 段 apply V1;生成的 `scripts/setup-test-db.mjs` 在测试闸门前后 drop+create 空库 |
| 172 | -- **Spring Boot + Flyway**(**必需**):pom.xml 声明 `flyway-core` + `flyway-mysql`;Spring 启动时自动 apply `sql/migrations/V*.sql`。本插件生成的 `setup-test-db.mjs` 只清库,schema 必须由 Flyway 应用 | 172 | +- **Spring Boot + Flyway**(**必需**):build.gradle 声明 `flyway-core` + `flyway-mysql`;Spring 启动时自动 apply `sql/migrations/V*.sql`。本插件生成的 `setup-test-db.mjs` 只清库,schema 必须由 Flyway 应用 |
| 173 | - **本地 git 仓库**(纯本地,无需远程):A0 `project-init` 执行 `git init`;B 阶段每模块由 `coding.mjs` 的 milestone stage 本地 `git merge --no-ff` 进默认分支并 `git tag -a milestone/<id>`,完成信号由 `git tag -l` 判定。**不依赖任何远程仓库 / push / GitLab** | 173 | - **本地 git 仓库**(纯本地,无需远程):A0 `project-init` 执行 `git init`;B 阶段每模块由 `coding.mjs` 的 milestone stage 本地 `git merge --no-ff` 进默认分支并 `git tag -a milestone/<id>`,完成信号由 `git tag -l` 判定。**不依赖任何远程仓库 / push / GitLab** |
| 174 | -- **本地可运行 `mvn test` / `pnpm test`**:测试命令由 A1 写入 docs/04 § 零,生成的 `scripts/test.mjs` 由 `skeleton-gen` 产出,`coding.mjs` 的 testGate stage 调用 | 174 | +- **本地可运行 `./gradlew test` / `pnpm test`**:测试命令由 A1 写入 docs/04 § 零,生成的 `scripts/test.mjs` 由 `skeleton-gen` 产出,`coding.mjs` 的 testGate stage 调用 |
| 175 | 175 | ||
| 176 | ## 设计原则 | 176 | ## 设计原则 |
| 177 | 177 |
skills/plan/project-init/templates/CLAUDE-template.md
| @@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
| 31 | 31 | ||
| 32 | 1. **文件命名**:`sql/migrations/V<n>__<snake_case_desc>.sql`,例:`V5__add_user_email_unique_index.sql` | 32 | 1. **文件命名**:`sql/migrations/V<n>__<snake_case_desc>.sql`,例:`V5__add_user_email_unique_index.sql` |
| 33 | 2. **版本号分配**:建文件前 `ls sql/migrations/V*.sql` 查当前最大 n,新文件 `n_max + 1` | 33 | 2. **版本号分配**:建文件前 `ls sql/migrations/V*.sql` 查当前最大 n,新文件 `n_max + 1` |
| 34 | -3. **Apply 方式**:Spring Boot 启动 / 测试启动时 Flyway 自动 apply(项目必须在 `pom.xml` 声明 `flyway-core` + `flyway-mysql` 依赖)。`scripts/setup-test-db.mjs` 只负责清空库,不做 apply | 34 | +3. **Apply 方式**:Spring Boot 启动 / 测试启动时 Flyway 自动 apply(项目必须在 `build.gradle` 声明 `flyway-core` + `flyway-mysql` 依赖)。`scripts/setup-test-db.mjs` 只负责清空库,不做 apply |
| 35 | 4. **已合并的 migration 永不修改**:发现错了写一个补救 migration(如 `V7__fix_V5_index_name.sql`),旧 `V_n.sql` | 35 | 4. **已合并的 migration 永不修改**:发现错了写一个补救 migration(如 `V7__fix_V5_index_name.sql`),旧 `V_n.sql` |
| 36 | 5. **临时调试 DDL**:临时在本地试字段/索引可手动 `mysql -e`,但不写 migration;下次 `setup-test-db.mjs` 会 drop+create 清掉 | 36 | 5. **临时调试 DDL**:临时在本地试字段/索引可手动 `mysql -e`,但不写 migration;下次 `setup-test-db.mjs` 会 drop+create 清掉 |
| 37 | 6. **A4 生成的 V1**:`V1__initial_schema.sql` 是 A 阶段由 `db-init` 从 `docs/03-数据库设计文档.md`(A3 正向设计的 schema SSoT)翻译生成的初始版本;后续 V2/V3/... 由 B 阶段每个 REQ 按需写入,**同时**反向同步更新 docs/03 对应表小节以保持 SSoT 一致 | 37 | 6. **A4 生成的 V1**:`V1__initial_schema.sql` 是 A 阶段由 `db-init` 从 `docs/03-数据库设计文档.md`(A3 正向设计的 schema SSoT)翻译生成的初始版本;后续 V2/V3/... 由 B 阶段每个 REQ 按需写入,**同时**反向同步更新 docs/03 对应表小节以保持 SSoT 一致 |
skills/plan/project-init/templates/docs-04-stack-template.md
| @@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
| 21 | | 接口风格 | RESTful API | 统一规范 | 前后端接口设计规范 | | 21 | | 接口风格 | RESTful API | 统一规范 | 前后端接口设计规范 | |
| 22 | | 权限认证 | Spring Security / JWT | 最新稳定版 | 登录认证、权限控制 | | 22 | | 权限认证 | Spring Security / JWT | 最新稳定版 | 登录认证、权限控制 | |
| 23 | | API 文档 | OpenAPI / Swagger | 最新稳定版 | 接口文档与调试 | | 23 | | API 文档 | OpenAPI / Swagger | 最新稳定版 | 接口文档与调试 | |
| 24 | -| 项目构建管理 | Maven | 3.9.x | Java 项目依赖与构建 | | 24 | +| 项目构建管理 | Gradle | 7.5.x | Java 项目依赖与构建 | |
| 25 | | JDK 运行环境 | Java | 17 / 21 | Spring Boot 3 推荐版本 | | 25 | | JDK 运行环境 | Java | 17 / 21 | Spring Boot 3 推荐版本 | |
| 26 | | 部署容器 | Docker | 最新稳定版 | 容器化部署 | | 26 | | 部署容器 | Docker | 最新稳定版 | 容器化部署 | |
| 27 | | Web 服务器 / 反向代理 | Nginx | 最新稳定版 | 前端托管、反向代理、负载分发 | | 27 | | Web 服务器 / 反向代理 | Nginx | 最新稳定版 | 前端托管、反向代理、负载分发 | |
skills/plan/scope-lock/SKILL.md
| @@ -71,9 +71,9 @@ allowed-tools: Read Write Edit Grep Glob Skill AskUserQuestion Bash(mkdir *) | @@ -71,9 +71,9 @@ allowed-tools: Read Write Edit Grep Glob Skill AskUserQuestion Bash(mkdir *) | ||
| 71 | 71 | ||
| 72 | 1. 用 `Read` 读 `docs/04-技术规范.md` § 零技术栈表,确定本项目涉及的每个 stack(如后端、前端,可能多个)。 | 72 | 1. 用 `Read` 读 `docs/04-技术规范.md` § 零技术栈表,确定本项目涉及的每个 stack(如后端、前端,可能多个)。 |
| 73 | 2. 对**每个 stack**,用 `AskUserQuestion`(如默认值可推断则展示默认值让用户确认/覆盖)收集四类命令: | 73 | 2. 对**每个 stack**,用 `AskUserQuestion`(如默认值可推断则展示默认值让用户确认/覆盖)收集四类命令: |
| 74 | - - **build**(构建命令,如 `mvn package` / `npm run build`) | 74 | + - **build**(构建命令,如 `./gradlew build` / `npm run build`) |
| 75 | - **lint**(静态检查命令,如 `npm run lint`) | 75 | - **lint**(静态检查命令,如 `npm run lint`) |
| 76 | - - **unit**(单元测试命令,如 `mvn test` / `npm run test:unit`) | 76 | + - **unit**(单元测试命令,如 `./gradlew test` / `npm run test:unit`) |
| 77 | - **e2e**(端到端测试命令,如 `npm run test:e2e`;无则显式记 `无`) | 77 | - **e2e**(端到端测试命令,如 `npm run test:e2e`;无则显式记 `无`) |
| 78 | 3. 把确认后的命令写入 `docs/04-技术规范.md` § 零(若 § 零无「命令」小节则用 `Edit` 新增一个「命令清单」小节,按 stack 分组列出 build/lint/unit/e2e 四行)。这些命令是 Coding 阶段 `coding.mjs` 的 tdd / test-gate 读取来源,必须在此锁全。 | 78 | 3. 把确认后的命令写入 `docs/04-技术规范.md` § 零(若 § 零无「命令」小节则用 `Edit` 新增一个「命令清单」小节,按 stack 分组列出 build/lint/unit/e2e 四行)。这些命令是 Coding 阶段 `coding.mjs` 的 tdd / test-gate 读取来源,必须在此锁全。 |
| 79 | 79 |
skills/plan/skeleton-gen/templates/gitignore-append-template
| 1 | # ==== ERP 插件推荐忽略项(skeleton-gen 追加) ==== | 1 | # ==== ERP 插件推荐忽略项(skeleton-gen 追加) ==== |
| 2 | # 注:项目配置(含凭据)统一在 config-vars.yaml,随项目提交(内部 git 传播),不在此忽略。 | 2 | # 注:项目配置(含凭据)统一在 config-vars.yaml,随项目提交(内部 git 传播),不在此忽略。 |
| 3 | 3 | ||
| 4 | -# Java / Maven | ||
| 5 | -target/ | 4 | +# Java / Gradle |
| 5 | +.gradle/ | ||
| 6 | *.class | 6 | *.class |
| 7 | 7 | ||
| 8 | -# Node / 前端构建产物 | 8 | +# 构建产物(build/ 同时覆盖 Gradle 输出与前端构建目录) |
| 9 | node_modules/ | 9 | node_modules/ |
| 10 | dist/ | 10 | dist/ |
| 11 | build/ | 11 | build/ |
workflows/coding.mjs
| @@ -344,7 +344,7 @@ function planPrompt(id, phase, specPath) { | @@ -344,7 +344,7 @@ function planPrompt(id, phase, specPath) { | ||
| 344 | '## 计划写作原则', | 344 | '## 计划写作原则', |
| 345 | '- Plan 告诉 TDD 执行者**做什么**,不是**怎么写代码**(执行者是同模型、全上下文的 tdd stage)。', | 345 | '- Plan 告诉 TDD 执行者**做什么**,不是**怎么写代码**(执行者是同模型、全上下文的 tdd stage)。', |
| 346 | `- Plan 锁定**文件边界 + 测试意图 + ${fe ? 'props 契约' : 'API 形状'} + 完成判据**;代码由 TDD 红绿循环产出。`, | 346 | `- Plan 锁定**文件边界 + 测试意图 + ${fe ? 'props 契约' : 'API 形状'} + 完成判据**;代码由 TDD 红绿循环产出。`, |
| 347 | - '- **禁止 dump 整个文件内容**(pom.xml / entity / config / 组件源码)到 plan——避免双 source of truth 漂移。', | 347 | + '- **禁止 dump 整个文件内容**(build.gradle / entity / config / 组件源码)到 plan——避免双 source of truth 漂移。', |
| 348 | fe ? '- 每个任务标注"测试先行类型" = **jsdom 组件测试** OR **Playwright E2E**。' : '', | 348 | fe ? '- 每个任务标注"测试先行类型" = **jsdom 组件测试** OR **Playwright E2E**。' : '', |
| 349 | '- DRY、YAGNI、TDD、frequent commits。', | 349 | '- DRY、YAGNI、TDD、frequent commits。', |
| 350 | '', | 350 | '', |
| @@ -382,7 +382,7 @@ function tddPrompt(id, phase, planPath) { | @@ -382,7 +382,7 @@ function tddPrompt(id, phase, planPath) { | ||
| 382 | `- 计划文件:\`${planPath}\`(不存在则 halt)。`, | 382 | `- 计划文件:\`${planPath}\`(不存在则 halt)。`, |
| 383 | `- 测试命令来源:\`${ROOT}/docs/04-技术规范.md § 零\`${fe | 383 | `- 测试命令来源:\`${ROOT}/docs/04-技术规范.md § 零\`${fe |
| 384 | ? ' 的 `frontend.unit_test_runner` / `frontend.e2e_runner` / `frontend.test_command` / `frontend.e2e_command`(缺失则默认 `pnpm test:ci` / `pnpm e2e:ci`)。' | 384 | ? ' 的 `frontend.unit_test_runner` / `frontend.e2e_runner` / `frontend.test_command` / `frontend.e2e_command`(缺失则默认 `pnpm test:ci` / `pnpm e2e:ci`)。' |
| 385 | - : ' 确认的后端测试命令(如 Maven profile / `./scripts/test.mjs`);缺失则默认 `node scripts/test.mjs`(与 test-gate 一致)。'}`, | 385 | + : ' 确认的后端测试命令(如 Gradle task / `./scripts/test.mjs`);缺失则默认 `node scripts/test.mjs`(与 test-gate 一致)。'}`, |
| 386 | '', | 386 | '', |
| 387 | '## 流程', | 387 | '## 流程', |
| 388 | fe ? '' : '- **Schema 改动前置**(仅当 plan 声明需要):第一个任务写 migration 文件 `V<n>__<snake_case>.sql`(`<n>` = 现有 `sql/migrations/V*.sql` 最大版本号 + 1,只含 DDL),**同步**把新 CREATE / ALTER 反向更新到 `docs/03-数据库设计文档.md` 对应表小节(docs/03 是 schema 的 SSoT),migration + docs/03 改动同一 commit。', | 388 | fe ? '' : '- **Schema 改动前置**(仅当 plan 声明需要):第一个任务写 migration 文件 `V<n>__<snake_case>.sql`(`<n>` = 现有 `sql/migrations/V*.sql` 最大版本号 + 1,只含 DDL),**同步**把新 CREATE / ALTER 反向更新到 `docs/03-数据库设计文档.md` 对应表小节(docs/03 是 schema 的 SSoT),migration + docs/03 改动同一 commit。', |
| @@ -395,7 +395,7 @@ function tddPrompt(id, phase, planPath) { | @@ -395,7 +395,7 @@ function tddPrompt(id, phase, planPath) { | ||
| 395 | : '', | 395 | : '', |
| 396 | '', | 396 | '', |
| 397 | '## 护栏', | 397 | '## 护栏', |
| 398 | - '- **绝不**在主会话直接跑测试(mvn / pnpm / playwright / scripts/test.mjs)——必须通过 Agent 子会话。', | 398 | + '- **绝不**在主会话直接跑测试(gradle / pnpm / playwright / scripts/test.mjs)——必须通过 Agent 子会话。', |
| 399 | fe | 399 | fe |
| 400 | ? '- **绝不**写非 `frontend/` 路径的 `impl_file`;命中 `backend/` / `sql/` / `scripts/` → 硬停并打印 `不允许写非前端文件:<impl_file>`。' | 400 | ? '- **绝不**写非 `frontend/` 路径的 `impl_file`;命中 `backend/` / `sql/` / `scripts/` → 硬停并打印 `不允许写非前端文件:<impl_file>`。' |
| 401 | : '- **后端阶段路径硬护栏**:任意 `impl_file` 以 `frontend/` 开头 → 硬停并打印 `后端阶段不允许写前端代码:<impl_file>`,不再继续 TDD。', | 401 | : '- **后端阶段路径硬护栏**:任意 `impl_file` 以 `frontend/` 开头 → 硬停并打印 `后端阶段不允许写前端代码:<impl_file>`,不再继续 TDD。', |
| @@ -436,7 +436,7 @@ function verifyPrompt(id, phase, implSummary, specPath, round = 0) { | @@ -436,7 +436,7 @@ function verifyPrompt(id, phase, implSummary, specPath, round = 0) { | ||
| 436 | '- **任一目标 `exit_code != 0` 或 `failed > 0`** → 渲染证据后 halt,不进入 review。', | 436 | '- **任一目标 `exit_code != 0` 或 `failed > 0`** → 渲染证据后 halt,不进入 review。', |
| 437 | ].join('\n') | 437 | ].join('\n') |
| 438 | : [ | 438 | : [ |
| 439 | - `- 测试目标:从 plan 或项目标准命令确定(Maven profile / pnpm script / pytest path / - `- 测试目标:从 plan 或项目标准命令确定(Maven profile${ROOT}/docs/04-技术规范.md § 零- `- 测试目标:从 plan 或项目标准命令确定(Maven profile 的后端命令)。`, | 439 | + `- 测试目标:从 plan 或项目标准命令确定(Gradle task / pnpm script / pytest path / + `- 测试目标:从 plan 或项目标准命令确定(Gradle task${ROOT}/docs/04-技术规范.md § 零+ `- 测试目标:从 plan 或项目标准命令确定(Gradle task 的后端命令)。`, |
| 440 | '- 派子会话执行,子会话只返回结构化 JSON:`{command, exit_code, passed, failed, failed_list, stdout_excerpt}`(`stdout_excerpt` ≤ 30 行,不塞全文 stdout)。', | 440 | '- 派子会话执行,子会话只返回结构化 JSON:`{command, exit_code, passed, failed, failed_list, stdout_excerpt}`(`stdout_excerpt` ≤ 30 行,不塞全文 stdout)。', |
| 441 | '- **`exit_code != 0` 或 `failed > 0`** → 渲染证据后 halt,不进入 review。', | 441 | '- **`exit_code != 0` 或 `failed > 0`** → 渲染证据后 halt,不进入 review。', |
| 442 | ].join('\n'), | 442 | ].join('\n'), |