@topmindspace/tms-skills 0.1.0 → 0.1.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.
Files changed (93) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +9 -3
  3. package/bin/tms-skills.js +200 -160
  4. package/package.json +12 -9
  5. package/top-ppt-html/README.md +254 -254
  6. package/top-ppt-html/SKILL.md +111 -111
  7. package/top-ppt-html/assets/examples/2026-09-09-architecture-graphite-dark.html +3926 -3926
  8. package/top-ppt-html/assets/examples/2026-09-09-architecture-graphite-dark.model.json +167 -167
  9. package/top-ppt-html/assets/examples/2026-09-09-architecture-spectrum.html +3926 -3926
  10. package/top-ppt-html/assets/examples/2026-09-09-architecture-spectrum.model.json +167 -167
  11. package/top-ppt-html/assets/examples/2026-09-09-presentation-apple-mono.html +4325 -4325
  12. package/top-ppt-html/assets/examples/2026-09-09-presentation-apple-mono.model.json +320 -320
  13. package/top-ppt-html/assets/examples/2026-09-09-presentation-brand-red.html +4325 -4325
  14. package/top-ppt-html/assets/examples/2026-09-09-presentation-brand-red.model.json +320 -320
  15. package/top-ppt-html/assets/examples/2026-09-09-presentation-business-blue.html +4325 -4325
  16. package/top-ppt-html/assets/examples/2026-09-09-presentation-business-blue.model.json +320 -320
  17. package/top-ppt-html/assets/examples/2026-09-09-research-deep-teal.html +5527 -5527
  18. package/top-ppt-html/assets/examples/2026-09-09-research-deep-teal.model.json +913 -913
  19. package/top-ppt-html/assets/examples/2026-09-09-research-indigo-violet.html +5527 -5527
  20. package/top-ppt-html/assets/examples/2026-09-09-research-indigo-violet.model.json +913 -913
  21. package/top-ppt-html/assets/examples/2026-09-09-research-mckinsey.html +5527 -5527
  22. package/top-ppt-html/assets/examples/2026-09-09-research-mckinsey.model.json +913 -913
  23. package/top-ppt-html/assets/examples/2026-09-09-research-warm-sand.html +5527 -5527
  24. package/top-ppt-html/assets/examples/2026-09-09-research-warm-sand.model.json +913 -913
  25. package/top-ppt-html/assets/pptx-export.js +1944 -1944
  26. package/top-ppt-html/assets/style-gallery.html +589 -589
  27. package/top-ppt-html/assets/templates/architecture.html +3728 -3728
  28. package/top-ppt-html/assets/templates/engine.css +840 -840
  29. package/top-ppt-html/assets/templates/presentation.html +3738 -3738
  30. package/top-ppt-html/assets/templates/research.html +4017 -4017
  31. package/top-ppt-html/assets/templates/ui.js +520 -520
  32. package/top-ppt-html/evals/prompts.csv +15 -15
  33. package/top-ppt-html/evals/rubric.schema.json +25 -25
  34. package/top-ppt-html/evals/run_evals.py +220 -220
  35. package/top-ppt-html/evals/trace.example.json +16 -16
  36. package/top-ppt-html/package-lock.json +186 -0
  37. package/top-ppt-html/package.json +10 -10
  38. package/top-ppt-html/references/charts-basic.md +624 -624
  39. package/top-ppt-html/references/charts-discipline.md +108 -108
  40. package/top-ppt-html/references/charts-extended.md +482 -482
  41. package/top-ppt-html/references/charts.md +28 -28
  42. package/top-ppt-html/references/components-atoms.md +624 -624
  43. package/top-ppt-html/references/components.md +30 -30
  44. package/top-ppt-html/references/content-rules.md +490 -490
  45. package/top-ppt-html/references/design-system-engine.md +235 -235
  46. package/top-ppt-html/references/design-system.md +478 -478
  47. package/top-ppt-html/references/failure-modes.md +214 -214
  48. package/top-ppt-html/references/high-fidelity.md +127 -127
  49. package/top-ppt-html/references/icons.md +397 -397
  50. package/top-ppt-html/references/industry-benchmark.md +105 -105
  51. package/top-ppt-html/references/infographics-stats.md +308 -308
  52. package/top-ppt-html/references/infographics-structure.md +226 -226
  53. package/top-ppt-html/references/infographics.md +43 -43
  54. package/top-ppt-html/references/layout-grammar.md +315 -315
  55. package/top-ppt-html/references/layouts-architecture.md +108 -108
  56. package/top-ppt-html/references/layouts-combo.md +600 -600
  57. package/top-ppt-html/references/layouts-research.md +160 -160
  58. package/top-ppt-html/references/modes.md +254 -254
  59. package/top-ppt-html/references/outline-design.md +275 -275
  60. package/top-ppt-html/references/playbook.md +266 -266
  61. package/top-ppt-html/references/pptx-export.md +209 -209
  62. package/top-ppt-html/references/reform-plan.md +252 -252
  63. package/top-ppt-html/references/styles.md +370 -370
  64. package/top-ppt-html/references/tech-design.md +138 -138
  65. package/top-ppt-html/scripts/audit_css.py +109 -109
  66. package/top-ppt-html/scripts/audit_docs.py +176 -176
  67. package/top-ppt-html/scripts/audit_skill.py +220 -220
  68. package/top-ppt-html/scripts/audit_styles.py +351 -351
  69. package/top-ppt-html/scripts/build_examples.py +2276 -2276
  70. package/top-ppt-html/scripts/build_pptx.js +2380 -2380
  71. package/top-ppt-html/scripts/capture_theme_overview.js +79 -78
  72. package/top-ppt-html/scripts/checks_html.py +127 -127
  73. package/top-ppt-html/scripts/cross_verify.py +294 -294
  74. package/top-ppt-html/scripts/env_probe.py +158 -158
  75. package/top-ppt-html/scripts/extract_model.py +210 -210
  76. package/top-ppt-html/scripts/extract_snippet.py +374 -374
  77. package/top-ppt-html/scripts/gen_channel_a.js +214 -214
  78. package/top-ppt-html/scripts/lib_layout_regions.js +412 -412
  79. package/top-ppt-html/scripts/measure_height.py +178 -178
  80. package/top-ppt-html/scripts/negative_tests.py +307 -307
  81. package/top-ppt-html/scripts/package_skill.py +291 -291
  82. package/top-ppt-html/scripts/prepare_images.py +341 -341
  83. package/top-ppt-html/scripts/probe_image_export.py +187 -188
  84. package/top-ppt-html/scripts/quality_gate.py +301 -301
  85. package/top-ppt-html/scripts/regression.py +308 -308
  86. package/top-ppt-html/scripts/render_compare.py +275 -275
  87. package/top-ppt-html/scripts/render_from_model.py +698 -698
  88. package/top-ppt-html/scripts/scaffold_report.py +1054 -1054
  89. package/top-ppt-html/scripts/section-file-map.json +104 -104
  90. package/top-ppt-html/scripts/sync_runtime.py +662 -662
  91. package/top-ppt-html/scripts/validate_pptx.py +1510 -1510
  92. package/top-ppt-html/scripts/validate_report.py +1456 -1456
  93. package/top-ppt-html/assets/theme-overview-presentation.png +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 0.1.1 — 2026-09-24
