Introduction¶
The common workflow for writing WeChat Official Account (公众号) articles involves drafting in Markdown locally, manually adding illustrations, uploading images to the media library, and finally pasting and formatting them in the backend. The number of illustrations often needs to be adjusted based on the chapter structure, and local image paths must be replaced with WeChat CDN addresses to prevent blank displays in the body text. If you are already using an Agent to write, you might want to consolidate the process of “Image Generation → Rendering → Uploading → Draft Box Submission” into a reproducible command chain. Below is an introduction to the WeChat Article Content Generation & Publishing (@user_d369ea45/wechat-article-gen, v1.0.3) Skill on SkillHub.
What is this¶
WeChat Article Content Generation & Publishing is a community Skill on SkillHub (Publisher: user_d369ea45, Category: content-creation), located at @user_d369ea45/wechat-article-gen. The official description is: Smart illustration for WeChat articles + one-click publishing; based on wenyan-cli, it supports automatic uploading of local images to the WeChat CDN.
It targets scenarios where you “already have a Markdown draft and need to add illustrations and publish to the Official Account draft box.” It encapsulates the Jimeng AI image generation script and wenyan publish within the same Skill directory, guided by the Agent executing according to SKILL.md.
Core Features¶
The following capabilities are derived from the SKILL.md and script descriptions within the Skill package.
- Smart Illustration:
generate_images.pyanalyzes the article structure to generate 1 to 4 16:9 illustrations based on the number of chapters. Content images have rounded corners; the cover is generated in a 2.35:1 ratio. - One-click Publishing:
publish.shcallswenyan publishto complete Markdown rendering, upload local/web images to the WeChat CDN, replace them withdata-srcaddresses, and push them to the draft box. - Typography Themes: Supports themes like
lapis,phycat,default, as well as code highlighting styles likesolarized-light,monokai, andgithub. You can usewenyan theme -lto view all themes. - Credentials and Loading: WeChat and Jimeng credentials are written in
config.envwithin the Skill directory, or provided via theexportformat in the OpenClaw workspaceTOOLS.md;setup.sh/publish.shwill read them based on priority.
The SkillHub tag is requires_api_key=true. In practice, both Jimeng AI and WeChat Official Account keys need to be configured (see below).
Installation and Activation¶
Installing the Skill via SkillHub¶
First, ensure the skillhub CLI is available on your machine (see the SkillHub Installation Documentation for installation methods). When installing the Skill, you must use --dir to point to the current Agent’s skills directory; otherwise, installing to the default ./skills/ might not be recognized.
Example for Cursor:
skillhub install @user_d369ea45/wechat-article-gen --dir ~/.cursor/skills/
For Claude Code, Codex, and other clients, the paths differ. Common directories are ~/.claude/skills/, ~/.codex/skills/, or .agents/skills/ within the project. Simply change the --dir in the installation command to the corresponding path.
You can also ask the Agent in the conversation to install it according to the official prompt:
Please install `@user_d369ea45/wechat-article-gen` based on https://skillhub.cn/install/skillhub.md.
Dependencies and Credentials¶
The Skill Quick Start requires global installation of wenyan-cli:
npm install -g @wenyan-md/cli
Edit config.env in the Skill directory (this file is provided directly in the current v1.0.3 package; SKILL.md Quick Start also mentions cp config.env.example config.env, if you only have config.env locally, just edit it directly):
Key fields to fill in (excerpted from config.env):
JIMENG_ACCESS_KEY_ID=your_access_key_id
JIMENG_SECRET_ACCESS_KEY=your_secret_access_key
WECHAT_APP_ID=your_app_id
WECHAT_APP_SECRET=your_app_secret
Source of credentials:
- WeChat Official Account: https://mp.weixin.qq.com/ → Settings & Development → Basic Configuration
- Jimeng AI / Volcano Engine Access Key: https://console.volcengine.cn/
Before publishing, you also need to add the public IP of the running environment to the Official Account IP Whitelist, otherwise you may encounter error code 45166. You can use curl ifconfig.me to check your machine’s public IP.
Typical Usage¶
1. Prepare Markdown with frontmatter¶
The top of the file must include title and cover:
---
title: Article Title (Required)
cover: ./cover.png
---
# Body Text

2. Generate Illustrations¶
Execute in the Skill directory (adjust the path relative to where you store article.md):
python3 scripts/generate_images.py --article article.md --output ./images/
Correspondence between the number of illustrations and chapters (Rules from Skill documentation):
| Number of Chapters | Number of Images | Ratio |
|---|---|---|
| 6 or more sections | 4 images | 16:9 |
| 4~5 sections | 3 images | 16:9 |
| 2~3 sections | 2 images | 16:9 |
| 1 section | 1 image | 16:9 |
3. Publish to Draft Box¶
./scripts/publish.sh article.md
./scripts/publish.sh article.md phycat
./scripts/publish.sh article.md lapis solarized-light
To only render and not publish, you can use wenyan-cli directly:
wenyan render -f article.md -t lapis
After successful publication, check the draft box at https://mp.weixin.qq.com/; the Skill documentation mentions there may be a few seconds of delay with the API.
Use Cases and Notes¶
Who is it for
- Already using Markdown to manage Official Account drafts and want the Agent to complete illustration and publishing via fixed scripts.
- Have enabled Official Account developer configuration and Jimeng AI, and accept maintaining keys in
config.envorTOOLS.md. - Willing to rely on wenyan-cli’s themes and WeChat CDN upload logic rather than manually pasting HTML in the backend.
Limitations and Common Pitfalls
- If
@wenyan-md/cliis not installed, it will reportwenyan: command not found;publish.shwill attemptnpm install -gfor automatic installation. - Missing
titleorcoverin frontmatter will result in errors like “Article cover not found”. - IP not in whitelist or incorrect AppID/AppSecret will cause publishing failures; incorrect Jimeng credentials will cause illustration errors (the documentation also mentions a historical bug with rounded corner processing, so keep
generate_images.pyas the latest version from the Skill package). - This Skill outputs a Draft Box workflow; mass sending, scheduled publishing, etc., still need to be operated in the Official Account backend.
- When a user requests “Do not do Official Account HTML layout”, distinguish that: this Skill’s layout is done by wenyan themes; if you only need a plain manuscript, use
wenyan renderor a--no-publishworkflow, do not force the publishing script.
Conclusion¶
WeChat Article Content Generation & Publishing strings together Jimeng illustration, wenyan-cli rendering, and WeChat CDN uploading into a scriptable process, suitable for pushing from a Markdown file to the draft box within an Agent session. Installation and instructions are subject to SkillHub and the SKILL.md within the package.
- SkillHub Page: https://www.skillhub.cn/skills/user_d369ea45/wechat-article-gen
- Installation Coordinate:
@user_d369ea45/wechat-article-gen(v1.0.3)