@topmindspace/tms-skills 0.2.0 → 0.3.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.en.md +47 -12
  3. package/README.md +46 -11
  4. package/bin/tms-skills.js +35 -5
  5. package/package.json +1 -1
  6. package/top-ppt-html/README.en.md +2 -2
  7. package/top-ppt-html/README.md +3 -3
  8. package/top-ppt-html/SKILL.md +4 -5
  9. package/top-ppt-html/references/modes.md +1 -1
  10. package/top-ppt-html/scripts/audit_docs.py +24 -0
  11. package/top-ppt-html/scripts/audit_skill.py +2 -2
  12. package/top-ppt-html/scripts/build_pptx.js +36 -0
  13. package/top-ppt-html/scripts/package_skill.py +3 -3
  14. package/topmind-cover/README.en.md +51 -0
  15. package/topmind-cover/README.md +17 -6
  16. package/topmind-cover/SKILL.md +25 -7
  17. package/topmind-cover/assets/examples/README.md +29 -0
  18. package/topmind-cover/assets/examples/big-poster-wechat.png +0 -0
  19. package/topmind-cover/assets/examples/big-poster.png +0 -0
  20. package/topmind-cover/assets/examples/cyber-glitch-wechat.png +0 -0
  21. package/topmind-cover/assets/examples/cyber-glitch.png +0 -0
  22. package/topmind-cover/assets/examples/guochao-wechat.png +0 -0
  23. package/topmind-cover/assets/examples/guochao.png +0 -0
  24. package/topmind-cover/assets/examples/magazine-wechat.png +0 -0
  25. package/topmind-cover/assets/examples/magazine.png +0 -0
  26. package/topmind-cover/assets/examples/minimal-wechat.png +0 -0
  27. package/topmind-cover/assets/examples/minimal.png +0 -0
  28. package/topmind-cover/assets/examples/tech-future-wechat.png +0 -0
  29. package/topmind-cover/assets/examples/tech-future.png +0 -0
  30. package/topmind-cover/references/cover-styles.md +174 -21
  31. package/topmind-cover/scripts/audit_docs.py +22 -0
  32. package/topmind-cover/scripts/crop-cover.py +1 -2
  33. package/topmind-wechat-post/README.en.md +63 -0
  34. package/topmind-wechat-post/README.md +16 -0
  35. package/topmind-wechat-post/SKILL.md +22 -13
  36. package/topmind-wechat-post/references/typography-rules.md +1 -1
  37. package/topmind-wechat-post/references/writing-quality.md +2 -2
  38. package/topmind-wechat-post/scripts/audit_docs.py +22 -0
  39. package/topmind-x-article/README.en.md +46 -0
  40. package/topmind-x-article/README.md +13 -2
  41. package/topmind-x-article/SKILL.md +13 -4
  42. package/topmind-x-article/scripts/audit_docs.py +22 -0
  43. package/topmind-x-article/scripts/md2x.py +5 -3