6
+
7
+ ### Fixes (P0 / P1)
8
+
9
+ - **Release 顺序与稳健性**:Privacy → 技能门禁 → Package → Collect → GitHub Release → **npm publish(已发布则跳过,避免 E409)** → 再 Prune。
10
+ - **Prune 策略**:只删旧 GitHub Release(保留 2 个);**不再删除 git tags**。
11
+ - **多技能发现**:`scripts/discover_skills.js` + CI/Release 动态打包/门禁;`npm run sync:files` 同步 `package.json` `files`。
12
+ - **CLI**:校验 skill id;目标目录已存在时须 `--force`;文档口径与 README 对齐(npm 推荐 / GitHub 跟 HEAD)。
13
+ - **python3**:根与技能 `package.json`、workflows 统一 `python3`。
14
+ - **打包门禁**:`references/layout-grammar.md` 纳入 REQUIRED;去掉与 `theme-overview.png` 完全重复的 `theme-overview-presentation.png`。
15
+ - **Lockfile**:提交 `top-ppt-html/package-lock.json`;CI 优先 `npm ci --omit=dev`。
16
+ - **npm 2.x**:文档警告勿装 `^2`;提供 `scripts/deprecate-npm-2x.sh`(须维护者本地 npm 登录后执行)。
17
+
3
18
  ## 0.1.0 — 2026-09-24
