@agile-team/wl-skills-kit 2.2.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +33 -22
  2. package/README.md +11 -103
  3. package/bin/wl-skills.js +2 -42
  4. package/files/.github/guides/README.md +13 -13
  5. package/files/.github/guides/architecture.md +555 -555
  6. package/files/.github/guides/usage.md +176 -173
  7. package/files/.github/reports/README.md +65 -65
  8. package/files/.github/reports/SYS_DICT_INFO.md +50 -50
  9. package/files/.github/reports/SYS_MENU_INFO.md +247 -247
  10. package/files/.github/reports/SYS_PERMISSION_INFO.md +20 -20
  11. package/files/.github/reports//347/273/204/344/273/266/346/217/220/345/217/226/345/273/272/350/256/256.md +33 -33
  12. package/files/.github/reports//350/247/204/350/214/203/345/256/241/346/237/245/346/212/245/345/221/212.md +44 -44
  13. package/files/.github/skills/_compat/README.md +108 -108
  14. package/files/.github/skills/_compat/headers/agents.txt +8 -8
  15. package/files/.github/skills/_compat/headers/claude-code.txt +7 -7
  16. package/files/.github/skills/_compat/headers/cline.txt +7 -7
  17. package/files/.github/skills/_compat/headers/cursor-mdc.txt +16 -16
  18. package/files/.github/skills/_compat/headers/cursor-rules.txt +7 -7
  19. package/files/.github/skills/_compat/headers/github-copilot.txt +1 -1
  20. package/files/.github/skills/_compat/headers/kiro.txt +10 -10
  21. package/files/.github/skills/_compat/headers/trae.txt +11 -11
  22. package/files/.github/skills/_compat/headers/windsurf.txt +7 -7
  23. package/files/.github/skills/_registry.md +81 -81
  24. package/files/.github/skills/core/api-contract/SKILL.md +344 -344
  25. package/files/.github/skills/core/api-contract/USAGE.md +110 -110
  26. package/files/.github/skills/core/convention-audit/SKILL.md +189 -189
  27. package/files/.github/skills/core/convention-audit/USAGE.md +99 -99
  28. package/files/.github/skills/core/page-codegen/SKILL.md +973 -973
  29. package/files/.github/skills/core/page-codegen/USAGE.md +102 -102
  30. package/files/.github/skills/core/page-codegen/templates/_index.md +46 -46
  31. package/files/.github/skills/core/page-codegen/templates/domains/_CONTRIBUTING.md +107 -107
  32. package/files/.github/skills/core/page-codegen/templates/domains/produce/TPL-OPERATION-STATION.md +442 -442
  33. package/files/.github/skills/core/page-codegen/templates/domains/sale/README.md +26 -26
  34. package/files/.github/skills/core/page-codegen/templates/universal/TPL-CHANGE-HISTORY.md +276 -276
  35. package/files/.github/skills/core/page-codegen/templates/universal/TPL-DETAIL-TABS.md +1145 -1145
  36. package/files/.github/skills/core/page-codegen/templates/universal/TPL-DRIVEN.md +124 -124
  37. package/files/.github/skills/core/page-codegen/templates/universal/TPL-FORM-ROUTE.md +436 -436
  38. package/files/.github/skills/core/page-codegen/templates/universal/TPL-LIST.md +191 -191
  39. package/files/.github/skills/core/page-codegen/templates/universal/TPL-MASTER-DETAIL.md +148 -148
  40. package/files/.github/skills/core/page-codegen/templates/universal/TPL-RECORD-FORM.md +376 -376
  41. package/files/.github/skills/core/page-codegen/templates/universal/TPL-TREE-LIST.md +186 -186
  42. package/files/.github/skills/core/prototype-scan/SKILL.md +498 -498
  43. package/files/.github/skills/core/prototype-scan/USAGE.md +95 -95
  44. package/files/.github/skills/core/template-extract/SKILL.md +139 -139
  45. package/files/.github/skills/core/template-extract/USAGE.md +93 -93
  46. package/files/.github/skills/domain/README.md +51 -51
  47. package/files/.github/skills/sync/env.local.json +2 -1
  48. package/files/.github/skills/sync/menu-sync/SKILL.md +263 -263
  49. package/files/.github/skills/sync/menu-sync/USAGE.md +104 -104
  50. package/files/.github/skills/sync/menu-sync/env/env.local.json +7 -7
  51. package/files/.github/skills/sync/menu-sync/env/guide.md +99 -99
  52. package/files/.github/skills/sync/permission-sync/SKILL.draft.md +91 -91
  53. package/files/.github/standards/01-toolchain.md +57 -57
  54. package/files/.github/standards/02-code-structure.md +111 -111
  55. package/files/.github/standards/03-comments.md +53 -53
  56. package/files/.github/standards/04-coding-basics.md +33 -33
  57. package/files/.github/standards/05-logging.md +38 -38
  58. package/files/.github/standards/06-security.md +44 -44
  59. package/files/.github/standards/07-config.md +52 -52
  60. package/files/.github/standards/08-git.md +60 -60
  61. package/files/.github/standards/09-typescript.md +71 -71
  62. package/files/.github/standards/10-pinia.md +57 -57
  63. package/files/.github/standards/11-form-validation.md +81 -81
  64. package/files/.github/standards/12-base-table.md +153 -153
  65. package/files/.github/standards/13-platform-components.md +123 -123
  66. package/files/.github/standards/index.md +89 -89
  67. package/files/demo/produce/aiflow/mmwr-customer-apply-add/api.md +1 -1
  68. package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/data.ts +196 -196
  69. package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.scss +150 -150
  70. package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.vue +79 -79
  71. package/files/docs/jh-date-range.md +257 -257
  72. package/files/docs/jh-date.md +222 -222
  73. package/files/docs/jh-dept-picker.md +190 -190
  74. package/files/docs/jh-drag-row.md +590 -590
  75. package/files/docs/jh-file-upload.md +216 -216
  76. package/files/docs/jh-picker.md +218 -218
  77. package/files/docs/jh-select.md +148 -148
  78. package/files/docs/jh-text.md +248 -248
  79. package/files/docs/jh-user-picker.md +197 -197
  80. package/files/docs/request.md +24 -9
  81. package/files/src/components/global/C_RightToolbar/data.ts +228 -0
  82. package/files/src/components/global/C_RightToolbar/index.scss +44 -0
  83. package/files/src/components/global/C_RightToolbar/index.vue +34 -336
  84. package/files/src/components/global/C_Splitter/index.scss +61 -0
  85. package/files/src/components/global/C_Splitter/index.vue +2 -64
  86. package/files/src/components/global/C_SvgIcon/index.scss +15 -0
  87. package/files/src/components/global/C_SvgIcon/index.vue +20 -50
  88. package/files/src/components/global/C_TagStatus/index.scss +20 -0
  89. package/files/src/components/global/C_TagStatus/index.vue +1 -22
  90. package/files/src/components/global/C_Tree/data.ts +61 -0
  91. package/files/src/components/global/C_Tree/index.vue +12 -53
  92. package/files/src/components/local/c_listModal/index.scss +4 -0
  93. package/files/src/components/local/c_listModal/index.vue +1 -1
  94. package/mcp/api/client.js +76 -0
  95. package/mcp/api/dictApi.js +40 -0
  96. package/mcp/api/menuApi.js +32 -0
  97. package/mcp/config.js +47 -0
  98. package/mcp/server.js +210 -0
  99. package/mcp/tools/dictSync.js +173 -0
  100. package/mcp/tools/menuSync.js +96 -0
  101. package/package.json +6 -9
