@agile-team/wl-skills-kit 2.9.4 → 2.10.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.
@@ -125,15 +125,28 @@ wls_menu_sync_from_report ← MCP 工具,自动读报告 + 查菜单树 + 一
125
125
  - "接手新项目"
126
126
  - "项目体检"
127
127
  - "规范审计"
128
+ - "确认修复效果" / "复扫验证"
128
129
 
129
- **推荐流程**:
130
+ **推荐流程(完整闭环)**:
130
131
 
131
132
  ```
132
133
  wls_code_scan ← 概览:页面目录、API_CONFIG、文件完整性
133
134
  → convention-audit ← 14 条规范全量扫描,产出 AUDIT_*.md
134
- → code-fix(可选) 自动修复可整改项
135
+ → code-fix 自动修复可整改项(用户确认 diff 后写入)
136
+ → wl-skills validate ← ★ 强制复扫(自动执行,不等确认)
137
+ → 闭环确认 ← 0 error = 可提交;有残余 = 继续处理
135
138
  ```
136
139
 
140
+ **闭环强制规则**:
141
+ - code-fix 完成后必须自动执行 `wl-skills validate` 复扫
142
+ - 复扫未通过时,提示用户继续修复或标记人工处理
143
+ - 大规模修复后可另触发 `convention-audit --quick` 进行轻量级复扫
144
+
145
+ **关键检查点**:
146
+ - convention-audit 报告是否包含所有页面
147
+ - code-fix 仅修 🟡🟢,🔴 必须人工或 page-codegen
148
+ - 复扫通过后才可 git commit
149
+
137
150
  ---
138
151
 
139
152
  ## 6. 场景:仅 mock 跑通 / 后端没好先能跑
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "项目编码规范(13 条标准 + 10 个 Skill 自动调度,由 wl-skills-kit 自动生成)"
2
+ description: "项目编码规范(14 条标准 + 11 个 Skill 自动调度,由 wl-skills-kit 自动生成)"
3
3
  globs:
4
4
  - "**/*.vue"
5
5
  - "**/*.ts"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  inclusion: always
3
- description: 项目编码规范(13 条标准 + 10 个 Skill 自动调度)
3
+ description: 项目编码规范(14 条标准 + 11 个 Skill 自动调度)
4
4
  ---
5
5
 
6
6
  <!-- Kiro Steering 规则。由 @agile-team/wl-skills-kit 自动生成。-->
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "项目编码规范(13 条标准 + 10 个 Skill 自动调度,由 wl-skills-kit 自动生成)"
2
+ description: "项目编码规范(14 条标准 + 11 个 Skill 自动调度,由 wl-skills-kit 自动生成)"
3
3
  globs: ["**/*.vue", "**/*.ts", "**/*.tsx", "**/*.js", "**/*.scss"]
4
4
  alwaysApply: true
5
5
  ---
@@ -2,6 +2,7 @@
2
2
 
3
3
  > 本文件定义 Skill 间的输入/输出契约和推荐后续动作,是 Agent Pipeline 的调度依据。
4
4
  > Pipeline 只做**建议式串联**:AI 完成一步后提示下一步,是否继续由用户确认。
5
+ > **例外**:code-fix → validate 复扫是**强制约定**,不需要用户确认即自动执行。
5
6
 
6
7
  ---
7
8
 
@@ -18,20 +19,24 @@
18
19
  ## 2. Pipeline 总览
19
20
 
20
21
  ```text
21
- prototype-scan
22
+ prototype-scan // 原型线:Axure / 截图 / 口述 / 非规范详设
23
+ spec-doc-parse // 规范线:wl-skills-design 标准说明书(二者二选一,汇聚同一 page-spec)
22
24
  → business-doc-extract(可选,资料达模块级时推荐)
23
25
  → api-contract
24
26
  → page-codegen
25
- → convention-audit
27
+ → convention-audit(规范线可追加 --mode spec-align 生成 GAP 报告)
26
28
  → code-fix(可选)
27
29
  → menu-sync / dict-sync / permission-sync(按页面需要选择)
28
30
  → template-extract(成熟页面沉淀,可选)
29
31
  ```