@@ -0,0 +1,46 @@
1
+ # topmind-x-article · One-Click X Long-Form Publishing
2
+
3
+ **[中文](./README.md)** | English
4
+
5
+ Turn a Markdown draft into a "copy → paste → publish" X long-form (Article) package.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npx @topmindspace/tms-skills install topmind-x-article
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ # 1. Draft → paste-ready plain text (the heart of one-click copying)
17
+ python3 scripts/md2x.py <draft>.md --out <package>/X发布稿.txt
18
+
19
+ # 2. Cover: generate a 1200×675 cover with topmind-cover
20
+
21
+ # 3. Follow references/publish-checklist.md item by item
22
+ ```
23
+
24
+ ## Conversion rules
25
+
26
+ The X Article editor has weak, unstable markdown support, so `md2x.py` converts to plain text per `references/x-format.md`: headings → plain text lines, horizontal rules (`---` / `***` / `___`) → blank lines, bold/italic markers removed (including `***bold-italic***`), links → `text(url)`, images → `[图N]` (image list appended at the end), tables → "item: value" lists.
27
+
28
+ Read the result through once by hand after converting.
29
+
30
+ ## Publishing
31
+
32
+ X long-form posts are currently published by hand-pasting into the X Article editor; the API does not publish long-form. After publishing, do per the checklist: pin a first comment with the extra info, fetch the full text back for verification.
33
+
34
+ ## External dependencies
35
+
36
+ The following skills are **not in this repo** (usually provided by the user's local workbuddy environment). Missing ones disable the corresponding routed capability; the core flow (draft → text, cover, publish checklist) is unaffected:
37
+
38
+ - `topmind-x`: 280-char short posts (its xurl only covers short posts, not long-form).
39
+ - `topmind-capture`: the "archive only, don't publish" routing path.
40
+
41
+ ## Development
42
+
43
+ ```bash
44
+ python3 scripts/package_skill.py --check # pre-publish check
45
+ python3 scripts/negative_tests.py # bad-input tests
46
+ ```
@@ -1,5 +1,7 @@
1
1
  # topmind-x-article · X 长文一键发布
2
2
 
3
+ [English](./README.en.md) | 中文
4
+
3
5
  把 Markdown 原稿变成"复制 → 粘贴 → 发"的 X 长文(Article)发布包。
4
6
 
5
7
  ## 安装
@@ -22,8 +24,9 @@ python3 scripts/md2x.py <原稿>.md --out <包>/X发布稿.txt
22
24
  ## 转换规则
23
25
 
24
26
  X Article 编辑器对 markdown 支持弱且不稳定,`md2x.py` 按 `references/x-format.md`
25
- 转纯文本:标题→纯文本行、加粗/斜体去标记、链接→`文字(url)`、
26
- 图片→`[图N]`(文末附配图清单)、表格→"项:值"列表。
27
+ 转纯文本:标题→纯文本行、分隔线(`---` / `***` / `___`)→空行、加粗/斜体去标记
28
+ (含 `***粗斜体***`)、链接→`文字(url)`、图片→`[图N]`(文末附配图清单)、
29
+ 表格→"项:值"列表。
27
30
 
28
31
  转完必须人工通读一遍。
29
32
 
@@ -32,6 +35,14 @@ X Article 编辑器对 markdown 支持弱且不稳定,`md2x.py` 按 `reference
32
35
  X 长文目前走人工粘贴发布(X Article 编辑器),API 不发长文。
33
36
  发布后按清单做:首条评论置顶补信息、全文抓回核对。
34
37
 
38
+ ## 外部依赖
39
+
40
+ 以下技能**不在本仓库**(一般随用户侧 workbuddy 环境提供)。缺失时对应路由能力
41
+ 不可用,不影响本技能核心流程(原稿转文本、封面、发布清单):
42
+
43
+ - `topmind-x`:280 字短推文发布(其 xurl 只覆盖短推文,不发长文)。
44
+ - `topmind-capture`:「只想存档不发布」时的收录路由。
45
+
35
46
  ## 开发
36
47
 