4
19
 
5
20
  首个公开版本。
package/README.md CHANGED
@@ -18,6 +18,12 @@
18
18
 
19
19
  两条通道,装出来同一套技能。**npm = 钉版本快照**;**GitHub = 跟仓库 HEAD**。
20
20
 
21
+
22
+ > **警告 / Warning**:不要安装 `@topmindspace/tms-skills@^2`。npm 上残留的 **2.0.0–2.1.1** 是仓库重置前的过时线;当前线是 **0.1.x**(`latest` 亦指向 0.1.x)。维护者登录 npm 后可运行 `scripts/deprecate-npm-2x.sh` 标记弃用。
23
+ >
24
+ > Do **not** install `^2`. Versions 2.0.0–2.1.1 are obsolete after the repo reset; use **0.1.x**. Maintainers with npm auth should run `scripts/deprecate-npm-2x.sh`.
25
+
26
+
21
27
  ### npm(推荐)
22
28
 
23
29
  ```bash
@@ -74,7 +80,7 @@ tms-skills/
74
80
  | tag `vX.Y.Z` | Release + zip | **自动 publish** |
75
81
 
76
82
  - **push 不会更新 npm**;必须 bump 版本并打 tag。
77
- - **Release 只保留最近 2 个**(CI 自动清理);npm 可钉任意历史版本。
83
+ - **Release 只保留最近 2 个**(CI 只删旧 Release,**git tags 保留**);npm 可钉任意历史版本。
78
84
  - 安装器与技能 **版本各自独立**;默认 patch/minor,major 仅破坏性变更。
79
85
 
80
86
  详见 [docs/PUBLISHING.md](./docs/PUBLISHING.md)。
@@ -84,7 +90,7 @@ tms-skills/
84
90
  | 工作流 | 触发 | 做什么 |
85
91
  |--------|------|--------|
86
92
  | `ci.yml` | push / PR | 打包门禁、审计、隐私扫描、CLI 冒烟 |
87
- | `release.yml` | tag `v*` | 技能 zip → Release;npm publish;Release 保留 2 个 |
93
+ | `release.yml` | tag `v*` | 门禁 → zip → Release → npm publish(已存在则跳过)→ prune Release 留 2(tags 保留) |
88
94
 
89
95
  ```bash
90
96
  npm run check && npm run audit && npm run privacy
@@ -95,7 +101,7 @@ npm run check && npm run audit && npm run privacy
95
101
  1. 根目录建 `<skill-id>/`,`SKILL.md` 的 `name` 与目录一致。
96
102
  2. 人类说明写 `README.md`;智能体入口保持 `SKILL.md`。
97
103
  3. 发布前 `scripts/package_skill.py --check`。
98
- 4. 登记:根 README、`package.json` 的 `files`、`ci.yml`、`CHANGELOG.md`。
104
+ 4. 登记:根 README、`npm run sync:files`、`CHANGELOG.md`(CI 按发现的技能跑门禁,无需再硬编码)。
99
105
 
100
106
  ## 许可证
101
107
 
