Preface¶
A common workflow for publishing technical articles on WeChat Official Accounts (公众号) is: write in Markdown locally, then copy into the editor to adjust formatting, upload images one by one, and prepare a cover image separately. The WeChat admin backend also imposes requirements on HTML and image domains; manual alignment often leads to missed steps. If you are already drafting articles with an Agent in environments like Cursor or Claude Code, you’d prefer to send the finished draft to the drafts box with a single instruction, instead of setting up another publishing script.
Below is a community Skill on SkillHub: “WeChat Official Account Publishing Skill” (located at @user_cc41bf5e/wechat-mp-publish, version v1.0.0). It chains Markdown rendering, image upload, permanent cover material, and draft creation into a single pipeline.
What is this¶
The WeChat Official Account Publishing Skill is an Agent Skill for content creation, maintained by the community publisher user_cc41bf5e. On SkillHub, it is categorized under content-creation and labeled as community.
In one sentence: it pushes Markdown articles to the WeChat Official Account drafts box, supports automatic upload of in-article images, uploads the cover image via the permanent material API, and renders Markdown into HTML compatible with WeChat. Within conversations, trigger phrases like “推送公众号”, “发布公众号”, or “发到微信” can invoke the relevant workflow. The SkillHub page notes requires_api_key=true; the actual credentials correspond to the WeChat Official Accounts platform’s AppID and AppSecret (see configuration below).
Skill details and installation entry:
- API endpoint: https://api.skillhub.cn/user_cc41bf5e/wechat-mp-publish
- SkillHub page: https://www.skillhub.cn/skills/user_cc41bf5e/wechat-mp-publish
(SkillHub fetched data: rating 100000, downloads 1791, installations 26.)
Core capabilities¶
The following capabilities are described in the Skill’s SKILL.md and documentation. You can trim them as needed.
- access_token: automatic acquisition and refresh, with credentials configurable via environment variables.
- In-article images: scan images in the article and upload them to the WeChat CDN, replacing them with usable URLs.
- Cover image: upload the cover via the permanent material API (the documentation stresses that the cover must use a permanent material; otherwise, creating a draft may fail).
- Markdown → HTML: render into HTML suitable for the WeChat Official Account, along with HTML sanitization scripts.
- Drafts: call APIs to create a draft in the Official Account drafts box, rather than directly mass-posting (群发).
The processing order in the Skill documentation is summarized as: access_token → upload images → upload cover → create draft.
The main scripts included in the Skill package are publish.py, token_manager.py, image_uploader.py, cover_uploader.py, html_renderer.py, html_sanitizer.py, config.py, etc. The Agent or local command line will execute around these scripts.
Installation and activation¶
Install to Agent via SkillHub CLI¶
The official SkillHub installation guide is at: https://skillhub.cn/install/skillhub.md
First, check whether skillhub is already available on your machine:
command -v skillhub && skillhub --version
If it’s not installed, follow the SkillHub documentation for a complete installation (CLI + default Skill):
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash
When installing this Skill, you must use --dir to point to the current Agent’s skills directory; otherwise it defaults to ./skills/ and may not be recognized. Common paths given in the SkillHub documentation:
- Cursor:
~/.cursor/skills/ - Claude Code:
~/.claude/skills/ - Codex:
~/.codex/skills/or.agents/skills/under the project
Taking Cursor as an example, the installation command is:
skillhub install @user_cc41bf5e/wechat-mp-publish --dir ~/.cursor/skills/
Alternatively, you can ask the Agent in conversation to install @user_cc41bf5e/wechat-mp-publish per https://skillhub.cn/install/skillhub.md.
Runtime dependencies and credentials¶
The Skill’s README states that running the scripts locally requires a Python environment and the requests library:
pip install requests
Configuration on the WeChat Official Accounts platform (three steps in SKILL.md):
- On the WeChat Official Accounts Platform, under Settings & Development → Basic Configuration, obtain AppID and AppSecret (AppSecret is typically shown in full only once; save it securely).
- In the same developer configuration area, add the public IP of the machine calling the APIs to the IP whitelist; the Skill documentation suggests checking your public IP via https://ip.sb or https://ifconfig.me.
- Inject environment variables:
export WECHAT_APPID="your_appid"
export WECHAT_APPSECRET="your_appsecret"
Or use the configuration script under the Skill directory (it generates config.json under scripts/; the documentation requires that it must not be committed to version control):
python scripts/config.py <AppID> <AppSecret>
Typical usage¶
In Agent conversations¶
After installing and configuring credentials, tell the Agent the article path, title, author, digest, and cover image you want to push, and use trigger phrases like “推送公众号”, “发布公众号”, or “发到微信”. The Agent will follow the workflow in SKILL.md and call scripts like scripts/publish.py to complete uploads and draft creation.
Publish directly via the command line¶
In the Skill installation directory (e.g., ~/.cursor/skills/@user_cc41bf5e/wechat-mp-publish/), you can explicitly call the publishing script. For content, it’s recommended to pass the path to a Markdown file; the script will read the file content:
python scripts/publish.py \
--title "Article Title" \
--content "/path/to/article.md" \
--author "Author Name" \
--digest "Digest (auto-extracted if omitted)" \
--cover "/path/to/cover.jpg"
After the above steps, the finished article should appear in the drafts box of the Official Account backend. You can then preview and mass-post (群发) on the WeChat side (whether mass-posting is allowed depends on the account type and platform permissions).
Use cases and notes¶
Who it’s for
- Those who prefer writing in Markdown and want to reduce manual formatting in the Official Account editor.
- Those already using Skills in environments like Cursor / Claude Code, and want the publishing action to happen in the same conversation as drafting.
- Those comfortable with a workflow of “into the drafts box first, then confirm in the backend” (the Skill explicitly targets the drafts box).
Limitations and precautions
- Personal subscription accounts (个人订阅号): the Skill documentation states that it supports pushing to the drafts box; it does not support direct mass-posting, data APIs such as reading reading-count/user analytics, or some “published” related APIs; full capabilities typically require platform permissions such as a certified service account (认证服务号).
- Cover and images: the cover must go through permanent materials; in-article images are uploaded to the CDN by the tool and do not require manually changing URLs, but you still need to ensure the image files are readable and the paths are correct.
- Sensitive files: do not commit
scripts/config.json,token_store.json, etc., to Git; the Skill package includes.gitignorereminders. - Network and IP: access_token and upload APIs are subject to WeChat’s IP whitelist; if you change machines or outbound IP, update the whitelist accordingly.
Closing¶
The WeChat Official Account Publishing Skill consolidates finished Markdown, HTML rendering, image and cover handling, and draft creation into a reproducible pipeline. It’s a good fit as a content-creation tool on SkillHub to integrate into a writing Agent. Installation and coordinates are based on SkillHub: https://www.skillhub.cn/skills/user_cc41bf5e/wechat-mp-publish, API entry: https://api.skillhub.cn/user_cc41bf5e/wechat-mp-publish.