@topmindspace/tms-skills 2.0.1 → 2.1.0
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 +145 -134
- package/README.md +1 -1
- package/bin/tms-skills.js +160 -160
- package/package.json +48 -48
- package/top-ppt-html/README.md +254 -254
- package/top-ppt-html/SKILL.md +111 -111
- package/top-ppt-html/assets/examples/2026-09-09-architecture-graphite-dark.html +3926 -3926
- package/top-ppt-html/assets/examples/2026-09-09-architecture-graphite-dark.model.json +167 -167
- package/top-ppt-html/assets/examples/2026-09-09-architecture-spectrum.html +3926 -3926
- package/top-ppt-html/assets/examples/2026-09-09-architecture-spectrum.model.json +167 -167
- package/top-ppt-html/assets/examples/2026-09-09-presentation-apple-mono.html +4325 -4325
- package/top-ppt-html/assets/examples/2026-09-09-presentation-apple-mono.model.json +320 -320
- package/top-ppt-html/assets/examples/2026-09-09-presentation-brand-red.html +4325 -4325
- package/top-ppt-html/assets/examples/2026-09-09-presentation-brand-red.model.json +320 -320
- package/top-ppt-html/assets/examples/2026-09-09-presentation-business-blue.html +4325 -4325
- package/top-ppt-html/assets/examples/2026-09-09-presentation-business-blue.model.json +320 -320
- package/top-ppt-html/assets/examples/2026-09-09-research-deep-teal.html +5527 -5527
- package/top-ppt-html/assets/examples/2026-09-09-research-deep-teal.model.json +913 -913
- package/top-ppt-html/assets/examples/2026-09-09-research-indigo-violet.html +5527 -5527
- package/top-ppt-html/assets/examples/2026-09-09-research-indigo-violet.model.json +913 -913
- package/top-ppt-html/assets/examples/2026-09-09-research-mckinsey.html +5527 -5527
- package/top-ppt-html/assets/examples/2026-09-09-research-mckinsey.model.json +913 -913
- package/top-ppt-html/assets/examples/2026-09-09-research-warm-sand.html +5527 -5527
- package/top-ppt-html/assets/examples/2026-09-09-research-warm-sand.model.json +913 -913
- package/top-ppt-html/assets/pptx-export.js +1944 -1944
- package/top-ppt-html/assets/style-gallery.html +589 -589
- package/top-ppt-html/assets/templates/architecture.html +3728 -3728
- package/top-ppt-html/assets/templates/engine.css +840 -840
- package/top-ppt-html/assets/templates/presentation.html +3738 -3738
- package/top-ppt-html/assets/templates/research.html +4017 -4017
- package/top-ppt-html/assets/templates/ui.js +520 -520
- package/top-ppt-html/evals/prompts.csv +15 -15
- package/top-ppt-html/evals/rubric.schema.json +25 -25
- package/top-ppt-html/evals/run_evals.py +220 -220
- package/top-ppt-html/evals/trace.example.json +16 -16
- package/top-ppt-html/package-lock.json +207 -0
- package/top-ppt-html/package.json +35 -35
- package/top-ppt-html/references/charts-basic.md +624 -624
- package/top-ppt-html/references/charts-discipline.md +108 -108
- package/top-ppt-html/references/charts-extended.md +482 -482
- package/top-ppt-html/references/charts.md +28 -28
- package/top-ppt-html/references/components-atoms.md +624 -624
- package/top-ppt-html/references/components.md +30 -30
- package/top-ppt-html/references/content-rules.md +490 -490
- package/top-ppt-html/references/design-system-engine.md +235 -235
- package/top-ppt-html/references/design-system.md +478 -478
- package/top-ppt-html/references/failure-modes.md +214 -214
- package/top-ppt-html/references/high-fidelity.md +127 -127
- package/top-ppt-html/references/icons.md +397 -397
- package/top-ppt-html/references/industry-benchmark.md +105 -105
- package/top-ppt-html/references/infographics-stats.md +308 -308
- package/top-ppt-html/references/infographics-structure.md +226 -226
- package/top-ppt-html/references/infographics.md +43 -43
- package/top-ppt-html/references/layout-grammar.md +315 -315
- package/top-ppt-html/references/layouts-architecture.md +108 -108
- package/top-ppt-html/references/layouts-combo.md +600 -600
- package/top-ppt-html/references/layouts-research.md +160 -160
- package/top-ppt-html/references/modes.md +254 -254
- package/top-ppt-html/references/outline-design.md +275 -275
- package/top-ppt-html/references/playbook.md +266 -266
- package/top-ppt-html/references/pptx-export.md +209 -209
- package/top-ppt-html/references/reform-plan.md +252 -252
- package/top-ppt-html/references/styles.md +370 -370
- package/top-ppt-html/references/tech-design.md +138 -138
- package/top-ppt-html/scripts/audit_css.py +109 -109
- package/top-ppt-html/scripts/audit_docs.py +176 -176
- package/top-ppt-html/scripts/audit_skill.py +220 -220
- package/top-ppt-html/scripts/audit_styles.py +351 -351
- package/top-ppt-html/scripts/build_examples.py +2276 -2276
- package/top-ppt-html/scripts/build_pptx.js +2380 -2380
- package/top-ppt-html/scripts/capture_theme_overview.js +78 -78
- package/top-ppt-html/scripts/checks_html.py +127 -127
- package/top-ppt-html/scripts/cross_verify.py +294 -294
- package/top-ppt-html/scripts/env_probe.py +158 -158
- package/top-ppt-html/scripts/extract_model.py +210 -210
- package/top-ppt-html/scripts/extract_snippet.py +374 -374
- package/top-ppt-html/scripts/gen_channel_a.js +214 -214
- package/top-ppt-html/scripts/layout-constants.json +3377 -3377
- package/top-ppt-html/scripts/layout_slots.json +830 -830
- package/top-ppt-html/scripts/lib_layout_regions.js +412 -412
- package/top-ppt-html/scripts/measure_height.py +178 -178
- package/top-ppt-html/scripts/model-schema.json +547 -547
- package/top-ppt-html/scripts/negative_tests.py +307 -307
- package/top-ppt-html/scripts/package_skill.py +291 -291
- package/top-ppt-html/scripts/prepare_images.py +341 -341
- package/top-ppt-html/scripts/probe_image_export.py +188 -188
- package/top-ppt-html/scripts/quality_gate.py +301 -301
- package/top-ppt-html/scripts/regression.py +308 -308
- package/top-ppt-html/scripts/render_compare.py +275 -275
- package/top-ppt-html/scripts/render_from_model.py +698 -698
- package/top-ppt-html/scripts/scaffold_report.py +1054 -1054
- package/top-ppt-html/scripts/section-file-map.json +104 -104
- package/top-ppt-html/scripts/sync_runtime.py +662 -662
- package/top-ppt-html/scripts/validate_pptx.py +1510 -1510
- package/top-ppt-html/scripts/validate_report.py +1456 -1456
package/CHANGELOG.md
CHANGED
|
@@ -1,134 +1,145 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
所有 monorepo 变更记录见本文件。
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
### Changed
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### Changed
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
###
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- `docs/PUBLISHING.md`
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
- `
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
所有 monorepo 变更记录见本文件。
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- **技能风格语汇层**:`styleIdentity` 单源 + `engine.css` 字体/圆角/字阶/链接色覆盖 + `audit_styles` 门禁;示例与主题参考图刷新。
|
|
9
|
+
- **Release 保留策略:最多 2 个最近版本**——`release.yml` 发布后自动删除更旧 Release 与 tag;npm 历史版本不受影响。
|
|
10
|
+
|
|
11
|
+
## 2.0.2 — 2026-09-24(发布流水线校验)
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- 校验 **tag `v*` → GitHub Release + 自动 npm publish**(Secret `NPM_TOKEN`)链路。
|
|
15
|
+
|
|
16
|
+
## 2.0.1 — 2026-09-24(文档 + 发布链路)
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- 文档全面对齐「双通道分发」:npm [`@topmindspace/tms-skills`](https://www.npmjs.com/package/@topmindspace/tms-skills) 已公开发布(`2.0.0` 起),GitHub 直装仍可用。
|
|
20
|
+
- 明确 **GitHub ≠ npm 自动同步**:push 不更新 npm;**tag `v*` → `release.yml` 自动 npm publish**。
|
|
21
|
+
- `release.yml` 启用 npm 发布步骤(Secret `NPM_TOKEN`);`docs/PUBLISHING.md` 补版本策略、打包矩阵 npm 列、排错表。
|
|
22
|
+
|
|
23
|
+
## 2.0.0 — 2026-09-24(技能 9.1.0 · 仓库/技能更名 + 层级扁平化)
|
|
24
|
+
|
|
25
|
+
### Published
|
|
26
|
+
- 首次发布公共 npm:[`@topmindspace/tms-skills@2.0.0`](https://www.npmjs.com/package/@topmindspace/tms-skills)
|
|
27
|
+
- 安装:`npx @topmindspace/tms-skills install top-ppt-html`
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- **仓库更名**:GitHub `topmindspace/topskills` → **`topmindspace/tms-skills`**(旧 URL 301);本地根目录、`git remote`、npm 包名 `@topmindspace/tms-skills`、CLI `tms-skills` / `bin/tms-skills.js` 全部对齐。
|
|
31
|
+
- **技能更名**:`top-slides-expert` / TopSlides Expert → **`top-ppt-html` / TopPPT HTML**(目录、frontmatter `name`、分发包、文档一致)。
|
|
32
|
+
- **注入标记**:`__TOPSLIDES_*__` → `__TOPPPT_*__`;**环境变量**:`TOP_SLIDES_*` → `TOP_PPT_*`;**JS API**:`TopSlidesPptx` → `TopPptHtml`。
|
|
33
|
+
- **层级扁平化**:移除冗余的 `skills/` 中间层,技能目录直接放在仓库根(`top-ppt-html/`);安装器改为扫描根目录下含 `SKILL.md` 的技能目录。
|
|
34
|
+
- 版本:技能 `9.0.1` → **`9.1.0`**(`layout-constants.json` `version: 9.1`);monorepo `1.1.1` → **`2.0.0`**(包名/CLI/结构破坏性变更)。
|
|
35
|
+
|
|
36
|
+
### Migration
|
|
37
|
+
| Old | New |
|
|
38
|
+
|-----|-----|
|
|
39
|
+
| repo `topmindspace/topskills` | `topmindspace/tms-skills` |
|
|
40
|
+
| npm `@topmindspace/topskills` | `@topmindspace/tms-skills` |
|
|
41
|
+
| CLI `topskills` / `bin/topskills.js` | `tms-skills` / `bin/tms-skills.js` |
|
|
42
|
+
| skill id / dir `top-slides-expert` | `top-ppt-html` |
|
|
43
|
+
| brand `TopSlides Expert` | `TopPPT HTML` |
|
|
44
|
+
| `skills/<id>/` | `<id>/`(仓库根) |
|
|
45
|
+
| `__TOPSLIDES_*__` markers | `__TOPPPT_*__` |
|
|
46
|
+
| `TOP_SLIDES_*` env | `TOP_PPT_*` |
|
|
47
|
+
| `TopSlidesPptx` | `TopPptHtml` |
|
|
48
|
+
|
|
49
|
+
无静默别名;旧标识见 `docs/PUBLISHING.md` 废弃清单,仅 CHANGELOG / 迁移说明可提及。
|
|
50
|
+
|
|
51
|
+
## 1.1.1 — 2026-09-23(技能 9.0.1 · PPTX 往返与双形态修复)
|
|
52
|
+
|
|
53
|
+
### Fixed
|
|
54
|
+
- **PPTX 双形态载荷静默丢字**:`build_pptx.js` / `pptx-export.js` 用 `typeof x === 'object'` 区分 `[[t,d]…]` 与 `[{t,d,accent}…]`,但 `typeof [] === 'object'`,数组形态 steps/levels/lane/nodes 的标题与描述被读成 `undefined` 后落空(第 8 章 steps 仅 4/7 关键串)。改为 `isRec()`(非数组对象)判定,双引擎同步。
|
|
55
|
+
- **PPTX 模型往返误报(挡交付)**:`validate_pptx.validate_model_roundtrip` 关键串比对语料原先只取幻灯片形状文本,把原生图表 `chart.labels`(落在 chart part)和 notes-only 字段(`lead` / `image.hint` 等)误判为 `MODEL_ROUNDTRIP_CONTENT_MISSING`;v9 将 `roundtripMin` 提到 0.80 后 9 个随包示例全部 FAIL。现语料改为 **形状文本 ∪ 演讲者备注 ∪ 关联 chart part 文本**(`_roundtrip_corpus` + `slide_chart_text`),`slide_notes` 真正参与内容比对;探针跳过 `hint`/`src`/`alt` 等元数据键。
|
|
56
|
+
- 示例矩阵顶层金字塔描述过长触发 `CONTAINER_OVERFLOW`:顶层槽位收窄后改为「自动执行」;9 示例 `validate_pptx --strict --model` 全 0/0。
|
|
57
|
+
|
|
58
|
+
### Changed
|
|
59
|
+
- 随包示例按 v9.0 模板重建(内嵌 MODEL_SCHEMA 8.3 → 9.0);4 张 `theme-overview*.png` 主题参考图刷新。
|
|
60
|
+
- 版本:技能 `9.0.0` → **`9.0.1`**(`package.json` npm 语义化);monorepo `1.1.0` → **`1.1.1`**。版本单源仍为 `layout-constants.json` `version: 9.0`。
|
|
61
|
+
|
|
62
|
+
### Verified
|
|
63
|
+
- 全链路回归通过:HTML strict + B 通道精导 strict 0/0 + A 通道 strict 0/0 + 双区组合页探针 + 深色主题探针 + `negative_tests` + 任务路由遍历 + python-pptx 双裁判。
|
|
64
|
+
- 审计全绿:`audit_styles` / `audit_docs` / `audit_skill` / `audit_css`;`package_skill.py --check` 通过。
|
|
65
|
+
|
|
66
|
+
## 1.1.0 — 2026-09-23(安装口径 + 隐私门禁)
|
|
67
|
+
|
|
68
|
+
### Changed
|
|
69
|
+
- **安装口径改为 GitHub 优先**:根 README / 技能 README / `bin/topskills.js` / `docs/PUBLISHING.md` 统一以 `npx github:topmindspace/topskills ...` 为默认;npm 包名降为「已 publish 后的可选通道」。补充「找不到这个包」排错说明。
|
|
70
|
+
- `package.json` description 与新增 `npm run privacy` 脚本对齐上述口径。
|
|
71
|
+
|
|
72
|
+
### Fixed
|
|
73
|
+
- **隐私扫描器自身泄漏**:`ci_privacy_scan.py` 不再硬编码本机用户名;改为通用 home 用户名段检测 + 可选本地词表 `scripts/.privacy-deny.local`(gitignore)。
|
|
74
|
+
- **扫描器自扫失明**:旧版词表写在 raw string 里导致字面量扫不到自己;新版附合成样本自检,并拒绝在扫描器源码中出现用户名形态 token。
|
|
75
|
+
- **CI 日志二次泄漏**:扫描命中项一律脱敏输出(`xx***y(len=n)`),不回显密钥/路径原文。
|
|
76
|
+
- 删除本地临时脚本 `scripts/_find_dup.py`(`scripts/_*` 约定为用后即删)。
|
|
77
|
+
|
|
78
|
+
### Added
|
|
79
|
+
- 隐私扫描扩展:GitHub/npm token、AWS key、Bearer、密钥赋值形态;`git ls-files` 禁止跟踪路径门禁(临时脚本 / `.env` / 密钥 / 缓存 / 智能体本地状态)。
|
|
80
|
+
- `docs/PUBLISHING.md` 增加安装口径表、隐私扫描器自身约束、打包矩阵中的 `.privacy-deny.local` 行。
|
|
81
|
+
|
|
82
|
+
## 9.0.0 — 2026-09-23(v9 质量整改)
|
|
83
|
+
|
|
84
|
+
### Added
|
|
85
|
+
- `references/reform-plan.md`:整体整改方案(根因 / 设定纠偏 / 复杂度收敛 / 门禁重建 / 图文演讲 V1–V4 / **布局语法**)。
|
|
86
|
+
- **`references/layout-grammar.md`**:布局语法——12 列网格、预设骨架 **P1–P12**、元素级排版(图标/列表/卡/指标/图表/图文/结构图)、组合槽位、对齐与填充率。
|
|
87
|
+
- `layout-constants.layoutSystem`:骨架/元素/填充率/多重心/对齐/`pageToPreset`/`defaultCharts` 单源。
|
|
88
|
+
- v9 硬门禁:`HTML_TAG_IN_TEXT` / `TITLE_ONLY_PAGE` / `UNDERFILL_PAGE` / `CHART_SKEW_INVALID` / `CHART_OVERSIZE`。
|
|
89
|
+
- **`LAYOUT_*` 门禁**:`NO_SKELETON` / `MULTI_FOCUS` / `ALIGN_DRIFT` / `SPACING_OFF_TOKEN` / `ICON_SIZE` / `LABEL_COLLIDE` / `FILL`。
|
|
90
|
+
- scaffold:`PAGE_TO_PRESET` + `data-skel`/`data-page-type`/`layoutPreset`;图/exhibit 页强制 P8 主从;默认图表 8 核心轮换。
|
|
91
|
+
- **`render_from_model.py`**:模型驱动生成 HTML(只填 REPORT_MODEL,`--inplace` 回填正文;`[n]` 自动转 cite)。
|
|
92
|
+
- 结构图正交箭头:`engine.css` `.lane__arr`/`.arch__conn`/`.flow-*`;PPTX lane/diagram 线段+三角箭头。
|
|
93
|
+
- `layoutSlots` 并入 `layout-constants`(`lib_layout_regions` 优先读 LC);cards 双端兼容 `[[k,v]]`/`str`/`{t,d}`。
|
|
94
|
+
- `cross_verify` 逐页文本改为 **≥80% 覆盖**(与 roundtripMin 同源)。
|
|
95
|
+
- playbook §〇 排版总序 + §三-b 图文演讲 V1–V4;content-rules §二-b 模型字段禁 HTML 标签。
|
|
96
|
+
- 负向测试 N15–N17(标签泄漏 / 极偏 donut / 模型夹带标签)。
|
|
97
|
+
|
|
98
|
+
### Fixed
|
|
99
|
+
- SKILL.md 超重与 references 内容重复(audit_skill);CSS 未引用类清零(`flow-*` 接入 scaffold)。
|
|
100
|
+
- render_from_model:agenda 对齐、Exhibit 顺序编号、donut/matrix/threecol/halftable/comparison 版式类映射。
|
|
101
|
+
- cards 双端 points 形态兼容;页高估算按栅格折行 + 8% 容差。
|
|
102
|
+
- 临时脚本与死代码清理;tech-design/README 单写路径对齐。
|
|
103
|
+
|
|
104
|
+
### Docs
|
|
105
|
+
- 根 README / PUBLISHING 中文化;技能 `description` 重写(445 字,做什么+何时用+何时不用)。
|
|
106
|
+
- README 历史版本长文移除,统一看本 CHANGELOG;版本表述统一 v9.0。
|
|
107
|
+
|
|
108
|
+
### Changed
|
|
109
|
+
- 过空页、留白失衡(任一轴)、大图、文本溢出、内容保真(50%→80%)纳入 strict。
|
|
110
|
+
- 废除「presentation 每页 1 张大图」;图表面积随信息复杂度。
|
|
111
|
+
- scaffold `cards` 契约改为 `{title, points[]}`(与双引擎一致,修复空卡)。
|
|
112
|
+
- `extract_model` 自动剥离模型字段中的 HTML 标签。
|
|
113
|
+
- 承载口径扩展(ul/arch/lane/…);页高估算改重承载 + 8% 静态容差。
|
|
114
|
+
|
|
115
|
+
## 1.0.0 — 2026-09-23
|
|
116
|
+
|
|
117
|
+
### Added
|
|
118
|
+
- `@topmindspace/topskills` monorepo with `npx` installer (`topskills list|install`).
|
|
119
|
+
- GitHub Actions CI (audit + package gate + privacy scan) and release workflow.
|
|
120
|
+
- MIT license and release-ready root documentation.
|
|
121
|
+
|
|
122
|
+
### Changed
|
|
123
|
+
- Skill renamed **`topreport` / TopReport → `top-slides-expert` / TopSlides Expert**.
|
|
124
|
+
- Environment variables renamed: `TOPREPORT_*` → `TOP_SLIDES_*`.
|
|
125
|
+
- Injection markers renamed: `__TOPREPORT_*__` → `__TOPSLIDES_*__`.
|
|
126
|
+
- JS API renamed: `TopReportPptx` → `TopSlidesPptx`.
|
|
127
|
+
- Skill lives at `skills/top-slides-expert/` so more skills can join this repo.
|
|
128
|
+
|
|
129
|
+
### Removed / deprecated
|
|
130
|
+
- Legacy `topreport`, `TopReport`, `TOPREPORT_*`, `MIGA_*` identifiers (no silent aliases).
|
|
131
|
+
- Private host path probes and IDE/agent local state from the publishable tree.
|
|
132
|
+
- Internal optimization planning notes (`OPTIMIZATION-PLAN.md`) from the release tree.
|
|
133
|
+
- Build artifacts (`dist/`, `node_modules/`, caches) from version control.
|
|
134
|
+
|
|
135
|
+
### Migration
|
|
136
|
+
| Old | New |
|
|
137
|
+
|-----|-----|
|
|
138
|
+
| skill id `topreport` | `top-slides-expert` |
|
|
139
|
+
| brand `TopReport` | `TopSlides Expert` |
|
|
140
|
+
| `TOPREPORT_NODE_EXE` | `TOP_SLIDES_NODE_EXE` |
|
|
141
|
+
| `TOPREPORT_NODE_PATH` | `TOP_SLIDES_NODE_PATH` |
|
|
142
|
+
| `TOPREPORT_BROWSER_CHANNEL` | `TOP_SLIDES_BROWSER_CHANNEL` |
|
|
143
|
+
| `__TOPREPORT_*__` markers | `__TOPSLIDES_*__` |
|
|
144
|
+
| `TopReportPptx` | `TopSlidesPptx` |
|
|
145
|
+
| `MIGA_*` env | removed — use `TOP_SLIDES_*` |
|
package/README.md
CHANGED
|
@@ -103,7 +103,7 @@ tms-skills/
|
|
|
103
103
|
| 工作流 | 触发 | 做什么 |
|
|
104
104
|
|--------|------|--------|
|
|
105
105
|
| `ci.yml` | push / PR | 技能打包门禁、审计、隐私扫描、CLI 冒烟 |
|
|
106
|
-
| `release.yml` | tag `v*` | 技能 zip + manifest → GitHub Release
|
|
106
|
+
| `release.yml` | tag `v*` | 技能 zip + manifest → GitHub Release;**自动 npm publish**;**Release 只保留最近 2 个** |
|
|
107
107
|
|
|
108
108
|
本地推送前建议:
|
|
109
109
|
|
package/bin/tms-skills.js
CHANGED
|
@@ -1,160 +1,160 @@
|
|
|
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
|
+
* 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);
|