package/CHANGELOG.md CHANGED
@@ -1,43 +1,54 @@
1
1
  # Changelog
2
2
 
3
- ## [2.1.5] - 2026-04-27
3
+ ## [2.3.1] - 2026-04-27
4
4
 
5
- ### 🔄 版本自动同步 + 发布流程优化
5
+ ### 🔧 组件三文件分离规范补全 + 文档精准化
6
6
 
7
- #### 版本号自动同步机制
8
- - 新增 `scripts/sync-version.js`:npm `version` 钩子触发时自动将 `package.json` 版本号同步至 3 处文档:
9
- - `README.md` 标题行(`AI Skill 模板包 vX.X.X`)
10
- - `files/.github/guides/architecture.md` 头部「当前版本」行(含日期)
11
- - `bin/wl-skills.js` 顶部注释行
12
- - `package.json` 新增 `scripts.version` 钩子:`npm version patch/minor/major` 自动同步 + git add,无需手动改四个文件
13
- - 今后发版流程统一为三步:`npm version <type>` → `git push --follow-tags` → `npm publish`
7
+ #### global/local 组件
8
+ - **C_SvgIcon**: Options API → `<script setup lang="ts">`,修复 `scope` typo,提取内联样式到 `index.scss`
9
+ - **C_Splitter / C_TagStatus**: 内嵌样式提取到 `index.scss`,改为外链引用
10
+ - **C_Tree**: 所有逻辑提取到 `data.ts`(`createTree()`),vue 文件精简为纯模板层
11
+ - **C_RightToolbar**: 业务逻辑(列显隐、拖拽、API 调用)提取到 `data.ts`,样式提取到 `index.scss`
12
+ - **c_listModal**: 新增 `index.scss`,消除空 style
14
13
 
