wechat-article-to-md-skill
NewConvert WeChat Official Account articles into local Markdown archives with downloaded images and cleaned GFM formatting. Use when the user provides an mp.weixin.qq.com or weixin.qq.com article URL, asks to save/download/archive a WeChat public article, convert a WeChat article to Markdown, preserve article images locally, or find and save WeChat Official Account articles from search results.
Overview
WeChat Article To MD Skill
Use this skill to fetch WeChat Official Account articles and produce a local Markdown article bundle. The bundled script handles fetching, article extraction, image download, HTML-to-Markdown conversion, and post-processing for GitHub-flavored Markdown.
Quick Start
Run the pipeline from the skill directory:
python scripts/wechat_article_pipeline.py "<wechat_article_url>" --output-dir "./articles"Add --save-html when the user wants the cleaned source HTML saved alongside the Markdown:
python scripts/wechat_article_pipeline.py "<wechat_article_url>" --output-dir "./articles" --save-htmlUse python3 instead of python when that is the active Python command on the machine.
Workflow
- Confirm the URL is from
mp.weixin.qq.comorweixin.qq.com. - Run
scripts/wechat_article_pipeline.pywith the requested output directory. - Inspect the command summary. If the title is
未命名文章, treat the link as invalid or inaccessible and remove that failed output folder. - Spot-check the Markdown for table separators, image links, list formatting, blockquotes, and code fences.
- Report the output directory and Markdown file path to the user.
Output
The script creates a numbered article folder under the output root:
articles/
├── 01_文章标题/
│ ├── 文章标题.md
│ ├── source.html
│ ├── image_01.jpg
│ └── ...The generated folder is the final archive structure. Do not move downloaded images unless you also update the Markdown image references.
Arguments
| Argument | Purpose | Default |
|---|---|---|
<url> | WeChat article URL | Required |
--output-dir | Output root directory | {workspace}/articles |
--workspace-dir | Workspace used to resolve default output | Auto-detected |
--save-html | Save cleaned source.html | Off |
--timeout | HTTP timeout in seconds | 30 |
Workspace auto-detection order:
--workspace-dirWORKSPACE_DIR,PROJECT_ROOT, orCLAUDE_WORKSPACE- Current working directory
Dependencies
Requires Python 3.9+ and requests:
pip install requestsSearching For Articles
When the user asks to find WeChat articles but does not provide URLs, read references/搜索公众号文章链接.md. Use direct terminal search and validate every candidate URL before running the pipeline.
Do not rely on subagents to invent or collect WeChat URLs. Generated mp.weixin.qq.com links are often invalid, and failed downloads waste time.
Markdown Quality
The pipeline includes post-processing for common WeChat HTML edge cases:
- •Preserve blank-language code fences so the user can add language tags manually.
- •Add missing GFM table separator rows.
- •Merge orphan list markers with their list item text.
- •Merge orphan blockquote markers with their quote text.
- •Remove common WeChat noise such as QR prompts, preview labels, and read-original prompts.
For maintenance details, read references/formatting-edge-cases.md.
Project Defaults
For project-specific output paths or quality rules, read references/用户环境配置.md if it exists and is relevant. Keep that file free of secrets and machine-specific private data before publishing this skill.
Failure Signals
| Signal | Action |
|---|---|
| Script rejects the URL | Ask for a valid WeChat article URL |
| Request fails or requires login | Explain that the article is inaccessible from the current environment |
Title is 未命名文章 | Treat as invalid extraction and remove the failed folder |
| Missing local images | Keep the Markdown clean; missing image references are removed by formatter |
| Tables/lists/quotes render incorrectly | Update the formatter and document the case in references/formatting-edge-cases.md |
Install & Usage
mkdir -p .claude/skillsmkdir -p .claude/skills && curl -o .claude/skills/wechat-article-to-md-skill.md https://raw.githubusercontent.com/Yui-cx/wechat-article-to-md-skill/main/SKILL.md/wechat-article-to-md-skillSecurity Audits
Frequently Asked Questions
What is wechat-article-to-md-skill?
Convert WeChat Official Account articles into local Markdown archives with downloaded images and cleaned GFM formatting. Use when the user provides an mp.weixin.qq.com or weixin.qq.com article URL, asks to save/download/archive a WeChat public article, convert a WeChat article to Markdown, preserve article images locally, or find and save WeChat Official Account articles from search results.
How to install wechat-article-to-md-skill?
To install wechat-article-to-md-skill: create the skills directory (mkdir -p .claude/skills), then run: mkdir -p .claude/skills && curl -o .claude/skills/wechat-article-to-md-skill.md https://raw.githubusercontent.com/Yui-cx/wechat-article-to-md-skill/main/SKILL.md. Finally, /wechat-article-to-md-skill in Claude Code.
What is wechat-article-to-md-skill best for?
wechat-article-to-md-skill is a skill categorized under General. Created by Yui-cx.