Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
freestylefly avatar

Canghe Post To Wechat

  • 467 installs
  • 424 repo stars
  • Updated June 8, 2026
  • freestylefly/canghe-skills

canghe-post-to-wechat is an agent skill that publishes formatted articles and announcements to WeChat Official Accounts for developers distributing product updates and content to Chinese audiences.

About

canghe-post-to-wechat is an agent skill from freestylefly/canghe-skills that helps coding agents publish formatted articles and announcements to WeChat Official Accounts for Chinese-language distribution. The skill guides formatting, posting steps, and announcement structure so launch updates, feature releases, and promotional content reach subscribers on WeChat instead of staying as local markdown or English-only channels. Developers reach for canghe-post-to-wechat when a release needs WeChat Official Account coverage alongside other launch assets—particularly for products, APIs, or developer tools targeting mainland China users. It fits the distribution slice of a launch plan where the artifact is a live WeChat post rather than repository code. Pair it with general content or SEO skills for drafting, then invoke canghe-post-to-wechat when the remaining work is platform-specific publishing and audience reach on WeChat.

  • WeChat Official Account posting
  • Localized distribution
  • Launch announcement workflow
  • Formatted article publishing
  • China-market reach

Canghe Post To Wechat by the numbers

  • 467 all-time installs (skills.sh)
  • Ranked #182 of 853 Sales & Marketing skills by installs in the Skillselion catalog
  • Data as of Jul 31, 2026 (Skillselion catalog sync)
npx skills add https://github.com/freestylefly/canghe-skills --skill canghe-post-to-wechat

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs467
repo stars424
Last updatedJune 8, 2026
Repositoryfreestylefly/canghe-skills

How do you publish articles to WeChat Official Accounts?

Publish formatted articles and announcements to WeChat Official Accounts to reach Chinese audiences during launch and ongoing promotion.

Who is it for?

Developers launching products or developer tools who need WeChat Official Account posts to reach Chinese-speaking users during release or ongoing promotion.

Skip if: English-only blog or newsletter publishing on Substack, Medium, or Resend where WeChat Official Account credentials and formatting rules do not apply.

When should I use this skill?

The user wants to post or publish formatted articles, announcements, or launch updates to a WeChat Official Account for Chinese audience distribution.

What you get

Formatted WeChat Official Account article or announcement posted to subscribers with platform-appropriate layout and publishing metadata.

  • published WeChat article
  • formatted announcement post

Files

SKILL.mdMarkdownGitHub ↗

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 SKILL_DIR, then use ${SKILL_DIR}/scripts/<name>.ts.

ScriptPurpose
scripts/wechat-browser.tsImage-text posts (图文)
scripts/wechat-article.tsArticle posting via browser (文章)
scripts/wechat-api.tsArticle posting via API (文章)
scripts/check-permissions.tsVerify environment & permissions

Preferences (EXTEND.md)

Use Bash to check EXTEND.md existence (priority order):

# Check project-level first
test -f .canghe-skills/canghe-post-to-wechat/EXTEND.md && echo "project"

# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.canghe-skills/canghe-post-to-wechat/EXTEND.md" && echo "user"

┌────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ .canghe-skills/canghe-post-to-wechat/EXTEND.md │ Project directory │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.canghe-skills/canghe-post-to-wechat/EXTEND.md │ User home │ └────────────────────────────────────────────────────────┴───────────────────┘

┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, apply settings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ Run first-time setup (references/config/first-time-setup.md) → Save → Continue │ └───────────┴───────────────────────────────────────────────────────────────────────────┘

EXTEND.md Supports: Default theme | Default publishing method (api/browser) | Default author | Default open-comment switch | Default fans-only-comment switch | Chrome profile path

First-time setup: references/config/first-time-setup.md

Minimum supported keys (case-insensitive, accept 1/0 or true/false):

KeyDefaultMapping
default_authoremptyFallback for author when CLI/frontmatter not provided
need_open_comment1articles[].need_open_comment in draft/add request
only_fans_can_comment0articles[].only_fans_can_comment in draft/add request

Recommended EXTEND.md example:

default_theme: default
default_publish_method: api
default_author: 苍何
need_open_comment: 1
only_fans_can_comment: 0
chrome_profile_path: /path/to/chrome/profile

Value priority: 1. CLI arguments 2. Frontmatter 3. EXTEND.md 4. Skill defaults

Pre-flight Check (Optional)

Before first use, suggest running the environment check. User can skip if they prefer.

npx -y bun ${SKILL_DIR}/scripts/check-permissions.ts

Checks: Chrome, profile isolation, Bun, Accessibility, clipboard, paste keystroke, API credentials, Chrome conflicts.

If any check fails, provide fix guidance per item:

