@agile-team/wl-skills-kit 2.3.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.
- package/CHANGELOG.md +33 -63
- package/README.md +15 -148
- package/bin/wl-skills.js +2 -100
- package/files/.github/guides/README.md +13 -13
- package/files/.github/guides/architecture.md +555 -576
- package/files/.github/guides/usage.md +176 -176
- package/files/.github/reports/README.md +65 -65
- package/files/.github/reports/SYS_DICT_INFO.md +50 -50
- package/files/.github/reports/SYS_MENU_INFO.md +247 -247
- package/files/.github/reports/SYS_PERMISSION_INFO.md +20 -20
- 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
- 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
- package/files/.github/skills/_compat/README.md +108 -108
- package/files/.github/skills/_compat/headers/agents.txt +8 -8
- package/files/.github/skills/_compat/headers/claude-code.txt +7 -7
- package/files/.github/skills/_compat/headers/cline.txt +7 -7
- package/files/.github/skills/_compat/headers/cursor-mdc.txt +16 -16
- package/files/.github/skills/_compat/headers/cursor-rules.txt +7 -7
- package/files/.github/skills/_compat/headers/github-copilot.txt +1 -1
- package/files/.github/skills/_compat/headers/kiro.txt +10 -10
- package/files/.github/skills/_compat/headers/trae.txt +11 -11
- package/files/.github/skills/_compat/headers/windsurf.txt +7 -7
- package/files/.github/skills/_registry.md +81 -81
- package/files/.github/skills/core/api-contract/SKILL.md +344 -344
- package/files/.github/skills/core/api-contract/USAGE.md +110 -110
- package/files/.github/skills/core/convention-audit/SKILL.md +189 -189
- package/files/.github/skills/core/convention-audit/USAGE.md +99 -99
- package/files/.github/skills/core/page-codegen/SKILL.md +973 -973
- package/files/.github/skills/core/page-codegen/USAGE.md +102 -102
- package/files/.github/skills/core/page-codegen/templates/_index.md +46 -46
- package/files/.github/skills/core/page-codegen/templates/domains/_CONTRIBUTING.md +107 -107
- package/files/.github/skills/core/page-codegen/templates/domains/produce/TPL-OPERATION-STATION.md +442 -442
- package/files/.github/skills/core/page-codegen/templates/domains/sale/README.md +26 -26
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-CHANGE-HISTORY.md +276 -276
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-DETAIL-TABS.md +1145 -1145
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-DRIVEN.md +124 -124
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-FORM-ROUTE.md +436 -436
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-LIST.md +191 -191
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-MASTER-DETAIL.md +148 -148
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-RECORD-FORM.md +376 -376
- package/files/.github/skills/core/page-codegen/templates/universal/TPL-TREE-LIST.md +186 -186
- package/files/.github/skills/core/prototype-scan/SKILL.md +498 -498
- package/files/.github/skills/core/prototype-scan/USAGE.md +95 -95
- package/files/.github/skills/core/template-extract/SKILL.md +139 -139
- package/files/.github/skills/core/template-extract/USAGE.md +93 -93
- package/files/.github/skills/domain/README.md +51 -51
- package/files/.github/skills/sync/menu-sync/SKILL.md +263 -263
- package/files/.github/skills/sync/menu-sync/USAGE.md +104 -104
- package/files/.github/skills/sync/menu-sync/env/env.local.json +7 -7
- package/files/.github/skills/sync/menu-sync/env/guide.md +99 -99
- package/files/.github/skills/sync/permission-sync/SKILL.draft.md +91 -91
- package/files/.github/standards/01-toolchain.md +57 -57
- package/files/.github/standards/02-code-structure.md +111 -111
- package/files/.github/standards/03-comments.md +53 -53
- package/files/.github/standards/04-coding-basics.md +33 -33
- package/files/.github/standards/05-logging.md +38 -38
- package/files/.github/standards/06-security.md +44 -44
- package/files/.github/standards/07-config.md +52 -52
- package/files/.github/standards/08-git.md +60 -60
- package/files/.github/standards/09-typescript.md +71 -71
- package/files/.github/standards/10-pinia.md +57 -57
- package/files/.github/standards/11-form-validation.md +81 -81
- package/files/.github/standards/12-base-table.md +153 -153
- package/files/.github/standards/13-platform-components.md +123 -123
- package/files/.github/standards/index.md +89 -89
- package/files/demo/produce/aiflow/mmwr-customer-apply-add/api.md +1 -1
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/data.ts +196 -196
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.scss +150 -150
- package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.vue +79 -79
- package/files/docs/jh-date-range.md +257 -257
- package/files/docs/jh-date.md +222 -222
- package/files/docs/jh-dept-picker.md +190 -190
- package/files/docs/jh-drag-row.md +590 -590
- package/files/docs/jh-file-upload.md +216 -216
- package/files/docs/jh-picker.md +218 -218
- package/files/docs/jh-select.md +148 -148
- package/files/docs/jh-text.md +248 -248
- package/files/docs/jh-user-picker.md +197 -197
- package/files/docs/request.md +24 -9
- package/files/src/components/global/C_RightToolbar/data.ts +228 -0
- package/files/src/components/global/C_RightToolbar/index.scss +44 -0
- package/files/src/components/global/C_RightToolbar/index.vue +34 -336
- package/files/src/components/global/C_Splitter/index.scss +61 -0
- package/files/src/components/global/C_Splitter/index.vue +2 -64
- package/files/src/components/global/C_SvgIcon/index.scss +15 -0
- package/files/src/components/global/C_SvgIcon/index.vue +20 -50
- package/files/src/components/global/C_TagStatus/index.scss +20 -0
- package/files/src/components/global/C_TagStatus/index.vue +1 -22
- package/files/src/components/global/C_Tree/data.ts +61 -0
- package/files/src/components/global/C_Tree/index.vue +12 -53
- package/files/src/components/local/c_listModal/index.scss +4 -0
- package/files/src/components/local/c_listModal/index.vue +1 -1
- package/package.json +5 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,84 +1,54 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [2.3.
|
|
3
|
+
## [2.3.1] - 2026-04-27
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### 🔧 组件三文件分离规范补全 + 文档精准化
|
|
6
6
|
|
|
7
|
-
####
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
- `
|
|
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 块
|
|
12
13
|
|
|
13
|
-
####
|
|
14
|
-
- `
|
|
15
|
-
- `
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
#### 配置扩展
|
|
19
|
-
- `files/.github/skills/sync/env.local.json` 模板新增 `menu.domainId` 字段(MCP wls_menu_query 使用)
|
|
20
|
-
|
|
21
|
-
#### 文档同步
|
|
22
|
-
- `files/.github/guides/architecture.md`:第 8 节新增 MCP 模式说明;第 4.2 节 dict-sync 状态改为 ✅;bin 工作流补 Step 5;版本表更新至 v2.3.0
|
|
23
|
-
- `files/.github/guides/usage.md`:Skill 速览表 menu-sync / dict-sync 行补充"MCP 自动模式"说明;FAQ 新增 MCP 配置问题
|
|
24
|
-
- `README.md`:新增"MCP Server"章节(工具清单 + 配置说明 + 效率对比表)
|
|
25
|
-
- `docs/mcp建议.md`:新增第七节(已确认接口清单),更新阶段一目录结构为实际 .js 文件
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## [2.2.0] - 2026-04-27
|
|
30
|
-
|
|
31
|
-
### 🔄 sync-version.js 扩展 + 文档修复
|
|
32
|
-
|
|
33
|
-
#### sync-version.js 扩展
|
|
34
|
-
- 新增 `SKILL_COUNT` 常量(值 8),改一处自动同步到所有编辑器适配文件中的 Skill 数量描述
|
|
35
|
-
- 新增同步目标:`package.json description`、`files/.github/skills/_compat/headers/cursor-mdc.txt`、`kiro.txt`、`trae.txt`
|
|
36
|
-
|
|
37
|
-
#### 流程文档更新
|
|
38
|
-
- `files/.github/guides/usage.md`:完整流水线补充 step 5(dict-sync)和 step 7(code-fix)
|
|
39
|
-
- `files/.github/standards/12-base-table.md`:新增批量 cid 碰撞预防代码块
|
|
40
|
-
- `files/.github/skills/core/convention-audit/SKILL.md`:Rule 12 旧格式 cid 降级为 🟡 偏差(迁移豁免)
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## [2.1.5] - 2026-04-27
|
|
45
|
-
|
|
46
|
-
### 🔄 版本自动同步 + 发布流程优化
|
|
47
|
-
|
|
48
|
-
#### 版本号自动同步机制
|
|
49
|
-
- 新增 `scripts/sync-version.js`:npm `version` 钩子触发时自动将 `package.json` 版本号同步至 3 处文档:
|
|
50
|
-
- `README.md` 标题行(`AI Skill 模板包 vX.X.X`)
|
|
51
|
-
- `files/.github/guides/architecture.md` 头部「当前版本」行(含日期)
|
|
52
|
-
- `bin/wl-skills.js` 顶部注释行
|
|
53
|
-
- `package.json` 新增 `scripts.version` 钩子:`npm version patch/minor/major` 自动同步 + git add,无需手动改四个文件
|
|
54
|
-
- 今后发版流程统一为三步:`npm version <type>` → `git push --follow-tags` → `npm publish`
|
|
55
|
-
|
|
56
|
-
#### 发布配置
|
|
57
|
-
- `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
|
|
58
18
|
|
|
59
19
|
---
|
|
60
20
|
|
|
61
21
|
## [2.1.4] - 2026-04-27
|
|
62
22
|
|
|
63
|
-
###
|
|
23
|
+
### 🔧 Mock 响应格式统一
|
|
64
24
|
|
|
65
|
-
-
|
|
66
|
-
- `
|
|
67
|
-
- `
|
|
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 模式下永远失败的问题
|
|
68
29
|
|
|
69
30
|
---
|
|
70
31
|
|
|
71
32
|
## [2.1.3] - 2026-04-27
|
|
72
33
|
|
|
73
|
-
###
|
|
34
|
+
### 🔧 组件规范补全 + API 文档修正 + MCP 发布修复
|
|
35
|
+
|
|
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`
|
|
42
|
+
|
|
43
|
+
#### local 组件规范补全
|
|
44
|
+
- **c_listModal**: 补充 `index.scss`(空 style 块改为外链引用)
|
|
74
45
|
|
|
75
|
-
####
|
|
76
|
-
- `
|
|
77
|
-
- `
|
|
78
|
-
- `--help` 保护路径说明新增 `env.local.json` 条目
|
|
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`,保持与架构规范一致
|
|
79
49
|
|
|
80
|
-
####
|
|
81
|
-
-
|
|
50
|
+
#### MCP Server npm 发布修复
|
|
51
|
+
- `package.json` `files` 字段补充 `"mcp/"` 目录,修复之前 MCP Server 代码未被打包到 npm 的严重缺失(导致 `wl-skills init` 后 `.cursor/mcp.json` 指向的 `node_modules/.../mcp/server.js` 实际不存在)
|
|
82
52
|
|
|
83
53
|
---
|
|
84
54
|
|
package/README.md
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
# @agile-team/wl-skills-kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**AI Skill 模板包 v2.1** — 一条命令将 13 条编码规范、6 个 AI Skill、组件文档、领域样例导入 Vue 3 项目。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
让 AI 编辑器(Copilot / Cursor / Windsurf / Claude Code / Cline / Kiro / Trae / 通用 Agents)**真正理解项目规范**,从原型/详设到完整页面代码全流程自动化。内置 MCP Server 实现菜单和字典自动同步(对话轮数 ≤ 2)。
|
|
5
|
+
让 AI 编辑器(Copilot / Cursor / Windsurf / Claude Code / Cline / Kiro / Trae / 通用 Agents)**真正理解项目规范**,从原型/详设到完整页面代码全流程自动化。
|
|
8
6
|
|
|
9
7
|
---
|
|
10
8
|
|
|
@@ -12,11 +10,10 @@
|
|
|
12
10
|
|
|
13
11
|
```bash
|
|
14
12
|
npx @robot-admin/git-standards init # 工程化前置(必须)
|
|
15
|
-
npx @agile-team/wl-skills-kit # 安装 AI
|
|
16
|
-
# 填写 .github/skills/sync/env.local.json(token / domainId)
|
|
13
|
+
npx @agile-team/wl-skills-kit # 安装 AI 体系
|
|
17
14
|
# 在 AI 对话中:
|
|
18
|
-
"
|
|
19
|
-
"
|
|
15
|
+
"扫描 docs/prototypes/ 下的原型生成页面清单"
|
|
16
|
+
"基于上一步生成所有 api.md,再 codegen 出页面"
|
|
20
17
|
```
|
|
21
18
|
|
|
22
19
|
---
|
|
@@ -100,7 +97,7 @@ wl-skills-kit/ ← 你正看的这个仓库
|
|
|
100
97
|
│ │ ├── 02-code-structure.md
|
|
101
98
|
│ │ ├── ... (共 13 条)
|
|
102
99
|
│ │ └── 13-platform-components.md
|
|
103
|
-
│ ├── skills/
|
|
100
|
+
│ ├── skills/ 6 个启用 Skill + 3 个 PLANNED 草稿
|
|
104
101
|
│ │ ├── _registry.md ★ 触发词 → SKILL 路径单一数据源
|
|
105
102
|
│ │ ├── _compat/ 多 AI 编辑器适配(配置 + headers)
|
|
106
103
|
│ │ ├── core/ 核心通用 Skill
|
|
@@ -111,10 +108,10 @@ wl-skills-kit/ ← 你正看的这个仓库
|
|
|
111
108
|
│ │ │ └── template-extract/ { SKILL.md, USAGE.md }
|
|
112
109
|
│ │ ├── sync/ 数据同步类
|
|
113
110
|
│ │ │ ├── menu-sync/ { SKILL.md, USAGE.md, env/ }
|
|
114
|
-
│ │ │ ├── dict-sync/
|
|
111
|
+
│ │ │ ├── dict-sync/ [PLANNED] SKILL.draft.md
|
|
115
112
|
│ │ │ └── permission-sync/ [PLANNED] SKILL.draft.md
|
|
116
113
|
│ │ ├── ops/ 运维类
|
|
117
|
-
│ │ │ └── code-fix/
|
|
114
|
+
│ │ │ └── code-fix/ [PLANNED] SKILL.draft.md
|
|
118
115
|
│ │ └── domain/ 领域专属(按需创建)
|
|
119
116
|
│ ├── guides/ 人读指南(usage.md / architecture.md)
|
|
120
117
|
│ └── reports/ AI 生成报告(追加不覆盖)
|
|
@@ -188,46 +185,6 @@ npx @agile-team/wl-skills-kit update
|
|
|
188
185
|
|
|
189
186
|
---
|
|
190
187
|
|
|
191
|
-
## MCP Server(菜单 & 字典自动同步)
|
|
192
|
-
|
|
193
|
-
`init` 安装时会自动生成 `.cursor/mcp.json` 和 `.claude/settings.json`,将 wl-skills MCP server 注册到 AI 编辑器。**无需手动配置**,启动 Cursor / Claude Code 后自动启用。
|
|
194
|
-
|
|
195
|
-
### 提供的工具
|
|
196
|
-
|
|
197
|
-
| 工具 | 用途 |
|
|
198
|
-
|---|---|
|
|
199
|
-
| `wls_menu_query` | 查询当前应用完整菜单树(用于决策新增/更新) |
|
|
200
|
-
| `wls_menu_upsert` | 批量新增或更新菜单(有 id=更新,无 id=新增,自动返回服务端 id) |
|
|
201
|
-
| `wls_dict_query` | 查询所有字典模块及字典项 |
|
|
202
|
-
| `wls_dict_upsert` | 新增/更新字典模块+字典项(内部自动 re-query 获取 id) |
|
|
203
|
-
|
|
204
|
-
### 配置(安装后填写一次)
|
|
205
|
-
|
|
206
|
-
在 `.github/skills/sync/env.local.json` 中填写:
|
|
207
|
-
|
|
208
|
-
```json
|
|
209
|
-
{
|
|
210
|
-
"gatewayPath": "http://你的网关地址:端口",
|
|
211
|
-
"token": "Bearer Token(不含 Bearer 前缀)",
|
|
212
|
-
"sysAppNo": "应用编码",
|
|
213
|
-
"menu": {
|
|
214
|
-
"domainId": "从 Network 面板 getMenuTreeByDomainId?domainId=xxx 中获取",
|
|
215
|
-
"parentMenuId": "新建菜单的父节点 ID"
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
> `env.local.json` 已自动加入 `.gitignore`,不会入库。
|
|
221
|
-
|
|
222
|
-
### 效率对比
|
|
223
|
-
|
|
224
|
-
| 方式 | 同步 10 条菜单 | 手动操作 | 耗时 |
|
|
225
|
-
|---|---|---|---|
|
|
226
|
-
| SKILL.md(prompt-based) | ~4000 token | 10 次 | ~20 分钟 |
|
|
227
|
-
| **MCP tools** | ~500 token | **0 次** | **~1 分钟** |
|
|
228
|
-
|
|
229
|
-
---
|
|
230
|
-
|
|
231
188
|
## Skill 概览
|
|
232
189
|
|
|
233
190
|
| Skill | 状态 | 路径 | 核心用途 |
|
|
@@ -238,102 +195,14 @@ npx @agile-team/wl-skills-kit update
|
|
|
238
195
|
| `convention-audit` | ✅ 启用 | `skills/core/convention-audit/` | 13 条规范扫描 + 双报告 |
|
|
239
196
|
| `template-extract` | ✅ 启用 | `skills/core/template-extract/` | 现有页面 → 领域模板 |
|
|
240
197
|
| `menu-sync` | ✅ 启用 | `skills/sync/menu-sync/` | 菜单基线 ↔ 后端接口 |
|
|
241
|
-
| `dict-sync` |
|
|
198
|
+
| `dict-sync` | ⏳ PLANNED | `skills/sync/dict-sync/` | 字典基线 ↔ 后端接口 |
|
|
242
199
|
| `permission-sync` | ⏳ PLANNED | `skills/sync/permission-sync/` | 权限基线 ↔ 后端接口 |
|
|
243
|
-
| `code-fix` |
|
|
200
|
+
| `code-fix` | ⏳ PLANNED | `skills/ops/code-fix/` | 受控自动修复偏差 |
|
|
244
201
|
|
|
245
202
|
每个启用 Skill 同目录都有 **`SKILL.md`(AI 触发用)+ `USAGE.md`(团队成员阅读)**。
|
|
246
203
|
|
|
247
204
|
---
|
|
248
205
|
|
|
249
|
-
## AGGrid cid 唯一性规则
|
|
250
|
-
|
|
251
|
-
> 21 个系统共享同一浏览器 origin(localStorage 共用),cid 碰撞会导致列配置互相覆盖。
|
|
252
|
-
|
|
253
|
-
```typescript
|
|
254
|
-
// ✅ 正确:Date.now().toString(36) — 毫秒级唯一,永不重复,约 9 位 base-36
|
|
255
|
-
cid="mca-lhfge5hc" // 表格级:{页面首字母缩写}-{base36时间戳}
|
|
256
|
-
cid: 'mca-lhfge5hc-customerName' // 列级:{完整表格cid}-{fieldName}
|
|
257
|
-
cid: 'mca-lhfge5hc-sub1-customerName' // 子表列级:{完整子表cid}-{fieldName}
|
|
258
|
-
|
|
259
|
-
// ❌ 错误:截断十进制后6位(每11.5天循环一次)
|
|
260
|
-
cid="mca-745831"
|
|
261
|
-
// ❌ 错误:列级只用缩写(同页面两张表都有steelCode → mca-steelCode 碰撞)
|
|
262
|
-
cid: 'mca-customerName'
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
**Pre-flight 中 AI 自动输出**:`✅ cid 已生成:mca-lhfge5hc(mmwr-customer-archive)`
|
|
266
|
-
`convention-audit` 遇到旧格式 cid 会标记为 🟡 偏差提示。
|
|
267
|
-
|
|
268
|
-
---
|
|
269
|
-
|
|
270
|
-
## 技能触发 & 验证
|
|
271
|
-
|
|
272
|
-
> **所有编辑器使用相同的触发词**,无需区分编辑器类型。Copilot / Cursor / Windsurf / Claude Code / Cline / Kiro / Trae 读取各自对应的配置文件,内容完全一致,仅 frontmatter 格式不同。
|
|
273
|
-
|
|
274
|
-
**触发成功的标志 — Pre-flight 声明**(技能触发后 AI 必须先输出):
|
|
275
|
-
|
|
276
|
-
```
|
|
277
|
-
🚀 已触发技能 page-codegen/SKILL.md → 页面代码生成:4文件 + 模板调度 + 前置检查
|
|
278
|
-
✅ 已读取 templates/_index.md → 模板注册表,匹配 → TPL-LIST.md
|
|
279
|
-
✅ 已读取 standards/02-code-structure.md → 4文件原则 + 三段式 + script 9段顺序
|
|
280
|
-
✅ cid 已生成:cXxxx(首字母缩写)
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
> 看到这段输出 = 技能路径已激活,AI 遵循 Skill 规则而非默认推断。
|
|
284
|
-
> 没有这段输出 = AI 走了默认推断,补充说:「请先读取 `.github/skills/core/xxx/SKILL.md`,再按其执行」。
|
|
285
|
-
|
|
286
|
-
### 单技能触发
|
|
287
|
-
|
|
288
|
-
| 技能 | 说任意一个即可触发 | 输出结果 | 验证方法 |
|
|
289
|
-
| ---- | ------------------ | -------- | -------- |
|
|
290
|
-
| `prototype-scan` | 扫描原型 / 页面清单 / 口述需求 / 建个页面 / 帮我建一个XX页面 | `reports/PROTOTYPE_SCAN_*.md` 结构化页面清单 | reports/ 下有新文件 |
|
|
291
|
-
| `api-contract` | 接口约定 / api.md / 字段定义 / 前后端对齐 | 每个页面目录下生成 `api.md` | 对应目录有 api.md |
|
|
292
|
-
| `page-codegen` | 生成页面 / 创建页面 / 代码生成 / 帮我生成 | `index.vue + data.ts + index.scss + api.md` 4 文件 | 4 文件完整 + Pre-flight ✅ |
|
|
293
|
-
| `convention-audit` | 规范审计 / 规范检查 / 代码审计 / **接手新项目** / **项目体检** | `reports/规范审查报告.md` + `reports/组件提取建议.md` 追加新章节 | 报告文件有新内容追加 |
|
|
294
|
-
| `template-extract` | 提取模板 / 沉淀模板 / 模板贡献 | `skills/core/page-codegen/templates/domains/{域}/TPL-*.md` | templates/ 下有新模板文件 |
|
|
295
|
-
| `menu-sync` | 创建菜单 / 同步菜单 / 补菜单 | API 调用结果表 + `reports/SYS_MENU_INFO.md` 更新 | 系统管理后台出现新菜单 |
|
|
296
|
-
|
|
297
|
-
### 流程组合触发
|
|
298
|
-
|
|
299
|
-
**完整链路:原型 → 上线可访问(分步连续触发)**
|
|
300
|
-
|
|
301
|
-
```
|
|
302
|
-
① "扫描 docs/prototypes/ 下的原型,生成页面清单" → prototype-scan
|
|
303
|
-
② "基于清单,逐页生成 api.md" → api-contract
|
|
304
|
-
③ "按 api.md 生成所有页面代码" → page-codegen
|
|
305
|
-
④ "对刚生成的页面做规范审计" → convention-audit
|
|
306
|
-
⑤ "补菜单" → menu-sync
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
**快捷链路:口述直接生成(单句触发)**
|
|
310
|
-
|
|
311
|
-
```
|
|
312
|
-
"帮我建一个客户管理页面,有名称、编码、状态三个查询字段,支持新增编辑删除"
|
|
313
|
-
→ prototype-scan(内部推断)→ page-codegen → 直接输出 4 文件
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
**接手存量项目(逐步推进)**
|
|
317
|
-
|
|
318
|
-
```
|
|
319
|
-
"扫描 src/views/ 下所有页面,做规范审计,输出偏差报告" → convention-audit
|
|
320
|
-
→ 人工确认整改优先级(报告中标 🔴 / 🟡 / 🟢)
|
|
321
|
-
→ "对 {偏差文件} 做规范整改" → code-fix
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
### 触发异常处理
|
|
325
|
-
|
|
326
|
-
| 现象 | 原因 | 应对 |
|
|
327
|
-
| ---- | ---- | ---- |
|
|
328
|
-
| 输出以 `🚀 已触发技能 xxx/SKILL.md` 开头 | ✅ 技能路径正确激活 | 继续即可 |
|
|
329
|
-
| 直接输出代码,无 Pre-flight 声明 | AI 走了默认推断,未加载 Skill | 补充说:「先读取 `.github/skills/core/xxx/SKILL.md`,再按其执行」 |
|
|
330
|
-
| Pre-flight 含 `❌ 工具链检测失败` | 缺少 `.prettierrc.js` / `eslint.config.ts` / `.husky/` | 执行 `npx @robot-admin/git-standards init` |
|
|
331
|
-
| reports/ 无新文件 | 输出写到了错误路径 | 明确告知 AI:「报告写入 `.github/reports/` 目录」 |
|
|
332
|
-
|
|
333
|
-
> 详细使用示例和踩坑 FAQ 见安装后的 `.github/guides/usage.md`(每个 Skill 同目录的 `USAGE.md` 也有完整示例)。
|
|
334
|
-
|
|
335
|
-
---
|
|
336
|
-
|
|
337
206
|
## 多 AI 编辑器适配(解耦设计)
|
|
338
207
|
|
|
339
208
|
`init` / `update` 读取 `files/.github/skills/_compat/editors.json` 生成对应配置:
|
|
@@ -356,13 +225,11 @@ cid: 'mca-customerName'
|
|
|
356
225
|
|
|
357
226
|
## 受保护路径
|
|
358
227
|
|
|
359
|
-
| 命令 | 保护路径
|
|
360
|
-
| ------------------------ |
|
|
361
|
-
| `init` / `update` | `.github/reports/*.md`
|
|
362
|
-
| `
|
|
363
|
-
| `
|
|
364
|
-
| `clean`(默认) | `src/components/` + `src/types/` | 业务代码必需,永不删除 |
|
|
365
|
-
| `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/` | 保留菜单/字典/权限基线 |
|
|
366
233
|
|
|
367
234
|
---
|
|
368
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.
|
|
4
|
+
* wl-skills-kit CLI v2.1
|
|
5
5
|
*
|
|
6
6
|
* 命令:
|
|
7
7
|
* init 全量安装(默认,向后兼容)
|
|
@@ -51,10 +51,7 @@ if (showHelp) {
|
|
|
51
51
|
npx @agile-team/wl-skills-kit clean --dry-run 预览将要清理哪些文件
|
|
52
52
|
|
|
53
53
|
保护路径(init / update 不覆盖已存在的):
|
|
54
|
-
.github/reports/
|
|
55
|
-
.github/skills/sync/env.local.json 用户本地配置(token 等,已存在则跳过)
|
|
56
|
-
.cursor/mcp.json MCP 配置(已存在则跳过,避免覆盖其他 server)
|
|
57
|
-
.claude/settings.json MCP 配置(已存在则跳过)
|
|
54
|
+
.github/reports/ AI 生成报告(团队累积数据,存在则跳过)
|
|
58
55
|
|
|
59
56
|
清理保护路径(clean 不删除):
|
|
60
57
|
src/components/ 通用组件(被业务页面 import,构建必需)
|
|
@@ -165,15 +162,6 @@ function isReportFile(relPath) {
|
|
|
165
162
|
return relPath.startsWith(".github/reports/") && relPath.endsWith(".md");
|
|
166
163
|
}
|
|
167
164
|
|
|
168
|
-
// 用户本地配置:init/update 遇到已存在不覆盖(含 token / gatewayPath 等敏感信息)
|
|
169
|
-
const USER_LOCAL_CONFIGS = [
|
|
170
|
-
".github/skills/sync/env.local.json", // 统一配置(v2.1.5+,菜单+字典+权限共用)
|
|
171
|
-
".github/skills/sync/menu-sync/env/env.local.json", // 老版兼容
|
|
172
|
-
];
|
|
173
|
-
function isUserLocalConfig(relPath) {
|
|
174
|
-
return USER_LOCAL_CONFIGS.includes(relPath);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
165
|
// ─── 旧版遗留路径(v1.x/v2.0 → v2.1 迁移清理)───────────────────────────
|
|
178
166
|
// update 时自动检测并移除,避免旧结构与新结构并存产生歧义。
|
|
179
167
|
const LEGACY_PATHS = [
|
|
@@ -295,13 +283,6 @@ function runInstall(incremental) {
|
|
|
295
283
|
continue;
|
|
296
284
|
}
|
|
297
285
|
|
|
298
|
-
// 用户本地配置:已存在则跳过(含 token / gatewayPath 等敏感信息,不覆盖)
|
|
299
|
-
if (isUserLocalConfig(relPath) && fs.existsSync(dest)) {
|
|
300
|
-
preserved++;
|
|
301
|
-
if (dryRun) console.log(" 保留 " + relPath + " (用户本地配置,不覆盖)");
|
|
302
|
-
continue;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
286
|
// update 模式: 跳过内容相同的文件
|
|
306
287
|
if (incremental && fs.existsSync(dest)) {
|
|
307
288
|
if (srcHash === fileMd5(dest)) {
|
|
@@ -319,29 +300,6 @@ function runInstall(incremental) {
|
|
|
319
300
|
}
|
|
320
301
|
}
|
|
321
302
|
|
|
322
|
-
// ── Step 1.5: .gitignore 安全修补(防止 env.local.json 意外入 git)────────
|
|
323
|
-
|
|
324
|
-
const ENV_LOCAL_GITIGNORE_ENTRIES = [
|
|
325
|
-
".github/skills/sync/env.local.json", // 统一配置(v2.1.5+)
|
|
326
|
-
".github/skills/sync/menu-sync/env/env.local.json", // 老版兼容
|
|
327
|
-
];
|
|
328
|
-
const gitignorePath = path.join(TARGET_DIR, ".gitignore");
|
|
329
|
-
if (!dryRun && fs.existsSync(gitignorePath)) {
|
|
330
|
-
const giContent = fs.readFileSync(gitignorePath, "utf8");
|
|
331
|
-
const missing = ENV_LOCAL_GITIGNORE_ENTRIES.filter(
|
|
332
|
-
(e) => !giContent.includes(e)
|
|
333
|
-
);
|
|
334
|
-
if (missing.length > 0) {
|
|
335
|
-
fs.appendFileSync(
|
|
336
|
-
gitignorePath,
|
|
337
|
-
"\n# wl-skills-kit: 本地敏感配置(token / gatewayPath,不入 git)\n" +
|
|
338
|
-
missing.join("\n") +
|
|
339
|
-
"\n",
|
|
340
|
-
);
|
|
341
|
-
console.log(" ✔ .gitignore 已追加 env.local.json 保护条目");
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
|
|
345
303
|
// ── Step 2: 动态生成编辑器配置文件 ────────────────────────────────
|
|
346
304
|
|
|
347
305
|
const INSTRUCTIONS_SRC = path.join(
|
|
@@ -383,62 +341,6 @@ function runInstall(incremental) {
|
|
|
383
341
|
}
|
|
384
342
|
}
|
|
385
343
|
|
|
386
|
-
// ── Step 2.5: MCP 配置文件(.cursor/mcp.json + .claude/settings.json)──────
|
|
387
|
-
|
|
388
|
-
const MCP_SERVER_ARGS = ["node_modules/@agile-team/wl-skills-kit/mcp/server.js"];
|
|
389
|
-
const MCP_CONFIGS = [
|
|
390
|
-
{
|
|
391
|
-
relPath: ".cursor/mcp.json",
|
|
392
|
-
content: JSON.stringify(
|
|
393
|
-
{
|
|
394
|
-
mcpServers: {
|
|
395
|
-
"wl-skills": {
|
|
396
|
-
command: "node",
|
|
397
|
-
args: MCP_SERVER_ARGS,
|
|
398
|
-
env: { WL_PROJECT_ROOT: "${workspaceFolder}" },
|
|
399
|
-
},
|
|
400
|
-
},
|
|
401
|
-
},
|
|
402
|
-
null,
|
|
403
|
-
2
|
|
404
|
-
),
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
relPath: ".claude/settings.json",
|
|
408
|
-
content: JSON.stringify(
|
|
409
|
-
{
|
|
410
|
-
mcpServers: {
|
|
411
|
-
"wl-skills": {
|
|
412
|
-
command: "node",
|
|
413
|
-
args: MCP_SERVER_ARGS,
|
|
414
|
-
env: { WL_PROJECT_ROOT: "." },
|
|
415
|
-
},
|
|
416
|
-
},
|
|
417
|
-
},
|
|
418
|
-
null,
|
|
419
|
-
2
|
|
420
|
-
),
|
|
421
|
-
},
|
|
422
|
-
];
|
|
423
|
-
|
|
424
|
-
if (dryRun) console.log("\n [Step 2.5] MCP 配置文件:\n");
|
|
425
|
-
|
|
426
|
-
for (const mc of MCP_CONFIGS) {
|
|
427
|
-
const mcDest = path.join(TARGET_DIR, mc.relPath);
|
|
428
|
-
if (fs.existsSync(mcDest)) {
|
|
429
|
-
preserved++;
|
|
430
|
-
if (dryRun) console.log(" 保留 " + mc.relPath + " (已存在,不覆盖)");
|
|
431
|
-
} else {
|
|
432
|
-
if (dryRun) {
|
|
433
|
-
console.log(" 新增 " + mc.relPath);
|
|
434
|
-
created++;
|
|
435
|
-
} else {
|
|
436
|
-
writeFile(mcDest, mc.content);
|
|
437
|
-
created++;
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
344
|
// ── Step 3: 迁移清理(仅 update,清理旧版遗留文件)──────────────────
|
|
443
345
|
|
|
444
346
|
if (incremental) {
|
|
@@ -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 仓库维护者阅读,**不安装到业务项目**
|