Skip to content

Guide · Agent skill

How to use the Post to WeChat Official Account agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

baoyu-post-to-wechat is an agent skill that teaches an AI agent to publish content to a WeChat Official Account (微信公众号). It accepts Markdown, HTML or plain-text articles, converts them into WeChat-friendly HTML, and posts them through WeChat's API or by driving a Chrome window. This guide explains what the skill does, how to install it, how to ask for a post in plain language, and what it needs and risks before you run it.

Post to WeChat Official AccountJimLiu/baoyu-skills · MIT

Quick start

  1. 1Download and unzip the skill. Download the ZIP from this page and unzip it. Keep the baoyu-post-to-wechat folder intact.
  2. 2Place the folder. Move it to ~/.claude/skills/ for all projects, or to .claude/skills/ in one project. Or upload it in the Claude apps under Settings → Capabilities → Skills.
  3. 3Install Bun. Make sure bun is available, or that npx can run it. If not, install Bun with brew install oven-sh/bun/bun.
  4. 4Complete first-time setup. Ask for a post in plain language. The agent asks setup questions such as language and preferences, then saves them to EXTEND.md.
  5. 5Add API credentials if using the API method. Copy AppID and AppSecret from the WeChat developer settings and save them to .baoyu-skills/.env when the guided setup asks.
  6. 6Publish and review. Give the agent a Markdown, HTML or text file and a method. Check the result in WeChat before sharing it with readers.

What is an agent skill, and what does this one do?

An agent skill is a folder of instructions and scripts that an AI agent loads when your request matches the skill's description. This skill's main file is SKILL.md, and it sets out a workflow the agent follows: load your preferences, decide the input type, choose a publishing method, check the theme, publish, and report back.

The skill handles two kinds of WeChat posts. Article posting (文章) takes a Markdown, HTML or plain-text article. Image-text posting (贴图, formerly 图文) makes a short post with multiple images, up to 9 according to the skill's description. For Markdown articles, ordinary external links are converted into bottom citations by default, which suits WeChat's formatting.

  • Article input: Markdown (.md), HTML (.html) or plain text
  • Publishing methods: api, browser (Chrome) or remote-api
  • Image-text posts with up to 9 images
  • Multi-account setup for operators who manage several Official Accounts

How do you install the skill?

Download the skill ZIP from this page and unzip it. Then place the folder in one of these locations: ~/.claude/skills/ for all your projects, or .claude/skills/ inside a specific project folder. Alternatively, in the Claude apps, open Settings → Capabilities → Skills and upload the skill there.

The skill needs Bun to run its scripts. The skill's instructions suggest bun if it is installed, otherwise npx -y bun, otherwise installing Bun with brew install oven-sh/bun/bun. You can also run a pre-flight check before first use; the skill describes it as optional.

  • Project scope: .claude/skills/ inside the project folder
  • User scope: ~/.claude/skills/
  • Claude apps: Settings → Capabilities → Skills, then upload
${BUN_X} {baseDir}/scripts/check-permissions.ts

What do you need before the first post?

You need a WeChat Official Account login for the browser method, or API credentials (AppID and AppSecret) for the API method. To get API credentials, the skill's guided setup points you to https://mp.weixin.qq.com, then to 开发 → 基本配置 to copy the AppID and AppSecret. The skill saves them to .baoyu-skills/.env in your project or your home folder.

The browser method needs Google Chrome, Chromium or Edge. On macOS, the skill needs Accessibility permission for the terminal app and Swift/AppKit for clipboard copy. On Linux, it needs xdotool (X11) or ydotool (Wayland) for paste keystrokes. If you cannot grant these permissions, the browser method will not work.

  • Bun runtime (or npx to run bun)
  • Chrome, Chromium or Edge for the browser method
  • WeChat login or AppID and AppSecret
  • macOS: Accessibility permission and xcode-select --install for Swift tools
  • Linux: xdotool or ydotool

How do you trigger the skill and post an article?

You do not need special syntax. Mention the skill's trigger phrases in a normal request, such as 发布公众号, post to wechat, 微信公众号, or 贴图, 图文 or 文章. The agent then follows the workflow. On first use, it asks setup questions and saves them to EXTEND.md before doing anything else.

For a Markdown file, the agent detects the input type, asks which method to use unless you already set one, and then publishes. You can also run the article script directly. The script reference lists --theme (default, grace, simple, modern), --no-cite to keep links inline, --author and --summary.

  • Ask in plain language: post article.md to WeChat using the grace theme
  • Choose a method: api (recommended), browser or remote-api
  • Use --no-cite if you want external links to stay inline
${BUN_X} ./scripts/wechat-article.ts --markdown article.md --theme grace --no-cite

How do you post an image-text (贴图) post?

For short posts with several images, point the script at a Markdown file and an image folder, or pass a title, content and image directly. Image-text posts go through the browser script. The source lists up to 9 images per post.

  • Markdown plus folder: use --markdown and --images
  • Single post: use --title, --content, --image and optionally --submit
${BUN_X} {baseDir}/scripts/wechat-browser.ts --markdown article.md --images ./images/

What should you check for safety and privacy?

This skill runs scripts and uses the network. It can publish to a public audience, and the source warns that automated browser pasting and publishing can send wrong or unapproved content. Review the converted HTML and the draft before you publish, and use the draft workflow where possible.

Credentials are read from environment variables or .baoyu-skills/.env files. The remote-api method sends only outbound HTTPS calls to api.weixin.qq.com through an SSH SOCKS5 tunnel, and the source says no files are written to the remote host and AppSecret stays on your local process. It uses SSH key authentication only. Use this method only if WeChat's IP allowlist requires it.

  • Read the scripts before running them, since the skill executes them
  • Keep .baoyu-skills/.env private
  • Preview output and confirm before publishing
  • Browser automation takes control of Chrome and keyboard input, so do not run it while you work in other apps

What people use it for

  • Drafting an article in Markdown and pushing it to an Official Account as a draft or post
  • Publishing a short image-text (贴图) post with several photos
  • Posting the same article to several Official Accounts using the multi-account configuration
  • Converting an HTML file into WeChat-ready HTML with a chosen theme

Frequently asked questions

Is the WeChat Official Account post to wechat skill free?

The source publishes this skill under the MIT licence, and the page does not list any price. Check the licence file in the repository for the exact terms.

What do I need to install the baoyu-post-to-wechat skill?

Download the ZIP, unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills in the Claude apps. You also need Bun, or npx to run it.

Do I need a WeChat Official Account to use it?

Yes. The posting targets require WeChat account access, so the skill is not useful without an Official Account. Either a logged-in browser session or API credentials are required.

Why does the browser method fail?

The browser method depends on Chrome, Chromium or Edge, and on paste permissions. On macOS, enable Accessibility for your terminal app. On Linux, install xdotool or ydotool. Running the pre-flight check script helps identify the failing item.

Does the skill convert external links?

Yes. For Markdown article workflows, ordinary external links are converted into bottom citations by default. Use --no-cite to keep them inline.

How does this compare with other ways to post to WeChat?

The source does not compare this skill with other tools or methods, so this page makes no claim about alternatives. If you want to avoid automated browser control, use the API method or post manually.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits Chinese-language creators and editors who already run a WeChat Official Account and want to draft in Markdown and publish from an agent. Skip it if you do not have Official Account access, cannot grant Chrome or accessibility permissions, or want to publish without reviewing the output first.

Download the skill