WeChat Official Account Custom Theme Tool: Apply Local CSS and Publish Drafts with Wenyan CLI

Preface

When writing long-form articles for WeChat Official Accounts, a common workflow is: write the draft in Markdown, then manually copy it into the editor to adjust styles, or rely on the platform’s default formatting. If you already have a custom CSS file (e.g., a theme generated by an Agent), you’d need to preview it yourself, then figure out how to push it to the drafts—a process that tends to be fragmented and prone to missed steps.

Below is the WeChat Official Account Custom Theme Application Tool (@user_d8946e26/apply-wenyan-custom-theme) on SkillHub. It packages the workflow of “local style testing → optional theme registration → push to WeChat Official Account drafts” into a standard, Agent-executable process, built on top of Wenyan CLI and local Markdown/CSS files. Unlike tools that merely convert Markdown to HTML, this one targets the “one-click publishing with custom themes” scenario.

What Is This

In one sentence: a Skill for AI Agents that uses Wenyan CLI to perform test rendering and theme registration on Markdown articles, and to publish articles to WeChat Official Accounts using local custom CSS themes.

  • Coordinate: @user_d8946e26/apply-wenyan-custom-theme
  • Version: 1.0.0 (as noted on the SkillHub page)
  • Source: community, category: content-creation, published by user_d8946e26
  • Official entry: https://api.skillhub.cn/user_d8946e26/apply-wenyan-custom-theme
    SkillHub detail page: https://www.skillhub.cn/skills/user_d8946e26/apply-wenyan-custom-theme

The original English description on SkillHub reads: AI-ready skill to test, register, and publish Markdown articles to WeChat Official Accounts using a local custom CSS theme via Wenyan CLI. The platform tag includes requires_api_key=true, indicating that relevant API credentials must be configured before use (see Prerequisites below).

Core Features

The following capabilities align with the official description and the documentation of related skills. After installing this Skill, the Agent should follow the workflow defined in its SKILL.md:

  1. Local test rendering: Before publishing, render the Markdown with the specified CSS to confirm that paths and styles are correct.
  2. Publish to WeChat Official Account drafts: After rendering passes, push the article to WeChat Official Account drafts using the local CSS theme (requires network access and WeChat API credentials).
  3. Theme registration (optional): Register the custom CSS into the local Wenyan theme library, so it can be invoked by theme name rather than file path.

Installation and Activation

1. Install SkillHub CLI (if not already installed)

First, check whether the CLI is available:

command -v skillhub && skillhub --version

If it’s not installed, follow the SkillHub installation documentation to perform a full installation or install only the CLI:

# Full installation (CLI + default Skills, recommended)
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

# Install CLI only
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only

For instructions, see: https://skillhub.cn/install/skillhub.md

2. Install This Skill

The installation prompt provided on the SkillHub detail page is: according to https://skillhub.cn/install/skillhub.md, install @user_d8946e26/apply-wenyan-custom-theme.

When installing, you must use --dir to point to the current Agent’s skills directory; otherwise, it will default to ./skills/ and may not be recognized:

skillhub install @user_d8946e26/apply-wenyan-custom-theme --dir <your skills directory>

Common path examples (from the SkillHub installation documentation):

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

You can also send the official prompt to the Agent and let it complete the installation according to the documentation above.

3. Prerequisites and Dependencies

The skill documentation requires (consistent with Wenyan publishing capabilities):

  • wenyan-cli installed, example installation command: pnpm add -g @wenyan-md/cli
  • Environment variables WECHAT_APP_ID and WECHAT_APP_SECRET configured (WeChat Official Account application credentials)
  • Local Markdown (.md) and CSS theme (.css) files already present

Installing the Skill itself does not replace the Wenyan CLI or WeChat credential configuration; the publishing step depends on network access to the WeChat API.

Typical Usage

When you need to “format and publish article.md using a certain theme.css”, the Agent should follow the standard operating procedure (SOP) defined in the skill. Below is a reproducible command pattern; replace the paths with actual files.

Step 1: Test rendering (recommended to be enforced before publishing)

wenyan render -f <markdown_file_path> -c <css_file_path>

Confirm that the command runs without errors and the output is the expected HTML before proceeding.

Step 2: Publish to WeChat Official Account drafts

wenyan publish -f <markdown_file_path> -c <css_file_path>

Optional parameters (listed in the skill documentation):

  • --no-mac-style: disable the Mac-style window for code blocks
  • -h <highlight_theme>: specify a code highlighting theme, e.g., atom-one-dark

Step 3: Register the theme (for long-term use of the same CSS)

wenyan theme --add --name <theme_name> --path <css_file_path>

After registration, publishing can use the theme name parameter -t <theme_name> instead. To list local themes:

wenyan theme -l

(For the behavior of wenyan theme subcommands, you can also refer to the Wenyan CLI official documentation: https://github.com/caol64/wenyan-cli/blob/main/docs/theme.md)

Use Cases and Notes

Who It’s For

  • Those who already write in Markdown locally and want to lock in a consistent CSS visual style, rather than manually adjusting the Official Account editor every time.
  • Those who want Cursor, Claude Code, or similar Agents to follow a fixed SOP for previewing and draft publishing, reducing missed steps.
  • Teams or individuals managing multiple articles and themes who need to register CSS into the Wenyan theme library for reuse.

Limitations and Notes

  • The platform tags it as requires_api_key=true: the WeChat application ID and Secret must be correctly configured; if the API returns invalid credential, check WECHAT_APP_ID and WECHAT_APP_SECRET.
  • Publishing depends on external network and the WeChat API; only local render can be used for style validation when there’s no intention to publish.
  • CSS selectors must conform to Wenyan’s conventions (the skill’s troubleshooting notes mention: if styles don’t take effect, check whether the #wenyan prefix is missing).
  • File path errors will manifest as errors like ENOENT; verify the Markdown and CSS paths.
  • This skill on SkillHub is community-sourced (community); before installation, you can use skillhub verify @user_d8946e26/apply-wenyan-custom-theme to verify content and signatures per the platform instructions (requires SkillHub CLI 2026.7.29+).

Conclusion

The WeChat Official Account Custom Theme Application Tool consolidates “custom CSS + Markdown → preview → Official Account draft” into an Agent-executable Wenyan CLI workflow, suitable for content creation workflows. If you use SkillHub, you can obtain and install it from the official addresses:

  • API / Installation entry: https://api.skillhub.cn/user_d8946e26/apply-wenyan-custom-theme
  • Detail page: https://www.skillhub.cn/skills/user_d8946e26/apply-wenyan-custom-theme

(SkillHub page statistics: rating 100000, downloads 928, installations 89; data is subject to the platform display.)

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

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

Xiaoye