Install
openclaw skills install wechat-article-to-obsidianSave WeChat public account articles (微信公众号文章) as clean Markdown notes in Obsidian. Use this skill whenever the user shares a mp.weixin.qq.com link and wants to save it to Obsidian, or mentions '微信文章', '公众号文章', '保存微信', '导入微信文章到Obsidian', 'save wechat article', 'clip wechat'. Also triggers when the user wants to batch-save multiple WeChat article URLs to their Obsidian vault. Zero external dependencies — just curl and Node.js.
openclaw skills install wechat-article-to-obsidianSave WeChat MP articles (微信公众号) as clean Markdown notes in Obsidian. No browser, no CDP, no plugins needed.
WeChat articles are fetched with a two-stage strategy. First, try a normal curl with browser-like headers. If that only returns a shell page and the parser cannot find usable metadata / #js_content, fall back to a real browser fetch using Playwright + Chrome, extract the rendered article body, then convert it to clean Markdown and save it into Obsidian.
On first use, check <skill-path>/config.json. If obsidian_vault or default_path is empty, ask the user:
obsidian CLI (e.g., vault=MyVault)notes/wechat, articles/wechat)Then write the answers to <skill-path>/config.json:
{
"obsidian_vault": "MyVault",
"default_path": "notes/wechat"
}
This only needs to happen once. After that, the skill uses the saved config automatically.
The user can override the default path anytime:
Parse the target path from the user's message and use it instead of default_path.
<skill-path>/config.json:
obsidian_vault: the vault name for obsidian CLIdefault_path: where to save articles when the user doesn't specify a pathvault_disk_root: absolute disk path of the vault root for direct-write savingRecommended setup:
obsidian_vault: optional vault name referencedefault_path: notes/wechatvault_disk_root: absolute disk path to the user's Obsidian vaultUse a step-by-step workflow by default. Do not assume the one-line "fetch + parse + save" pattern is the most reliable option in OpenClaw.
Preferred order:
fetch.shparse.mjs --jsonWhy this matters:
exec forms may be blocked by environment policy even when the underlying task is allowedexec does not always mean a user approval can fix itSKILL_PATH="<skill-path>"
# Step 1: Fetch HTML (fast path)
bash "$SKILL_PATH/scripts/fetch.sh" "URL" /tmp/wx_article.html
# Step 2: Inspect metadata
node "$SKILL_PATH/scripts/parse.mjs" /tmp/wx_article.html --json
# Step 3: If title/contentLength is empty or unusable, run browser fallback
python3 "$SKILL_PATH/scripts/fetch-browser.py" "URL" /tmp/wx_article.html
node "$SKILL_PATH/scripts/parse.mjs" /tmp/wx_article.html --json
# Step 4: Parse to Markdown
node "$SKILL_PATH/scripts/parse.mjs" /tmp/wx_article.html > /tmp/wx_article.md
# Step 5: Save with the bundled safe saver
node "$SKILL_PATH/scripts/save.mjs" \
--markdown /tmp/wx_article.md \
--config "$SKILL_PATH/config.json" \
--title "<article_title>" \
--target-path "<target_path>"
The filename should be derived from the article title, keeping it readable: strip special characters, keep Chinese characters. Example: 从Claude Code源码看AI Agent工程架构.md
The bundled save.mjs uses a strict safe save path:
vault_disk_rootIf shell redirection like > /tmp/wx_article.md is blocked by policy, use an equivalent alternate execution shape that still relies on the skill's own parser script, then save the resulting Markdown with the bundled direct-write saver.
For 2+ URLs, process them sequentially. For 4+ URLs, consider using subagents in parallel (each with its own temp file).
# Per URL:
bash "$SKILL_PATH/scripts/fetch.sh" "$url" "/tmp/wx_${i}.html"
node "$SKILL_PATH/scripts/parse.mjs" "/tmp/wx_${i}.html" > "/tmp/wx_${i}.md"
# Then save each to Obsidian
The parser produces clean Markdown with YAML frontmatter:
---
title: "Article Title"
author: "公众号名称"
publish_date: "2026-03-31 19:45:08"
saved_date: "2026-03-31"
source: "wechat"
url: "https://mp.weixin.qq.com/s/..."
---
The parser automatically:
## PART.XX Title headingsAfter the parser runs, review the output and apply any remaining cleanup:
<vault_disk_root>/<target_path>/<filename>.md<vault_disk_root>/notes/wechat/文章名.mdhumanlike/ unless the user explicitly asked for that vault subdirectoryTry the browser fallback:
python3 "$SKILL_PATH/scripts/fetch-browser.py" "URL" /tmp/wx_article.html
If browser fallback also fails, the article may require a stronger logged-in context or be a special unsupported page type.
If browser fallback fails with missing Playwright modules (for example ModuleNotFoundError: No module named 'playwright'), do not block the whole workflow.
Do this instead:
fetch.sh path as the default first attemptThese are different situations and must be treated differently:
Do not assume every blocked command can be fixed with an approval command. If there is no actual approval object from the runtime, explain that clearly and switch to a different execution shape.
Some special article types (mini-programs, video-only) aren't supported. Inform the user.
If a direct command like:
node "$SKILL_PATH/scripts/parse.mjs" /tmp/wx_article.html > /tmp/wx_article.md
is blocked by policy, do not abandon the skill. Use another execution form that still calls the same parser script and captures its stdout, then save the Markdown with the bundled direct-write saver.
That is fine. The publish build saves by direct file write to the configured vault disk path.
Important for this setup:
vault_disk_root from config when presentnotes/wechat should resolve inside the configured vault root