30
32
 
33
+ > **双线隔离**:`prototype-scan`(原型线)与 `spec-doc-parse`(规范线)是互斥的两个入口,按输入类型二选一(详见 `_registry.md` 调度规则优先级 0),输出格式完全相同,下游无感知。
34
+
31
35
  常见变体:
32
36
 
33
37
  ```text
34
38
  口述需求 → page-codegen → convention-audit // 碎片化,不走业务文档
39
+ 标准说明书 → spec-doc-parse → api-contract → page-codegen → convention-audit --mode spec-align // 规范线闭环
35
40
  存量项目反向梳理 → business-doc-extract → convention-audit
36
41
  原型/详设 → business-doc-extract → api-contract → page-codegen
37
42
  存量项目体检 → convention-audit → code-fix
@@ -48,12 +53,13 @@ prototype-scan
48
53
 
49
54
  | Skill | input_from | output_file | next_suggest |
50
55
  |---|---|---|---|
51
- | `prototype-scan` | 原型/详设/口述需求 | `.github/reports/PROTOTYPE_SCAN_*.md` | `business-doc-extract`(资料达模块级)或 `api-contract` |
56
+ | `prototype-scan` | 原型/非规范详设/口述需求 | `.github/reports/PROTOTYPE_SCAN_*.md` | `business-doc-extract`(资料达模块级)或 `api-contract` |
57
+ | `spec-doc-parse` | wl-skills-design 标准说明书(`docs/spec/{项目代号}/ch1-3.md` + `4.x-*.md` + `4.N-data-report.md`) | `.github/reports/SPEC_PARSE_*.md`(含 page-spec JSON + 解析报告) | `api-contract`(处理完阻断/待确认项后) |
52
58
  | `business-doc-extract` | 已发布原型目录 / 详设 / 字段实体 / 字典资料 / 现有页面 + `api.md` / `prototype-scan` 输出 | `docs/business/index.md` + `docs/business/open-questions.md` + `docs/business/0X-xx/{index,requirement,dictionary,field}.md` | `api-contract` 或 `page-codegen`(项目需求依据) |
53
- | `api-contract` | `prototype-scan` 输出、`docs/business/0X-xx/requirement.md` + `field.md` 或用户口述接口信息 | `src/views/**/api.md` | `page-codegen` |
59
+ | `api-contract` | `prototype-scan` 输出、`spec-doc-parse` 输出、`docs/business/0X-xx/requirement.md` + `field.md` 或用户口述接口信息 | `src/views/**/api.md` | `page-codegen` |
54
60
  | `page-codegen` | `api.md` / page-spec / 用户口述需求 | `src/views/**/{index.vue,data.ts,index.scss,api.md}` + `.github/reports/SYS_MENU_INFO.md` | `convention-audit`;如有菜单则 `menu-sync` |
55
- | `convention-audit` | 任意源码目录或文件 | `.github/reports/AUDIT_*.md` | 有可自动修复项时 `code-fix`;有菜单/字典/权限差异时对应 sync Skill |
56
- | `code-fix` | `convention-audit` 报告 | 源码 diff / 修复摘要 | `convention-audit` 复扫 |
61
+ | `convention-audit` | 任意源码目录或文件;`--mode spec-align` 时额外入 `spec-doc-parse` 的 page-spec / 说明书 | `.github/reports/AUDIT_*.md`;`--mode spec-align` 输出 `SPEC_GAP_*.md` | 有可自动修复项时 `code-fix`;有菜单/字典/权限差异时对应 sync Skill |
62
+ | `code-fix` | `convention-audit` 报告 | 源码 diff / 修复摘要 | **强制** `wl-skills validate` 复扫(自动执行,不等确认);可选 `convention-audit --quick` |
57
63
  | `menu-sync` | `.github/reports/SYS_MENU_INFO.md` | 后端菜单数据 + 同步摘要 | `permission-sync`(如需角色授权/动作) |
58
64
  | `dict-sync` | `.github/reports/SYS_DICT_INFO.md` | 后端字典数据 + 同步摘要 | `convention-audit` 复扫(如页面依赖字典) |
59
65
  | `permission-sync` | `.github/reports/SYS_PERMISSION_INFO.md` 或用户口述权限需求 | 后端角色/授权/动作数据 + 同步摘要 | `convention-audit` 复扫权限码使用 |
@@ -70,13 +76,24 @@ AI 每完成一个 Skill,必须输出:
70
76
  - 产物:{output_file}
71
77
  - 关键数据:{counts / changed files / backend ids}
72
78
  - 风险:{manual review items}
79
+ - 复扫结果:{code-fix 专属,其他 Skill 可省略}
73
80
 
74
81
  ## 建议下一步
75
82
  - next_suggest:{skill-name}
76
83
  - 原因:{why}
77
- - 是否需要用户确认:是
84
+ - 是否需要用户确认:是 / 否(code-fix 复扫为"否",自动执行)
78
85
  ```
