agentleFS
lingengyuanlingengyuan/my-skills/.claude/skills/wechat2md/SKILL.md

wechat2md

Skill9 starsChanged 3 days agoMITView on GitHub

Convert WeChat Official Account articles and topic albums (mp.weixin.qq.com) to local Markdown files with downloaded images. Use when converting WeChat articles, saving WeChat albums, downloading article content, or extracting Markdown from WeChat URLs.

  • Installs packages

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use wechat2md_v2.py for single articles.

    line 22
  2. Very specific:

    Use wechat2md.py with --album to batch-download all articles in a WeChat collection (auto-detected if URL contains /mp/appmsgalbum):

    line 35
  3. Distinctive:

    Image failure handling: If an individual image fails to download, keep the remote URL and log a warning.

    line 85
  4. Very specific:

    Metadata preservation: Always preserve original publishing timestamp, author name, and source URL in frontmatter or meta.json.

    line 87
  5. Distinctive:

    Before completing the task, verify:

    line 91

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

WeChat to Markdown Skill

Convert WeChat Official Account web articles and albums into local Markdown with downloaded images. Standard Markdown syntax is assumed knowledge.

Setup

Python 3.8+ and curl in PATH are required. Install dependencies in the Skill directory:

pip install -r "<skill-dir>/requirements.txt"

Workflows

1. Convert Single Article

Use wechat2md_v2.py for single articles. It creates an isolated asset directory with downloaded images and metadata:

python3 "<skill-dir>/tools/wechat2md_v2.py" "<article-url>"

Custom output paths:

python3 "<skill-dir>/tools/wechat2md_v2.py" "<article-url>" --output-dir "outputs" --target-folder "20-阅读笔记" --slug "custom-slug"

2. Convert Topic Album

Use wechat2md.py with --album to batch-download all articles in a WeChat collection (auto-detected if URL contains /mp/appmsgalbum):

python3 "<skill-dir>/tools/wechat2md.py" "<album-url>" --album

Optional settings (output path template, slug format, tags) are configured via config.json in this Skill's directory. See references/config.md.

CLI Reference

wechat2md_v2.py (Single Article)

ArgumentTypeDefaultDescription
urlstring (positional)requiredWeChat article URL
--output-dirstringoutputsBase output directory
--target-folderstring20-阅读笔记Target folder within output directory
--slugstringauto from titleCustom directory slug

wechat2md.py (Album / Batch Mode)

ArgumentTypeDefaultDescription
urlstring (positional)requiredWeChat article or album URL
--albumboolean flagoptionalForce album mode (auto-detected if URL contains /mp/appmsgalbum)

Output Package Structure

Single Article

outputs/<target-folder>/<slug>/
├── article.md          # Converted article in clean Markdown
├── images/             # Downloaded local images (if present)
└── meta.json           # Article metadata (title, author, url, asset_id)

Album Collection

outputs/<target-folder>/<album-name>/
├── _index.md           # Album table of contents
└── 001-<article-title>/
    ├── article.md      # Article Markdown
    └── images/         # Local images

Guidelines

  • Relative paths: Rewrite image tags in article.md to relative paths (images/001.jpg).
  • Image failure handling: If an individual image fails to download, keep the remote URL and log a warning. Do not terminate the conversion.
  • Album continuity: In album mode, continue downloading remaining articles if an individual article fails. Record failed items in _index.md.
  • Metadata preservation: Always preserve original publishing timestamp, author name, and source URL in frontmatter or meta.json.

Validation Checklist

Before completing the task, verify:

  1. article.md exists and contains readable article text.
  2. Image links in article.md point to local files in the images/ directory.
  3. Downloaded image files exist on disk and have non-zero size.
  4. For albums, _index.md lists all successfully downloaded chapters and any failed URLs.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.