Md2wechat-skill md2wechat
Convert Markdown to WeChat Official Account HTML. Use this whenever the user wants WeChat article conversion, draft upload, image generation for articles, cover or infographic generation, image-post creation, writer-style drafting, AI trace removal, or needs to inspect supported providers, themes, and prompt templates before running the workflow.
install
source · Clone the upstream repo
git clone https://github.com/geekjourneyx/md2wechat-skill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/geekjourneyx/md2wechat-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/md2wechat" ~/.claude/skills/geekjourneyx-md2wechat-skill-md2wechat && rm -rf "$T"
manifest:
skills/md2wechat/SKILL.mdsource content
MD to WeChat
Use
md2wechat when the user wants to:
- convert Markdown into WeChat Official Account HTML
- inspect resolved article metadata, readiness, and publish risks before conversion
- generate a local preview artifact or upload article drafts
- inspect live capabilities, providers, themes, and prompts
- generate covers, infographics, or other article images
- create image posts
- write in creator styles or remove AI writing traces
Intent Routing
Choose the command family before doing any publish action:
- Use
/convert
/inspect
when the user wants a standard WeChat article draft (preview
), HTML conversion, article metadata, article preview, or a draft that needsnews
.--cover - Use
when the user sayscreate_image_post
,小绿书
,图文笔记
,图片消息
,newspic
, or asks to publish an image-first post rather than an article HTML draft.多图帖子 - Do not route
/小绿书
requests to图文笔记
just because the user also has a Markdown article. A Markdown file can still be the image source forconvert --draft
.create_image_post -m article.md - Treat
andconvert --draft
as different publish targets, not interchangeable command variants.create_image_post
Defaults And Config
- Assume
is already available onmd2wechat
.PATH - Draft upload and publish-related actions require
andWECHAT_APPID
.WECHAT_SECRET - Image generation may require extra provider config in
.~/.config/md2wechat/config.yaml
defaults toconvert
mode unless the user explicitly asks forapi
.--mode ai- Check config in this order:
~/.config/md2wechat/config.yaml- environment variables such as
MD2WECHAT_BASE_URL - project-local
,md2wechat.yaml
, ormd2wechat.ymlmd2wechat.json
- If the user asks to switch API domain, change
orapi.md2wechat_base_url
.MD2WECHAT_BASE_URL - Treat live CLI discovery output as the source of truth. Do not guess provider names, theme names, or prompt names from repository files alone.
Discovery First
Run these before selecting a provider, theme, or prompt:
md2wechat version --json md2wechat capabilities --json md2wechat providers list --json md2wechat themes list --json md2wechat prompts list --json md2wechat prompts list --kind image --json md2wechat prompts list --kind image --archetype cover --json
Inspect a specific resource before using it:
md2wechat providers show openrouter --json md2wechat providers show volcengine --json md2wechat themes show autumn-warm --json md2wechat prompts show cover-default --kind image --json md2wechat prompts show cover-hero --kind image --archetype cover --tag hero --json md2wechat prompts show infographic-victorian-engraving-banner --kind image --archetype infographic --tag victorian --json md2wechat prompts render cover-default --kind image --var article_title='Example' --json
When choosing image presets, prefer the prompt metadata returned by
prompts show --json, especially primary_use_case, compatible_use_cases, recommended_aspect_ratios, and default_aspect_ratio.
When choosing an image model, prefer providers show <name> --json and read supported_models before hard-coding --model.
Core Commands
Configuration:
md2wechat config initmd2wechat config show --format jsonmd2wechat config validate
Conversion:
md2wechat inspect article.mdmd2wechat preview article.mdmd2wechat convert article.md --previewmd2wechat convert article.md -o output.htmlmd2wechat convert article.md --draft --cover cover.jpgmd2wechat convert article.md --mode ai --theme autumn-warm --previewmd2wechat convert article.md --title "新标题" --author "作者名" --digest "摘要"
Image handling:
md2wechat upload_image photo.jpgmd2wechat download_and_upload https://example.com/image.jpgmd2wechat generate_image "A cute cat sitting on a windowsill"md2wechat generate_image --preset cover-hero --article article.md --size 2560x1440md2wechat generate_cover --article article.mdmd2wechat generate_infographic --article article.md --preset infographic-comparisonmd2wechat generate_infographic --article article.md --preset infographic-dark-ticket-cn --aspect 21:9md2wechat generate_infographic --article article.md --preset infographic-handdrawn-sketchnote
Drafts and image posts:
md2wechat create_draft draft.jsonmd2wechat test-draft article.html cover.jpgmd2wechat create_image_post --helpmd2wechat create_image_post -t "Weekend Trip" --images photo1.jpg,photo2.jpgmd2wechat create_image_post -t "Travel Diary" -m article.mdecho "Daily check-in" | md2wechat create_image_post -t "Daily" --images pic.jpgmd2wechat create_image_post -t "Test" --images a.jpg,b.jpg --dry-run
Writing and humanizing:
md2wechat write --listmd2wechat write --style dan-koemd2wechat write --style dan-koe --input-type fragment article.mdmd2wechat write --style dan-koe --cover-onlymd2wechat write --style dan-koe --covermd2wechat write --style dan-koe --humanize --humanize-intensity aggressivemd2wechat humanize article.mdmd2wechat humanize article.md --intensity aggressivemd2wechat humanize article.md --show-changesmd2wechat humanize article.md -o output.md
Article Metadata Rules
For
convert, metadata resolution is:
- Title:
->--title
-> first Markdown heading ->frontmatter.title未命名文章 - Author:
->--authorfrontmatter.author - Digest:
->--digest
->frontmatter.digest
->frontmatter.summaryfrontmatter.description
Limits enforced by the CLI:
: max 32 characters--title
: max 16 characters--author
: max 128 characters--digest
Draft behavior:
- If digest is still empty when creating a draft, the draft layer generates one from article HTML content with a 120-character fallback.
- Creating a draft requires either
or--cover
.--cover-media-id
is a local image path contract for article drafts.--cover
is for an existing WeChat permanent cover asset. Do not assume a WeChat URL or--cover-media-id
URL can be reused asmmbiz.qpic.cn
.thumb_media_id
is the source-of-truth command for resolved metadata, readiness, and checks.inspect
v1 writes a standalone local HTML preview file. It does not start a workbench, write back to Markdown, upload images, or create drafts.preview
is still the convert-path preview flag; it is not the same thing as the standaloneconvert --preview
command.preview
is degraded confirmation only; it must not be treated as final AI-generated layout.preview --mode ai
/--title
/--author
affect draft metadata, not necessarily visible body HTML.--digest- Markdown images are only uploaded/replaced during
or--upload
, not during plain--draft
.convert --preview
Agent Rules
- Start with discovery commands before committing to a provider, theme, or prompt.
- Route by publish target first: article draft =>
; image post / 小绿书 / newspic =>convert
.create_image_post - Prefer the confirm-first flow for article work:
->inspect
->preview
/convert
.--draft - If the user says
,小绿书
,图文笔记
,图片消息
, or asks for a multi-image post, prefernewspic
even when the source content lives in Markdown.create_image_post - Prefer
orgenerate_cover
over a rawgenerate_infographic
call when a bundled preset fits the task.generate_image "prompt" - Validate config before any draft, publish, or image-post action.
- If draft creation returns
, check digest/summary/description before assuming the body content is too long.45004 - If the user asks for AI conversion or style writing, be explicit that the CLI may return an AI request or prompt rather than final HTML or prose unless the workflow completes the external model step.
- Do not perform draft creation, publishing, or remote image generation unless the user asked for it.
Safety And Transparency
- Reads local Markdown files and local images.
- May download remote images when asked.
- May call external image-generation services when configured.
- May upload HTML, images, drafts, and image posts to WeChat when the user explicitly requests those actions.