79
86
 
87
+ ### 强制执行 vs 建议执行
88
+
89
+ | 步骤 | 类型 | 说明 |
90
+ |------|------|------|
91
+ | code-fix → wl-skills validate | **强制** | 修复后自动复扫,不等用户确认 |
92
+ | code-fix → convention-audit --quick | **建议** | 大规模修复后推荐 |
93
+ | page-codegen → convention-audit | **建议** | 生成后建议审计 |
94
+ | convention-audit → code-fix | **建议** | 有可修复项时推荐 |
95
+ | 其他所有 next_suggest | **建议** | 用户确认后执行 |
96
+
80
97
  ---
81
98
 
82
99
  ## 5. MCP/CLI 辅助能力
@@ -13,6 +13,7 @@ skills/
13
13
 
14
14
  ├── core/ 核心通用 Skill(任何前端业务项目通用)
15
15
  │ ├── prototype-scan/
16
+ │ ├── spec-doc-parse/
16
17
  │ ├── api-contract/
17
18
  │ ├── page-codegen/
18
19
  │ ├── convention-audit/
@@ -41,7 +42,8 @@ skills/
41
42
 
42
43
  | Skill 名 | 状态 | 路径 | MCP 工具依赖 | 触发关键词 |
43
44
  | ---------------- | ------- | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
44
- | prototype-scan | ✅ 启用 | `skills/core/prototype-scan/SKILL.md` | — | 扫描原型 / 解析原型 / 页面清单 / 详设文档 / 口述需求 / 建个页面 / 写个页面 / 根据截图 / 根据原型 |
45
+ | prototype-scan | ✅ 启用 | `skills/core/prototype-scan/SKILL.md` | — | 扫描原型 / 解析原型 / 页面清单 / 口述需求 / 建个页面 / 写个页面 / 根据截图 / 根据原型(**非规范零散详设**) |
46
+ | spec-doc-parse | ✅ 启用 | `skills/core/spec-doc-parse/SKILL.md` | — | 解析说明书 / 解析需求文档 / 规范文档转页面 / 根据说明书生成 / IPO 转页面 / 功能编码 / docs/spec(**wl-skills-design 标准说明书**) |
45
47
  | api-contract | ✅ 启用 | `skills/core/api-contract/SKILL.md` | — | 接口约定 / api.md / 字段定义 / 前后端对齐 / 接口设计 |
46
48
  | page-codegen | ✅ 启用 | `skills/core/page-codegen/SKILL.md` | `wls_validate_page` / `wls_doctor_ui` | 生成页面 / 创建页面 / 代码生成 / vue页面 / 按原型生成 / 帮我生成 / 列表页 / 管理页 / 台账 / mock / 假数据 / 先能跑 / AGGrid / skills-ui |
