ufy2024/auc/baoyu-post-to-wechat
Claude Code and agent skill by ufy2024/auc
- community
Checking that the SKILL.md file is still in the repository.
Posts content to WeChat Official Account (微信公众号) via API or Chrome CDP.
Install
npx vskill@latest install ufy2024/auc/baoyu-post-to-wechatSKILL.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 SKILL_DIR, then use ${SKILL_DIR}/scripts/<name>.ts.
| Script | Purpose | |
|---|---|---|
scripts/wechat-browser.ts | Image-text posts (图文) | |
scripts/wechat-article.ts | Article posting via browser (文章) | |
scripts/wechat-api.ts | Article posting via API (文章) |
Preferences (EXTEND.md)
Use Bash to check EXTEND.md existence (priority order):
┌────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-post-to-wechat/EXTEND.md │ Project directory │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-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):
| Key | Default | Mapping | |
|---|---|---|---|
default_author | empty | Fallback for author when CLI/frontmatter not provided | |
need_open_comment | 1 | articles[].need_open_comment in draft/add request | |
only_fans_can_comment | 0 | articles[].only_fans_can_comment in draft/add request |
Recommended EXTEND.md example:
Value priority:
- CLI arguments
- Frontmatter
- EXTEND.md
- Skill defaults
Image-Text Posting (图文)
For short posts with multiple images (up to 9):
See references/image-text-posting.md for details.
Article Posting Workflow (文章)
Copy this checklist and check off items as you complete them:
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_authorneed_open_comment(default1)only_fans_can_comment(default0)
Step 1: Determine Input Type
| Input Type | Detection | Action | |
|---|---|---|---|
| HTML file | Path ends with .html, file exists | Skip to Step 4 | |
| Markdown file | Path ends with .md, file exists | Continue to Step 2 | |
| Plain text | Not a file path, or file doesn't exist | Save to markdown, then Step 2 |
Plain Text Handling:
- Generate slug from content (first 2-4 meaningful words, kebab-case)
- Create directory and save file:
- 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:
| Result | Action | |
|---|---|---|
| Found | Read its SKILL.md, continue to Step 3 | |
| Multiple skills | AskUserQuestion to choose | |
| Not found | Show installation suggestion |
When Not Found:
Step 3: Convert Markdown to HTML
Skip if: Input is .html file
- Ask theme preference (unless specified in EXTEND.md or CLI):
| Theme | Description | |
|---|---|---|
default | 经典主题 - 传统排版,标题居中带底边,二级标题白字彩底 | |
grace | 优雅主题 - 文字阴影,圆角卡片,精致引用块 | |
simple | 简洁主题 - 现代极简风,不对称圆角,清爽留白 |
- Execute conversion (using the discovered skill):
- 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).
| Field | If Missing | |
|---|---|---|
| Title | Prompt: "Enter title, or press Enter to auto-generate from content" | |
| Summary | Prompt: "Enter summary, or press Enter to auto-generate (recommended for SEO)" | |
| Author | Use 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):
- Use CLI
--coverif provided. - Else use frontmatter (
featureImage,coverImage,cover,image). - Else check article directory default path:
imgs/cover.png. - Else fallback to first inline content image.
- 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):
| Method | Speed | Requirements | |
|---|---|---|---|
api (Recommended) | Fast | API credentials | |
browser | Slow | Chrome, login session |
If API Selected - Check Credentials:
If Credentials Missing - Guide Setup:
After location choice, prompt for values and write to .env:
Step 6: Publish to WeChat
API method:
`draft/add` payload rules:
- Use endpoint:
POST https://api.weixin.qq.com/cgi-bin/draft/add?access_token=ACCESS_TOKEN article_type:news(default) ornewspic- For
news, includethumb_media_id(cover is required) - Always resolve and send:
need_open_comment(default1)only_fans_can_comment(default0)authorresolution: CLI--author→ frontmatterauthor→ EXTEND.mddefault_author
If script parameters do not expose the two comment fields, still ensure final API request body includes resolved values.
Browser method:
Step 7: Completion Report
For API method, include draft management link:
For Browser method:
Detailed References
| Topic | Reference | |
|---|---|---|
| Image-text parameters, auto-compression | references/image-text-posting.md | |
| Article themes, image handling | references/article-posting.md |
Feature Comparison
| Feature | Image-Text | Article (API) | Article (Browser) | |
|---|---|---|---|---|
| Plain text input | ✗ | ✓ | ✓ | |
| HTML input | ✗ | ✓ | ✓ | |
| Markdown input | Title/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 | ✗ | ✓ | ✗ | |
| Speed | Medium | Fast | Slow |
Prerequisites
For API method:
- WeChat Official Account API credentials
- Guided setup in Step 5, or manually set in
.baoyu-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.,
baoyu-markdown-to-html) - If not installed, the workflow will suggest installation
Config File Locations (priority order):
- Environment variables
<cwd>/.baoyu-skills/.env~/.baoyu-skills/.env
Troubleshooting
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingauc/skill_library/bundled/baoyu-post-to-wechat/SKILL.md
Popularity
- Repository stars
- 1,086
- Repository forks
- 42
- 7-day trend score
- 35
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ufy2024/auc/baoyu-post-to-wechat)