wechat-article-md-local
Skill1 starsChanged 16 days agoMITView on GitHub
Download and read a single WeChat Official Account article (微信公众号文章) from a public mp.weixin.qq.com link, save it in the workspace as local Markdown with all images downloaded locally, falling back to HTML when Markdown conversion is impossible. ALWAYS use this skill first whenever the user sends a single WeChat article link — even without asking to download it — and especially before summarizing, extracting, analyzing, quoting, rewriting or translating that article. Triggers: mp.weixin.qq.com link, 下载公众号文章, 公众号文章转 Markdown, 保存这篇公众号, wechat article to markdown.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-chromeSkill
- audio-inboxSkill
- ci-reviewSkill
- doc-readerSkill
- do-somethingSkill
- gpt-image2-prompt-directorSkill
- harnessSkill
- hkr-renderSkill
- hook-test-kitSkill
- launch-videoSkill
- md2viewSkill
- model-guardSkill
- model-prompt-auditSkill
- pdf-triptychSkill
- readme-craftSkill
- repo-mapSkill
- repo-tidySkill
- scanned-book-ocrSkill
- session-handoffSkill
- x-article-downloadSkill
- xiaohongshuSkill
- x-postSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill for single article WeChat Official Account links.
- Distinctive: line 34
Run the bundled shell script above.
- Distinctive: line 51
Only if the bundled script fails, fall back to the manual two-step flow:
- Distinctive: line 53
Use the browser tool to open the article page.
- Distinctive: line 60
Use browser evaluate on the opened article page and extract at least:
- Very specific: line 80
If html is empty, stop and report the page could not be extracted.
- Distinctive: line 107
Prefer the bundled shell script over manual browser extraction.
- Distinctive: line 108
If Markdown conversion has issues, still keep the cleaned HTML fallback.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
WeChat article → local Markdown
Use this skill for single article WeChat Official Account links.
Default path: use the bundled script first
For normal use, do not manually shuttle the full article HTML through the browser tool.
微信公众号正文经常很长,#js_content.innerHTML 可能超过工具返回长度,导致提取结果被截断。
优先直接运行这个脚本:
SKILL_DIR="$(cd "$(dirname "$0")" && pwd)"
bash "${SKILL_DIR}/scripts/download_wechat_article.sh" '<MP_URL>' '<OUTPUT_DIR>'这个脚本会自动:
- 用 Playwright 打开文章页
- 提取元数据和完整
#js_contentHTML - 调用
save_wechat_article.py - 下载图片到本地
- 生成 Markdown 和 HTML fallback
What to do
- Validate the URL is a single article link on
mp.weixin.qq.com. - Run the bundled shell script above.
- Parse the JSON result printed by the script.
- Return the saved file paths.
Expected output from the script
脚本成功时会输出 JSON,包含至少这些字段:
titlearticle_dirmarkdown_pathhtml_pathimages_dirimage_countmarkdown_ok
Fallback path
Only if the bundled script fails, fall back to the manual two-step flow:
- Use the browser tool to open the article page.
- Extract article metadata and the full
#js_contentHTML from the rendered page. - Save the extracted payload to a temporary JSON file.
- Run
scripts/save_wechat_article.pymanually.
Manual browser extraction
Use browser evaluate on the opened article page and extract at least:
() => {
const q = s => document.querySelector(s);
const text = s => q(s)?.textContent?.trim() || '';
const html = q('#js_content')?.innerHTML || '';
return {
url: location.href,
title: text('#activity-name') || text('#js_name') || document.title,
account: text('#js_name'),
author: text('#js_author_name') || text('#js_author'),
publish_time: text('#publish_time'),
description: document.querySelector('meta[name="description"]')?.content || '',
cover: document.querySelector('meta[property="og:image"]')?.content || '',
html
};
}If html is empty, stop and report the page could not be extracted.
Manual converter script
Run:
SKILL_DIR="$(cd "$(dirname "$0")" && pwd)"
source "${SKILL_DIR}/scripts/../.venv-wechat-skill/bin/activate" 2>/dev/null || true
python "${SKILL_DIR}/scripts/save_wechat_article.py" \
--input /tmp/wechat_article_input.json \
--output-dir '<OUTPUT_DIR>'Success response
Report:
- article title
- markdown path
- images directory
- fallback HTML path
- image count if available
Notes
- This skill is intentionally for single article links only.
- Images should always be localized.
- Prefer the bundled shell script over manual browser extraction.
- If Markdown conversion has issues, still keep the cleaned HTML fallback.
- Gotcha: do not rely on a single browser-tool response to carry very large HTML blobs when a local script can write them directly to disk.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