package/bin/tms-skills.js CHANGED
@@ -1,160 +1,200 @@
1
- #!/usr/bin/env node
2
- /**
3
- * tms-skills — TopMindspace agent skills installer
4
- *
5
- * Usage (GitHub is the primary install source — npm publish is optional):
6
- * npx github:topmindspace/tms-skills list
7
- * npx github:topmindspace/tms-skills install top-ppt-html
8
- * npx github:topmindspace/tms-skills install top-ppt-html --to ./skills-out
9
- * npx @topmindspace/tms-skills install top-ppt-html # only after npm publish
10
- */
11
- 'use strict';
12
-
13
- const fs = require('fs');
14
- const path = require('path');
15
-
16
- const ROOT = path.resolve(__dirname, '..');
17
- // Skills live at repo root (one directory per skill with SKILL.md).
18
- const INFRA_DIRS = new Set(['bin', 'docs', 'scripts', 'node_modules', 'dist', 'release-assets']);
19
-
20
- function die(msg, code = 1) {
21
- console.error(msg);
22
- process.exit(code);
23
- }
24
-
25
- function skillDir(skillId) {
26
- return path.join(ROOT, skillId);
27
- }
28
-
29
- function listSkillIds() {
30
- return fs
31
- .readdirSync(ROOT, { withFileTypes: true })
32
- .filter((d) => d.isDirectory() && !INFRA_DIRS.has(d.name) && !d.name.startsWith('.'))
33
- .filter((d) => fs.existsSync(path.join(ROOT, d.name, 'SKILL.md')))
34
- .map((d) => d.name)
35
- .sort();
36
- }
37
-
38
- function readSkillMeta(skillId) {
39
- const skillPath = skillDir(skillId);
40
- const skillMd = path.join(skillPath, 'SKILL.md');
41
- if (!fs.existsSync(skillMd)) return { id: skillId, description: '' };
42
- const text = fs.readFileSync(skillMd, 'utf8');
43
- const m = text.match(/^---\r?\n([\s\S]*?)\r?\n---/);
44
- if (!m) return { id: skillId, description: '' };
45
- const desc = (m[1].match(/^description:\s*"(.*)"\s*$/m) || m[1].match(/^description:\s*(.+)\s*$/m) || [])[1] || '';
46
- return { id: skillId, description: String(desc).slice(0, 120) };
47
- }
48
-
49
- function resolveDefaultTarget() {
50
- const candidates = [
51
- path.join(process.cwd(), '.agents', 'skills'),
52
- path.join(process.cwd(), '.claude', 'skills'),
53
- path.join(process.cwd(), '.mimocode', 'skills'),
54
- path.join(process.env.HOME || process.env.USERPROFILE || '', '.claude', 'skills'),
55
- path.join(process.env.HOME || process.env.USERPROFILE || '', '.agents', 'skills'),
56
- ];
57
- for (const dir of candidates) {
58
- if (dir && fs.existsSync(path.dirname(dir))) {
59
- return dir;
60
- }
61
- }
62
- return path.join(process.cwd(), '.agents', 'skills');
63
- }
64
-
65
- function copyDir(src, dest) {
66
- fs.mkdirSync(dest, { recursive: true });
67
- for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
68
- const s = path.join(src, entry.name);
69
- const d = path.join(dest, entry.name);
70
- if (entry.isDirectory()) {
71
- if (entry.name === 'node_modules' || entry.name === 'dist' || entry.name === '__pycache__') continue;
72
- copyDir(s, d);
73
- } else if (entry.isFile()) {
74
- if (entry.name.endsWith('.pyc')) continue;
75
- fs.copyFileSync(s, d);
76
- }
77
- }
78
- }
79
-
80
- function install(skillId, targetRoot) {
81
- const src = skillDir(skillId);
82
- if (!fs.existsSync(path.join(src, 'SKILL.md'))) {
83
- die(`Skill not found: ${skillId}\nAvailable: ${listSkillIds().join(', ') || '(none)'}`);
84
- }
85
- const dest = path.join(targetRoot, skillId);
86
- fs.mkdirSync(targetRoot, { recursive: true });
87
- if (fs.existsSync(dest)) {
88
- fs.rmSync(dest, { recursive: true, force: true });
89
- }
90
- copyDir(src, dest);
91
- console.log(`Installed ${skillId}`);
92
- console.log(` from ${src}`);
93
- console.log(` to ${dest}`);
94
- console.log('');
95
- console.log('Optional (PPTX export only):');
96
- console.log(` cd "${dest}" && npm install`);
97
- }
98
-
99
- function usage() {
100
- console.log(`tms-skills — install TopMindspace agent skills
101
-
102
- Usage:
103
- tms-skills list
104
- tms-skills install <skill-id> [--to <dir>]
105
- tms-skills help
106
-
107
- Examples:
108
- npx github:topmindspace/tms-skills list
109
- npx github:topmindspace/tms-skills install top-ppt-html
110
- npx github:topmindspace/tms-skills install top-ppt-html --to ./.agents/skills
111
-
112
- # Optional npm package (only after @topmindspace/tms-skills is published):
113
- npx @topmindspace/tms-skills install top-ppt-html
114
- `);
115
- }
116
-
117
- function main(argv) {
118
- const args = argv.slice(2);
119
- const cmd = args[0];
120
-
121
- if (!cmd || cmd === 'help' || cmd === '--help' || cmd === '-h') {
122
- usage();
123
- return;
124
- }
125
-
126
- if (cmd === 'list' || cmd === 'ls') {
127
- const ids = listSkillIds();
128
- if (!ids.length) {
129
- console.log('No skills found in package.');
130
- return;
131
- }
132
- for (const id of ids) {
133
- const meta = readSkillMeta(id);
134
- console.log(`${id}`);
135
- if (meta.description) console.log(` ${meta.description}…`);
136
- }
137
- return;
138
- }
139
-
140
- if (cmd === 'install') {
141
- const skillId = args[1];
142
- if (!skillId || skillId.startsWith('-')) {
143
- die('Missing skill id.\n\n' + usage());
144
- }
145
- let to = null;
146
- for (let i = 2; i < args.length; i++) {
147
- if (args[i] === '--to' || args[i] === '-t') {
148
- to = args[++i];
149
- if (!to) die('Option --to requires a directory path.');
150
- }
151
- }
152
- const targetRoot = to ? path.resolve(to) : resolveDefaultTarget();
153
- install(skillId, targetRoot);
154
- return;
155
- }
156
-
157
- die(`Unknown command: ${cmd}\n\n` + usage());
158
- }
159
-
160
- main(process.argv);
1
+ #!/usr/bin/env node
2
+ /**
3
+ * tms-skills — TopMindspace agent skills installer
4
+ *
5
+ * Recommended channel (when published): npm @topmindspace/tms-skills
6
+ * GitHub npx remains available for HEAD / offline clone.
7
+ *
8
+ * Usage:
9
+ * npx @topmindspace/tms-skills list
10
+ * npx @topmindspace/tms-skills install top-ppt-html
11
+ * npx @topmindspace/tms-skills install top-ppt-html --to ./skills-out
12
+ * npx @topmindspace/tms-skills install top-ppt-html --force
13
+ * npx github:topmindspace/tms-skills install top-ppt-html # follow repo HEAD
14
+ */
15
+ 'use strict';
16
+
17
+ const fs = require('fs');
18
+ const path = require('path');
19
+
20
+ const ROOT = path.resolve(__dirname, '..');
21
+ // Skills live at repo root (one directory per skill with SKILL.md).
22
+ const INFRA_DIRS = new Set(['bin', 'docs', 'scripts', 'node_modules', 'dist', 'release-assets']);
23
+ const SKILL_ID_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
24
+
25
+ function die(msg, code = 1) {
26
+ console.error(msg);
27
+ process.exit(code);
28
+ }
29
+
30
+ function skillDir(skillId) {
31
+ return path.join(ROOT, skillId);
32
+ }
33
+
34
+ function assertSkillId(skillId) {
35
+ if (!skillId || typeof skillId !== 'string') {
36
+ die('Missing skill id.\n\n' + usageText());
37
+ }
38
+ if (
39
+ skillId.includes('..') ||
40
+ skillId.includes('/') ||
41
+ skillId.includes('\\') ||
42
+ path.isAbsolute(skillId) ||
43
+ !SKILL_ID_RE.test(skillId)
44
+ ) {
45
+ die(
46
+ `Invalid skill id: ${JSON.stringify(skillId)}\n` +
47
+ 'Skill ids must match ^[a-z0-9]+(?:-[a-z0-9]+)*$ (no paths, dots, or slashes).'
48
+ );
49
+ }
50
+ }
51
+
52
+ function listSkillIds() {
53
+ return fs
54
+ .readdirSync(ROOT, { withFileTypes: true })
55
+ .filter((d) => d.isDirectory() && !INFRA_DIRS.has(d.name) && !d.name.startsWith('.'))
56
+ .filter((d) => fs.existsSync(path.join(ROOT, d.name, 'SKILL.md')))
57
+ .map((d) => d.name)
58
+ .sort();
59
+ }
60
+
61
+ function readSkillMeta(skillId) {
62
+ const skillPath = skillDir(skillId);
63
+ const skillMd = path.join(skillPath, 'SKILL.md');
64
+ if (!fs.existsSync(skillMd)) return { id: skillId, description: '' };
65
+ const text = fs.readFileSync(skillMd, 'utf8');
66
+ const m = text.match(/^---\r?\n([\s\S]*?)\r?\n---/);
67
+ if (!m) return { id: skillId, description: '' };
68
+ const desc = (m[1].match(/^description:\s*"(.*)"\s*$/m) || m[1].match(/^description:\s*(.+)\s*$/m) || [])[1] || '';
69
+ return { id: skillId, description: String(desc).slice(0, 120) };
70
+ }
71
+
72
+ function resolveDefaultTarget() {
73
+ const candidates = [
74
+ path.join(process.cwd(), '.agents', 'skills'),
75
+ path.join(process.cwd(), '.claude', 'skills'),
76
+ path.join(process.cwd(), '.mimocode', 'skills'),
77
+ path.join(process.env.HOME || process.env.USERPROFILE || '', '.claude', 'skills'),
78
+ path.join(process.env.HOME || process.env.USERPROFILE || '', '.agents', 'skills'),
79
+ ];
80
+ for (const dir of candidates) {
81
+ if (dir && fs.existsSync(path.dirname(dir))) {
82
+ return dir;
83
+ }
84
+ }
85
+ return path.join(process.cwd(), '.agents', 'skills');
86
+ }
87
+
88
+ function copyDir(src, dest) {
89
+ fs.mkdirSync(dest, { recursive: true });
90
+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
91
+ const s = path.join(src, entry.name);
92
+ const d = path.join(dest, entry.name);
93
+ if (entry.isDirectory()) {
94
+ if (entry.name === 'node_modules' || entry.name === 'dist' || entry.name === '__pycache__') continue;
95
+ copyDir(s, d);
96
+ } else if (entry.isFile()) {
97
+ if (entry.name.endsWith('.pyc')) continue;
98
+ fs.copyFileSync(s, d);
99
+ }
100
+ }
101
+ }
102
+
103
+ function install(skillId, targetRoot, { force = false } = {}) {
104
+ assertSkillId(skillId);
105
+ const src = skillDir(skillId);
106
+ if (!fs.existsSync(path.join(src, 'SKILL.md'))) {
107
+ die(`Skill not found: ${skillId}\nAvailable: ${listSkillIds().join(', ') || '(none)'}`);
108
+ }
109
+ const dest = path.join(targetRoot, skillId);
110
+ fs.mkdirSync(targetRoot, { recursive: true });
111
+ if (fs.existsSync(dest)) {
112
+ if (!force) {
113
+ die(
114
+ `Destination already exists: ${dest}\n` +
115
+ 'Refusing to overwrite. Pass --force (or -f) to replace.'
116
+ );
117
+ }
118
+ fs.rmSync(dest, { recursive: true, force: true });
119
+ }
120
+ copyDir(src, dest);
121
+ console.log(`Installed ${skillId}`);
122
+ console.log(` from ${src}`);
123
+ console.log(` to ${dest}`);
124
+ console.log('');
125
+ console.log('Optional (PPTX export only):');
126
+ console.log(` cd "${dest}" && npm install`);
127
+ }
128
+
129
+ function usageText() {
130
+ return `tms-skills — install TopMindspace agent skills
131
+
132
+ Usage:
133
+ tms-skills list
134
+ tms-skills install <skill-id> [--to <dir>] [--force|-f]
135
+ tms-skills help
136
+
137
+ Examples (npm recommended when published):
138
+ npx @topmindspace/tms-skills list
139
+ npx @topmindspace/tms-skills install top-ppt-html
140
+ npx @topmindspace/tms-skills install top-ppt-html --to ./.agents/skills
141
+ npx @topmindspace/tms-skills install top-ppt-html --force
142
+
143
+ # Follow repo HEAD:
144
+ npx github:topmindspace/tms-skills install top-ppt-html
145
+ `;
146
+ }
147
+
148
+ function usage() {
149
+ console.log(usageText());
150
+ }
151
+
152
+ function main(argv) {
153
+ const args = argv.slice(2);
154
+ const cmd = args[0];
155
+
156
+ if (!cmd || cmd === 'help' || cmd === '--help' || cmd === '-h') {
157
+ usage();
158
+ return;
159
+ }
160
+
161
+ if (cmd === 'list' || cmd === 'ls') {
162
+ const ids = listSkillIds();
163
+ if (!ids.length) {
164
+ console.log('No skills found in package.');
165
+ return;
166
+ }
167
+ for (const id of ids) {
168
+ const meta = readSkillMeta(id);
169
+ console.log(`${id}`);
170
+ if (meta.description) console.log(` ${meta.description}…`);
171
+ }
172
+ return;
173
+ }
174
+
175
+ if (cmd === 'install') {
176
+ const skillId = args[1];
177
+ if (!skillId || skillId.startsWith('-')) {
178
+ die('Missing skill id.\n\n' + usageText());
179
+ }
180
+ let to = null;
181
+ let force = false;
182
+ for (let i = 2; i < args.length; i++) {
183
+ if (args[i] === '--to' || args[i] === '-t') {
184
+ to = args[++i];
185
+ if (!to) die('Option --to requires a directory path.');
186
+ } else if (args[i] === '--force' || args[i] === '-f') {
187
+ force = true;
188
+ } else {
189
+ die(`Unknown option: ${args[i]}\n\n` + usageText());
190
+ }
191
+ }
192
+ const targetRoot = to ? path.resolve(to) : resolveDefaultTarget();
193
+ install(skillId, targetRoot, { force });
194
+ return;
195
+ }
196
+
197
+ die(`Unknown command: ${cmd}\n\n` + usageText());
198
+ }
199
+
200
+ main(process.argv);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@topmindspace/tms-skills",
3
- "version": "0.1.0",
4
- "description": "TopMindspace 智能体技能 monorepo — 通过 GitHub npx 安装技能(top-ppt-html 等)。",
3
+ "version": "0.1.1",
4
+ "description": "TopMindspace 智能体技能 monorepo — 通过 npm / GitHub npx 安装技能(top-ppt-html 等)。",
5
5
  "license": "MIT",