37
48
  ```bash
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: topmind-x-article
3
- version: 1.0.0
4
- description: "X 长文(Article)一键发布:Markdown 原稿 → 可直接粘贴的 X发布稿.txt + 封面图 + 发布清单。沉淀自实战。Use when X 长文、发 X 文章、X article、长文发 X。Do NOT use for 短推文(走推文流程)、公众号。"
3
+ version: 0.1.0
4
+ description: "X 长文(Article)一键发布:Markdown 原稿 → 可直接粘贴的 X发布稿.txt + 封面图 + 发布清单。沉淀自实战。Use when X 长文、发 X 文章、X article、长文发 X。Do NOT use for 短推文(→ topmind-x)、公众号。"
5
5
  action_category: write
6
6
  triggers:
7
7
  - X 长文
@@ -11,8 +11,9 @@ triggers:
11
11
  triggers_cn:
12
12
  - 写 X 长文
13
13
  - X 长文发布
14
- author: Muse
14
+ author: TopMindspace
15
15
  license: MIT
16
+ homepage: https://github.com/topmindspace/tms-skills#readme
16
17
  updated: 2026-09-29
17
18
  ---
18
19
 
@@ -58,5 +59,13 @@ updated: 2026-09-29
58
59
  ## When NOT to use
59
60
 
60
61
  - 280 字短推文 → `topmind-x`
61
- - 公众号 → `topmind-wechat`
62
+ - 公众号 → `topmind-wechat-post`
62
63
  - 只想存档不发布 → `topmind-capture`
64
+
65
+ ## 外部依赖
66
+
67
+ 以下技能**不在本仓库**(一般随用户侧 workbuddy 环境提供);缺失时对应路由能力不可用,
68
+ 本技能核心流程(原稿转文本、封面、发布清单)不受影响:
69
+
70
+ - `topmind-x`:280 字短推文发布(其 xurl 只覆盖短推文,不发长文)。
71
+ - `topmind-capture`:「只想存档不发布」时的收录路由。
@@ -48,6 +48,28 @@ def main() -> None:
48
48
  check(False, f"{rel} 悬空链接: {link}")
49
49
  check(True, "内部 md 链接可达")
50
50
 
51
+ # 反引号代码引用中的路径可达(审计 轻微-15 门禁盲区:之前只查 [text](path) 形式,
52
+ # `references/pan-style.md` 这类反引号引用曾漏网)。抓取反引号内的 references/*.md
53
+ # 与 scripts/* 路径并校验存在;glob/占位符写法(* ? < > |)跳过。
54
+ backtick_path_re = re.compile(r"(references|scripts)/([\w.\-/]+)")
55
+ line_suffix_re = re.compile(r":\d+(?:-\d+)?$")
56
+ backtick_bad = 0
57
+ for md in md_files:
58
+ text = md.read_text(encoding="utf-8")
59
+ rel = md.relative_to(ROOT).as_posix()
60
+ for span in set(re.findall(r"`([^`]+)`", text)):
61
+ for kind, p in backtick_path_re.findall(span):
62
+ p = line_suffix_re.sub("", p)
63
+ if not p or any(c in p for c in "*?<>|"):
64
+ continue
65
+ target = md.parent / kind / p
66
+ if not target.exists():
67
+ target = ROOT / kind / p
68
+ if not target.exists():
69
+ backtick_bad += 1
70
+ check(False, f"{rel} 反引号引用不可达: `{kind}/{p}`")
71
+ check(backtick_bad == 0, f"反引号内 references/scripts 引用可达(扫描 {len(md_files)} 个 md 文件)")
72
+
51
73
  if errors:
52
74
  print(f"\n[audit_docs] {NAME}: {len(errors)} 项失败")
53
75
  sys.exit(1)
@@ -28,8 +28,9 @@ def convert(md: str):
28
28
  for raw in md.splitlines():
29
29
  line = raw.rstrip()
30
30
 
31
- # frontmatter 直接跳过
32
- if line.strip() == "---":
31
+ # 分割线 → 空行(frontmatter 已在 main() 去除,这里只剩正文分隔线)
32
+ if re.match(r"^(\*{3,}|-{3,}|_{3,})\s*$", line):
33
+ out_lines.append("")
33
34
  continue
34
35
 
35
36
  # 代码块:去围栏,内容缩进保留
@@ -69,7 +70,8 @@ def convert(md: str):
69
70
  out_lines.append(f"{label}:{rest}" if rest else label)
70
71
  continue
71
72
 
72
- # 行内标记剥离
73
+ # 行内标记剥离(先 *** 再 ** 再 *,防残留)
74
+ line = re.sub(r"\*\*\*(.+?)\*\*\*", r"\1", line) # 粗斜体
73
75
  line = re.sub(r"\*\*(.+?)\*\*", r"\1", line) # 加粗
74
76
  line = re.sub(r"__(.+?)__", r"\1", line)
75
77
  line = re.sub(r"\*(.+?)\*", r"\1", line) # 斜体