agentleFS
guanyangguanyang/super-publisher/skills/wechat-post-publisher/SKILL.md

wechat-post-publisher

Skill32 starsChanged 4 months agoMITView on GitHub

Posts content to WeChat Official Account (微信公众号) via API or Chrome CDP. Supports article posting (文章) and image-text posting (贴图).

  • Reads credentials

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    Check and load EXTEND.md settings (details in Preferences & Multi-Account Settings).

    line 58
  2. Very specific:

    Ask publishing method (unless specified in EXTEND.md or CLI):

    line 67
  3. Very specific:

    If API Selected, check credentials in .super-publisher/.env or ~/.super-publisher/.env.

    line 71

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Post to WeChat Official Account

Language

Match user's language: Respond in the same language the user uses. If user writes in Chinese, respond in Chinese. If user writes in English, respond in English.

Script Directory

Agent Execution: Determine this SKILL.md directory as {baseDir}, then use {baseDir}/scripts/<name>.ts. Resolve ${BUN_X} runtime: if bun installed → bun; if npx available → npx -y bun; else suggest installing bun.

ScriptPurpose
scripts/wechat-browser.tsImage-text posts (图文)
scripts/wechat-article.tsArticle posting via browser (文章)
scripts/wechat-api.tsArticle posting via API (文章)
scripts/md-to-wechat.tsMarkdown → WeChat-ready HTML with image placeholders
scripts/check-permissions.tsVerify environment & permissions

Reference Guides

For detailed setup, configuration, features, and troubleshooting, refer to these standalone documents:

  • Multi-Account & EXTEND.md Configuration
  • Feature Comparison Matrix & Prerequisites
  • Environment Pre-flight Check & Troubleshooting

Article Posting Workflow (文章)

Copy this checklist and check off items as you complete them:

Publishing Progress:
- [ ] Step 0: Load preferences (EXTEND.md)
- [ ] Step 0.5: Resolve account (multi-account only - see references/accounts.md)
- [ ] Step 1: Determine input type
- [ ] Step 2: Select method and configure credentials
- [ ] Step 3: Resolve theme/color and validate metadata
- [ ] Step 4: Publish to WeChat
- [ ] Step 5: Report completion

Step 0: Load Preferences

Check and load EXTEND.md settings (details in Preferences & Multi-Account Settings). If not found, complete first-time setup BEFORE any other steps. Resolve: default_theme (default default), default_color, default_author, need_open_comment (default 1), only_fans_can_comment (default 0).

Step 1: Determine Input Type

  • HTML file: Ends with .html, file exists -> Skip to Step 3.
  • Markdown file: Ends with .md, file exists -> Continue to Step 2.
  • Plain text: Otherwise -> Save to post-to-wechat/yyyy-MM-dd/[slug].md (generate slug from first 2-4 English words of content), then continue to Step 2.

Step 2: Select Publishing Method and Configure

Ask publishing method (unless specified in EXTEND.md or CLI):

  • api (Recommended, Fast, requires API credentials)
  • browser (Slow, requires Chrome, login session)

If API Selected, check credentials in .super-publisher/.env or ~/.super-publisher/.env. If missing, guide user to obtain AppID/AppSecret from WeChat Admin platform and save.

Step 3: Resolve Theme/Color and Validate Metadata

  1. Resolve Theme & Color: From CLI -> EXTEND.md defaults -> Fallback (default).
  2. Validate Metadata:
    • Title: Prompt or auto-generate from first H1/H2 or first sentence.
    • Summary: Use description/summary in frontmatter, or prompt, or auto-generate (first paragraph truncated to 120 chars).
    • Author: CLI --author -> frontmatter author -> default_author.
    • Cover Image: Check CLI --cover -> frontmatter cover keys -> default imgs/cover.png -> first inline image. (Stop and request if missing for API).

Step 4: Publish to WeChat

  • CRITICAL: Pass the original markdown file directly, do NOT pre-convert to HTML.
  • API Method:
    ${BUN_X} {baseDir}/scripts/wechat-api.ts <file> --theme <theme> [--color <color>] [--title <title>] [--summary <summary>] [--author <author>] [--cover <cover_path>] [--no-cite]
  • Browser Method:
    ${BUN_X} {baseDir}/scripts/wechat-article.ts --markdown <markdown_file> --theme <theme> [--color <color>] [--no-cite]
    # OR
    ${BUN_X} {baseDir}/scripts/wechat-article.ts --html <html_file>

Step 5: Completion Report

Print status details: Input path, Method, Theme/Color, Title, Summary, Images count, Comment settings, and Resulting draft links or IDs. See Features & Comparison Matrix for more details.

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.