47
49
  | convention-audit | ✅ 启用 | `skills/core/convention-audit/SKILL.md` | `wls_code_scan` / `wls_audit_report_push` | 规范审计 / 代码审计 / 规范检查 / 对齐规范 / 规范偏差 / 接手新项目 / 存量代码分析 / 项目体检 |
@@ -58,6 +60,7 @@ skills/
58
60
 
59
61
  ## 调度规则
60
62
 
63
+ 0. **优先级 0(最高)— 双线隔离**:若用户输入路径含 `docs/spec/`,或文档含功能编码 `/[A-Z]{2,6}[0-9]{3}/` / IPO 表「处理逻辑」/ 流程五要素,**强制路由 `spec-doc-parse`(规范线)**,跳过 `prototype-scan` 的所有模式匹配。反之,Axure HTML / 截图 / 口述 / 非规范零散详设走 `prototype-scan`(原型线)。两线最终汇聚到同一份 page-spec JSON。
61
64
  1. **首先加载** `_best-practices.md`(场景索引,语义级路由依据),结合用户意图判断属于哪个场景
62
65
  2. 按场景指向的 Skill,`read_file` 加载对应 SKILL.md
63
66
  3. SKILL.md 中标注的 `必读 standards` 按 `standards/index.md` 任务类型映射加载
@@ -65,8 +68,14 @@ skills/
65
68
  5. 如用户表达连续交付/智能体/全流程意图,同时读取 `_pipeline.md` 获取 Skill I/O 与 `next_suggest`
66
69
  6. 在 SKILL.md 指示下输出 **Pre-flight 声明**(强制约定式输出)
67
70
  7. 页面生成任务必须额外读取 `standards/12-base-table.md`,并执行 `BaseTable + render-type="agGrid" + cid + defineColumns + renderOps` 硬约束
68
- 8. 若消息包含"风格 / skills-ui / 状态标签 / 操作列 / AGGrid",同时建议运行 `wl-skills doctor-ui`
71
+ 8. 若消息包含“风格 / skills-ui / 状态标签 / 操作列 / AGGrid”,同时建议运行 `wl-skills doctor-ui`
69
72
  9. `business-doc-extract` 不依赖关键词匹配,AI 必须按 `资料源 + 意图 + 范围` 三因素自行判断;缺资料时先询问用户提供原型/详设/字段资料路径,不要凭推断写入 `docs/business`
73
+ 10. **闭环强制约定**:code-fix 完成后必须自动执行 `wl-skills validate` 复扫,不等待用户确认
74
+ 11. **高风险 Skill 确认机制**:以下 Skill 触发前必须二次确认用户意图(输出“即将执行 XX,确认继续?”):
75
+ - `page-codegen`(会创建/覆盖文件)
76
+ - `menu-sync` / `dict-sync` / `permission-sync`(会调用后端接口写数据)
77
+ - `code-fix`(会修改源码)
78
+ 12. **误触发防护**:当用户消息同时匹配 2+ Skill 且非明确流水线意图时,必须先输出“检测到多个可能的 Skill,您的意图是?”并列出候选,而不是自行决定
70
79
 
71
80
  ---
72
81
 
@@ -74,7 +83,7 @@ skills/
74
83
 
75
84
  当用户消息同时匹配多个 Skill 时(如"扫描原型并生成页面"):
76
85
 
77
- 1. 优先识别**完整流水线意图**:读取 `_pipeline.md`,按 `prototype-scan` `api-contract` → `page-codegen` → `convention-audit` → sync/ops 的顺序建议下一步
86
+ 1. 优先识别**完整流水线意图**:读取 `_pipeline.md`,按 `prototype-scan`(原型线)或 `spec-doc-parse`(规范线)→ `api-contract` → `page-codegen` → `convention-audit` → sync/ops 的顺序建议下一步
78
87
  2. 否则按**最具体的触发词**匹配单个 Skill