15
- #### 发布配置
16
- - `package.json` 新增 `publishConfig.access: "public"`,Scoped 包发布无需每次追加 `--access public`
14
+ #### 文档与规范
15
+ - `docs/request.md`: 补充 `ApiResult<T>` 显式类型定义,说明 mock `code:200` 与真实后端 `code:2000` 均被 interceptor 接受
16
+ - `page-codegen/SKILL.md` + `TPL-*.md`: mock 响应格式统一为 `code:2000 + message`
17
+ - `package.json`: `files` 补加 `mcp/`,修复 MCP server 从未被 npm 打包的 bug
17
18
 
18
19
  ---
19
20
 
20
21
  ## [2.1.4] - 2026-04-27
21
22
 
22
- ### 📝 文档增强
23
+ ### 🔧 Mock 响应格式统一
23
24
 
24
- - README 新增「技能触发 & 验证」章节:6 Skill 的触发词、输出结果、Pre-flight 说明、完整链路触发示例、异常处理表一见全貌
25
- - `convention-audit` SKILL.md frontmatter 补充触发词:`接手新项目` / `存量代码分析` / `项目体检` / `onboard project`
26
- - `_registry.md` convention-audit 行同步更新
25
+ - `page-codegen/SKILL.md`:mock 响应码 `code: 200` `code: 2000`,`msg` → `message`,与真实后端格式完全一致
26
+ - `TPL-DETAIL-TABS.md`:全部 mock 端点(list/getById/remove/save/update)响应格式同步修正
27
+ - `TPL-RECORD-FORM.md`:getBy*/saveOrUpdate mock 端点响应格式同步修正
28
+ - 修复后 AI 生成的 mock 文件与真实后端响应结构一致,避免前端 `res.code === 2000` 判断在 mock 模式下永远失败的问题
27
29
 
28
30
  ---
29
31
 
30
32
  ## [2.1.3] - 2026-04-27
31
33
 
32
- ### 🔒 安全修复 + 依赖清理
34
+ ### 🔧 组件规范补全 + API 文档修正 + MCP 发布修复
33
35
 
