Loading...
Loading...
End-to-end pipeline for writing and publishing an article to the WeChat Official Account draft box. Triggered when the user says "help me write a new article", "write an article for the Official Account", "add illustrations, typeset and send to draft box", "post directly to WeChat Official Account", "publish with illustrations", "write and publish", or any combination of writing + illustrating + posting to WeChat that requires no manual confirmation steps.
npx skill4agent add buda-ai/buda-marketplace wechat-publish-pipeline[Text: ✅ Step N completed: ...]
[Tool invocation: First tool for Step N+1]✅ Step 0 completed: Selected topic 「{title}」 (HN {N} points)
✅ Step 1 completed: Article finished, {word count} words
✅ Step 2 completed: All 5 illustrations generated
✅ Step 3 completed: Cover image generated
✅ Step 4 completed: Typesetting finished
✅ Step 5 completed: Published to draft box, media_id: {id}Step 0: Topic Selection (web-search + judgment)
Step 1: Research & Write (url-to-markdown + translate + write)
Step 2: Article Illustrations (baoyu-article-illustrator)
Step 3: Cover Image (baoyu-imagine)
Step 4: Markdown → HTML (baoyu-markdown-to-html)
Step 5: Publish to Draft Box (baoyu-post-to-wechat API)- Hacker News Hot List Top 20(https://news.ycombinator.com/best)
- GitHub Trending(https://github.com/trending)
- If necessary: Twitter/X AI/tech topics| Criteria | Description |
|---|---|
| Relevance | AI, development tools, technology trends, security incidents, engineering practices |
| Timeliness | Event occurred within 48 hours, with first-hand information available |
| Depth Potential | Has technical details to explore, not pure news retelling |
| Audience Match | Suitable for technology-focused Official Account readers (engineers, AI practitioners) |
| Not Previously Written | Check |
📢 Output, then immediately start the tool invocation for Step 1 (crawl the original text) in the same response.✅ Step 0 completed: Selected topic 「{title}」 (HN {N} points, source: {URL})
baoyu-url-to-markdownSKILL_DIR="/agent/wechat-agent-skills/skills/baoyu-url-to-markdown"
npx -y bun "$SKILL_DIR/scripts/main.ts" --url "{source_url}" --output /tmp/source.mdbaoyu-translateSKILL_DIR="/agent/wechat-agent-skills/skills/baoyu-translate"
npx -y bun "$SKILL_DIR/scripts/main.ts" /tmp/source.md --mode normal --to zh/agent/articles/drafts/{slug}-{YYYY-MM-DD}.md---
title: 文章标题
date: YYYY-MM-DD
source: 原文URL
tags: [tag1, tag2]
digest: 文章摘要(≤15字,发布时传给微信)
---📢 Output, then immediately start the tool invocation for Step 2 (create illustration prompts) in the same response.✅ Step 1 completed: Article finished, about {word count} words, saved to {path}
baoyu-article-illustratortech-explainertech-explainertimelinesystem-designper-section{article-dir}/imgs/outline.md{article-dir}/imgs/prompts/NN-{type}-{slug}.mdLayoutZONESLABELSCOLORSSTYLEASPECTmoderation_blocked{article-dir}/imgs/batch.json{
"jobs": 3,
"tasks": [
{
"id": "01-slug",
"promptFiles": ["prompts/01-type-slug.md"],
"image": "01-type-slug.png",
"provider": "openai",
"model": "gpt-image-1",
"ar": "16:9",
"quality": "2k"
}
]
}cd {article-dir}/imgs
SKILL_DIR="/agent/wechat-agent-skills/skills/baoyu-imagine"
npx -y bun "$SKILL_DIR/scripts/main.ts" --batchfile batch.json --jobs 3📢 Output, then immediately start the tool invocation for Step 3 (generate cover image) in the same response.✅ Step 2 completed: All 5 illustrations generated and inserted into the article
{article-dir}/imgs/cover.pngwechat-api.ts{article-dir}/imgs/prompts/cover.mdtype: conceptualpalette: darkrendering: digitalcd {article-dir}/imgs
SKILL_DIR="/agent/wechat-agent-skills/skills/baoyu-imagine"
npx -y bun "$SKILL_DIR/scripts/main.ts" \
--promptfiles "prompts/cover.md" \
--image "cover.png" \
--provider openai \
--model gpt-image-1 \
--ar 16:9 \
--quality 2k📢 Output, then immediately start the tool invocation for Step 4 (typesetting) in the same response.✅ Step 3 completed: Cover image generated
cd {article-dir}
SKILL_DIR="/agent/wechat-agent-skills/skills/baoyu-markdown-to-html"
npx -y bun "$SKILL_DIR/scripts/main.ts" {article-file} --theme grace --citegrace--citecontentImages📢 Output, then immediately start the tool invocation for Step 5 (publish to WeChat) in the same response.✅ Step 4 completed: Typesetting finished
cd {article-dir}
SKILL_DIR="/agent/wechat-agent-skills/skills/baoyu-post-to-wechat"
npx -y bun "$SKILL_DIR/scripts/wechat-api.ts" \
{article-file} \
--theme grace \
--color blue \
--cover imgs/cover.png.md.htmlmedia_id📢 Final Report: Send, pipeline ends.✅ Step 5 completed: Published to draft box, media_id: {media_id}
test -f "$HOME/.baoyu-skills/baoyu-article-illustrator/EXTEND.md" || mkdir -p "$HOME/.baoyu-skills/baoyu-article-illustrator" && cat > "$HOME/.baoyu-skills/baoyu-article-illustrator/EXTEND.md" << 'EOF'
---
version: 1
watermark:
enabled: false
content: ""
position: bottom-right
opacity: 0.7
preferred_style:
name: null
description: ""
default_output_dir: imgs-subdir
language: zh
custom_styles: []
---
EOF
test -f "$HOME/.baoyu-skills/baoyu-imagine/EXTEND.md" || mkdir -p "$HOME/.baoyu-skills/baoyu-imagine" && cat > "$HOME/.baoyu-skills/baoyu-imagine/EXTEND.md" << 'EOF'
---
version: 1
default_provider: openai
default_quality: 2k
default_aspect_ratio: null
default_image_size: null
default_model:
google: null
openai: gpt-image-1
azure: null
openrouter: null
dashscope: null
minimax: null
replicate: null
---
EOF
test -f "$HOME/.baoyu-skills/baoyu-cover-image/EXTEND.md" || mkdir -p "$HOME/.baoyu-skills/baoyu-cover-image" && cat > "$HOME/.baoyu-skills/baoyu-cover-image/EXTEND.md" << 'EOF'
---
version: 1
watermark:
enabled: false
content: ""
position: bottom-right
opacity: 0.7
preferred_type: null
preferred_palette: null
preferred_rendering: null
preferred_text: title-only
preferred_mood: balanced
preferred_font: clean
default_aspect: 16:9
default_output_dir: imgs-subdir
quick_mode: false
language: zh
custom_palettes: []
---
EOF
test -f "$HOME/.baoyu-skills/baoyu-post-to-wechat/EXTEND.md" || mkdir -p "$HOME/.baoyu-skills/baoyu-post-to-wechat" && cat > "$HOME/.baoyu-skills/baoyu-post-to-wechat/EXTEND.md" << 'EOF'
default_theme: grace
default_color: blue
default_publish_method: api
default_author: 宝玉
need_open_comment: 1
only_fans_can_comment: 0
EOFls /agent/skills/baoyu-skills/node_modules/jimp 2>/dev/null || \
(cd /agent/skills/baoyu-skills && npm install jimp @jsquash/webp)WeChat Full Pipeline Complete!
Topic: [topic]
Source: [source URL]
Article: [article path]
Illustrations: X pieces
Cover: imgs/cover.png
Theme: grace + blue
✓ Published to Official Account draft box
• media_id: [media_id]
→ Draft Box: https://mp.weixin.qq.com (Content Management → Draft Box)