79
88
  3. 用户明确指定时(如"只扫描,不生成"),按用户指示
80
89
 
@@ -45,6 +45,51 @@ description: "Use when: auditing project source code against the 14 modular stan
45
45
 
46
46
  ---
47
47
 
48
+ ## 复扫模式(--quick,v2.11+ 新增)
49
+
50
+ > 闭环专用:code-fix 修复后快速验证,不做全量 14 条扫描,仅复查上次报告中的 🔴🟡 项。
51
+
52
+ ### 触发方式
53
+
54
+ ```
55
+ 复扫验证 / 复扫上次审计 / convention-audit --quick / 确认修复效果
56
+ ```
57
+
58
+ ### 执行逻辑
59
+
60
+ 1. 读取 `reports/规范审查报告.md` 最新章节中的 🔴🟡 偏差清单
61
+ 2. **仅对这些偏差涉及的文件**重新检测(不扫描全项目)
62
+ 3. 对比上次报告数据,输出变化矩阵
63
+ 4. 追加复扫结果到报告
64
+
65
+ ### 复扫报告格式
66
+
67
+ ```markdown
68
+ ## 🔄 复扫 {YYYY-MM-DD HH:mm} | 触发:code-fix 后自动复扫
69
+
70
+ | 指标 | 修复前 | 修复后 | 变化 |
71
+ |---|---:|---:|---|
72
+ | 🔴 严重 | {N} | {N} | {-N} ✅ |
73
+ | 🟡 警告 | {N} | {N} | {-N} ✅ |
74
+ | 未解决 | - | {N} | 待处理 |
75
+
76
+ ### 结论
77
+ - ✔ 闭环完成,可提交
78
+ - 或:✖ 仍有 {N} 个未解决项,建议继续处理
79
+ ```
80
+
81
+ ### 与全量审计的区别
82
+
83
+ | | 全量审计 | --quick 复扫 |
84
+ |---|---|---|
85
+ | 规范覆盖 | 14 条全部 | 仅上次报告中的偏差项 |
86
+ | 扫描范围 | 指定目录或全项目 | 仅偏差涉及文件 |
87
+ | token 消耗 | 高 | 低(约全量的 10%) |
88
+ | 适用场景 | 首次体检/定期审计 | code-fix 后闭环验证 |
89
+ | 输出 | 完整报告 12 章 | 复扫对比矩阵 |
90
+
91
+ ---
92
+
48
93
  ## 审计范围(14 条规范全覆盖)
49
94
 
50
95
  ### 审计方式分层
@@ -110,7 +155,7 @@ description: "Use when: auditing project source code against the 14 modular stan
110
155
 
111
156
  ### 步骤 2:加载规范基线 + 工具链检测
112
157
 
113
- 1. 读取 `standards/01 ~ 13` 全部规范文件
158
+ 1. 读取 `standards/01 ~ 14` 全部规范文件
114
159
  2. 检测工具链状态:
115
160
  - ESLint:是否可执行
116
161
  - TypeScript:`tsc --noEmit` 是否可执行
@@ -366,6 +411,7 @@ description: "Use when: auditing project source code against the 14 modular stan
366
411
  | **page-codegen** | 审计发现偏差后,可调用 page-codegen 重新生成合规代码 |
367
412
  | **template-extract** | 审计输出的"组件提取建议",确认后可触发 template-extract |
368
413
  | **code-fix** | 审计报告中 ✅/⚠️ 标记项作为修复输入 |
414
+ | **spec-doc-parse** | 提供 spec 对齐模式的基准:用规范线解析出的 page-spec 与生成代码比对,输出 GAP 报告 |
369
415
  | **CI/CD** | 审计可作为 PR 检查项,不合规 PR 阻断合并 |