34
- #### env.local.json 双重保护
35
- - `init` / `update` 遇到已存在的 `env.local.json` 不再覆盖(用户填写的 token / gatewayPath 等敏感数据不丢失)
36
- - `init` / `update` 完成后自动向业务项目 `.gitignore` 追加 `env.local.json` 保护条目(若尚未包含),防止 token 意外提交到远端仓库
37
- - `--help` 保护路径说明新增 `env.local.json` 条目
36
+ #### global 组件三文件分离规范补全
37
+ - **C_SvgIcon**: Options API `<script setup lang="ts">` 重构;修复 `<style scope>` typo(改为 `scoped`);提取内联样式到新增 `index.scss`
38
+ - **C_Splitter**: `<style scoped>` 内嵌样式全部提取到新增 `index.scss`,vue 文件改为外链引用
39
+ - **C_TagStatus**: `<style scoped>` 内嵌样式全部提取到新增 `index.scss`,vue 文件改为外链引用
40
+ - **C_Tree**: 将 `<script setup>` 中所有响应式逻辑提取到新增 `data.ts`(`createTree()` 函数),vue 文件精简为模板 + 调用层
41
+ - **C_RightToolbar**: 将全部业务逻辑(列显隐、拖拽排序、保存接口调用)提取到新增 `data.ts`(`createRightToolbar()` 函数);将 `<style scoped>` 内嵌样式提取到新增 `index.scss`
38
42
 
39
- #### 依赖清理
40
- - 移除 `devDependencies` 中的 `xlsx`(CLI 本身不使用;`xlsx` 是业务项目的依赖,已在 SKILL.md 中说明安装方式)
43
+ #### local 组件规范补全
44
+ - **c_listModal**: 补充 `index.scss`(空 style 块改为外链引用)
45
+
46
+ #### API 文档修正 (code:200 → code:2000)
47
+ - `demo/produce/aiflow/mmwr-customer-apply-add/api.md`: 响应示例 `code:200, result:{}` → `code:2000, data:{}`
48
+ - `docs/request.md`: 响应示例 `code: 200` → `code: 2000`,保持与架构规范一致
49
+
50
+ #### MCP Server npm 发布修复
51
+ - `package.json` `files` 字段补充 `"mcp/"` 目录,修复之前 MCP Server 代码未被打包到 npm 的严重缺失(导致 `wl-skills init` 后 `.cursor/mcp.json` 指向的 `node_modules/.../mcp/server.js` 实际不存在)
41
52
 
42
53
  ---
43
54
 
