正文
获取原文件SKILL.md
Use this skill when the user wants an Obsidian note turned into a polished WeChat public-account article.
Default Workflow
-
Identify the input note.
- Prefer an explicit
.mdpath. - If the user says "the latest Obsidian article", search the vault for recent Markdown files and confirm the likely source only when ambiguous.
- Default vault path:
/Users/liuhaoxian/Downloads/我的/Obsidian.
- Prefer an explicit
-
If the user provides a reference WeChat article, try to read it first.
- Extract reusable layout ideas: opening rhythm, heading hierarchy, image placement, emphasis blocks, conclusion style, and copy-to-WeChat caveats.
- If the page is blocked or cannot be fetched, say so briefly and proceed with the default layout strategy.
-
Convert the source note with:
python3 scripts/obsidian_wechat_format.py \
--input "/Users/liuhaoxian/Downloads/我的/Obsidian/path/to/article.md"
-
Save outputs back into Obsidian.
- Default output folder:
公众号排版beside the source note. - HTML output:
<title>.wechat.html, ready to open in a browser and copy into the WeChat editor. - Obsidian output:
<title>.wechat.md, a review note containing the styled article body and publishing checklist. - Component library output:
公众号组件库.wechat.md, reusable module patterns for future articles. - Local images are copied into
<title>_assets/and rewritten to relative paths.
- Default output folder:
-
Verify the output.
- Read the generated
.wechat.mdand.wechat.htmlpaths. - Check whether image files were resolved and copied.
- If dependencies are missing, install only the packages listed in
requirements.txt.
- Read the generated
Dependencies
Required:
pip3 install -r requirements.txt
The formatter needs:
markdownbeautifulsoup4Pygments
cssutils, lxml, and watchdog from the original community skill are not required by this Codex version.
Obsidian Handling
Supported image syntaxes:
![[image.png]]
![[folder/image.png|caption]]

Supported note links:
[[Some Note]]
[[Some Note|alias]]
Non-image wiki links are converted to readable text so the WeChat article does not contain broken Obsidian-only syntax.
Layout Strategy
Use a restrained WeChat layout:
- Remove the H1 from the body; WeChat has its own title field.
- Treat the first one or two paragraphs as the lead and give them a softer card style.
- Use clear H2 section blocks and compact H3 subheads.
- Keep paragraphs airy but not decorative.
- Convert Obsidian callouts and
:::blocks into inline styled information cards. - Keep images full width with captions when available.
- Add a final checklist in the Obsidian output for title, cover image, local image upload, mobile preview, and link checks.
Avoid adding unrelated rewriting unless the user asks for content editing. Formatting should preserve the original article's substance.
Component Library Strategy
The reference article "新媒体人看过来:用 SOLO 快速设计公众号视觉模板" is useful mainly for its workflow: do not design one-off article pages; split WeChat publishing into reusable components and keep improving that library.
Apply this idea when formatting:
- Preserve stable inline CSS because the WeChat editor may strip stylesheet-based rules.
- Prefer mobile-safe single-column layouts for images and cards.
- Keep component names consistent so the user can reuse them across articles.
- Generate or update a small component library note in the output folder.
Supported component blocks:
::: qa
Q: 这个方法适合谁?
A: 适合长期做公众号、希望统一视觉风格的人。
:::
::: timeline
- 选题:明确文章主线
- 写作:完成正文
- 排版:生成公众号版本
:::
::: author
刘浩南|医疗 AI、产品与内容系统
:::
::: readmore
- [[上一篇文章]]
- [外部链接](https://example.com)
:::
::: cta
如果这篇对你有帮助,欢迎点赞、在看或转发。
:::