@agile-team/wl-skills-kit 1.2.0 → 2.1.0

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 (86) hide show
  1. package/CHANGELOG.md +130 -0
  2. package/README.md +169 -366
  3. package/bin/wl-skills.js +149 -43
  4. package/files/.github/copilot-instructions.md +105 -42
  5. package/files/.github/guides/README.md +13 -0
  6. package/files/.github/guides/architecture.md +555 -0
  7. package/files/.github/guides/usage.md +166 -0
  8. package/files/.github/reports/README.md +65 -0
  9. package/files/.github/reports/SYS_DICT_INFO.md +19 -0
  10. package/files/.github/reports/SYS_PERMISSION_INFO.md +20 -0
  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 -0
  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 -0
  13. package/files/.github/skills/_compat/README.md +108 -0
  14. package/files/.github/skills/_compat/editors.json +61 -0
  15. package/files/.github/skills/_compat/headers/agents.txt +8 -0
  16. package/files/.github/skills/_compat/headers/claude-code.txt +7 -0
  17. package/files/.github/skills/_compat/headers/cline.txt +7 -0
  18. package/files/.github/skills/_compat/headers/cursor-mdc.txt +16 -0
  19. package/files/.github/skills/_compat/headers/cursor-rules.txt +7 -0
  20. package/files/.github/skills/_compat/headers/github-copilot.txt +1 -0
  21. package/files/.github/skills/_compat/headers/kiro.txt +10 -0
  22. package/files/.github/skills/_compat/headers/trae.txt +11 -0
  23. package/files/.github/skills/_compat/headers/windsurf.txt +7 -0
  24. package/files/.github/skills/_registry.md +81 -0
  25. package/files/.github/skills/{api-contract → core/api-contract}/SKILL.md +126 -29
  26. package/files/.github/skills/core/api-contract/USAGE.md +110 -0
  27. package/files/.github/skills/core/convention-audit/SKILL.md +189 -0
  28. package/files/.github/skills/core/convention-audit/USAGE.md +99 -0
  29. package/files/.github/skills/{page-codegen → core/page-codegen}/SKILL.md +67 -22
  30. package/files/.github/skills/core/page-codegen/USAGE.md +102 -0
  31. package/files/.github/skills/core/page-codegen/templates/_index.md +46 -0
  32. package/files/.github/skills/core/page-codegen/templates/domains/_CONTRIBUTING.md +107 -0
  33. package/files/.github/skills/{page-codegen → core/page-codegen/templates/domains/produce}/TPL-OPERATION-STATION.md +442 -442
  34. package/files/.github/skills/core/page-codegen/templates/domains/sale/README.md +26 -0
  35. package/files/.github/skills/{page-codegen → core/page-codegen/templates/universal}/TPL-DETAIL-TABS.md +94 -39
  36. package/files/.github/skills/{page-codegen → core/page-codegen/templates/universal}/TPL-DRIVEN.md +124 -124
  37. package/files/.github/skills/{prototype-scan → core/prototype-scan}/SKILL.md +87 -3
  38. package/files/.github/skills/core/prototype-scan/USAGE.md +95 -0
  39. package/files/.github/skills/core/template-extract/SKILL.md +139 -0
  40. package/files/.github/skills/core/template-extract/USAGE.md +93 -0
  41. package/files/.github/skills/domain/README.md +51 -0
  42. package/files/.github/skills/ops/code-fix/SKILL.draft.md +108 -0
  43. package/files/.github/skills/sync/dict-sync/SKILL.draft.md +100 -0
  44. package/files/.github/skills/{menu-sync → sync/menu-sync}/SKILL.md +258 -258
  45. package/files/.github/skills/sync/menu-sync/USAGE.md +104 -0
  46. package/files/.github/skills/{menu-sync → sync/menu-sync}/env/guide.md +83 -83
  47. package/files/.github/skills/sync/permission-sync/SKILL.draft.md +91 -0
  48. package/files/.github/standards/01-toolchain.md +57 -0
  49. package/files/.github/standards/02-code-structure.md +111 -0
  50. package/files/.github/standards/03-comments.md +53 -0
  51. package/files/.github/standards/04-coding-basics.md +33 -0
  52. package/files/.github/standards/05-logging.md +38 -0
  53. package/files/.github/standards/06-security.md +44 -0
  54. package/files/.github/standards/07-config.md +52 -0
  55. package/files/.github/standards/08-git.md +60 -0
  56. package/files/.github/standards/09-typescript.md +71 -0
  57. package/files/.github/standards/10-pinia.md +57 -0
  58. package/files/.github/standards/11-form-validation.md +81 -0
  59. package/files/.github/standards/12-base-table.md +116 -0
  60. package/files/.github/standards/13-platform-components.md +123 -0
  61. package/files/.github/standards/index.md +89 -0
  62. package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/data.ts +196 -196
  63. package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.scss +150 -150
  64. package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.vue +79 -79
  65. package/files/docs/jh-date-range.md +257 -257
  66. package/files/docs/jh-date.md +222 -222
  67. package/files/docs/jh-dept-picker.md +190 -190
  68. package/files/docs/jh-drag-row.md +590 -590
  69. package/files/docs/jh-file-upload.md +216 -216
  70. package/files/docs/jh-picker.md +218 -218
  71. package/files/docs/jh-select.md +148 -148
  72. package/files/docs/jh-text.md +248 -248
  73. package/files/docs/jh-user-picker.md +197 -197
  74. package/package.json +4 -1
  75. package/files/.github/docs/menu-sync-design.md +0 -264
  76. package/files/.github/docs/use-skill.md +0 -382
  77. package/files/.github/docs/wl-skills-kit.md +0 -266
  78. package/files/.github/skills/convention-extract/SKILL.md +0 -236
  79. /package/files/.github/{docs → reports}/SYS_MENU_INFO.md +0 -0
  80. /package/files/.github/skills/{page-codegen → core/page-codegen/templates/universal}/TPL-CHANGE-HISTORY.md +0 -0
  81. /package/files/.github/skills/{page-codegen → core/page-codegen/templates/universal}/TPL-FORM-ROUTE.md +0 -0
  82. /package/files/.github/skills/{page-codegen → core/page-codegen/templates/universal}/TPL-LIST.md +0 -0
  83. /package/files/.github/skills/{page-codegen → core/page-codegen/templates/universal}/TPL-MASTER-DETAIL.md +0 -0
  84. /package/files/.github/skills/{page-codegen → core/page-codegen/templates/universal}/TPL-RECORD-FORM.md +0 -0
  85. /package/files/.github/skills/{page-codegen → core/page-codegen/templates/universal}/TPL-TREE-LIST.md +0 -0
  86. /package/files/.github/skills/{menu-sync → sync/menu-sync}/env/env.local.json +0 -0
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.0
4
+ * wl-skills-kit CLI v2.1
5
5
  *
