@agile-team/wl-skills-kit 2.10.1 → 2.11.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 +51 -8
- package/README.md +47 -29
- package/bin/wl-skills.js +156 -53
- package/docs/agent-pipeline-runbook.md +3 -3
- package/docs//345/205/250/347/233/230/345/210/206/346/236/220/344/270/216/346/231/272/350/203/275/344/275/223/346/220/255/345/273/272/346/214/207/345/215/227.md +4 -4
- package/files/.github/copilot-instructions.md +23 -465
- package/files/.wl-skills/copilot-instructions-full.md +233 -0
- package/files/{docs → .wl-skills/docs}/jh-pagination.md +2 -2
- package/files/{docs → .wl-skills/docs}/page-query-hook-best-practices.md +3 -3
- package/files/.wl-skills/docs/page-spec-schema.md +109 -0
- package/files/{.github → .wl-skills}/guides/README.md +1 -1
- package/files/{.github → .wl-skills}/guides/architecture.md +5 -5
- package/files/{.github → .wl-skills}/guides/mcp-setup.md +1 -1
- package/files/{.github → .wl-skills}/guides/usage.md +8 -8
- package/files/{.github → .wl-skills}/reports/SYS_MENU_INFO.md +1 -1
- package/files/{.github → .wl-skills}/reports/SYS_PERMISSION_INFO.md +1 -1
- package/files/{.github → .wl-skills}/reports//347/273/204/344/273/266/346/217/220/345/217/226/345/273/272/350/256/256.md +1 -1
- package/files/{.github → .wl-skills}/skills/_best-practices.md +5 -5
- package/files/{.github → .wl-skills}/skills/_compat/README.md +1 -1
- package/files/{.github → .wl-skills}/skills/_compat/editors.json +1 -1
- package/files/{.github → .wl-skills}/skills/_pipeline.md +9 -9
- package/files/{.github → .wl-skills}/skills/_registry.md +3 -3
- package/files/{.github → .wl-skills}/skills/core/business-doc-extract/SKILL.md +27 -27
- package/files/{.github → .wl-skills}/skills/core/business-doc-extract/USAGE.md +22 -22
- package/files/{.github → .wl-skills}/skills/core/business-doc-extract/templates/business-index.md +1 -1
- package/files/{.github → .wl-skills}/skills/core/business-doc-extract/templates/business-open-questions.md +1 -1
- package/files/{.github → .wl-skills}/skills/core/business-doc-extract/templates/module-dictionary.md +1 -1
- package/files/{.github → .wl-skills}/skills/core/business-doc-extract/templates/module-field.md +1 -1
- package/files/{.github → .wl-skills}/skills/core/business-doc-extract/templates/module-index.md +2 -2
- package/files/{.github → .wl-skills}/skills/core/business-doc-extract/templates/module-requirement.md +2 -2
- package/files/{.github → .wl-skills}/skills/core/convention-audit/SKILL.md +6 -6
- package/files/{.github → .wl-skills}/skills/core/convention-audit/USAGE.md +1 -1
- package/files/{.github → .wl-skills}/skills/core/page-codegen/SKILL.md +20 -14
- package/files/{.github → .wl-skills}/skills/core/page-codegen/USAGE.md +1 -1
- package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/universal/TPL-DETAIL-TABS.md +7 -7
- package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/universal/TPL-DRIVEN.md +5 -5
- package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/universal/TPL-FORM-ROUTE.md +2 -2
- package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/universal/TPL-RECORD-FORM.md +1 -1
- package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/universal/TPL-TREE-LIST.md +1 -1
- package/files/{.github → .wl-skills}/skills/core/prototype-scan/SKILL.md +11 -11
- package/files/{.github → .wl-skills}/skills/core/prototype-scan/USAGE.md +3 -3
- package/files/{.github → .wl-skills}/skills/core/spec-doc-parse/SKILL.md +9 -9
- package/files/{.github → .wl-skills}/skills/core/spec-doc-parse/USAGE.md +6 -6
- package/files/{.github → .wl-skills}/skills/core/template-extract/SKILL.md +1 -1
- package/files/{.github → .wl-skills}/skills/core/template-extract/USAGE.md +1 -1
- package/files/{.github → .wl-skills}/skills/sync/_mcp-guardrail.md +3 -3
- package/files/{.github → .wl-skills}/skills/sync/dict-sync/SKILL.md +5 -5
- package/files/{.github → .wl-skills}/skills/sync/dict-sync/USAGE.md +2 -2
- package/files/{.github → .wl-skills}/skills/sync/menu-sync/SKILL.md +6 -6
- package/files/{.github → .wl-skills}/skills/sync/menu-sync/USAGE.md +3 -3
- package/files/{.github → .wl-skills}/skills/sync/menu-sync/env/guide.md +2 -2
- package/files/{.github → .wl-skills}/skills/sync/permission-sync/SKILL.md +3 -3
- package/files/{.github → .wl-skills}/skills/sync/permission-sync/USAGE.md +1 -1
- package/files/{src → .wl-skills/src}/components/local/c_formModal/README.md +1 -1
- package/files/{src → .wl-skills/src}/components/local/c_formSections/README.md +2 -2
- package/files/{src → .wl-skills/src}/components/remote/BaseForm/README.md +2 -2
- package/files/{src → .wl-skills/src}/components/remote/BaseQuery/README.md +4 -4
- package/files/{src → .wl-skills/src}/components/remote/BaseTable/README.md +2 -2
- package/files/{src → .wl-skills/src}/components/remote/BaseToolbar/README.md +1 -1
- package/files/{.github → .wl-skills}/standards/02-code-structure.md +1 -1
- package/files/{.github → .wl-skills}/standards/08-git.md +1 -1
- package/files/{.github → .wl-skills}/standards/11-form-validation.md +1 -1
- package/files/{.github → .wl-skills}/standards/13-platform-components.md +15 -15
- package/files/{.github → .wl-skills}/standards/14-layout-containers.md +9 -9
- package/files/{demo → .wl-skills/templates}/README.md +3 -3
- package/lib/page-spec.js +588 -0
- package/lib/safe-fix.js +115 -0
- package/lib/vite-plugin-wl-skills.js +97 -0
- package/mcp/config.js +3 -3
- package/mcp/tools/projectTools.js +10 -0
- package/package.json +16 -11
- package/files/src/components/global/C_Splitter/index.scss +0 -61
- package/files/src/components/global/C_Splitter/index.vue +0 -149
- /package/files/{docs → .wl-skills/docs}/jh-date-range.md +0 -0
- /package/files/{docs → .wl-skills/docs}/jh-date.md +0 -0
- /package/files/{docs → .wl-skills/docs}/jh-dept-picker.md +0 -0
- /package/files/{docs → .wl-skills/docs}/jh-drag-row.md +0 -0
- /package/files/{docs → .wl-skills/docs}/jh-file-upload.md +0 -0
- /package/files/{docs → .wl-skills/docs}/jh-picker.md +0 -0
- /package/files/{docs → .wl-skills/docs}/jh-select.md +0 -0
- /package/files/{docs → .wl-skills/docs}/jh-text.md +0 -0
- /package/files/{docs → .wl-skills/docs}/jh-textarea.md +0 -0
- /package/files/{docs → .wl-skills/docs}/jh-user-picker.md +0 -0
- /package/files/{docs → .wl-skills/docs}/mock-architecture.md +0 -0
- /package/files/{docs → .wl-skills/docs}/request.md +0 -0
- /package/files/{.github → .wl-skills}/reports/README.md +0 -0
- /package/files/{.github → .wl-skills}/reports/SYS_DICT_INFO.md +0 -0
- /package/files/{.github → .wl-skills}/reports//350/247/204/350/214/203/345/256/241/346/237/245/346/212/245/345/221/212.md" +0 -0
- /package/files/{.github → .wl-skills}/skills/_compat/headers/agents.txt +0 -0
- /package/files/{.github → .wl-skills}/skills/_compat/headers/claude-code.txt +0 -0
- /package/files/{.github → .wl-skills}/skills/_compat/headers/cline.txt +0 -0
- /package/files/{.github → .wl-skills}/skills/_compat/headers/cursor-mdc.txt +0 -0
- /package/files/{.github → .wl-skills}/skills/_compat/headers/cursor-rules.txt +0 -0
- /package/files/{.github → .wl-skills}/skills/_compat/headers/github-copilot.txt +0 -0
- /package/files/{.github → .wl-skills}/skills/_compat/headers/kiro.txt +0 -0
- /package/files/{.github → .wl-skills}/skills/_compat/headers/qoder.txt +0 -0
- /package/files/{.github → .wl-skills}/skills/_compat/headers/trae.txt +0 -0
- /package/files/{.github → .wl-skills}/skills/_compat/headers/windsurf.txt +0 -0
- /package/files/{.github → .wl-skills}/skills/core/api-contract/SKILL.md +0 -0
- /package/files/{.github → .wl-skills}/skills/core/api-contract/USAGE.md +0 -0
- /package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/_index.md +0 -0
- /package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/domains/_CONTRIBUTING.md +0 -0
- /package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/domains/produce/TPL-OPERATION-STATION.md +0 -0
- /package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/domains/sale/README.md +0 -0
- /package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/universal/TPL-CHANGE-HISTORY.md +0 -0
- /package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/universal/TPL-LIST.md +0 -0
- /package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/universal/TPL-MASTER-DETAIL.md +0 -0
- /package/files/{.github → .wl-skills}/skills/domain/README.md +0 -0
- /package/files/{.github → .wl-skills}/skills/ops/code-fix/SKILL.md +0 -0
- /package/files/{.github → .wl-skills}/skills/ops/code-fix/USAGE.md +0 -0
- /package/files/{.github → .wl-skills}/skills/sync/env.local.json +0 -0
- /package/files/{.github → .wl-skills}/skills/sync/menu-sync/env/env.local.json +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_ParentView/index.vue +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_RightToolbar/data.ts +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_RightToolbar/index.scss +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_RightToolbar/index.vue +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_SvgIcon/index.scss +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_SvgIcon/index.vue +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_SvgIcon/svgicon.js +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_TagStatus/README.md +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_TagStatus/config.ts +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_TagStatus/index.scss +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_TagStatus/index.vue +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_TagStatus/types.ts +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_Tree/README.md +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_Tree/data.ts +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_Tree/index.scss +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_Tree/index.vue +0 -0
- /package/files/{src → .wl-skills/src}/components/global/C_Tree/types.ts +0 -0
- /package/files/{src → .wl-skills/src}/components/local/c_formModal/data.ts +0 -0
- /package/files/{src → .wl-skills/src}/components/local/c_formModal/index.scss +0 -0
- /package/files/{src → .wl-skills/src}/components/local/c_formModal/index.vue +0 -0
- /package/files/{src → .wl-skills/src}/components/local/c_formSections/data.ts +0 -0
- /package/files/{src → .wl-skills/src}/components/local/c_formSections/index.scss +0 -0
- /package/files/{src → .wl-skills/src}/components/local/c_formSections/index.vue +0 -0
- /package/files/{src → .wl-skills/src}/components/local/c_listModal/data.ts +0 -0
- /package/files/{src → .wl-skills/src}/components/local/c_listModal/index.scss +0 -0
- /package/files/{src → .wl-skills/src}/components/local/c_listModal/index.vue +0 -0
- /package/files/{src → .wl-skills/src}/components/local/c_spliterTitle/index.scss +0 -0
- /package/files/{src → .wl-skills/src}/components/local/c_spliterTitle/index.vue +0 -0
- /package/files/{src → .wl-skills/src}/components/remote/AGGrid/README.md +0 -0
- /package/files/{src → .wl-skills/src}/types/page.ts +0 -0
- /package/files/{.github → .wl-skills}/standards/01-toolchain.md +0 -0
- /package/files/{.github → .wl-skills}/standards/03-comments.md +0 -0
- /package/files/{.github → .wl-skills}/standards/04-coding-basics.md +0 -0
- /package/files/{.github → .wl-skills}/standards/05-logging.md +0 -0
- /package/files/{.github → .wl-skills}/standards/06-security.md +0 -0
- /package/files/{.github → .wl-skills}/standards/07-config.md +0 -0
- /package/files/{.github → .wl-skills}/standards/09-typescript.md +0 -0
- /package/files/{.github → .wl-skills}/standards/10-pinia.md +0 -0
- /package/files/{.github → .wl-skills}/standards/12-base-table.md +0 -0
- /package/files/{.github → .wl-skills}/standards/index.md +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-add/api.md +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-add/data.ts +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-add/index.scss +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-add/index.vue +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-add-form/data.ts +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-add-form/index.scss +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-add-form/index.vue +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-change/data.ts +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-change/index.scss +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-change/index.vue +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-change-form/data.ts +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-change-form/index.scss +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-change-form/index.vue +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-change-history/data.ts +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-change-history/index.scss +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-change-history/index.vue +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-archive/api.md +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-archive/data.ts +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-archive/index.scss +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-archive/index.vue +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-detail/api.md +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-detail/data.ts +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-detail/index.scss +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-detail/index.vue +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-temp-customer-archive/api.md +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-temp-customer-archive/data.ts +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-temp-customer-archive/index.scss +0 -0
- /package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-temp-customer-archive/index.vue +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/add-demo/data.ts +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/add-demo/index.scss +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/add-demo/index.vue +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/billet-flame-cut-plan/data.ts +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/billet-flame-cut-plan/index.scss +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/billet-flame-cut-plan/index.vue +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/domestic-trade-order/data.ts +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/domestic-trade-order/index.scss +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/domestic-trade-order/index.vue +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/heat-batch-return/data.ts +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/heat-batch-return/index.scss +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/heat-batch-return/index.vue +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/heat-batch-return/meltDialog.vue +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/metallurgical-spec/data.ts +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/metallurgical-spec/index.scss +0 -0
- /package/files/{demo → .wl-skills/templates}/sale/demo/metallurgical-spec/index.vue +0 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* lib/vite-plugin-wl-skills.js — wl-skills-kit Vite 构建时约束插件
|
|
5
|
+
*
|
|
6
|
+
* 这是不依赖业务项目配置 CI 的"第五层防线":
|
|
7
|
+
* dev 模式 → 启动时扫描 src/views,在终端输出 warning
|
|
8
|
+
* build 模式 → 构建前全量扫描,有 error 级别违规时中断构建
|
|
9
|
+
*
|
|
10
|
+
* 使用方式(业务项目 vite.config.ts):
|
|
11
|
+
* import wlSkillsPlugin from "@agile-team/wl-skills-kit/lib/vite-plugin-wl-skills.js";
|
|
12
|
+
* export default defineConfig({
|
|
13
|
+
* plugins: [vue(), wlSkillsPlugin()],
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* 或在 init/update 时自动注入到 vite.config.ts 的 plugins 数组(可选)。
|
|
17
|
+
*
|
|
18
|
+
* 约束层级定位:
|
|
19
|
+
* ① AI 指令层(文字) → 可被忽略
|
|
20
|
+
* ② validate 检测层 → 手动调用
|
|
21
|
+
* ③ pre-commit 层 → --no-verify 可绕过
|
|
22
|
+
* ④ CI 层 → 业务项目需手动配置
|
|
23
|
+
* ⑤ Vite 插件层(本插件) → 构建时自动执行,无需额外配置 ← 不可绕开
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
const path = require("path");
|
|
27
|
+
|
|
28
|
+
let astRules = null;
|
|
29
|
+
try {
|
|
30
|
+
astRules = require("./ast-rules.js");
|
|
31
|
+
} catch {
|
|
32
|
+
astRules = null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function wlSkillsPlugin(options) {
|
|
36
|
+
options = options || {};
|
|
37
|
+
const scanRel = options.scanRel || "src/views";
|
|
38
|
+
const failOnWarn = options.failOnWarn || false; // build 模式下 warn 也中断(等同 --strict)
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
name: "wl-skills-guard",
|
|
42
|
+
apply: "all", // serve + build 都生效
|
|
43
|
+
|
|
44
|
+
configResolved(config) {
|
|
45
|
+
// 只在业务项目运行,跳过 kit 自身
|
|
46
|
+
if (!astRules || !astRules.hasAstAvailable()) return;
|
|
47
|
+
|
|
48
|
+
const root = config.root || process.cwd();
|
|
49
|
+
const isBuild = config.command === "build";
|
|
50
|
+
|
|
51
|
+
const result = astRules.runAstRules(root, scanRel);
|
|
52
|
+
if (!result.astAvailable) return;
|
|
53
|
+
|
|
54
|
+
const errors = result.issues.filter((i) => i.level === "error");
|
|
55
|
+
const warns = result.issues.filter((i) => i.level === "warn");
|
|
56
|
+
|
|
57
|
+
if (result.issues.length === 0) {
|
|
58
|
+
if (isBuild) {
|
|
59
|
+
console.log("\n ✔ wl-skills-guard: 页面规范检查通过(" + result.pages + " 个页面)\n");
|
|
60
|
+
}
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 输出所有问题
|
|
65
|
+
console.log("\n wl-skills-guard: 发现 " + result.issues.length + " 个规范偏差(" + result.pages + " 页面)");
|
|
66
|
+
for (const issue of result.issues.slice(0, 30)) {
|
|
67
|
+
const icon = issue.level === "error" ? "✖" : "⚠";
|
|
68
|
+
console.log(" " + icon + " [" + issue.rule + "] " + issue.dir + " — " + issue.text);
|
|
69
|
+
}
|
|
70
|
+
if (result.issues.length > 30) {
|
|
71
|
+
console.log(" ... 还有 " + (result.issues.length - 30) + " 条");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// build 模式:error 中断构建
|
|
75
|
+
if (isBuild && errors.length > 0) {
|
|
76
|
+
console.log("\n ✖ wl-skills-guard: 构建中断 — " + errors.length + " 个 error 级规范违规");
|
|
77
|
+
console.log(" → 修复后重新构建,或使用 wl-skills:ignore 标记豁免");
|
|
78
|
+
throw new Error(
|
|
79
|
+
"wl-skills-guard: " + errors.length + " 个 error 级规范违规,构建已中断",
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// build 模式 + failOnWarn:warn 也中断
|
|
84
|
+
if (isBuild && failOnWarn && warns.length > 0) {
|
|
85
|
+
console.log("\n ✖ wl-skills-guard: 构建中断 — " + warns.length + " 个 warn 级规范违规(failOnWarn)");
|
|
86
|
+
throw new Error(
|
|
87
|
+
"wl-skills-guard: " + warns.length + " 个 warn 级违规(failOnWarn 模式)",
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
console.log("");
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
module.exports = wlSkillsPlugin;
|
|
97
|
+
module.exports.default = wlSkillsPlugin;
|
package/mcp/config.js
CHANGED
|
@@ -4,7 +4,7 @@ const fs = require('fs')
|
|
|
4
4
|
const path = require('path')
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* 从项目的 .
|
|
7
|
+
* 从项目的 .wl-skills/skills/sync/env.local.json 加载 MCP 运行配置
|
|
8
8
|
* 项目根目录通过环境变量 WL_PROJECT_ROOT 传入(由 .cursor/mcp.json 注入)
|
|
9
9
|
*/
|
|
10
10
|
function loadConfig() {
|
|
@@ -12,12 +12,12 @@ function loadConfig() {
|
|
|
12
12
|
? path.resolve(process.env.WL_PROJECT_ROOT)
|
|
13
13
|
: process.cwd()
|
|
14
14
|
|
|
15
|
-
const configPath = path.join(projectRoot, '.
|
|
15
|
+
const configPath = path.join(projectRoot, '.wl-skills', 'skills', 'sync', 'env.local.json')
|
|
16
16
|
|
|
17
17
|
if (!fs.existsSync(configPath)) {
|
|
18
18
|
throw new Error(
|
|
19
19
|
`配置文件不存在: ${configPath}\n` +
|
|
20
|
-
`请先执行
|
|
20
|
+
`请先执行 pnpm dlx @agile-team/wl-skills-kit init,然后填写 .wl-skills/skills/sync/env.local.json`
|
|
21
21
|
)
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -5,6 +5,7 @@ const path = require("path");
|
|
|
5
5
|
const { execFileSync } = require("child_process");
|
|
6
6
|
const https = require("https");
|
|
7
7
|
const { runAstRules } = require("../../lib/ast-rules");
|
|
8
|
+
const { alignPage } = require("../../lib/page-spec");
|
|
8
9
|
|
|
9
10
|
function getProjectRoot() {
|
|
10
11
|
return process.env.WL_PROJECT_ROOT
|
|
@@ -203,6 +204,15 @@ async function handleValidatePage(args) {
|
|
|
203
204
|
}
|
|
204
205
|
}
|
|
205
206
|
|
|
207
|
+
// ── page-spec 比对(v2.11.1+,"约定 vs 代码"确定性核对 S1~S5)───────
|
|
208
|
+
for (const page of pages) {
|
|
209
|
+
const absDir = path.join(root, page.dir);
|
|
210
|
+
const { issues: specIssues } = alignPage(absDir, page.dir);
|
|
211
|
+
for (const iss of specIssues) {
|
|
212
|
+
issues.push([iss.dir, iss.level, `[${iss.rule}] ${iss.text}`]);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
206
216
|
const errors = issues.filter((item) => item[1] === "error").length;
|
|
207
217
|
const lines = [
|
|
208
218
|
`✅ 页面校验完成:${scanPath}`,
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agile-team/wl-skills-kit",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "AI Skill 模板包 v2.
|
|
3
|
+
"version": "2.11.1",
|
|
4
|
+
"description": "AI Skill 模板包 v2.11.1 — 14 条编码规范 + 11 个 AI Skill + 17 个 MCP Tool,一条命令导入 Vue 3 项目(.wl-skills/ 统一隔离架构)",
|
|
5
5
|
"main": "./bin/wl-skills.js",
|
|
6
|
+
"packageManager": "pnpm@11.5.3",
|
|
6
7
|
"bin": {
|
|
7
8
|
"wl-skills": "bin/wl-skills.js"
|
|
8
9
|
},
|
|
@@ -37,28 +38,29 @@
|
|
|
37
38
|
"url": "git+https://github.com/ChenyCHENYU/wl-skills-kit.git"
|
|
38
39
|
},
|
|
39
40
|
"engines": {
|
|
40
|
-
"node": ">=
|
|
41
|
+
"node": ">=18.0.0"
|
|
41
42
|
},
|
|
42
43
|
"scripts": {
|
|
43
|
-
"standards:init": "
|
|
44
|
+
"standards:init": "pnpm dlx @robot-admin/git-standards init",
|
|
44
45
|
"prepare": "husky",
|
|
45
46
|
"cz": "git-cz",
|
|
46
47
|
"lint": "eslint .",
|
|
47
48
|
"lint:skills": "node scripts/lint-skills.js",
|
|
48
49
|
"test": "vitest run",
|
|
49
50
|
"version:verify": "node scripts/verify-version.js",
|
|
51
|
+
"verify": "pnpm version:verify && pnpm lint:skills && pnpm test",
|
|
52
|
+
"ci": "pnpm install --frozen-lockfile && pnpm verify",
|
|
53
|
+
"pack:dry": "npm pack --dry-run --ignore-scripts",
|
|
54
|
+
"release:check": "pnpm verify && npm pack --dry-run --ignore-scripts",
|
|
50
55
|
"prepublishOnly": "node scripts/verify-version.js && node scripts/lint-skills.js && vitest run"
|
|
51
56
|
},
|
|
52
|
-
"dependencies": {
|
|
53
|
-
"xlsx": "^0.18.5"
|
|
54
|
-
},
|
|
55
57
|
"optionalDependencies": {
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
+
"@babel/parser": "^7.20.0",
|
|
59
|
+
"@vue/compiler-sfc": "^3.2.0"
|
|
58
60
|
},
|
|
59
61
|
"peerDependencies": {
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
+
"@babel/parser": "^7.20.0",
|
|
63
|
+
"@vue/compiler-sfc": "^3.2.0"
|
|
62
64
|
},
|
|
63
65
|
"peerDependenciesMeta": {
|
|
64
66
|
"@vue/compiler-sfc": {
|
|
@@ -91,5 +93,8 @@
|
|
|
91
93
|
"src/**/*.{js,jsx,ts,tsx,vue}": [
|
|
92
94
|
"eslint --fix --no-cache"
|
|
93
95
|
]
|
|
96
|
+
},
|
|
97
|
+
"dependencies": {
|
|
98
|
+
"write-excel-file": "^4.1.1"
|
|
94
99
|
}
|
|
95
100
|
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
.my-splitter-container {
|
|
2
|
-
display: flex;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.is-horizontal {
|
|
9
|
-
flex-direction: row;
|
|
10
|
-
}
|
|
11
|
-
.is-vertical {
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.splitter-item {
|
|
16
|
-
overflow: auto;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.splitter-trigger {
|
|
20
|
-
background-color: #f0f2f5;
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: center;
|
|
23
|
-
justify-content: center;
|
|
24
|
-
transition: background-color 0.2s;
|
|
25
|
-
z-index: 10;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.splitter-trigger:hover {
|
|
29
|
-
background-color: #409eff;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/* 水平线 */
|
|
33
|
-
.is-horizontal > .splitter-trigger {
|
|
34
|
-
width: 4px;
|
|
35
|
-
cursor: col-resize;
|
|
36
|
-
}
|
|
37
|
-
.is-horizontal .trigger-line {
|
|
38
|
-
width: 1px;
|
|
39
|
-
height: 20px;
|
|
40
|
-
background: #dcdfe6;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/* 垂直线 */
|
|
44
|
-
.is-vertical > .splitter-trigger {
|
|
45
|
-
height: 8px;
|
|
46
|
-
cursor: row-resize;
|
|
47
|
-
background-color: #f5f5f5;
|
|
48
|
-
flex-shrink: 0;
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
justify-content: center;
|
|
52
|
-
}
|
|
53
|
-
.is-vertical .trigger-line {
|
|
54
|
-
width: 30px;
|
|
55
|
-
height: 3px;
|
|
56
|
-
background: #d9d9d9;
|
|
57
|
-
border-radius: 2px;
|
|
58
|
-
}
|
|
59
|
-
.is-vertical > .splitter-trigger:hover .trigger-line {
|
|
60
|
-
background: #409eff;
|
|
61
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="containerRef"
|
|
4
|
-
class="my-splitter-container"
|
|
5
|
-
:class="[`is-${direction}`]"
|
|
6
|
-
>
|
|
7
|
-
<template v-for="(item, index) in vnodes" :key="index">
|
|
8
|
-
<div class="splitter-item" :style="getItemStyle(index)">
|
|
9
|
-
<component :is="item" />
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<div
|
|
13
|
-
v-if="index < vnodes.length - 1"
|
|
14
|
-
class="splitter-trigger"
|
|
15
|
-
@mousedown="(e) => onMouseDown(e, index)"
|
|
16
|
-
>
|
|
17
|
-
<div class="trigger-line"></div>
|
|
18
|
-
</div>
|
|
19
|
-
</template>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<script setup>
|
|
24
|
-
import { ref, reactive, onMounted, useSlots, onUnmounted } from "vue";
|
|
25
|
-
|
|
26
|
-
// ⚠️ [DEPRECATED] C_Splitter 已废弃,请改用:
|
|
27
|
-
// 左右分割 → <jh-drag-col :leftWidth="260"> #left / #right </jh-drag-col>
|
|
28
|
-
// 上下分栈 → <jh-drag-row :topHeight="200"> #top / #bottom </jh-drag-row>
|
|
29
|
-
// 原因:C_Splitter 在 onMounted 中调用 slots.default() 冻结 vnode 快照,
|
|
30
|
-
// 导致子树响应式绑定(v-if / v-show / 插值)与父组件 ref 完全解耦,
|
|
31
|
-
// ref 赋值不触发重渲染。详见 .github/standards/14-layout-containers.md
|
|
32
|
-
if (typeof window !== "undefined" && !window.__C_SPLITTER_WARNED__) {
|
|
33
|
-
window.__C_SPLITTER_WARNED__ = true;
|
|
34
|
-
// eslint-disable-next-line no-console
|
|
35
|
-
console.warn(
|
|
36
|
-
"[C_Splitter 已废弃] 已检测到 C_Splitter 使用。请改用 jh-drag-col / jh-drag-row。\n" +
|
|
37
|
-
"原因:slots.default() 被冻结为 vnode 快照,导致子树响应式失效。\n" +
|
|
38
|
-
"详见:.github/standards/14-layout-containers.md"
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const props = defineProps({
|
|
43
|
-
direction: {
|
|
44
|
-
type: String,
|
|
45
|
-
default: "horizontal" // horizontal | vertical
|
|
46
|
-
},
|
|
47
|
-
minSize: {
|
|
48
|
-
type: Number,
|
|
49
|
-
default: 50
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
const slots = useSlots();
|
|
54
|
-
const containerRef = ref(null);
|
|
55
|
-
const vnodes = ref([]); // 存储虚拟节点
|
|
56
|
-
const paneConfigs = ref([]); // 存储每个面板的 minSize 等配置
|
|
57
|
-
const sizes = reactive([]);
|
|
58
|
-
const isDragging = ref(false);
|
|
59
|
-
let currentTriggerIndex = -1;
|
|
60
|
-
|
|
61
|
-
// 初始化:获取插槽并分配初始平均尺寸
|
|
62
|
-
onMounted(() => {
|
|
63
|
-
const defaultSlots = slots.default ? slots.default() : [];
|
|
64
|
-
// 过滤掉注释节点(Symbol(v-cmt))和Fragment,只保留真正的元素
|
|
65
|
-
const children = defaultSlots.filter((v) => {
|
|
66
|
-
// 排除 Symbol 类型(注释节点)和 Fragment
|
|
67
|
-
if (typeof v.type === "symbol") return false;
|
|
68
|
-
// 保留 string(原生HTML元素)和 object(组件)
|
|
69
|
-
return typeof v.type === "string" || typeof v.type === "object";
|
|
70
|
-
});
|
|
71
|
-
vnodes.value = children;
|
|
72
|
-
|
|
73
|
-
const rect = containerRef.value.getBoundingClientRect();
|
|
74
|
-
const totalAvailable =
|
|
75
|
-
props.direction === "horizontal" ? rect.width : rect.height;
|
|
76
|
-
// vertical 模式 trigger 高度是 8px,horizontal 模式宽度是 4px
|
|
77
|
-
const triggerSize = props.direction === "horizontal" ? 4 : 8;
|
|
78
|
-
const triggerTotalSize = (children.length - 1) * triggerSize;
|
|
79
|
-
|
|
80
|
-
let remainingSize = totalAvailable - triggerTotalSize;
|
|
81
|
-
let autoCount = 0;
|
|
82
|
-
|
|
83
|
-
// 1. 第一次遍历:解析 initialSize (支持 200 或 "30%")
|
|
84
|
-
const tempSizes = children.map((vnode) => {
|
|
85
|
-
const initSize = vnode.props?.initialSize;
|
|
86
|
-
if (initSize === undefined || initSize === null) {
|
|
87
|
-
autoCount++;
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
const sizePx =
|
|
91
|
-
typeof initSize === "string" && initSize.endsWith("%")
|
|
92
|
-
? (parseFloat(initSize) / 100) * (totalAvailable - triggerTotalSize)
|
|
93
|
-
: parseFloat(initSize);
|
|
94
|
-
remainingSize -= sizePx;
|
|
95
|
-
return sizePx;
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
// 2. 第二次遍历:填充 sizes 和 paneConfigs
|
|
99
|
-
tempSizes.forEach((size, idx) => {
|
|
100
|
-
sizes.push(size === null ? remainingSize / autoCount : size);
|
|
101
|
-
paneConfigs.value.push({
|
|
102
|
-
minSize: children[idx].props?.minSize || props.minSize
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
const getItemStyle = (index) => {
|
|
108
|
-
const prop = props.direction === "horizontal" ? "width" : "height";
|
|
109
|
-
return { [prop]: `${sizes[index]}px` };
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
// 拖拽逻辑
|
|
113
|
-
const onMouseDown = (e, index) => {
|
|
114
|
-
isDragging.value = true;
|
|
115
|
-
currentTriggerIndex = index;
|
|
116
|
-
document.body.style.userSelect = "none";
|
|
117
|
-
document.body.style.cursor =
|
|
118
|
-
props.direction === "horizontal" ? "col-resize" : "row-resize";
|
|
119
|
-
|
|
120
|
-
window.addEventListener("mousemove", onMouseMove);
|
|
121
|
-
window.addEventListener("mouseup", onMouseUp);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const onMouseMove = (e) => {
|
|
125
|
-
if (!isDragging.value) return;
|
|
126
|
-
const i = currentTriggerIndex;
|
|
127
|
-
const movement = props.direction === "horizontal" ? e.movementX : e.movementY;
|
|
128
|
-
|
|
129
|
-
const minCurr = paneConfigs.value[i].minSize;
|
|
130
|
-
const minNext = paneConfigs.value[i + 1].minSize;
|
|
131
|
-
|
|
132
|
-
if (sizes[i] + movement >= minCurr && sizes[i + 1] - movement >= minNext) {
|
|
133
|
-
sizes[i] += movement;
|
|
134
|
-
sizes[i + 1] -= movement;
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
const onMouseUp = () => {
|
|
139
|
-
isDragging.value = false;
|
|
140
|
-
document.body.style.userSelect = "";
|
|
141
|
-
document.body.style.cursor = "";
|
|
142
|
-
window.removeEventListener("mousemove", onMouseMove);
|
|
143
|
-
window.removeEventListener("mouseup", onMouseUp);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
onUnmounted(() => onMouseUp())
|
|
147
|
-
</script>
|
|
148
|
-
|
|
149
|
-
<style scoped src="./index.scss"></style>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/domains/_CONTRIBUTING.md
RENAMED
|
File without changes
|
|
File without changes
|
/package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/domains/sale/README.md
RENAMED
|
File without changes
|
|
File without changes
|
/package/files/{.github → .wl-skills}/skills/core/page-codegen/templates/universal/TPL-LIST.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-add/index.scss
RENAMED
|
File without changes
|
/package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-add/index.vue
RENAMED
|
File without changes
|
/package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-add-form/data.ts
RENAMED
|
File without changes
|
/package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-add-form/index.scss
RENAMED
|
File without changes
|
/package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-add-form/index.vue
RENAMED
|
File without changes
|
/package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-change/data.ts
RENAMED
|
File without changes
|
/package/files/{demo → .wl-skills/templates}/produce/aiflow/mmwr-customer-apply-change/index.scss
RENAMED
|
File without changes
|