6
6
  "author": "TopMindspace",
7
7
  "repository": {
@@ -26,21 +26,24 @@
26
26
  },
27
27
  "files": [
28
28
  "bin",
29
- "top-ppt-html",
30
29
  "README.md",
31
30
  "LICENSE",
32
- "CHANGELOG.md"
31
+ "CHANGELOG.md",
32
+ "top-ppt-html"
33
33
  ],
34
34
  "engines": {
35
35
  "node": ">=18"
36
36
  },
37
37
  "scripts": {
38
38
  "list": "node bin/tms-skills.js list",
39
- "install:skills": "node bin/tms-skills.js install top-ppt-html",
40
- "check": "python top-ppt-html/scripts/package_skill.py --check",
41
- "privacy": "python scripts/ci_privacy_scan.py",
42
- "audit": "python top-ppt-html/scripts/audit_styles.py && python top-ppt-html/scripts/audit_docs.py && python top-ppt-html/scripts/audit_skill.py && python top-ppt-html/scripts/audit_css.py",
43
- "package:skill": "python top-ppt-html/scripts/package_skill.py"
39
+ "discover": "node scripts/discover_skills.js",
40
+ "sync:files": "node scripts/sync_npm_files.js",
41
+ "prepack": "node scripts/sync_npm_files.js",
42
+ "install:skills": "node -e \"const {discoverSkills}=require('./scripts/discover_skills'); const {spawnSync}=require('child_process'); for (const id of discoverSkills()) { const r=spawnSync(process.execPath,['bin/tms-skills.js','install',id],{stdio:'inherit'}); if(r.status) process.exit(r.status||1); }\"",
43
+ "check": "node scripts/run_skill_gates.js check",
44
+ "privacy": "python3 scripts/ci_privacy_scan.py",
45
+ "audit": "node scripts/run_skill_gates.js audit",
46
+ "package:skill": "node scripts/run_skill_gates.js package"
44
47
  },
45
48
  "publishConfig": {
46
49
  "access": "public"