6
6
  * 命令:
7
7
  * init 全量安装(默认,向后兼容)
@@ -23,6 +23,7 @@ const PKG = require("../package.json");
23
23
  const args = process.argv.slice(2);
24
24
  const dryRun = args.includes("--dry-run");
25
25
  const showHelp = args.includes("--help") || args.includes("-h");
26
+ const keepReports = args.includes("--keep-reports");
26
27
  const command = args.find((a) => !a.startsWith("-")) || "init";
27
28
 
28
29
  if (showHelp) {
@@ -38,14 +39,19 @@ if (showHelp) {
38
39
  clean 构建清理(移除开发期 AI 文件,保留 src/components + src/types)
39
40
 
40
41
  选项:
41
- --dry-run 预览模式,不实际写入/删除任何文件
42
- --help 显示帮助
42
+ --dry-run 预览模式,不实际写入/删除任何文件
43
+ --keep-reports clean 命令保留 .github/reports/(默认一起删除)
44
+ --help 显示帮助
43
45
 
44
46
  示例:
45
- npx @agile-team/wl-skills-kit 安装全量文件
46
- npx @agile-team/wl-skills-kit update 仅更新有变化的文件
47
- npx @agile-team/wl-skills-kit clean 清理开发期文件
48
- npx @agile-team/wl-skills-kit clean --dry-run 预览将要清理哪些文件
47
+ npx @agile-team/wl-skills-kit 安装全量文件
48
+ npx @agile-team/wl-skills-kit update 仅更新有变化的文件
49
+ npx @agile-team/wl-skills-kit clean 清理开发期文件
50
+ npx @agile-team/wl-skills-kit clean --keep-reports 保留 reports/中的菜单/字典数据
51
+ npx @agile-team/wl-skills-kit clean --dry-run 预览将要清理哪些文件
52
+
53
+ 保护路径(init / update 不覆盖已存在的):
54
+ .github/reports/ AI 生成报告(团队累积数据,存在则跳过)
49
55
 
50
56
  清理保护路径(clean 不删除):
51
57
  src/components/ 通用组件(被业务页面 import,构建必需)
@@ -119,16 +125,23 @@ function removeFileAndEmptyParents(filePath) {
119
125
  if (fs.readdirSync(dir).length === 0) {
120
126
  fs.rmdirSync(dir);
121
127
  dir = path.dirname(dir);
122
- } else { break; }
123
- } catch (e) { break; }
128
+ } else {
129
+ break;
130
+ }
131
+ } catch (e) {
132
+ break;
133
+ }
124
134
  }
