WeChat Official Account Article Publishing Tool: Publishing Markdown via Wenyan CLI

Preface

WeChat Official Account backends have fixed requirements for layout, cover images, and media assets. Many teams write drafts locally in Markdown and then manually paste them or use scattered scripts to convert them to HTML. This involves multiple intermediate steps, and it is easy to miss items like covers, image uploads, and Frontmatter. Below is an introduction to the “WeChat Official Account Article Publishing Tool” on SkillHub: it encodes the publishing workflow of Wenyan CLI into an Agent-readable SKILL.md, allowing clients like Cursor and Claude Code to complete formatting and publishing within their conversations according to a unified set of specifications.

What is this

The WeChat Official Account Article Publishing Tool (located at @user_d8946e26/wenyan-publish, version 1.0.0) is a content-creation Skill listed on SkillHub by community publisher user_d8946e26. The official description is: AI-ready skill to format and publish Markdown articles to WeChat Official Accounts using Wenyan CLI.

In one sentence: It is a skill package designed for AI Agents, guiding them to convert standard Markdown into rich text that meets WeChat Official Account requirements and to publish via the Wenyan CLI by calling WeChat interfaces. The internal identifier name within the Skill package is publish-to-wechat. The SkillHub tag includes requires_api_key=true, indicating that operation relies on key-based configurations such as WeChat Official Account credentials.

Core Features

The following capabilities are derived from the SKILL.md within the Skill package:

  1. Automated Formatting: Supports multiple built-in themes (documentation examples include orangeheart) and code highlighting schemes.
  2. Asset Handling: Parses local or web-based images in Markdown and synchronously uploads them to the WeChat media library.
  3. Metadata-Driven: Configures titles, covers, authors, and original source links via YAML Frontmatter.
  4. Style Customization: Supports the injection of custom CSS themes.

Publishing-related CLI arguments (excerpt):

  • -f, --file: Path to the Markdown file (required).
  • -t, --theme: Layout theme, defaults to default.
  • -h, --highlight: Code highlighting theme, defaults to solarized-light.
  • --no-mac-style: Disables the Mac-style code block appearance.

Installation and Activation

Install SkillHub CLI

If skillhub is not installed on your local machine, please first check or install it according to the SkillHub Installation Documentation:

command -v skillhub && skillhub --version

If not installed, you can execute the following (full installation, including default Skills):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

Install this Skill

The installation prompt provided by the SkillHub page is: According to https://skillhub.cn/install/skillhub.md, install @user_d8946e26/wenyan-publish.

When installing via the command line, you must use --dir to point to the current Agent’s skills directory; otherwise, it defaults to ./skills/ and may not be recognized. The installation command in the search index is:

skillhub install wenyan-publish --namespace user_d8946e26 --dir <your skills directory>

Common client skills paths (excerpted from SkillHub installation documentation):

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project

After installation, you need to restart or refresh according to the requirements of each client to enable the new Skill.

Prerequisites and Keys

The Skill documentation requires:

  1. Set environment variables WECHAT_APP_ID and WECHAT_APP_SECRET (WeChat Official Account development credentials).
  2. Install Wenyan CLI globally:
pnpm add -g @wenyan-md/cli

Typical Usage

Article Frontmatter (Required)

Before publishing, the Markdown file must contain a YAML block at the beginning; omission will cause the publishing interface to report an error. The template specified by the Skill is as follows:

---
title: Article Title
cover: ./cover.jpg
author: Author Name
source_url: https://example.com/original-article
---

Note: If cover is omitted, the first image in the body will serve as the cover; author and source_url are optional.

Wenyan CLI Publishing Examples

Standard publishing (default theme and highlighting):

wenyan publish -f my-article.md

Specify theme and highlighting:

wenyan publish -f article.md -t orangeheart -h solarized-light

View available theme list:

wenyan theme -l

On the Agent side, after installing this Skill, the above constraints and commands can be used as conversation context. The Agent will check the Frontmatter, environment variables, and file paths before executing the publication.

Use Cases and Notes

Who is it for: Developers or content teams who already maintain WeChat Official Account drafts locally in Markdown and wish to hand over the “formatting + image upload + WeChat API invocation” to an Agent to execute according to documentation.

Limitations and Common Issues (from the Skill troubleshooting guide):

  • invalid ip: You need to add the current environment’s egress IP to the WeChat Official Account platform IP whitelist.
  • AppID/Secret Errors: Check if WECHAT_APP_ID and WECHAT_APP_SECRET have been correctly injected into the runtime environment.
  • Image Upload Failure: Confirm that the local image paths referenced in the Markdown actually exist in the runtime directory.
  • Formatting Anomalies: Prioritize checking if the YAML Frontmatter is complete and if the fields comply with specifications.

On the SkillHub side, this Skill is of community origin; the visible version on the page is v1.0.0. Store statistics (based on crawled data): Rating 100000, Downloads 1487, Installs 117.

Conclusion

The “WeChat Official Account Article Publishing Tool” solidifies the Wenyan CLI’s WeChat publishing workflow into an Agent Skill: keys, Frontmatter, theme parameters, and troubleshooting points are all written in SKILL.md, reducing the need for manual prompt writing every time. To install or view details, please visit the SkillHub page: https://www.skillhub.cn/skills/user_d8946e26/wenyan-publish , API Entry: https://api.skillhub.cn/user_d8946e26/wenyan-publish .

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye