@topmindspace/topmind-writing-skills 0.8.40 → 0.8.42

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 CHANGED
@@ -1,4 +1,20 @@
1
- ## [0.8.40] - 2026-10-16
1
+ ## [0.8.42] - 2026-10-16
2
+
3
+ > 根包 0.8.41 → **0.8.42**(patch,仅安装器与文档);技能版本不变。
4
+
5
+ - 文档对齐默认升级:README 中英文加 `@latest` 升级、`--force` 重装 / 降级示例,钉版本示例注明已装更新时需 `--force`;PUBLISHING 加「升级」一行。
6
+ - CI 安装冒烟改测新行为:同版本 → Already up to date,旧版本 → Upgraded。
7
+
8
+ - 2026-10-16
9
+
10
+ > 根包 0.8.40 → **0.8.41**(patch,仅安装器);技能版本不变。
11
+
12
+ ### 变更(安装器默认升级)
13
+
14
+ - `install` 遇到已装技能时默认升级:包内版本更新(或已装版本缺失 / 解析不了)→ 直接覆盖,不备份,打印 `Upgraded <id> <旧> -> <新>`;版本相同 → `Already up to date`,exit 0,`--force` 重装;已装版本更新 → 拒绝降级,`--force` 才覆盖。
15
+ - 帮助文本、README 中英文同步;`test_installer_cli.js` 新增升级 / 同版本 / 已装更新 / 版本缺失用例。
16
+
17
+ - 2026-10-16
2
18
 
3
19
  > 根包 0.8.39 → **0.8.40**(patch);技能版本:topmind-briefs 0.2.20 → 0.2.21、topmind-format 0.1.5 → 0.1.6、topmind-viral-posts 0.3.12 → 0.3.13、topmind-wechat-post 0.3.12 → 0.3.13、topmind-x-article 0.4.18 → 0.4.19。
4
20
 
package/README.en.md CHANGED
@@ -128,7 +128,7 @@ Every skill ships sample outputs written by us (fictional or neutral topics; no
128
128
  | [`topmind-format`](./topmind-format/) | **0.1.6** | X plain-text formatter: to duanzi (blank lines, no emoji) / to short post (paragraphing + sensible lists, emoji optional); layout only, words unchanged, with a fidelity check; one copy-ready plain-text body, links / images sent separately |
129
129
  | [`topmind-poster`](./topmind-poster/) | **0.1.6** | HTML+CSS → high-res long image / poster / infographic PNG: headless Chrome 2× screenshot + auto-trim; "one image per section" batch workflow (generator + renderer) |
130
130
 
131
- Installer [`@topmindspace/topmind-writing-skills`](https://www.npmjs.com/package/@topmindspace/topmind-writing-skills) is **0.8.40** (whole-repo same-tag releases).
131
+ Installer [`@topmindspace/topmind-writing-skills`](https://www.npmjs.com/package/@topmindspace/topmind-writing-skills) is **0.8.42** (whole-repo same-tag releases).
132
132
 
133
133
  ### Which skill, and how they combine
134
134
 
@@ -151,7 +151,9 @@ Installer [`@topmindspace/topmind-writing-skills`](https://www.npmjs.com/package
151
151
  npx @topmindspace/topmind-writing-skills list
152
152
  npx @topmindspace/topmind-writing-skills install topmind-briefs
153
153
  npx @topmindspace/topmind-writing-skills install topmind-briefs --to ./.claude/skills
154
- npx @topmindspace/topmind-writing-skills@0.8.4 install topmind-briefs # pin
154
+ npx @topmindspace/topmind-writing-skills@latest install topmind-briefs # upgrade: older install is overwritten, no --force needed
155
+ npx @topmindspace/topmind-writing-skills install topmind-briefs --force # reinstall same version / downgrade
156
+ npx @topmindspace/topmind-writing-skills@0.8.4 install topmind-briefs # pin (needs --force if a newer version is installed)
155
157
  npx @topmindspace/topmind-writing-skills uninstall topmind-briefs --to ./.claude/skills
156
158
  ```
157
159
 
@@ -162,7 +164,7 @@ npx github:topmindspace/topmind-writing-skills install topmind-briefs
162
164
 
163
165
  Default probe order: `./.agents` → `./.claude` → `./.cursor` → `./.codex` → `./.mimocode`, then user-level `~/.claude`, etc. Or pass `--to`. When `--to` is omitted, the install summary explicitly prints the auto-detected target directory. Do not `npm install topmind-briefs` (skill id is not a standalone package).
164
166
 
165
- `install` details: if a same-named skill already exists, the installed version is reported and overwriting is refused — pass `--force` to replace (or `uninstall` first). On success, a three-line summary is printed: where it was installed / installed skill version and installer version / next steps.
167
+ `install` details: upgrades by default: if the installed version is older (or unreadable), it is overwritten in place (no backup) and `Upgraded <skill> <old> -> <new>` is printed; the same version prints `Already up to date` (`--force` reinstalls); an installed version newer than the package is refused unless `--force`. On success, a three-line summary is printed: where it was installed / installed skill version and installer version / next steps.
166
168
 
167
169
  ## Repo layout
168
170
 
package/README.md CHANGED
@@ -128,7 +128,7 @@ npx @topmindspace/topmind-writing-skills install topmind-poster
128
128
  | [`topmind-format`](./topmind-format/) | **0.1.6** | X 纯文本格式化:转段子(行间空行,零 emoji)/ 格式化成短文(分段 + 合理列表,emoji 可选),只动排版不改字,带原文保真校验;交付一段可复制纯文本,链接 / 原图另发 |
129
129
  | [`topmind-poster`](./topmind-poster/) | **0.1.6** | HTML+CSS → 高清长图 / 海报 / 信息图 PNG:无头 Chrome 2× 截图 + 自动裁白;「一段一图」分段图批量出图(生成器 + 渲染器) |
130
130
 
131
- 安装器 [`@topmindspace/topmind-writing-skills`](https://www.npmjs.com/package/@topmindspace/topmind-writing-skills) 为 **0.8.40**(整仓同 tag 发版)。
131
+ 安装器 [`@topmindspace/topmind-writing-skills`](https://www.npmjs.com/package/@topmindspace/topmind-writing-skills) 为 **0.8.42**(整仓同 tag 发版)。
132
132
 
133
133
  ### 怎么选、怎么组合
134
134
 
@@ -155,7 +155,9 @@ npx @topmindspace/topmind-writing-skills install topmind-poster
155
155
  npx @topmindspace/topmind-writing-skills list
156
156
  npx @topmindspace/topmind-writing-skills install topmind-briefs
157
157
  npx @topmindspace/topmind-writing-skills install topmind-briefs --to ./.claude/skills
158
- npx @topmindspace/topmind-writing-skills@0.8.4 install topmind-briefs # 钉版本
158
+ npx @topmindspace/topmind-writing-skills@latest install topmind-briefs # 升级:已装旧版直接覆盖,无需 --force
159
+ npx @topmindspace/topmind-writing-skills install topmind-briefs --force # 同版本重装 / 降级
160
+ npx @topmindspace/topmind-writing-skills@0.8.4 install topmind-briefs # 钉版本(已装更新的版本时需 --force)
159
161
  npx @topmindspace/topmind-writing-skills uninstall topmind-briefs --to ./.claude/skills
160
162
  ```
161
163
 
@@ -166,7 +168,7 @@ npx github:topmindspace/topmind-writing-skills install topmind-briefs
166
168
 
167
169
  默认探测:`./.agents` → `./.claude` → `./.cursor` → `./.codex` → `./.mimocode`,再用户级 `~/.claude` 等;也可用 `--to`。未给 `--to` 时安装摘要会明确打印探测到的目标目录。不要 `npm install topmind-briefs`(技能 id 不是独立包)。
168
170
 
169
- `install` 细节:若同名技能已存在,会报出已装版本并拒绝覆盖,需加 `--force` 才替换(或先 `uninstall` 再装)。安装成功后打印三行摘要:装到哪里 / 装的技能版本与安装器版本 / 下一步。
171
+ `install` 细节:默认升级:已装版本比包里旧(或读不到版本)就直接覆盖(不备份),打印 `Upgraded <技能> <旧> -> <新>`;版本相同打印 `Already up to date`,加 `--force` 可重装;已装版本比包里新则拒绝降级,需加 `--force`。安装成功后打印三行摘要:装到哪里 / 装的技能版本与安装器版本 / 下一步。
170
172
 
171
173
  ## 仓库结构
172
174
 
@@ -193,6 +193,20 @@ function assertDestOutsideSource(src, dest) {
193
193
  }
194
194
  }
195
195
 
196
+ /** 比较版本 a 与 b:a>b 返回 1,相等 0,a<b -1。b 缺失或解析不了视为最旧(返回 1)。 */
197
+ function parseVer(v) {
198
+ const m = String(v || '').trim().replace(/^["']|["']$/g, '').replace(/^v/, '').match(/^(\d+)\.(\d+)\.(\d+)/);
199
+ return m ? m.slice(1, 4).map(Number) : null;
200
+ }
201
+ function compareVersions(a, b) {
202
+ const pa = parseVer(a);
203
+ const pb = parseVer(b);
204
+ if (!pb) return 1;
205
+ if (!pa) return -1;
206
+ for (let i = 0; i < 3; i++) if (pa[i] !== pb[i]) return pa[i] > pb[i] ? 1 : -1;
207
+ return 0;
208
+ }
209
+
196
210
  function install(skillId, targetRoot, { force = false, defaultTarget = false } = {}) {
197
211
  assertSkillId(skillId);
198
212
  const src = skillDir(skillId);
@@ -210,25 +224,32 @@ function install(skillId, targetRoot, { force = false, defaultTarget = false } =
210
224
  'Choose a --to directory that can be created (not a file, not unwritable).'
211
225
  );
212
226
  }
227
+ let upgradedFrom = null;
213
228
  if (fs.existsSync(dest)) {
214
- if (!force) {
215
- // 已装过:报出已装版本,要求 --force 才覆盖(不静默覆盖)。
216
- const installedVer = readSkillVersion(dest) || 'unknown';
217
- const packageVer = readSkillVersion(src) || 'unknown';
229
+ // 已装过:默认升级。打包版本更新 → 直接覆盖(不备份);相同 → 已是最新;已装版本更新 → 需 --force。
230
+ const installedVer = readSkillVersion(dest);
231
+ const packageVer = readSkillVersion(src) || 'unknown';
232
+ const cmp = compareVersions(packageVer, installedVer);
233
+ if (!force && cmp === 0) {
234
+ console.log(`Already up to date: ${skillId} ${installedVer} (use --force to reinstall)`);
235
+ console.log(` at: ${dest}`);
236
+ return;
237
+ }
238
+ if (!force && cmp < 0) {
218
239
  die(
219
- `Already installed: ${dest}\n` +
220
- ` installed version: ${installedVer} (this package ships ${packageVer})\n` +
221
- 'Refusing to overwrite. Pass --force (or -f) to replace, or remove it first:\n' +
222
- ` topmind-writing-skills uninstall ${skillId} --to ${targetRoot}`
240
+ `Installed ${skillId} ${installedVer} is newer than packaged ${packageVer}; not downgrading. ` +
241
+ 'Pass --force (or -f) to downgrade.'
223
242
  );
224
243
  }
244
+ upgradedFrom = cmp > 0 ? installedVer || 'unknown' : null;
225
245
  fs.rmSync(dest, { recursive: true, force: true });
226
246
  }
227
247
  copyDir(src, dest);
228
248
  // 安装摘要三行:装到哪里 / 装了什么版本 / 下一步。
229
249
  const toNote = defaultTarget ? ' (default, auto-detected — no --to given)' : '';
230
250
  const skillVer = readSkillVersion(dest) || 'unknown';
231
- console.log(`Installed ${skillId}`);
251
+ if (upgradedFrom) console.log(`Upgraded ${skillId} ${upgradedFrom} -> ${skillVer}`);
252
+ else console.log(`Installed ${skillId}`);
232
253
  console.log(` to: ${dest}${toNote}`);
233
254
  console.log(` version: skill ${skillVer} (installer ${installerVersion()})`);
234
255
  console.log(` next: ${nextStep(skillId, dest)}`);
@@ -290,8 +311,12 @@ Usage:
290
311
 
291
312
  Behavior:
292
313
  install copies <skill-id>/ into <dir>/<skill-id>/. If the skill is already
293
- installed, the installed version is reported and --force is required
294
- to overwrite. Prints where/what-version/next-steps when done.
314
+ installed: a newer packaged version upgrades it in place (no backup,
315
+ prints "Upgraded <id> <old> -> <new>"); the same version prints
316
+ "Already up to date" (--force reinstalls); an installed version newer
317
+ than the package is refused unless --force. A missing/unparseable
318
+ installed version counts as an upgrade. Prints where/what-version/
319
+ next-steps when done.
295
320
  uninstall removes <dir>/<skill-id>/ (refuses: not installed, not a skill
296
321
  directory, or the package's own skill source).
297
322
  No --to: the target directory is auto-detected (probe order below) and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topmindspace/topmind-writing-skills",
3
- "version": "0.8.40",
3
+ "version": "0.8.42",
4
4
  "description": "TopMindSpace 写作技能合集 — 通过 npm / npx 安装技能(公众号长文、X 长文、干货短文、X 引流短帖、封面图、长图海报)。只出稿与发布包,不代发。",
5
5
  "license": "MIT",
6
6
  "author": "TopMindspace",
@@ -7,7 +7,7 @@ A brief is not a long-form article — **no HTML by default**: the workflow is v
7
7
  The X version is one copy-ready plain-text block (emoji optional); **links (including sources), original images and any generated images are sent separately**, never mixed into the body.
8
8
  The WeChat version is ~300–800 Chinese characters of Markdown. With no original image it asks before generating one.
9
9
 
10
- - Version: **v0.2.21** (ships with `@topmindspace/topmind-writing-skills@0.8.40`)
10
+ - Version: **v0.2.21** (ships with `@topmindspace/topmind-writing-skills@0.8.42`)
11
11
 
12
12
  ## Install
13
13
 
@@ -7,7 +7,7 @@
7
7
  X 版交付一段可直接复制的纯文本(emoji 可选),**链接(含来源)、原图、配图另发**,不和正文混在一起;公众号版约 300–800 字 Markdown。
8
8
  没有原图时先问要不要配图(`topmind-cover`);链接那一条写明来源名称、发布时间与 URL。
9
9
 
10
- - 版本:**v0.2.21**(随 `@topmindspace/topmind-writing-skills@0.8.40` 发布)
10
+ - 版本:**v0.2.21**(随 `@topmindspace/topmind-writing-skills@0.8.42` 发布)
11
11
 
12
12
  ## 安装
13
13
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  A reusable skill for generating cover art for X long-form posts and WeChat articles. Goal: **striking, eye-catching, theme-focused**.
6
6
 
7
- - Version: **v0.4.11** (ships with `@topmindspace/topmind-writing-skills@0.8.40`)
7
+ - Version: **v0.4.11** (ships with `@topmindspace/topmind-writing-skills@0.8.42`)
8
8
 
9
9
  ## Style gallery
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  为 X 长文和公众号文章生成封面图的可复用技能。目标:**震撼、醒目、主题突出**。
6
6
 
7
- - 版本:**v0.4.11**(随 `@topmindspace/topmind-writing-skills@0.8.40` 发布)
7
+ - 版本:**v0.4.11**(随 `@topmindspace/topmind-writing-skills@0.8.42` 发布)
8
8
 
9
9
  ## 风格样张
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Lays out existing text for X: **duanzi mode** (one sentence per line, a blank line between every line, no emoji at all, bullets without symbols) or **short-post mode** (paragraphing; lists become 「·」/「1)」 or, optionally, emoji bullets; title emoji and motifs are optional). Layout only — the words are never changed; a fidelity check enforces it. Links, source lines and image notes are pulled out of the body so it stays one copy-ready plain-text block; links and images are sent separately.
6
6
 
7
- - Version: **v0.1.6** (ships with `@topmindspace/topmind-writing-skills@0.8.40`)
7
+ - Version: **v0.1.6** (ships with `@topmindspace/topmind-writing-skills@0.8.42`)
8
8
 
9
9
  ## Install
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  把现成的文字排成 X 上好读的样子:**转段子**(每句一行、行间空一行,完全不用 emoji,分点不加符号)或**格式化成短文**(合理分段换行、列表改「·」「1)」或 emoji,标题 emoji 与人设点缀可选)。只动排版,不改字,自带原文保真校验;正文里的链接、来源行、配图行会拿出来另列,交付一段可直接复制的纯文本,链接和图片另发。
6
6
 
7
- - 版本:**v0.1.6**(随 `@topmindspace/topmind-writing-skills@0.8.40` 发布)
7
+ - 版本:**v0.1.6**(随 `@topmindspace/topmind-writing-skills@0.8.42` 发布)
8
8
 
9
9
  ## 安装
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Rankings, infographics, monthly-report long images, posters — plus the "one image per section" workflow for splitting a long article into N shareable images. Text is 100% controllable, diffable, and iterable.
6
6
 
7
- - Version: **v0.1.6** (ships with `@topmindspace/topmind-writing-skills@0.8.40`)
7
+ - Version: **v0.1.6** (ships with `@topmindspace/topmind-writing-skills@0.8.42`)
8
8
 
9
9
  ## Install
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  榜单、信息图、月报长图、海报,以及「一段一图」的分段图批量出图。文本 100% 可控、可 diff、可迭代。
6
6
 
7
- - 版本:**v0.1.6**(随 `@topmindspace/topmind-writing-skills@0.8.40` 发布)
7
+ - 版本:**v0.1.6**(随 `@topmindspace/topmind-writing-skills@0.8.42` 发布)
8
8
 
9
9
  ## 安装
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Short, real, hooked — read in 3 seconds, impossible not to like/comment/follow. 18 post types plus hook × body × closer combinations, summarised from common high-engagement writing patterns in the Chinese X community (all examples are original). Posts default to "duanzi" layout (one sentence per line, a blank line between lines), original images first, plus a hashtag set and classification tags. Existing text → `topmind-format`.
6
6
 
7
- - Version: **v0.3.13** (ships with `@topmindspace/topmind-writing-skills@0.8.40`)
7
+ - Version: **v0.3.13** (ships with `@topmindspace/topmind-writing-skills@0.8.42`)
8
8
 
9
9
  ## Install
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  短、真、钩子——3 秒看完,忍不住点赞/评论/关注。基于对 X 中文区常见高互动写法的归纳,提供 18 类型模板 + 钩子×主体×收尾组合玩法(示例均为自编),默认段子体排版(一句一行、行间空一行),配图原图优先,并附话题标签与分类标签。
6
6
 
7
- - 版本:**v0.3.13**(随 `@topmindspace/topmind-writing-skills@0.8.40` 发布)
7
+ - 版本:**v0.3.13**(随 `@topmindspace/topmind-writing-skills@0.8.42` 发布)
8
8
 
9
9
  ## 安装
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Full lifecycle for WeChat articles: delivery package, review & rewrite, three quality gates, status sync, WeChat inline typography, and publish checklist.
6
6
 
7
- - Version: **v0.3.13** (ships with `@topmindspace/topmind-writing-skills@0.8.40`)
7
+ - Version: **v0.3.13** (ships with `@topmindspace/topmind-writing-skills@0.8.42`)
8
8
 
9
9
  ## Install
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  公众号文章全生命周期:交付包、审校改写、质量三关、状态同步、微信内联排版与发布清单。
6
6
 
7
- - 版本:**v0.3.13**(随 `@topmindspace/topmind-writing-skills@0.8.40` 发布)
7
+ - 版本:**v0.3.13**(随 `@topmindspace/topmind-writing-skills@0.8.42` 发布)
8
8
 
9
9
  ## 安装
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Turn a Markdown draft into a "copy → paste → publish" X long-form (Article) package.
6
6
 
7
- - Version: **v0.4.19** (ships with `@topmindspace/topmind-writing-skills@0.8.40`)
7
+ - Version: **v0.4.19** (ships with `@topmindspace/topmind-writing-skills@0.8.42`)
8
8
 
9
9
  ## Install
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  把 Markdown 原稿变成"复制 → 粘贴 → 发"的 X 长文(Article)发布包。
6
6
 
7
- - 版本:**v0.4.19**(随 `@topmindspace/topmind-writing-skills@0.8.40` 发布)
7
+ - 版本:**v0.4.19**(随 `@topmindspace/topmind-writing-skills@0.8.42` 发布)
8
8
 
9
9
  ## 安装
10
10