125
135
  }
126
136
 
127
137
  /** 读取 manifest */
128
138
  function readManifest() {
129
139
  if (fs.existsSync(MANIFEST_PATH)) {
130
- try { return JSON.parse(fs.readFileSync(MANIFEST_PATH, "utf8")); }
131
- catch (e) { return null; }
140
+ try {
141
+ return JSON.parse(fs.readFileSync(MANIFEST_PATH, "utf8"));
142
+ } catch (e) {
143
+ return null;
144
+ }
132
145
  }
133
146
  return null;
134
147
  }
@@ -144,30 +157,60 @@ function isProtected(relPath) {
144
157
  return PROTECTED_PREFIXES.some((p) => relPath.startsWith(p));
145
158
  }
146
159
 
147
- // ─── 编辑器配置生成 ─────────────────────────────────────────────────────
160
+ // reports/ 中的 AI 生成报告:init/update 遇到已存在不覆盖(团队累积数据)
161
+ function isReportFile(relPath) {
162
+ return relPath.startsWith(".github/reports/") && relPath.endsWith(".md");
163
+ }
148
164
 
149
- const AUTO_HEADER =
150
- "<!-- 由 @agile-team/wl-skills-kit 自动生成。源文件:.github/copilot-instructions.md -->\n" +
151
- "<!-- 请勿手动编辑本文件,更新时重新执行:npx @agile-team/wl-skills-kit@latest -->\n\n";
165
+ // ─── 编辑器配置生成(从 _compat/editors.json 读取,特化 frontmatter 注入)─────
152
166
 
153
- const CURSOR_MDC_HEADER =
154
- "---\n" +
155
- 'description: "项目编码规范(由 wl-skills-kit 自动生成)"\n' +
156
- "alwaysApply: true\n" +
157
- "---\n\n" +
158
- AUTO_HEADER;
167
+ const AUTO_HEADER_NOTE =
168
+ "<!-- 由 @agile-team/wl-skills-kit 自动生成。源文件:.github/copilot-instructions.md -->\n" +
169
+ "<!-- 请勿手动编辑本文件,更新时重新执行:npx @agile-team/wl-skills-kit@latest update -->\n\n";
159
170
 
160
171
  function getEditorConfigs(raw) {
161
- return [
162
- ["AGENTS.md", AUTO_HEADER + raw],
163
- ["CLAUDE.md", AUTO_HEADER + raw],
164
- [".clinerules", AUTO_HEADER + raw],
165
- [".cursorrules", AUTO_HEADER + raw],
166
- [".cursor/rules/conventions.mdc", CURSOR_MDC_HEADER + raw],
167
- [".windsurfrules", AUTO_HEADER + raw],
168
- [".kiro/steering/conventions.md", AUTO_HEADER + raw],
169
- [".trae/rules/conventions.md", AUTO_HEADER + raw],
170
- ];
172
+ const editorsJsonPath = path.join(
173
+ FILES_DIR,
174
+ ".github",
175
+ "skills",
176
+ "_compat",
177
+ "editors.json",
178
+ );
179
+ const headersDir = path.join(
180
+ FILES_DIR,
181
+ ".github",
182
+ "skills",
183
+ "_compat",
184
+ "headers",
185
+ );
186
+
187
+ if (!fs.existsSync(editorsJsonPath)) {
188
+ console.warn(" ⚠ _compat/editors.json 不存在,跳过多 AI 编辑器配置生成");
189
+ return [];
190
+ }
191
+
192
+ let registry;
193
+ try {
194
+ registry = JSON.parse(fs.readFileSync(editorsJsonPath, "utf8"));
195
+ } catch (e) {
196
+ console.warn(" ⚠ _compat/editors.json 解析失败:" + e.message);
197
+ return [];
198
+ }
199
+
200
+ const configs = [];
201
+ for (const editor of registry.editors || []) {
202
+ if (editor.enabled === false) continue;
203
+ // GitHub Copilot 直接使用 .github/copilot-instructions.md,不重复生成
204
+ if (editor.outputPath === ".github/copilot-instructions.md") continue;
205
+
206
+ const headerPath = path.join(headersDir, editor.headerFile);
207
+ let header = "";
208
+ if (fs.existsSync(headerPath)) {
209
+ header = fs.readFileSync(headerPath, "utf8");
210
+ }
211
+ configs.push([editor.outputPath, header + AUTO_HEADER_NOTE + raw]);
212
+ }
213
+ return configs;
171
214
  }
