Preface¶
When using AI to write articles for WeChat Official Accounts, the latter half of the process often gets stuck on formatting and publishing: pasting Markdown into the editor loses styles, third-party formatting tools have fixed themes, and manually copying HTML into the backend is time-consuming. To achieve a flow of “Finish MD → Render with Custom Theme → Directly into Draft Box,” the rendering service and WeChat Official Account API need to be connected into an Agent-executable pipeline. The following introduces how the Official Account Formatting skill (Coordinate: @user_5223609c/md-to-wechat) on SkillHub handles this pipeline.
What is this¶
The Official Account Formatting skill is an Agent Skill published by the community (Version 1.0.0, Category content-creation). It renders local Markdown into WeChat-compatible HTML using themes configured in a formatting service and calls the Official Account API to write to the draft box. The rendering side relies on an account and Theme ID from feishu2weixin.maolai.cc; the pushing side uses the Official Account AppID / AppSecret found in the local .env. The SkillHub page marks requires_api_key=true, which corresponds to the aforementioned credentials and account configuration, rather than a single third-party LLM Key.
Core Functions¶
Based on the SkillHub description and the SKILL.md in the repository, verified capabilities include:
- Themed Rendering: Background color, rounded corners, titles, code blocks, image borders and shadows, ordered/unordered lists, etc., can be customized on the website side and bound to the push result via
THEME_ID. - One-step Publishing Script: Uses
scripts/publish.cjsto complete rendering and pushing without needing to save HTML locally (Requires Node.js 18+, script is CommonJS, with zero external npm dependencies). - Agent Trigger Convention: When a user expresses intents like “Push this article to the Official Account,” “Publish to WeChat Official Account,” “Push draft,” or “Sync to Official Account draft box,” the Skill requires the Agent to proactively follow this workflow, rather than just generating formatting instructions.
- Auxiliary Query:
scripts/list_themes.cjscan list theme names and IDs under the account for easy verification of.env. - Runtime Cache: A
.cache.jsonfile is automatically generated in the directory to cache uploaded images and reduce redundant uploads.
Installation and Activation¶
Install via SkillHub¶
The installation prompt provided on the SkillHub skill page is: Install coordinate @user_5223609c/md-to-wechat according to the SkillHub Installation Guide.
If the skillhub CLI is already installed on the machine, the --dir flag must be used during installation to point to the current Agent’s skills directory; otherwise, it defaults to ./skills/ and may not be recognized. Common paths for Cursor are ~/.cursor/skills/, or you can use .cursor/skills/ within the project. Example:
command -v skillhub && skillhub --version
skillhub install user_5223609c/md-to-wechat --dir ~/.cursor/skills/
If the CLI is not installed, you can execute the following according to the official documentation:
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash
Manual Installation¶
The publisher provides the GitHub path in the introduction: https://github.com/maolai7/agent-skills/tree/main/md-to-wechat. If GitHub is inaccessible, you need to obtain the skill package according to the publisher’s SkillHub / Official Account instructions and place the directory into the Agent’s skills folder.
First-time Configuration¶
After installation, edit .env in the directory where SKILL.md is located (denoted as <SKILL_DIR>). references/setup.md requires at least the following fields:
ACCOUNT=Your feishu2weixin login email or phone number
THEME_ID=Theme ID created or selected at https://feishu2weixin.maolai.cc
WECHAT_APP_ID=Official Account AppID
WECHAT_APP_SECRET=Official Account AppSecret
Optional fields include AUTHOR_NAME (default author), WECHAT_DEFAULT_COVER (Cover URL when there is no image in the body). The Theme ID can be copied from “My Themes” on the website, or by executing:
node "<SKILL_DIR>/scripts/list_themes.cjs"
The WeChat Official Account Platform requires the IPv4 address of the machine calling the API to be added to the API IP whitelist in Settings & Development → Basic Configuration; if the network changes and the IP changes, it must be re-added, otherwise, it will return 40164.
Typical Usage¶
Push after Human Confirmation (Recommended Flow)¶
The Skill stipulates that the Agent first checks if .env is filled in, then locates the absolute path of the Markdown. For the first push or when the whitelist is unverified, run without --confirmed first to print the local public IP, and have the user confirm the IP, title, author, and cover in one go:
node "<SKILL_DIR>/scripts/publish.cjs" --file "/path/to/article.md"
After user confirmation, perform the formal push:
node "<SKILL_DIR>/scripts/publish.cjs" \
--file "/path/to/article.md" \
--confirmed \
--title "Article Title" \
--author "Author Name" \
--cover "https://example.com/cover.jpg"
On success, the script outputs JSON containing fields like success, media_id, title, etc.; subsequently, check the Draft Box in the Official Account backend.
Cover Priority (Instructions within the Skill): First image in the body MD → WECHAT_DEFAULT_COVER in .env → if neither exists, the user must provide it via --cover, otherwise the push fails.
Trigger in Conversation¶
After configuration is complete, simply tell the Agent “Push this article to the Official Account” and attach or @ reference the MD file; the Agent should read this Skill’s SKILL.md and execute steps accordingly, rather than just outputting HTML fragments.
Suitable Scenarios and Notes¶
Suitable for: Users already writing drafts in Markdown locally or in repos; need to fine-tune themes on feishu2weixin for long-term reuse; hope for Cursor or similar Agents to complete “Rendering + Draft Box” instead of manual pasting into the backend.
Limitations and Notes:
- Must have a WeChat Official Account with callable APIs, and complete AppID, AppSecret, and IP whitelist configuration.
- Rendering styles depend on website-side themes, not pure local CSS; incorrect
ACCOUNT/THEME_IDwill manifest asapi_error, which can be troubleshooted usinglist_themes.cjs. - Pushing originates from the local machine or the environment running the Agent; the public IP must match the whitelist.
- SkillHub Statistics (Based on skill page scraping): Rating 100000, Downloads ~27984, Installs ~179; Tags include
requires_api_key=true. Please keep.envsecure before deployment and do not commit it to version control.
For more complete steps on configuring images, see the publisher’s Official Account article: 《I Decided to Open Source the Official Account Formatting skill: Connecting the Last Kilometer of AI Writing for Official Accounts》.
Conclusion¶
The Official Account Formatting skill encapsulates “Custom Theme Rendering” and “WeChat Draft Box API” into an Agent-executable publish.cjs workflow, suitable for changing the second half of AI writing from copy-pasting to a single command. Installation and coordinates are subject to SkillHub:
- API / Installation Entry: https://api.skillhub.cn/user_5223609c/md-to-wechat
- SkillHub Skill Page: https://www.skillhub.cn/skills/user_5223609c/md-to-wechat
- Coordinate:
@user_5223609c/md-to-wechat