370
416
 
371
417
  ---
@@ -378,3 +424,54 @@ description: "Use when: auditing project source code against the 14 modular stan
378
424
  4. **AI 自我审计**:page-codegen 生成代码后,建议立即跑一次单页审计验证合规
379
425
  5. **工具链优先**:TS 类型 / ESLint 规则优先借助工具链扫描,AI 负责监督验证和归类,不浪费算力逐文件做语义分析
380
426
  6. **场景化判定**:`data.ts` / `api.md` / AGGrid 均按场景规则判定,不机械检查文件数量
427
+
428
+ ---
429
+
430
+ ## spec 对齐扫描(GAP 报告)
431
+
432
+ > 闭环能力:与 `core/spec-doc-parse` 联动。当页面代码来自「规范线」(wl-skills-design 说明书 → spec-doc-parse → page-codegen)时,本模式把 **原始 spec 定义的字段** 与 **代码中实际存在的字段** 逐项比对,生成 GAP 报告,验证「说明书 → 代码」是否零损耗。
433
+
434
+ ### 触发
435
+
436
+ ```
437
+ 审计 {页面目录} --mode spec-align --spec docs/spec/{项目代号}/4.x-{子模块}.md
438
+ ```
439
+ 或自然语言:「检查 {页面} 是否跟说明书对齐」。
440
+
441
+ ### 比对维度
442
+
443
+ | 维度 | 检查点 | 偏差判定 |
444
+ |------|--------|---------|
445
+ | 查询字段 | spec `query[]` vs 代码 `queryDef()` | spec 有代码缺 → 🔴 漏字段;代码多出 → 🟡 超出 spec |
446
+ | 表格列 | spec `columns[]` vs 代码 `columnsDef()` | 同上,且顺序不一致 → 🟡 |
447
+ | 工具栏 | spec `toolbar[]` vs 代码 `toolbarDef()` | 按钮缺失/多出 → 🔴/🟡 |
448
+ | 表单字段 | spec `formSections[].fields[]` vs 弹窗组件 | 必填字段缺失 → 🔴 |
449
+ | 接口 URL | spec 推算 URL vs 代码 `API_CONFIG` | 路径不一致 → 🟡 待确认 |
450
+ | 权限码 | spec notes 权限码候选 vs 代码 v-permission | 未挂载 → 🟡,建议 permission-sync |
451
+
452
+ ### GAP 报告(reports/SPEC_GAP_{模块}_{日期}.md)
453
+
454
+ ```markdown
455
+ # Spec 对齐 GAP 报告
456
+ - 生成时间:{YYYY-MM-DD HH:mm}
457
+ - spec 来源:docs/spec/{项目代号}/4.x-{子模块}.md
458
+ - 代码范围:src/views/.../{页面}/
459
+
460
+ ## GAP 摘要
461
+ - spec 字段总数:N 代码实现:N 漏:N 多:N 顺序不一致:N
462
+
463
+ ## 漏字段(spec 有、代码无 → 🔴)
464
+ | # | 类型 | spec 字段 | 所在功能 | 建议 |
465
+ |---|------|----------|---------|------|
466
+ | 1 | query | customerType | PMMB001 | 补入查询项 |
467
+
468
+ ## 多余字段(代码有、spec 未定义 → 🟡)
469
+ | # | 类型 | 代码字段 | 建议 |
470
+ |---|------|----------|------|
471
+ | 1 | column | remark | 确认是否需要,否则反馈 design 补 spec |
472
+
473
+ ## 下一步
474
+ → 漏字段交 code-fix / page-codegen 补齐;多余字段反馈上游 design 补 spec。
475
+ ```
476
+
477
+ > spec 对齐模式**只对规范线生成的页面生效**;原型线(prototype-scan)生成的页面无 spec 基准,跳过本模式。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: page-codegen
3
- description: "Use when: generating complete Vue 3 page code (index.vue + data.ts + modal components + api.md + pages.ts registration) from a prototype page inventory and API contract, strictly following the cx-ui-produce project conventions. Read SKILL.md first (rules+constraints), then read the matching TPL-*.md for the template code. Triggers on: generate page, create page, code generation, 生成页面, 页面代码, 代码生成, vue页面, 按原型生成, 口述需求, 建个页面, 写个页面, 帮我生成, natural language page generation."
3
+ description: "Use when: generating complete Vue 3 page code (index.vue + data.ts + modal components + api.md + pages.ts registration) from a prototype page inventory and API contract, strictly following the cx-ui-produce project conventions. Read SKILL.md first (rules+constraints), then read the matching TPL-*.md for the template code. Triggers on: generate page, create page, code generation, 生成页面, 页面代码, 代码生成, vue页面, 帮我生成, natural language page generation. NOTE: 口述需求/建个页面/写个页面/按原型生成 belong to prototype-scan first (page-codegen chains from it via 模式 0)."
4
4
  ---
