baoyu-post-to-wechat
npx skills add https://github.com/xfstudio/skills --skill baoyu-post-to-wechat
Agent 安装分布
Skill 文档
Post to WeChat Official Account
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 (æç« ) |
scripts/md-to-wechat.ts |
Markdown â WeChat HTML |
Preferences (EXTEND.md)
Use Bash to check EXTEND.md existence (priority order):
# Check project-level first
test -f .baoyu-skills/baoyu-post-to-wechat/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.baoyu-skills/baoyu-post-to-wechat/EXTEND.md" && echo "user"
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¬ââââââââââââââââââââ â 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 â Use defaults â âââââââââââââ´ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
EXTEND.md Supports: Default theme | Auto-submit preference | Chrome profile path
Usage
Image-Text (徿)
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
Article (æç« )
Before posting, ask user to choose a theme using AskUserQuestion:
| Theme | Description |
|---|---|
default |
ç»å ¸ä¸»é¢ – ä¼ ç»æçï¼æ é¢å± ä¸å¸¦åºè¾¹ï¼äºçº§æ é¢ç½åå½©åº |
grace |
ä¼é ä¸»é¢ – æåé´å½±ï¼åè§å¡çï¼ç²¾è´å¼ç¨å (by @brzhang) |
simple |
ç®æ´ä¸»é¢ – ç°ä»£æç®é£ï¼ä¸å¯¹ç§°åè§ï¼æ¸ ç½çç½ (by @okooo5km) |
Default: default. If user has already specified a theme, skip the question.
Workflow:
- Generate HTML preview and print the full
htmlPathfrom JSON output so user can click to preview:
npx -y bun ${SKILL_DIR}/scripts/md-to-wechat.ts article.md --theme <chosen-theme>
- Post to WeChat:
npx -y bun ${SKILL_DIR}/scripts/wechat-article.ts --markdown article.md --theme <chosen-theme>
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 |
|---|---|---|
| Multiple images | â (up to 9) | â (inline) |
| Markdown support | Title/content extraction | Full formatting |
| Auto compression | â (title: 20, content: 1000 chars) | â |
| Themes | â | â (default, grace, simple) |
Prerequisites
- Google Chrome
- First run: log in to WeChat Official Account (session preserved)
Troubleshooting
| Issue | Solution |
|---|---|
| Not logged in | First run opens browser – scan QR to log in |
| Chrome not found | Set WECHAT_BROWSER_CHROME_PATH env var |
| Paste fails | Check system clipboard permissions |
Extension Support
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.