agentleFS
tentacle-protentacle-pro/skills/baoyu-post-to-wechat/SKILL.md

baoyu-post-to-wechat

Skill4 starsChanged 9 months agoCC0-1.0View on GitHub

Posts content to WeChat Official Account draft box via official API. Supports HTML/Markdown input, cover image upload, inline image upload, and draft saving. Use when user asks to publish article draft to WeChat.

  • Reads credentials

12 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use baoyu-format-markdown and baoyu-url-to-markdown.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ideaccoSkill

    baoyu-format-markdown

    Formats plain text or markdown files with frontmatter, titles, summaries, headings, bold, lists, and code blocks. Use when user asks to "format markdown", "beautify article", "add formatting", or improve article layout. Outputs to {filename}-formatted.md.

    Also in 4 projects that use this

  • xfstudioSkill

    baoyu-url-to-markdown

    Fetch any URL and convert to markdown using Chrome CDP. Supports two modes - auto-capture on page load, or wait for user signal (for pages requiring login). Use when user wants to save a webpage as markdown.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Put credentials in shared .agents/skills/.env:

    line 21
  2. Distinctive:

    If input is markdown, script converts markdown first, then uploads inline images and publishes.

    line 62

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

baoyu-post-to-wechat (Community Edition)

Community edition posts directly to WeChat Official Account API from local machine.

Runtime

  • Entry script: scripts/wechat-api.ts
  • Run command:
bun .agents/skills/baoyu-post-to-wechat/scripts/wechat-api.ts <file> [options]

Credentials

Put credentials in shared .agents/skills/.env:

WECHAT_APP_ID=...
WECHAT_APP_SECRET=...

Resolution order:

  1. Process env
  2. .agents/skills/.env

Scope

This skill only targets draft box saving (draft/add), not mass-send.

Publishing Rules

  1. Cover image uses permanent material API (material/add_material, type=image), obtains thumb_media_id.
  2. Inline images in article HTML use media/uploadimg, obtains public url.
  3. Save draft through draft/add with article payload.
  4. need_open_comment=1, only_fans_can_comment=0 by default.

Official API Mapping

  • draft/add (article_type=news):
    • thumb_media_id must be a permanent media_id.
    • content image URLs must come from media/uploadimg.
  • material/add_material?type=image: cover and other permanent image assets.
  • media/uploadimg: inline images for article HTML content.

Recommended Operation Order

  1. Normalize Obsidian image syntax (including ![[...]]) to standard markdown image form.
  2. Render markdown to HTML.
  3. Upload inline images with uploadimg and replace <img src> with returned URLs.
  4. Upload cover with permanent material API and get thumb_media_id.
  5. Call draft/add.

Input

  • .md or .html
  • If input is markdown, script converts markdown first, then uploads inline images and publishes.

Examples

# Basic markdown draft publish
bun .agents/skills/baoyu-post-to-wechat/scripts/wechat-api.ts article.md

# Explicit cover and metadata
bun .agents/skills/baoyu-post-to-wechat/scripts/wechat-api.ts article.md \
  --cover Assets/Cover-Images/my-topic/cover.jpg \
  --title "标题" \
  --author "作者" \
  --summary "摘要"

# HTML input
bun .agents/skills/baoyu-post-to-wechat/scripts/wechat-api.ts article.html --cover Assets/cover.jpg

Notes

  • WeChat requires inline article images to come from uploadimg URLs.
  • Cover and inline image APIs are different and both are required for stable draft publishing.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.