172
215
 
173
216
  // ─── 命令: init / update ────────────────────────────────────────────────
@@ -187,9 +230,12 @@ function runInstall(incremental) {
187
230
 
188
231
  const oldManifest = readManifest();
189
232
  const newManifest = { version: PKG.version, files: {} };
190
- let created = 0, updated = 0, unchanged = 0;
233
+ let created = 0,
234
+ updated = 0,
235
+ unchanged = 0,
236
+ preserved = 0;
191
237
 
192
- // ── Step 1: 复制 files/ 静态文件 ───────────────────────────────────
238
+ // ── Step 1: 复制 files/ 静态文件 ───────────────────
193
239
 
194
240
  const files = walkDir(FILES_DIR, FILES_DIR);
195
241
  if (dryRun) console.log(" [Step 1] files/ 静态文件:\n");
@@ -200,9 +246,19 @@ function runInstall(incremental) {
200
246
  const srcHash = fileMd5(src);
201
247
  newManifest.files[relPath] = srcHash;
202
248
 
249
+ // reports/ 下的报告文件:已存在则跳过(保护团队累积数据)
250
+ if (isReportFile(relPath) && fs.existsSync(dest)) {
251
+ preserved++;
252
+ if (dryRun) console.log(" 保留 " + relPath + " (reports/ 已存在)");
253
+ continue;
254
+ }
255
+
203
256
  // update 模式: 跳过内容相同的文件
204
257
  if (incremental && fs.existsSync(dest)) {
205
- if (srcHash === fileMd5(dest)) { unchanged++; continue; }
258
+ if (srcHash === fileMd5(dest)) {
259
+ unchanged++;
260
+ continue;
261
+ }
206
262
  }
207
263
 
208
264
  if (dryRun) {
@@ -216,13 +272,19 @@ function runInstall(incremental) {
216
272
 
217
273
  // ── Step 2: 动态生成编辑器配置文件 ────────────────────────────────
218
274
 
219
- const INSTRUCTIONS_SRC = path.join(FILES_DIR, ".github", "copilot-instructions.md");
275
+ const INSTRUCTIONS_SRC = path.join(
276
+ FILES_DIR,
277
+ ".github",
278
+ "copilot-instructions.md",
279
+ );
220
280
  if (fs.existsSync(INSTRUCTIONS_SRC)) {
221
281
  const raw = fs.readFileSync(INSTRUCTIONS_SRC, "utf8");
222
282
  const editorConfigs = getEditorConfigs(raw);
223
283
 
224
284
  if (dryRun) {
225
- console.log("\n [Step 2] 编辑器配置文件(从 copilot-instructions.md 生成):\n");
285
+ console.log(
286
+ "\n [Step 2] 编辑器配置文件(从 copilot-instructions.md 生成):\n",
287
+ );
226
288
  }
227
289
 
228
290
  for (const [ecPath, ecContent] of editorConfigs) {
@@ -231,12 +293,17 @@ function runInstall(incremental) {
231
293
  newManifest.files[ecPath] = ecHash;
232
294
 
233
295
  if (incremental && fs.existsSync(ecDest)) {
234
- if (ecHash === fileMd5(ecDest)) { unchanged++; continue; }
296
+ if (ecHash === fileMd5(ecDest)) {
297
+ unchanged++;
298
+ continue;
299
+ }
235
300
  }
236
301
 
237
302
  if (dryRun) {
238
303
  const ecExists = fs.existsSync(ecDest);
239
- console.log(" " + (ecExists ? "覆盖" : "新增") + " [编辑器] " + ecPath);
304
+ console.log(
305
+ " " + (ecExists ? "覆盖" : "新增") + " [编辑器] " + ecPath,
306
+ );
240
307
  ecExists ? updated++ : created++;
241
308
  } else {
242
309
  writeFile(ecDest, ecContent) === "created" ? created++ : updated++;
@@ -254,7 +321,17 @@ function runInstall(incremental) {
254
321
  if (dryRun) {
255
322
  console.log("");
256
323
  if (incremental) {
257
- console.log(" 共 " + total + " 个文件(新增 " + created + ",变更 " + updated + ",未变 " + unchanged + ")(未实际写入)");
324
+ console.log(
325
+ " 共 " +
326
+ total +
327
+ " 个文件(新增 " +
328
+ created +
329
+ ",变更 " +
330
+ updated +
331
+ ",未变 " +
332
+ unchanged +
333
+ ")(未实际写入)",
334
+ );
258
335
  } else {
259
336
  console.log(" 共 " + total + " 个文件(未实际写入)");
260
337
  }
@@ -264,12 +341,20 @@ function runInstall(incremental) {
264
341
  console.log(" 新增: " + created + " 个文件");
265
342
  console.log(" 更新: " + updated + " 个文件");
266
343
  console.log(" 未变: " + unchanged + " 个文件");
344
+ if (preserved > 0)
345
+ console.log(
346
+ " 保留: " + preserved + " 个 reports/ 文件(团队累积数据不覆盖)",
347
+ );
267
348
  if (oldManifest && oldManifest.version !== PKG.version) {
268
349
  console.log(" 版本: " + oldManifest.version + " → " + PKG.version);
269
350
  }
270
351
  } else {
271
352
  console.log(" 新增: " + created + " 个文件");
272
353
  console.log(" 覆盖: " + updated + " 个文件");
354
+ if (preserved > 0)
355
+ console.log(
356
+ " 保留: " + preserved + " 个 reports/ 文件(团队累积数据不覆盖)",
357
+ );
273
358
  console.log(" 总计: " + (created + updated) + " 个文件");
274
359
  }
275
360
  }
@@ -294,8 +379,16 @@ function runClean() {
294
379
  }
295
380
 
296
381
  const allFiles = Object.keys(manifest.files);
297
- const toRemove = allFiles.filter((f) => !isProtected(f));
298
- const toKeep = allFiles.filter((f) => isProtected(f));
382
+ const toRemove = allFiles.filter((f) => {
383
+ if (isProtected(f)) return false;
384
+ if (keepReports && f.startsWith(".github/reports/")) return false;
385
+ return true;
386
+ });
387
+ const toKeep = allFiles.filter((f) => {
388
+ if (isProtected(f)) return true;
389
+ if (keepReports && f.startsWith(".github/reports/")) return true;
390
+ return false;
391
+ });
299
392
 
300
393
  if (dryRun) {
301
394
  console.log(" 将要删除(" + toRemove.length + " 个文件):\n");
@@ -308,7 +401,8 @@ function runClean() {
308
401
  console.log(" 保留 " + f);
309
402
  }
310
403
  } else {
311
- let removed = 0, skipped = 0;
404
+ let removed = 0,
405
+ skipped = 0;
312
406
  for (const f of toRemove) {
313
407
  const fullPath = path.join(TARGET_DIR, f);
314
408
  if (fs.existsSync(fullPath)) {
@@ -324,7 +418,19 @@ function runClean() {
324
418
  console.log(" ✔ 清理完成!");
325
419
  console.log(" 删除: " + removed + " 个文件");
326
420
  if (skipped > 0) console.log(" 跳过: " + skipped + " 个(已不存在)");
327
- console.log(" 保留: " + toKeep.length + " 个文件(src/components/ + src/types/)");
421
+ if (keepReports) {
422
+ console.log(
423
+ " 保留: " +
424
+ toKeep.length +
425
+ " 个文件(src/components/ + src/types/ + .github/reports/)",
426
+ );
427
+ } else {
428
+ console.log(
429
+ " 保留: " +
430
+ toKeep.length +
431
+ " 个文件(src/components/ + src/types/)",
432
+ );
433
+ }
328
434
  }
329
435
  console.log("");
330
436
  }
@@ -11,7 +11,7 @@
11
11
  - 样式:Windi CSS + SCSS
12
12
  - 状态:Pinia
13
13
  - 页面注册:`vite/plugins/shared/pages.ts` 通过 `gProd()` / `gSale()` 声明
14
- - 菜单路由配置:后端菜单表是唯一数据源。pages.ts 注册组件后,需在系统管理后台 → 菜单管理 → 新增菜单。批量新增页面时可用后端 batchImport 接口,详见 `.github/docs/menu-sync-design.md`
14
+ - 菜单路由配置:后端菜单表是唯一数据源。pages.ts 注册组件后,需在系统管理后台 → 菜单管理 → 新增菜单。批量新增页面时可用后端 batchImport 接口,详见 `.github/skills/sync/menu-sync/SKILL.md`
15
15
 
16
16
  ## 页面标准结构(4 文件)
17
17
 
@@ -198,62 +198,125 @@ onMounted(() => select());
198
198
  - ❌ 手写查询表单/工具栏/分页(用 BaseQuery/BaseToolbar/jh-pagination)
199
199
  - ❌ 每个页面重复写弹窗组件(优先用 `c_modal` 等局部公共组件)
200
200
 
201
- ## AI Skills 自动调度(强制执行 — 所有 AI 编辑器/模型通用)
202
201
 
203
- 本项目内置 5 个 Skill 文件,覆盖「原型/详设 → 可运行页面 → 菜单注册」完整流程。
204
- **执行以下任何任务前,必须先用工具读取(read_file)对应的 SKILL.md,读取完成前禁止生成任何代码或输出。**
202
+ ---
205
203
 
206
- ### Skill 注册表
204
+ ## 规范门控(standards/index.md 懒加载)
207
205
 
208
- | 触发场景(用户意图关键词) | 必须读取的文件 | Skill 名称 |
209
- |---|---|---|
210
- | 扫描原型、解析原型、页面清单、原型分析、详设文档 | `.github/skills/prototype-scan/SKILL.md` | prototype-scan |
211
- | 接口约定、api.md、字段定义、前后端对齐、接口设计 | `.github/skills/api-contract/SKILL.md` | api-contract |
212
- | 生成页面、创建页面、代码生成、vue页面、按原型生成 | `.github/skills/page-codegen/SKILL.md`(主文件会指示继续读取对应的 `TPL-*.md` 模板) | page-codegen |
213
- | 创建菜单、注册菜单、同步菜单、补菜单 | `.github/skills/menu-sync/SKILL.md` | menu-sync |
214
- | 规范审计、代码审计、规范检查、对齐规范、规范偏差 | `.github/skills/convention-extract/SKILL.md` | convention-audit |
206
+ > ⚠️ 本节为**强制约定**,所有 AI 编辑器/模型都必须遵守。
215
207
 
216
- ### 完整流水线(原型/详设 页面菜单)
208
+ 完整 13 条编码规范拆分在 `.github/standards/01 ~ 13.md`,由 `standards/index.md` 提供任务类型 规范子集映射,**按需加载,不全量读取**。
217
209
 
218
- 当用户提供原型文件或详设文档并要求批量生成页面时,按以下顺序依次执行:
210
+ | 任务类型 | 必读规范 |
211
+ | --------------------- | ------------------------------------------------- |
212
+ | A. 生成新页面 | 01, 02, 03, 04, 05, 06, 07, 09, 10, 11, 12, 13 |
213
+ | B. 修改/重构现有代码 | 02, 04, 05, 06, 09, 10, 12, 13 |
214
+ | C. 规范审计 | 全部 01 ~ 13 |
215
+ | D. 模板提取 | 02, 03, 09, 12, 13 |
216
+ | E. 数据同步(菜单等) | 04, 05, 07 |
217
+ | F. Git/分支/提交 | 08 |
218
+
219
+ **执行任何代码生成或改动前**:
220
+ 1. 先 `read_file` 加载 `standards/index.md` 确认任务类型
221
+ 2. 按映射读取对应 `standards/0X-*.md`
222
+ 3. 在 Pre-flight 声明中列出已加载文件
223
+
224
+ ---
225
+
226
+ ## AI Skills 自动调度
227
+
228
+ 完整触发词与 Skill 路径见 `skills/_registry.md`(**单一数据源**,不在此处重复)。
229
+
230
+ | Skill 名 | 状态 | 一句话说明 |
231
+ | -------------------- | -------- | --------------------------------------- |
232
+ | prototype-scan | ✅ 启用 | 原型/详设 → page-spec JSON |
233
+ | api-contract | ✅ 启用 | 生成 api.md 接口约定 |
234
+ | page-codegen | ✅ 启用 | 4 文件 + 模板调度 + 菜单追加 |
235
+ | menu-sync | ✅ 启用 | reports/SYS_MENU_INFO → 后端菜单接口 |
236
+ | convention-audit | ✅ 启用 | 13 条规范扫描 + 偏差报告 + 提取建议 |
237
+ | template-extract | ✅ 启用 | 现有页面 → 领域模板沉淀 |
238
+ | dict-sync | ⏳ PLANNED | 字典数据同步 |
239
+ | permission-sync | ⏳ PLANNED | 权限数据同步 |
240
+ | code-fix | ⏳ PLANNED | 自动整改 🟢🟡 等级偏差 |
241
+
242
+ **执行规则**:
243
+
244
+ 1. 用户消息匹配 `_registry.md` 触发词 → 用 `read_file` 加载对应 SKILL.md
245
+ 2. SKILL.md 中标注的"必读 standards"按 standards/index.md 映射加载
246
+ 3. 在 SKILL.md 指示下输出 **Pre-flight 声明**(强制)
247
+
248
+ ---
249
+
250
+ ## Pre-flight 声明(强制约定式输出)
251
+
252
+ 每次 Skill 触发时,**必须先输出**以下结构的 Pre-flight 声明,再开始执行:
219
253
 
220
254
  ```
221
- Step 1 → 读取 prototype-scan/SKILL.md 执行原型扫描 → 输出 page-spec
222
- Step 2 → 读取 api-contract/SKILL.md 生成 api.md 接口约定(先于代码生成,确保 API_CONFIG 与接口一致)
223
- Step 3 → 读取 page-codegen/SKILL.md 逐页生成代码 + 追加/覆盖 SYS_MENU_INFO.md(询问用户选择写入模式)
224
- Step 4读取 menu-sync/SKILL.md → 读取 SYS_MENU_INFO.md → 注册菜单到后端
255
+ 🚀 已触发技能 {skill-name}/SKILL.md {一句话用途}
256
+ 已读取 standards/index.md 规范门控
257
+ 已读取 standards/{相关条目} {一句话说明}
258
+ 已读取 {其他必要文档} {说明}
259
+ ✅ 工具链检测:{各项 ✓ / ✗}
260
+ ✅ {其他前置检查项,如 cid 生成等}
225
261
  ```
226
262
 
227
- 每个 Step 开始前读取对应 SKILL.md,**前一个 Step 完成后再进入下一个**。
228
- 上一步的输出(如 page-spec)直接作为下一步的输入,无需用户中间干预。
263
+ **工具链检测失败必须暂停**:
264
+
265
+ ```
266
+ ❌ 工具链检测失败:未找到 {缺失文件}
267
+ → 请执行:npx @robot-admin/git-standards init
268
+ → 或联系 CHENY(工号 409322)解决
269
+ → ⛔ 任务已暂停,修复后重新触发
270
+ ```
271
+
272
+ ---
273
+
274
+ ## 报告类文件(reports/)
275
+
276
+ AI 生成的所有报告类文件统一写入 `.github/reports/`,**全部追加不覆盖**。
277
+
278
+ | 文件 | 写入方 | 读取方 |
279
+ | --------------------------------- | ------------------ | --------------------- |
280
+ | `reports/SYS_MENU_INFO.md` | page-codegen | menu-sync |
281
+ | `reports/SYS_DICT_INFO.md` [PLANNED] | dict-collect | dict-sync |
282
+ | `reports/SYS_PERMISSION_INFO.md` [PLANNED] | permission-collect | permission-sync |
283
+ | `reports/规范审查报告.md` | convention-audit | 人工 → code-fix |
284
+ | `reports/组件提取建议.md` | convention-audit | 人工 → template-extract |
285
+
286
+ 详见 `reports/README.md`。
287
+
288
+ ---
289
+
290
+ ## 组件文档按需查阅
229
291
 
230
- > **数据闭环**:page-codegen 生成的 `SYS_MENU_INFO.md` 是 menu-sync 的唯一输入。
231
- > 菜单通过 `组件路径` 字段与 pages.ts 注册的文件路径关联,无论自动(menu-sync API)还是手动(系统管理后台)创建菜单,效果等价。
292
+ 生成代码时如需了解组件用法,按需读取以下文档(不要全量加载):
232
293
 
233
- ### 单独使用
294
+ | 主题 | 文档路径 |
295
+ | ----------------------------------- | ----------------------------------------------------- |
296
+ | BaseQuery / BaseTable / BaseToolbar | `src/components/remote/{BaseXxx}/README.md` |
297
+ | jh-* 平台组件 | `docs/jh-{name}.md` |
298
+ | c_formModal / c_listModal 等 | `src/components/local/{c_xxx}/README.md` |
299
+ | AbstractPageQueryHook 最佳实践 | `docs/page-query-hook-best-practices.md` |
300
+ | HTTP 请求工具 | `docs/request.md` |
234
301
 
235
- 用户也可以只执行单个 Skill(如只说"帮我生成客户档案页面"),此时只需读取对应的 SKILL.md,不必执行完整流水线。
302
+ > 详细对照表与"何时必读哪个文档" `standards/13-platform-components.md`。
236
303
 
237
- ### 组件文档按需查阅
304
+ ---
238
305
 
239
- 生成代码过程中如需了解组件用法,读取 `docs/` 下对应文档:
306
+ ## 领域样例参考
240
307
 
241
- | 组件 | 文档路径 |
242
- |------|---------|
243
- | BaseQuery / BaseTable / BaseToolbar | `src/components/remote/BaseQuery/README.md` 等 |
244
- | jh-select / jh-date / jh-pagination 等 | `docs/jh-select.md` / `docs/jh-date.md` 等 |
245
- | c_formModal / c_formSections / c_listModal | `src/components/local/c_formModal/README.md` 等 |
246
- | AbstractPageQueryHook 最佳实践 | `docs/page-query-hook-best-practices.md` |
247
- | HTTP 请求工具 | `docs/request.md` |
308
+ 首次生成某类页面时,可读取 `demo/` 下对应样例:
248
309
 
249
- ### 领域样例参考
310
+ | 模板类型 | 样例路径 |
311
+ | --------------------- | ------------------------------------------------------- |
312
+ | LIST | `demo/produce/aiflow/mmwr-customer-archive/` |
313
+ | FORM_ROUTE | `demo/produce/aiflow/mmwr-customer-apply-add-form/` |
314
+ | CHANGE_HISTORY | `demo/produce/aiflow/mmwr-customer-apply-change-history/` |
315
+ | DETAIL_TABS | `demo/produce/aiflow/mmwr-customer-detail/` |
316
+ | MASTER_DETAIL | `demo/sale/demo/metallurgical-spec/` |
250
317
 
251
- 首次生成某类页面时,可读取 `demo/` 下的对应样例学习实际写法:
318
+ ---
252
319
 
253
- | 模板类型 | 样例路径 |
254
- |---------|---------|
255
- | LIST(标准列表) | `demo/produce/aiflow/mmwr-customer-archive/` |
256
- | FORM_ROUTE(复杂表单) | `demo/produce/aiflow/mmwr-customer-apply-add-form/` |
257
- | CHANGE_HISTORY(变更历史) | `demo/produce/aiflow/mmwr-customer-apply-change-history/` |
258
- | DETAIL_TABS(详情Tab) | `demo/produce/aiflow/mmwr-customer-detail/` |
259
- | MASTER_DETAIL(上下分栏) | `demo/sale/demo/metallurgical-spec/` |
320
+ > 📚 完整指南:`.github/guides/usage.md`
321
+ > 🏗️ 架构设计:`.github/guides/architecture.md`
322
+ > 🔧 维护者文档:`kit-internal/`(仓库内,不安装到业务项目)
@@ -0,0 +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 仓库维护者阅读,**不安装到业务项目**