package/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # @agile-team/wl-skills-kit
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/@agile-team/wl-skills-kit?label=wl-skills-kit&color=brightgreen)](https://www.npmjs.com/package/@agile-team/wl-skills-kit)
4
-
5
- **AI Skill 模板包 v2.2.0** — 一条命令尗13 条编码规范、8 个 AI Skill、组件文档、领域样例导入 Vue 3 项目。
3
+ **AI Skill 模板包 v2.1** — 一条命令将 13 条编码规范、6 个 AI Skill、组件文档、领域样例导入 Vue 3 项目。
6
4
 
7
5
  让 AI 编辑器(Copilot / Cursor / Windsurf / Claude Code / Cline / Kiro / Trae / 通用 Agents)**真正理解项目规范**,从原型/详设到完整页面代码全流程自动化。
8
6
 
@@ -99,7 +97,7 @@ wl-skills-kit/ ← 你正看的这个仓库
99
97
  │ │ ├── 02-code-structure.md
100
98
  │ │ ├── ... (共 13 条)
101
99
  │ │ └── 13-platform-components.md
102
- │ ├── skills/ 8 个启用 Skill + 1 个 PLANNED 草稿
100
+ │ ├── skills/ 6 个启用 Skill + 3 个 PLANNED 草稿
103
101
  │ │ ├── _registry.md ★ 触发词 → SKILL 路径单一数据源
104
102
  │ │ ├── _compat/ 多 AI 编辑器适配(配置 + headers)
105
103
  │ │ ├── core/ 核心通用 Skill
@@ -110,10 +108,10 @@ wl-skills-kit/ ← 你正看的这个仓库
110
108
  │ │ │ └── template-extract/ { SKILL.md, USAGE.md }
111
109
  │ │ ├── sync/ 数据同步类
112
110
  │ │ │ ├── menu-sync/ { SKILL.md, USAGE.md, env/ }
113
- │ │ │ ├── dict-sync/ { SKILL.md, env/ }
111
+ │ │ │ ├── dict-sync/ [PLANNED] SKILL.draft.md
114
112
  │ │ │ └── permission-sync/ [PLANNED] SKILL.draft.md
115
113
  │ │ ├── ops/ 运维类
116
- │ │ │ └── code-fix/ { SKILL.md }
114
+ │ │ │ └── code-fix/ [PLANNED] SKILL.draft.md
117
115
  │ │ └── domain/ 领域专属(按需创建)
118
116
  │ ├── guides/ 人读指南(usage.md / architecture.md)
119
117
  │ └── reports/ AI 生成报告(追加不覆盖)
@@ -197,102 +195,14 @@ npx @agile-team/wl-skills-kit update
197
195
  | `convention-audit` | ✅ 启用 | `skills/core/convention-audit/` | 13 条规范扫描 + 双报告 |
198
196
  | `template-extract` | ✅ 启用 | `skills/core/template-extract/` | 现有页面 → 领域模板 |
199
197
  | `menu-sync` | ✅ 启用 | `skills/sync/menu-sync/` | 菜单基线 ↔ 后端接口 |
200
- | `dict-sync` | 启用 | `skills/sync/dict-sync/` | 字典基线 ↔ 后端接口 |
198
+ | `dict-sync` | PLANNED | `skills/sync/dict-sync/` | 字典基线 ↔ 后端接口 |
201
199
  | `permission-sync` | ⏳ PLANNED | `skills/sync/permission-sync/` | 权限基线 ↔ 后端接口 |
202
- | `code-fix` | 启用 | `skills/ops/code-fix/` | 受控自动修复偏差 |
200
+ | `code-fix` | PLANNED | `skills/ops/code-fix/` | 受控自动修复偏差 |
203
201
 
204
202
  每个启用 Skill 同目录都有 **`SKILL.md`(AI 触发用)+ `USAGE.md`(团队成员阅读)**。
205
203
 
206
204
  ---
207
205
 
208
- ## AGGrid cid 唯一性规则
209
-
210
- > 21 个系统共享同一浏览器 origin(localStorage 共用),cid 碰撞会导致列配置互相覆盖。
211
-
212
- ```typescript
213
- // ✅ 正确:Date.now().toString(36) — 毫秒级唯一,永不重复,约 9 位 base-36
214
- cid="mca-lhfge5hc" // 表格级:{页面首字母缩写}-{base36时间戳}
215
- cid: 'mca-lhfge5hc-customerName' // 列级:{完整表格cid}-{fieldName}
216
- cid: 'mca-lhfge5hc-sub1-customerName' // 子表列级:{完整子表cid}-{fieldName}
217
-
218
- // ❌ 错误:截断十进制后6位(每11.5天循环一次)
219
- cid="mca-745831"
220
- // ❌ 错误:列级只用缩写(同页面两张表都有steelCode → mca-steelCode 碰撞)
221
- cid: 'mca-customerName'
222
- ```
223
-
224
- **Pre-flight 中 AI 自动输出**:`✅ cid 已生成:mca-lhfge5hc(mmwr-customer-archive)`
225
- `convention-audit` 遇到旧格式 cid 会标记为 🟡 偏差提示。
226
-
227
- ---
228
-
229
- ## 技能触发 & 验证
230
-
231
- > **所有编辑器使用相同的触发词**,无需区分编辑器类型。Copilot / Cursor / Windsurf / Claude Code / Cline / Kiro / Trae 读取各自对应的配置文件,内容完全一致,仅 frontmatter 格式不同。
232
-
233
- **触发成功的标志 — Pre-flight 声明**(技能触发后 AI 必须先输出):
234
-
235
- ```
236
- 🚀 已触发技能 page-codegen/SKILL.md → 页面代码生成:4文件 + 模板调度 + 前置检查
237
- ✅ 已读取 templates/_index.md → 模板注册表,匹配 → TPL-LIST.md
238
- ✅ 已读取 standards/02-code-structure.md → 4文件原则 + 三段式 + script 9段顺序
239
- ✅ cid 已生成:cXxxx(首字母缩写)
240
- ```
241
-
242
- > 看到这段输出 = 技能路径已激活,AI 遵循 Skill 规则而非默认推断。
243
- > 没有这段输出 = AI 走了默认推断,补充说:「请先读取 `.github/skills/core/xxx/SKILL.md`,再按其执行」。
244
-
245
- ### 单技能触发
246
-
247
- | 技能 | 说任意一个即可触发 | 输出结果 | 验证方法 |
248
- | ---- | ------------------ | -------- | -------- |
249
- | `prototype-scan` | 扫描原型 / 页面清单 / 口述需求 / 建个页面 / 帮我建一个XX页面 | `reports/PROTOTYPE_SCAN_*.md` 结构化页面清单 | reports/ 下有新文件 |
250
- | `api-contract` | 接口约定 / api.md / 字段定义 / 前后端对齐 | 每个页面目录下生成 `api.md` | 对应目录有 api.md |
251
- | `page-codegen` | 生成页面 / 创建页面 / 代码生成 / 帮我生成 | `index.vue + data.ts + index.scss + api.md` 4 文件 | 4 文件完整 + Pre-flight ✅ |
252
- | `convention-audit` | 规范审计 / 规范检查 / 代码审计 / **接手新项目** / **项目体检** | `reports/规范审查报告.md` + `reports/组件提取建议.md` 追加新章节 | 报告文件有新内容追加 |
253
- | `template-extract` | 提取模板 / 沉淀模板 / 模板贡献 | `skills/core/page-codegen/templates/domains/{域}/TPL-*.md` | templates/ 下有新模板文件 |
254
- | `menu-sync` | 创建菜单 / 同步菜单 / 补菜单 | API 调用结果表 + `reports/SYS_MENU_INFO.md` 更新 | 系统管理后台出现新菜单 |
255
-
256
- ### 流程组合触发
257
-
258
- **完整链路:原型 → 上线可访问(分步连续触发)**
259
-
260
- ```
261
- ① "扫描 docs/prototypes/ 下的原型,生成页面清单" → prototype-scan
262
- ② "基于清单,逐页生成 api.md" → api-contract
263
- ③ "按 api.md 生成所有页面代码" → page-codegen
264
- ④ "对刚生成的页面做规范审计" → convention-audit
265
- ⑤ "补菜单" → menu-sync
266
- ```
267
-
268
- **快捷链路:口述直接生成(单句触发)**
269
-
270
- ```
271
- "帮我建一个客户管理页面,有名称、编码、状态三个查询字段,支持新增编辑删除"
272
- → prototype-scan(内部推断)→ page-codegen → 直接输出 4 文件
273
- ```
274
-
275
- **接手存量项目(逐步推进)**
276
-
277
- ```
278
- "扫描 src/views/ 下所有页面,做规范审计,输出偏差报告" → convention-audit
279
- → 人工确认整改优先级(报告中标 🔴 / 🟡 / 🟢)
280
- → "对 {偏差文件} 做规范整改" → code-fix
281
- ```
282
-
283
- ### 触发异常处理
284
-
285
- | 现象 | 原因 | 应对 |
286
- | ---- | ---- | ---- |
287
- | 输出以 `🚀 已触发技能 xxx/SKILL.md` 开头 | ✅ 技能路径正确激活 | 继续即可 |
288
- | 直接输出代码,无 Pre-flight 声明 | AI 走了默认推断,未加载 Skill | 补充说:「先读取 `.github/skills/core/xxx/SKILL.md`,再按其执行」 |
289
- | Pre-flight 含 `❌ 工具链检测失败` | 缺少 `.prettierrc.js` / `eslint.config.ts` / `.husky/` | 执行 `npx @robot-admin/git-standards init` |
290
- | reports/ 无新文件 | 输出写到了错误路径 | 明确告知 AI:「报告写入 `.github/reports/` 目录」 |
291
-
292
- > 详细使用示例和踩坑 FAQ 见安装后的 `.github/guides/usage.md`(每个 Skill 同目录的 `USAGE.md` 也有完整示例)。
293
-
294
- ---
295
-
296
206
  ## 多 AI 编辑器适配(解耦设计)
297
207
 
298
208
  `init` / `update` 读取 `files/.github/skills/_compat/editors.json` 生成对应配置:
@@ -315,13 +225,11 @@ cid: 'mca-customerName'
315
225
 
316
226
  ## 受保护路径
317
227
 
318
- | 命令 | 保护路径 | 说明 |
319
- | ------------------------ | --------------------------------------------------- | -------------------------- |
320
- | `init` / `update` | `.github/reports/*.md` | 已存则跳过,不覆盖累积 |
321
- | `init` / `update` | `.github/skills/sync/env.local.json` | 已存则跳过,保护同步配置(菜单+字典+权限统一) |
322
- | `init` / `update` | `.github/skills/sync/menu-sync/env/env.local.json` | 旧版兼容,已存则跳过 |
323
- | `clean`(默认) | `src/components/` + `src/types/` | 业务代码必需,永不删除 |
324
- | `clean --keep-reports` | + `.github/reports/` | 保留菜单/字典/权限基线 |
228
+ | 命令 | 保护路径 | 说明 |
229
+ | ------------------------ | --------------------------------- | -------------------------- |
230
+ | `init` / `update` | `.github/reports/*.md` | 已存在则跳过,不覆盖累积 |
231
+ | `clean`(默认) | `src/components/` + `src/types/` | 业务代码必需,永不删除 |
232
+ | `clean --keep-reports` | + `.github/reports/` | 保留菜单/字典/权限基线 |
325
233
 
326
234
  ---
327
235
 
package/bin/wl-skills.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * wl-skills-kit CLI v2.2.0
4
+ * wl-skills-kit CLI v2.1
5
5
  *
6
6
  * 命令:
7
7
  * init 全量安装(默认,向后兼容)
@@ -51,8 +51,7 @@ if (showHelp) {
51
51
  npx @agile-team/wl-skills-kit clean --dry-run 预览将要清理哪些文件
52
52
 
53
53
  保护路径(init / update 不覆盖已存在的):
54
- .github/reports/ AI 生成报告(团队累积数据,存在则跳过)
55
- .github/skills/sync/menu-sync/env/env.local.json 用户本地配置(token 等,已存在则跳过)
54
+ .github/reports/ AI 生成报告(团队累积数据,存在则跳过)
56
55
 
57
56
  清理保护路径(clean 不删除):
58
57
  src/components/ 通用组件(被业务页面 import,构建必需)
@@ -163,15 +162,6 @@ function isReportFile(relPath) {
163
162
  return relPath.startsWith(".github/reports/") && relPath.endsWith(".md");
164
163
  }
165
164
 
166
- // 用户本地配置:init/update 遇到已存在不覆盖(含 token / gatewayPath 等敏感信息)
167
- const USER_LOCAL_CONFIGS = [
168
- ".github/skills/sync/env.local.json", // 统一配置(v2.1.5+,菜单+字典+权限共用)
169
- ".github/skills/sync/menu-sync/env/env.local.json", // 老版兼容
170
- ];
171
- function isUserLocalConfig(relPath) {
172
- return USER_LOCAL_CONFIGS.includes(relPath);
173
- }
174
-
175
165
  // ─── 旧版遗留路径(v1.x/v2.0 → v2.1 迁移清理)───────────────────────────
176
166
  // update 时自动检测并移除,避免旧结构与新结构并存产生歧义。
177
167
  const LEGACY_PATHS = [
@@ -293,13 +283,6 @@ function runInstall(incremental) {
293
283
  continue;
294
284
  }
295
285
 
296
- // 用户本地配置:已存在则跳过(含 token / gatewayPath 等敏感信息,不覆盖)
297
- if (isUserLocalConfig(relPath) && fs.existsSync(dest)) {
298
- preserved++;
299
- if (dryRun) console.log(" 保留 " + relPath + " (用户本地配置,不覆盖)");
300
- continue;
301
- }
302
-
303
286
  // update 模式: 跳过内容相同的文件
304
287
  if (incremental && fs.existsSync(dest)) {
305
288
  if (srcHash === fileMd5(dest)) {
@@ -317,29 +300,6 @@ function runInstall(incremental) {
317
300
  }
318
301
  }
319
302
 
320
- // ── Step 1.5: .gitignore 安全修补(防止 env.local.json 意外入 git)────────
321
-
322
- const ENV_LOCAL_GITIGNORE_ENTRIES = [
323
- ".github/skills/sync/env.local.json", // 统一配置(v2.1.5+)
324
- ".github/skills/sync/menu-sync/env/env.local.json", // 老版兼容
325
- ];
326
- const gitignorePath = path.join(TARGET_DIR, ".gitignore");
327
- if (!dryRun && fs.existsSync(gitignorePath)) {
328
- const giContent = fs.readFileSync(gitignorePath, "utf8");
329
- const missing = ENV_LOCAL_GITIGNORE_ENTRIES.filter(
330
- (e) => !giContent.includes(e)
331
- );
332
- if (missing.length > 0) {
333
- fs.appendFileSync(
334
- gitignorePath,
335
- "\n# wl-skills-kit: 本地敏感配置(token / gatewayPath,不入 git)\n" +
336
- missing.join("\n") +
337
- "\n",
338
- );
339
- console.log(" ✔ .gitignore 已追加 env.local.json 保护条目");
340
- }
341
- }
342
-
343
303
  // ── Step 2: 动态生成编辑器配置文件 ────────────────────────────────
344
304
 
345
305
  const INSTRUCTIONS_SRC = path.join(
@@ -1,13 +1,13 @@
1
- # Guides 指南目录
2
-
3
- 本目录下文档由 `wl-skills-kit` 安装到业务项目的 `.github/guides/`,作为团队成员人工维护的指南类文档。
4
-
5
- | 文件 | 内容 |
6
- | ----------------- | ---------------------------------------------- |
7
- | `usage.md` | 全套 Skill 使用说明(团队成员上手必读) |
8
- | `architecture.md` | 整体架构设计与决策记录(含菜单同步等设计内容) |
9
-
10
- > 与 `kit-internal/`(仅 wl-skills-kit 仓库可见的维护文档)严格区分:
11
- >
12
- > - `guides/` → 业务项目使用方阅读
13
- > - `kit-internal/` → wl-skills-kit 仓库维护者阅读,**不安装到业务项目**
1
+ # Guides 指南目录
2
+
3
+ 本目录下文档由 `wl-skills-kit` 安装到业务项目的 `.github/guides/`,作为团队成员人工维护的指南类文档。
4
+
5
+ | 文件 | 内容 |
6
+ | ----------------- | ---------------------------------------------- |
7
+ | `usage.md` | 全套 Skill 使用说明(团队成员上手必读) |
8
+ | `architecture.md` | 整体架构设计与决策记录(含菜单同步等设计内容) |
9
+
10
+ > 与 `kit-internal/`(仅 wl-skills-kit 仓库可见的维护文档)严格区分:
11
+ >
12
+ > - `guides/` → 业务项目使用方阅读
13
+ > - `kit-internal/` → wl-skills-kit 仓库维护者阅读,**不安装到业务项目**