CheckFix
ChromeInstall Chrome or set WECHAT_BROWSER_CHROME_PATH env var
Profile dirEnsure ~/.local/share/wechat-browser-profile is writable
Bun runtime`curl -fsSL https://bun.sh/install \
Accessibility (macOS)System Settings → Privacy & Security → Accessibility → enable terminal app
Clipboard copyEnsure Swift/AppKit available (macOS Xcode CLI tools: xcode-select --install)
Paste keystroke (macOS)Same as Accessibility fix above
Paste keystroke (Linux)Install xdotool (X11) or ydotool (Wayland)
API credentialsFollow guided setup in Step 5, or manually set in .canghe-skills/.env

Image-Text Posting (图文)

For short posts with multiple images (up to 9):

npx -y bun ${SKILL_DIR}/scripts/wechat-browser.ts --markdown article.md --images ./images/
npx -y bun ${SKILL_DIR}/scripts/wechat-browser.ts --title "标题" --content "内容" --image img.png --submit

See references/image-text-posting.md for details.

Article Posting Workflow (文章)

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

Publishing Progress:
- [ ] Step 0: Load preferences (EXTEND.md)
- [ ] Step 1: Determine input type
- [ ] Step 2: Check markdown-to-html skill
- [ ] Step 3: Convert to HTML
- [ ] Step 4: Validate metadata (title, summary, cover)
- [ ] Step 5: Select method and configure credentials
- [ ] Step 6: Publish to WeChat
- [ ] Step 7: Report completion

Step 0: Load Preferences

Check and load EXTEND.md settings (see Preferences section above).

CRITICAL: If not found, complete first-time setup BEFORE any other steps or questions.

Resolve and store these defaults for later steps:

  • default_author
  • need_open_comment (default 1)
  • only_fans_can_comment (default 0)

Step 1: Determine Input Type

Input TypeDetectionAction
HTML filePath ends with .html, file existsSkip to Step 4
Markdown filePath ends with .md, file existsContinue to Step 2
Plain textNot a file path, or file doesn't existSave to markdown, then Step 2

Plain Text Handling:

1. Generate slug from content (first 2-4 meaningful words, kebab-case) 2. Create directory and save file:

mkdir -p "$(pwd)/post-to-wechat/$(date +%Y-%m-%d)"
# Save content to: post-to-wechat/yyyy-MM-dd/[slug].md

3. Continue processing as markdown file

Slug Examples:

  • "Understanding AI Models" → understanding-ai-models
  • "人工智能的未来" → ai-future (translate to English for slug)

Step 2: Check Markdown-to-HTML Skill

Skip if: Input is .html file

Skill Discovery:

# Check if canghe-markdown-to-html exists
test -f skills/canghe-markdown-to-html/SKILL.md && echo "found"
ResultAction
FoundRead its SKILL.md, continue to Step 3
Multiple skillsAskUserQuestion to choose
Not foundShow installation suggestion

When Not Found:

No markdown-to-html skill found.

Suggested installation:
https://github.com/JimLiu/canghe-skills/blob/main/skills/canghe-markdown-to-html/SKILL.md

Options:
A) Cancel - install the skill first
B) Continue - provide HTML file manually

Step 3: Convert Markdown to HTML

Skip if: Input is .html file

1. Ask theme preference (unless specified in EXTEND.md or CLI):

ThemeDescription
default经典主题 - 传统排版,标题居中带底边,二级标题白字彩底
grace优雅主题 - 文字阴影,圆角卡片,精致引用块
simple简洁主题 - 现代极简风,不对称圆角,清爽留白

2. Execute conversion (using the discovered skill):

npx -y bun ${MD_TO_HTML_SKILL_DIR}/scripts/main.ts <markdown_file> --theme <theme>

3. Parse JSON output to get: htmlPath, title, author, summary, contentImages

Step 4: Validate Metadata

Check extracted metadata from Step 3 (or HTML meta tags if direct HTML input).

FieldIf Missing
TitlePrompt: "Enter title, or press Enter to auto-generate from content"
SummaryPrompt: "Enter summary, or press Enter to auto-generate (recommended for SEO)"
AuthorUse fallback chain: CLI --author → frontmatter author → EXTEND.md default_author

Auto-Generation Logic:

  • Title: First H1/H2 heading, or first sentence
  • Summary: First paragraph, truncated to 120 characters

Cover Image Check (required for article_type=news): 1. Use CLI --cover if provided. 2. Else use frontmatter (coverImage, featureImage, cover, image). 3. Else check article directory default path: imgs/cover.png. 4. Else fallback to first inline content image. 5. If still missing, stop and request a cover image before publishing.

Step 5: Select Publishing Method and Configure

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

MethodSpeedRequirements
api (Recommended)FastAPI credentials
browserSlowChrome, login session

If API Selected - Check Credentials:

# Check project-level
test -f .canghe-skills/.env && grep -q "WECHAT_APP_ID" .canghe-skills/.env && echo "project"

# Check user-level
test -f "$HOME/.canghe-skills/.env" && grep -q "WECHAT_APP_ID" "$HOME/.canghe-skills/.env" && echo "user"

If Credentials Missing - Guide Setup:

WeChat API credentials not found.

To obtain credentials:
1. Visit https://mp.weixin.qq.com
2. Go to: 开发 → 基本配置
3. Copy AppID and AppSecret

Where to save?
A) Project-level: .canghe-skills/.env (this project only)
B) User-level: ~/.canghe-skills/.env (all projects)

After location choice, prompt for values and write to .env:

WECHAT_APP_ID=<user_input>
WECHAT_APP_SECRET=<user_input>

Step 6: Publish to WeChat

API method:

npx -y bun ${SKILL_DIR}/scripts/wechat-api.ts <html_file> [--title <title>] [--summary <summary>] [--author <author>] [--cover <cover_path>]

`draft/add` payload rules:

  • Use endpoint: POST https://api.weixin.qq.com/cgi-bin/draft/add?access_token=ACCESS_TOKEN
  • article_type: news (default) or newspic
  • For news, include thumb_media_id (cover is required)
  • Always resolve and send:
  • need_open_comment (default 1)
  • only_fans_can_comment (default 0)
  • author resolution: CLI --author → frontmatter author → EXTEND.md default_author

If script parameters do not expose the two comment fields, still ensure final API request body includes resolved values.

Browser method:

npx -y bun ${SKILL_DIR}/scripts/wechat-article.ts --html <html_file>

Step 7: Completion Report

For API method, include draft management link:

WeChat Publishing Complete!

Input: [type] - [path]
Method: API
Theme: [theme name]

Article:
• Title: [title]
• Summary: [summary]
• Images: [N] inline images
• Comments: [open/closed], [fans-only/all users]

Result:
✓ Draft saved to WeChat Official Account
• media_id: [media_id]

Next Steps:
→ Manage drafts: https://mp.weixin.qq.com (登录后进入「内容管理」→「草稿箱」)

Files created:
[• post-to-wechat/yyyy-MM-dd/slug.md (if plain text)]
[• slug.html (converted)]

For Browser method:

WeChat Publishing Complete!

Input: [type] - [path]
Method: Browser
Theme: [theme name]

Article:
• Title: [title]
• Summary: [summary]
• Images: [N] inline images

Result:
✓ Draft saved to WeChat Official Account

Files created:
[• post-to-wechat/yyyy-MM-dd/slug.md (if plain text)]
[• slug.html (converted)]

Detailed References

TopicReference
Image-text parameters, auto-compressionreferences/image-text-posting.md
Article themes, image handlingreferences/article-posting.md

Feature Comparison

FeatureImage-TextArticle (API)Article (Browser)
Plain text input
HTML input
Markdown inputTitle/content✓ (via skill)✓ (via skill)
Multiple images✓ (up to 9)✓ (inline)✓ (inline)
Themes
Auto-generate metadata
Default cover fallback (imgs/cover.png)
Comment control (need_open_comment, only_fans_can_comment)
Requires Chrome
Requires API credentials
SpeedMediumFastSlow

Prerequisites

For API method:

  • WeChat Official Account API credentials
  • Guided setup in Step 5, or manually set in .canghe-skills/.env

For Browser method:

  • Google Chrome
  • First run: log in to WeChat Official Account (session preserved)

For Markdown conversion:

  • A markdown-to-html skill (e.g., canghe-markdown-to-html)
  • If not installed, the workflow will suggest installation

Config File Locations (priority order): 1. Environment variables 2. <cwd>/.canghe-skills/.env 3. ~/.canghe-skills/.env

Troubleshooting

IssueSolution
No markdown-to-html skillInstall canghe-markdown-to-html from suggested URL
Missing API credentialsFollow guided setup in Step 5
Access token errorCheck if API credentials are valid and not expired
Not logged in (browser)First run opens browser - scan QR to log in
Chrome not foundSet WECHAT_BROWSER_CHROME_PATH env var
Title/summary missingUse auto-generation or provide manually
No cover imageAdd frontmatter cover or place imgs/cover.png in article directory
Wrong comment defaultsCheck EXTEND.md keys need_open_comment and only_fans_can_comment
Paste failsCheck system clipboard permissions

Extension Support

Custom configurations via EXTEND.md. See Preferences section for paths and supported options.

Related skills

FAQ

What platform does canghe-post-to-wechat target?

canghe-post-to-wechat publishes to WeChat Official Accounts (Weixin OA), not personal WeChat chats. It formats articles and announcements for subscriber distribution to Chinese-language audiences.

When should canghe-post-to-wechat be invoked?

canghe-post-to-wechat fits launch and promotion tasks where formatted content must go live on WeChat Official Accounts—product announcements, feature releases, or ongoing editorial posts for China reach.

Does canghe-post-to-wechat write the article content?

canghe-post-to-wechat focuses on WeChat publishing workflow and formatting. Drafting long-form copy may still use separate content or documentation skills before this skill handles Official Account posting steps.

Sales & Marketingdistributioncontent

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.