BeClaude

wechat-article-to-md-skill

New
2GitHub TrendingGeneralby Yui-cx

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.

First seen 5/26/2026

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:

bash
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:

bash
python scripts/wechat_article_pipeline.py "<wechat_article_url>" --output-dir "./articles" --save-html

Use python3 instead of python when that is the active Python command on the machine.

Workflow

  1. Confirm the URL is from mp.weixin.qq.com or weixin.qq.com.
  2. Run scripts/wechat_article_pipeline.py with the requested output directory.
  3. Inspect the command summary. If the title is 未命名文章, treat the link as invalid or inaccessible and remove that failed output folder.
  4. Spot-check the Markdown for table separators, image links, list formatting, blockquotes, and code fences.
  5. Report the output directory and Markdown file path to the user.

Output

The script creates a numbered article folder under the output root:

text
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

ArgumentPurposeDefault
<url>WeChat article URLRequired
--output-dirOutput root directory{workspace}/articles
--workspace-dirWorkspace used to resolve default outputAuto-detected
--save-htmlSave cleaned source.htmlOff
--timeoutHTTP timeout in seconds30

Workspace auto-detection order:

  1. --workspace-dir
  2. WORKSPACE_DIR, PROJECT_ROOT, or CLAUDE_WORKSPACE
  3. Current working directory

Dependencies

Requires Python 3.9+ and requests:

bash
pip install requests

Searching 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

SignalAction
Script rejects the URLAsk for a valid WeChat article URL
Request fails or requires loginExplain that the article is inaccessible from the current environment
Title is 未命名文章Treat as invalid extraction and remove the failed folder
Missing local imagesKeep the Markdown clean; missing image references are removed by formatter
Tables/lists/quotes render incorrectlyUpdate the formatter and document the case in references/formatting-edge-cases.md

Install & Usage

1
Create the skills directory
mkdir -p .claude/skills
2
Download the skill file
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
3
Invoke in Claude Code
/wechat-article-to-md-skill
View source on GitHub

Security Audits

LicenseUnknownSourceWarnRepositoryPass

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.