@qilitt-mickey/vue3-temp-skill 1.1.75 → 1.2.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/README.md +85 -84
- package/SKILL.md +55 -27
- package/bin/cli.js +5 -6
- package/mapping/admin.json +60 -0
- package/package.json +4 -13
- package/references/adapters/_new-adapter.md +88 -0
- package/references/adapters/vue-antdv.md +70 -0
- package/references/adapters/vue-element-plus.md +90 -0
- package/references/design-apply.md +238 -122
- package/scripts/modules.json +2 -2
- package/dist/mapping-type.d.ts +0 -33
- package/dist/theme-vars.js +0 -62
- package/dist/theme-vars.ts +0 -113
- package/dist/theme.css +0 -73
- package/mapping/basic/color.json +0 -35
- package/mapping/basic/radius.json +0 -17
- package/mapping/basic/semantic-values.json +0 -72
- package/mapping/basic/spacing.json +0 -21
- package/mapping/basic/typography.json +0 -21
- package/mapping/component/button.json +0 -90
- package/mapping/component/card.json +0 -31
- package/mapping/component/input.json +0 -42
- package/mapping/component/overlay.json +0 -79
- package/mapping/component/pagination.json +0 -34
- package/mapping/component/table.json +0 -42
- package/mapping/component/tag.json +0 -48
- package/mapping/layout/breakpoint.json +0 -20
- package/mapping/layout/shell-geometry.json +0 -26
- package/mapping/scenes/admin/content.json +0 -497
- package/mapping/scenes/admin/layout.json +0 -577
- package/parser/fixtures/changeset-fullpage-restore.json +0 -259
- package/parser/fixtures/changeset-gap-block.json +0 -24
- package/parser/fixtures/changeset-legacy.json +0 -11
- package/parser/fixtures/changeset-neg1.json +0 -8
- package/parser/fixtures/changeset-neg2.json +0 -10
- package/parser/fixtures/changeset-neg3.json +0 -22
- package/parser/fixtures/changeset-neg4-g8.json +0 -15
- package/parser/fixtures/changeset-neg5-g8-stub.json +0 -26
- package/parser/fixtures/changeset-neg6-g9-identity.json +0 -39
- package/parser/fixtures/changeset-neg7-g10-dims.json +0 -57
- package/parser/fixtures/changeset-neg8-g11-oracle.json +0 -57
- package/parser/fixtures/changeset-neg9-g6-token-chain.json +0 -34
- package/parser/fixtures/changeset-pos-g6-token-chain.json +0 -35
- package/parser/fixtures/changeset-pos-theme-neutral.json +0 -264
- package/parser/fixtures/changeset-pos-theme-nometa.json +0 -260
- package/parser/fixtures/changeset-pos.json +0 -50
- package/parser/fixtures/changeset-registry-gap.json +0 -29
- package/parser/fixtures/changeset-v32-fields.json +0 -71
- package/parser/fixtures/fake-project/src/styles/app.scss +0 -5
- package/parser/fixtures/fake-project/src/views/list.vue +0 -13
- package/parser/fixtures/registry-bad.json +0 -11
- package/parser/fixtures/registry-g6-token-chain.json +0 -10
- package/parser/fixtures/registry-sample.json +0 -15
- package/parser/fixtures/verify/actual-clean.json +0 -35
- package/parser/fixtures/verify/actual.json +0 -33
- package/parser/fixtures/verify/mockup-baseline-admin-list.html +0 -27
- package/parser/fixtures/verify/mockup-g6-content.html +0 -12
- package/parser/fixtures/verify/mockup-neutral.html +0 -26
- package/parser/fixtures/verify/mockup-nometa.html +0 -26
- package/parser/fixtures/verify/oracle.json +0 -37
- package/parser/fixtures/verify/snapshot-latest.json +0 -103
- package/parser/generator.js +0 -178
- package/parser/index.js +0 -2706
- package/parser/loader.js +0 -66
- package/parser/override.js +0 -119
- package/parser/regression.js +0 -301
- package/parser/validator.js +0 -206
- package/parser/watch.js +0 -103
- package/references/steps/maintenance.md +0 -31
- package/references/steps/regression.md +0 -49
- package/references/steps/step0-preflight.md +0 -58
- package/references/steps/step1-match.md +0 -65
- package/references/steps/step1b-audit.md +0 -23
- package/references/steps/step1c-registry.md +0 -29
- package/references/steps/step2-structure.md +0 -73
- package/references/steps/step3-style.md +0 -38
- package/references/steps/step3b-shell.md +0 -63
- package/references/steps/step3c-priority.md +0 -26
- package/references/steps/step4-l3.md +0 -14
- package/references/steps/step5-gates.md +0 -64
- package/references/steps/step6-verify.md +0 -77
- package/scripts/apply-final-gate.mjs +0 -170
- package/scripts/check.mjs +0 -207
- package/scripts/design-audit.mjs +0 -1575
- package/scripts/validate.mjs +0 -106
package/scripts/validate.mjs
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 技能包最小结构校验。
|
|
5
|
-
* 只验证:manifest、reference 文件、frontmatter、能力组引用和脚本依赖。
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import fs from "fs";
|
|
9
|
-
import path from "path";
|
|
10
|
-
import { fileURLToPath } from "url";
|
|
11
|
-
|
|
12
|
-
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
13
|
-
const REFS_DIR = path.join(ROOT, "references");
|
|
14
|
-
const MANIFEST_PATH = path.join(ROOT, "scripts", "modules.json");
|
|
15
|
-
const SKILL_PATH = path.join(ROOT, "SKILL.md");
|
|
16
|
-
const errors = [];
|
|
17
|
-
const warnings = [];
|
|
18
|
-
|
|
19
|
-
function parseFrontmatter(content) {
|
|
20
|
-
const match = content.replace(/^\uFEFF/, "").match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
21
|
-
if (!match) return null;
|
|
22
|
-
const result = {};
|
|
23
|
-
for (const line of match[1].split(/\r?\n/)) {
|
|
24
|
-
const item = line.match(/^([\w-]+):\s*(.*)$/);
|
|
25
|
-
if (!item) continue;
|
|
26
|
-
const value = item[2].trim();
|
|
27
|
-
result[item[1]] = value.startsWith("[")
|
|
28
|
-
? value.slice(1, -1).split(",").map(value => value.trim()).filter(Boolean)
|
|
29
|
-
: value.replace(/^['"]|['"]$/g, "");
|
|
30
|
-
}
|
|
31
|
-
return result;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function referenceFiles() {
|
|
35
|
-
return fs.readdirSync(REFS_DIR).filter(file => file.endsWith(".md")).sort();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function check() {
|
|
39
|
-
const manifest = JSON.parse(fs.readFileSync(MANIFEST_PATH, "utf8"));
|
|
40
|
-
const skill = fs.readFileSync(SKILL_PATH, "utf8");
|
|
41
|
-
const files = new Set(referenceFiles());
|
|
42
|
-
const groups = manifest.modules || {};
|
|
43
|
-
|
|
44
|
-
if (!skill.includes("agent_created: true")) {
|
|
45
|
-
errors.push("SKILL.md 缺少 agent_created: true");
|
|
46
|
-
}
|
|
47
|
-
if (!Array.isArray(manifest.always_load) || !manifest.always_load.includes("core-kernel")) {
|
|
48
|
-
errors.push("modules.json 必须始终加载 core-kernel");
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
for (const [groupId, group] of Object.entries(groups)) {
|
|
52
|
-
if (!group.description || !Array.isArray(group.load) || !Array.isArray(group.keywords)) {
|
|
53
|
-
errors.push(`能力组 ${groupId} 缺少 description/load/keywords`);
|
|
54
|
-
}
|
|
55
|
-
for (const ref of group.load || []) {
|
|
56
|
-
if (!files.has(`${ref}.md`)) errors.push(`${groupId} 引用了不存在的 reference: ${ref}.md`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
for (const file of files) {
|
|
61
|
-
const content = fs.readFileSync(path.join(REFS_DIR, file), "utf8");
|
|
62
|
-
const frontmatter = parseFrontmatter(content);
|
|
63
|
-
if (!frontmatter) {
|
|
64
|
-
errors.push(`${file} 缺少 frontmatter`);
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
const id = file.slice(0, -3);
|
|
68
|
-
if (!frontmatter.skill) warnings.push(`${file} 缺少 skill 字段`);
|
|
69
|
-
if (!frontmatter.description) warnings.push(`${file} 缺少 description 字段`);
|
|
70
|
-
if (!frontmatter.scope) warnings.push(`${file} 缺少 scope 字段`);
|
|
71
|
-
if (frontmatter.skill && frontmatter.skill !== id) warnings.push(`${file} 的 skill=${frontmatter.skill} 与文件名不一致`);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const referenced = new Set(["core-kernel", "code-quality"]);
|
|
75
|
-
for (const group of Object.values(groups)) {
|
|
76
|
-
for (const ref of group.load || []) referenced.add(ref);
|
|
77
|
-
}
|
|
78
|
-
for (const file of files) {
|
|
79
|
-
if (!referenced.has(file.slice(0, -3))) warnings.push(`${file} 未被能力组引用,确认是否保留`);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return {
|
|
83
|
-
errors,
|
|
84
|
-
warnings,
|
|
85
|
-
stats: {
|
|
86
|
-
groupCount: Object.keys(groups).length,
|
|
87
|
-
referenceCount: files.size,
|
|
88
|
-
referencedReferenceCount: referenced.size,
|
|
89
|
-
},
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const result = check();
|
|
94
|
-
if (process.argv.includes("--json")) {
|
|
95
|
-
console.log(JSON.stringify(result, null, 2));
|
|
96
|
-
} else {
|
|
97
|
-
console.log("\nvue3-temp-skill 结构校验\n");
|
|
98
|
-
console.log(`能力组: ${result.stats.groupCount} | reference: ${result.stats.referenceCount}`);
|
|
99
|
-
for (const warning of result.warnings) console.log(`! ${warning}`);
|
|
100
|
-
for (const error of result.errors) console.log(`✗ ${error}`);
|
|
101
|
-
if (result.errors.length) {
|
|
102
|
-
console.error(`\n校验失败:${result.errors.length} 个错误`);
|
|
103
|
-
process.exit(1);
|
|
104
|
-
}
|
|
105
|
-
console.log("\n✓ 校验通过\n");
|
|
106
|
-
}
|