5
5
 
6
6
  # Skill: 页面代码生成(page-codegen)
@@ -45,14 +45,34 @@ description: "Use when: generating complete Vue 3 page code (index.vue + data.ts
45
45
  ✅ src/views/.../{页面}/api.md
46
46
  ✅ reports/SYS_MENU_INFO.md → 已追加菜单条目
47
47
  ────────────────────────────────────────────────
48
+ 🔍 强制自检(不可跳过):
49
+ wl-skills validate src/views/{生成的页面目录}
50
+ → 结果:{0 error / N warn} 或列出 error 待修复
51
+ ────────────────────────────────────────────────
48
52
  📌 后续步骤:
49
53
  1. 在 router/pages.ts 注册路由
50
54
  2. 若本页 hiddenMenu=true → 在 src/util/navigate-hidden.ts 的 HIDDEN_ROUTE_MAP 追加一行
51
- 3. 提交:git cz(禁止直接 git commit
52
- 4. 可选:触发 convention-audit 扫描本次生成文件
55
+ 3. 提交:git cz(禁止直接 git commit,pre-commit 会自动检测规范)
53
56
  ────────────────────────────────────────────────
54
57
  ```
55
58
 
59
+ ### 生成后强制自检(不可跳过,不可标记为"可选")
60
+
61
+ > **v2.10.0+ 硬约束**:生成页面代码后,AI **必须**立即执行规范自检,不可跳过。
62
+
63
+ 1. **调用 MCP 工具** `wls_validate_page`,path 参数为**本次生成的页面目录**(精确到具体页面,不传 src/views 全局)
64
+ 2. 如有 **error**:
65
+ - 仅修复**本次生成的文件**中的 error(index.vue / data.ts / index.scss / api.md)
66
+ - 如 error 来自同目录下的**旧文件**(非本次生成),不要修改,在摘要中标注"已跳过 N 个旧文件 error"
67
+ - 修复后重新自检直到本次生成的文件 0 error
68
+ 3. 如有 **warn** → 尝试修复,确实无法修复的在摘要中说明原因
69
+ 4. 自检结果(error 数 / warn 数 / 跳过的旧文件数)写入上方"生成完成摘要"
70
+ 5. 自检范围为本次生成的**单个页面目录**,不对无关页面负责
71
+
72
+ > 这条规则确保 AI 不会"写完就跑"——生成和验证形成闭环。
73
+ > **作用域隔离原则**:AI 只对自己本次生成的文件负责,不强制修复历史遗留偏差。
74
+ > git commit 时 pre-commit hook 会再次拦截,但 AI 应在生成阶段就消除本次生成的 error。
75
+
56
76
  ---
57
77
 
58
78
  ## 前置检查
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: prototype-scan
3
- description: "Use when: analyzing Axure exported HTML prototype files to extract page inventory, classify interaction patterns, identify reusable components, and produce a structured page checklist for Vue development. Also supports detailed design documents (MD/Word) or natural language descriptions as input. Triggers on: prototype analysis, axure scan, page inventory, 原型解析, 页面清单, axure转vue, 详设文档, design doc, 详细设计, 口述需求, 自然语言建页面, natural language page request, 建个页面, 写个页面, 口头描述页面."
3
+ description: "Use when: analyzing Axure exported HTML prototype files to extract page inventory, classify interaction patterns, identify reusable components, and produce a structured page checklist for Vue development. Also supports NON-standard detailed design documents (free-form MD/Word) or natural language descriptions as input. DO NOT use for standard requirement-spec documents produced by wl-skills-design (path contains docs/spec/, has function codes like PMMB001, IPO tables, flow five-elements) — route those to spec-doc-parse instead. Triggers on: prototype analysis, axure scan, page inventory, 原型解析, 页面清单, axure转vue, 口述需求, 自然语言建页面, natural language page request, 建个页面, 写个页面, 口头描述页面."
4
4
  ---
5
5
 
6
6
  # Skill: 原型解析(prototype-scan)
@@ -15,7 +15,9 @@ description: "Use when: analyzing Axure exported HTML prototype files to extract
15
15
  |------|------|----------|
16
16
  | **模式 0(自然语言)** | 用户口述需求,无文件 | 日常对话:"帮我建一个客户管理页面,有XX字段" |
17
17
  | **模式 A(Axure)** | Axure HTML 文件包目录 | 已有原型设计,AI 全量扫描 HTML |
18
- | **模式 B(详设文档)** | MD/Word/表格格式的详细设计文档 | 已有详细设计文档,AI 解析结构化字段 |
18
+ | **模式 B(非规范详设)** | MD/Word/表格格式的零散详细设计 | 已有非规范详设文档,AI 解析结构化字段 |
19
+
20
+ > ⚠️ **双线隔离(必读)**:本 Skill 走「原型线」。若输入是 wl-skills-design 产出的**标准需求设计说明书**(路径含 `docs/spec/`、含功能编码 `/[A-Z]{2,6}[0-9]{3}/`、含 IPO 表「处理逻辑」、含流程五要素),属于「规范线」,**禁止本 Skill 接管**,必须路由到 `core/spec-doc-parse/SKILL.md`。两线各自解析,最终都汇聚到同一份 page-spec JSON,下游 `api-contract` / `page-codegen` 无感知来源。
19
21
 
20
22
  ---
21
23
 
@@ -403,9 +405,13 @@ const [模块名]Module = gProd("[base-path]", {
403
405
 
404
406
  ---
405
407
 
406
- ## 输入模式 B:详细设计文档
408
+ ## 输入模式 B:非规范详细设计文档
409
+
410
+ > ⚠️ **模式 B 排除范围**:若文档路径含 `docs/spec/`,或文档内含 `§四 功能设计详细规范` / IPO 表格(含「处理逻辑」二级标题)/ 功能编码(正则 `/[A-Z]{2,6}[0-9]{3}/`)/ 流程说明五要素,
411
+ > **表明这是 wl-skills-design 的标准产出,不触发本模式**,应转发 `core/spec-doc-parse/SKILL.md`。
412
+ > 本模式只处理**非规范、零散的**详设(本来就不规范的输入,AI 自由发挥是帮助);面对高精度规范文档时,专属解析才能保证零损耗。
407
413
 
408
- > 详设文档输入比 Axure HTML **精度更高(95-100%)**,因为字段名和类型是明确写出的,不需要从视觉推断。
414
+ > 非规范详设输入比 Axure HTML **精度更高(95-100%)**,因为字段名和类型是明确写出的,不需要从视觉推断。
409
415
  > 输出格式与模式 A 完全一致(page-spec JSON),page-codegen 无感知。
410
416
 
411
417
  ### 为什么详设比 Axure 更精确