Technology ·
Turning WeChat Article Layout into an Open-Source Skill
This is a text edition. Images, polls and embedded content from the original are not yet included; see the original source below.
OPEN SOURCE · SKILL
I turned WeChat article formatting into an open-source skill
Let an AI agent write WeChat-compatible HTML, manage drafts, and publish only after a second confirmation. You can format articles without credentials.
In one sentence: This is a ZCode / Codex skill called wechat-publisher. It formats what you write into attractive, WeChat-safe HTML you can copy into the editor and publish; with credentials configured, the agent can also manage drafts and publish for you.
The most tedious part of writing for a WeChat public account is not writing but formatting. The editor has many HTML/CSS restrictions: external stylesheets do not work, classes cannot be used, images must be uploaded manually, and font sizes and line spacing must be adjusted by hand. Paste in AI-generated content and the formatting often breaks.
This skill is meant to solve that problem.
01
Formatting: works without credentials
Component-based HTML · static SVG · mobile preview
You do not need a verified public account or API credentials. The skill includes five visual recipes (opinion and people, data analysis, case study and method, product and technology, news and signals), chosen according to the article rather than applying the same template by default.
All components use WeChat-safe inline styles, without relying on style tags, classes, or scripts. Charts and flowcharts favor static inline SVG: crisp vectors that do not use the image quota.
BEFORE · Manual formatting
Adjust font sizes and line spacing in the editor, upload images one by one, have WeChat repeatedly filter out styles, and start over when the formatting breaks.
AFTER · With the skill
Say one sentence → the agent chooses a recipe, generates compatible HTML, previews it locally, and gives you something ready to copy and publish.
02
Publishing: the entire draft lifecycle
Official API · image upload · second confirmation
If your public account is verified, configure its AppID / AppSecret and the skill can use the official API to help you:
A Upload article images, generate a cover, and automatically replace them with WeChat URLs.
B Create, view, update, and delete drafts.
C Publish formally—never automatically. Before submission, you must explicitly confirm it in the conversation.
Creating a draft is never the same as publishing. Publication is a public act and requires a fresh, explicit affirmative confirmation immediately beforehand.
03
Guided setup from scratch
It is fine if you do not know where to find your AppID.
First-time setup and unsure where to get your AppID / AppSecret or how to configure the IP allowlist? The skill includes an onboarding guide in four steps:
Step 1 Get the AppID and AppSecret from Basic Configuration in the public-account backend.
Step 2 Add the machine’s public IP to the API allowlist.
Step 3 Copy .env.example → .env and enter the credentials.
Step 4 Run a --list command to verify the connection.
An unverified public account is fine too: onboarding checks the account type; without API permissions it directs you back to the formatting-only workflow, where you copy the HTML into the editor and publish manually.
One-step setup
Send the following to any ZCode / Codex agent, and it will explain, install, and configure the skill:
Help me set up this skill:
https://github.com/KerryChia/wechat-publisher Clone it into the skills directory. Read SKILL.md and README.md to learn the formatting and publishing workflow. When credentials are needed, guide me through filling in .env; do not guess or echo the Secret. Once installed, tell me which commands I can use.
Three things you can do after reading
01 Open the GitHub repository and Star it for later.
02 Send that setup prompt to your agent and let it install the skill.
03 Write an article, try formatting it, and copy it into the editor to see the result.
A final note
This skill was itself used to format this article—the layout you are looking at right now was generated with its own workflow. A tool that can format its own promotional article is a kind of closed loop.
MIT open source · contains no keys · local .env under your control
LINKS
GitHub: github.com/KerryChia/wechat-publisher
(Click Read original below.) Example output: mp.weixin.qq.com/s/FkVIBPVkB0hm_jmXqWEHdQ
#OpenSource #WeChatArticleFormatting #AITools #ZCode Also, this article was made with the skill.