Purpose
Based on the topic provided by the user (optionally with a reference URL), automatically complete the entire WeChat Official Account article writing workflow: multi-source retrieval and evidence pool organization, first draft generation, self-review and polishing, reference material organization, and optionally automatic image matching and saving to the WeChat Official Account drafts folder (without submitting for publication).
When to Use
- User requests "write a WeChat Official Account article about XXX"
- User requests "generate a WeChat Official Account article, the topic is XXX"
- User needs a complete WeChat Official Account article creation workflow
- User wants to "automatically add images after writing" or "send to the WeChat Official Account drafts folder after writing"
Prerequisites
Before execution, confirm:
- The user has provided the article topic (
topic) - If there is a reference article URL, it can be provided as well (
urls) - If
topicis pure Chinese and noslugis provided, it is recommended to add an English/pinyinkebab-casedirectory name; otherwise an ASCII fallback will be used
Workflow
Execute the following steps in order (artifacts are saved to disk by default under articles/<slug>/..., for easy re-running and traceability):
Phase 0: Preflight
Goal: determine a directory and path specification that can be stably reused
Operations:
- Calculate
slug- If the user provides
slug: use it directly (recommended: English/pinyin kebab-case) - If
topiccontains Latin letters/digits: convert it to kebab-case - Otherwise fall back:
wechat-article-YYYYMMDD
- If the user provides
- Create directory:
articles/<slug>/articles/<slug>/sources/
- Specification: Markdown image references must use relative paths and the
/separator
Step 1: Material Collection
Goal: collect materials related to the topic and organize them into a traceable evidence pool
Operations:
- If the user provides
urls: use in parallelwebfetchto obtain content, extract key points, and record the URL and publication date if available - If the user does not provide
urls: use in parallelWebSearchfor multi-source retrieval (recommended coverage: official documentation / X(Twitter) / Reddit / technical forums / WeChat Official Accounts / engineering practice)- official/authority: official documentation, standards/specifications, authoritative media interpretation
- community: X(Twitter), Reddit, forums/discussions
- practice: GitHub issues, engineering blogs, case retrospectives
- Recommended parallel query templates (combine as needed, add year/time range where possible to emphasize recency):
{topic} official documentation/{topic} release notes 2025 2026{topic} site:x.com/{topic} site:twitter.com{topic} site:reddit.com/{topic} site:reddit.com/r/<subreddit>{topic} site:github.com issues/{topic} site:github.com discussions{topic} site:stackoverflow.com/{topic} site:news.ycombinator.com{topic} site:mp.weixin.qq.com(WeChat Official Account){topic} 实战 复盘 踩坑 2025 2026(Chinese engineering practice)
- Merge and deduplicate, grade by credibility (high/medium/low), form an evidence pool, and save to disk:
articles/<slug>/sources/evidence.md
Tool Mapping:
- "Search" in this workflow uses:
WebSearch - "Fetch web page content" in this workflow uses:
webfetch
About WebSearch (implementation notes):
- Prefer the
WebSearchtool included with the runtime environment. - If the current environment does not have an available
WebSearch: usewebfetchto fetch public search engine result pages (SERP), extract the URL list from the results, and then in parallelwebfetchthe body content.
Evidence pool entry format (each entry must include):
- title
- url
- published_at (write if available)
- source_type(official/community/practice)
- key_takeaways (3-6 key points, preferably directly rewritable as body material)
- confidence(high/medium/low)
Stop conditions (recommended):
- 8-12 candidate sources, of which medium/high >= 5
Common failure handling (new):
- X/Reddit login wall or body text cannot be scraped:
- Prefer publicly accessible mirrors/references (secondary reporting must be labeled
confidence=low/medium), or instead scrape blog/forum reposts of the same viewpoint; - If the original post must be cited: use only WebSearch result summaries + corroboration from other independent sources, and do not fabricate details.
- Prefer publicly accessible mirrors/references (secondary reporting must be labeled
- SERP scraping/parsing failure (when there is no WebSearch fallback path):
- Switch to a "site search" strategy: directly use
webfetchto scrape the official site's search/blog index page or GitHub search page; - If coverage is still impossible: ask the user for 3-5 key URLs or a specified list of information sources.
- Switch to a "site search" strategy: directly use
- Deduplication and credibility:
- Each fact must be corroborated by at least 2 independent sources;
- Official/first-hand documents should preferably be labeled
high; community discussions without actionable details or without cross-verification should be labeledlow。
Output:sources_path(evidence pool path)
Step 2: Draft generation
Goal: Generate a first draft of the WeChat public account article based on the materials
Writing requirements:
-
Title: Eye-catching; the following techniques may be used
- Numeric type:
5个方法让你... - Question type:
为什么...? - Contrast type:
A与B的区别... - Suspense type:
你不知道的...
- Numeric type:
-
Opening(first 3-5 lines):
- Present a pain point or create resonance
- Set up suspense or ask a question
- Clarify the article's value
-
Body structure:
- Use subheadings to divide sections (## or ###)
- Each section 200-300 characters
- Include cases and data support
- Use lists to enhance readability
-
Ending:
- Summarize the core viewpoint
- Guide interaction (likes, Wow, comments)
- May add a memorable quote or call to action
-
Word count requirement: 1500-2500 characters
-
Traceability requirements (new hard constraints):
- Key facts/data/conclusions must be supported in the evidence pool
- At the end of the article, append
## 参考资料/来源(5-10 links, with dates if possible)
Output: Markdown-format first draft, saved to:articles/<slug>/article.md
Step 3: Intelligent review
Goal: Review from four dimensions and identify problems
Review dimensions:
| Dimension | Checkpoints | Weight |
|---|---|---|
| Logic | Clear arguments, sufficient evidence, reasonable reasoning | 30% |
| Expression | Fluent language, no AI traces, appropriately conversational | 25% |
| Data | Accurate data, appropriate cases, standardized citations | 25% |
| Structure | Attractive title, clear paragraphs, opening and ending echo each other | 20% |
New hard checks:
- Traceability: whether key claims can be supported in the evidence pool
- Title consistency: whether the title's promise is clearly fulfilled in the body
Review operations:
- Check logical coherence paragraph by paragraph
- Flag AI-tell vocabulary (such as "in conclusion", "it is not hard to see", etc.)
- Verify the accuracy of data and cases
- Check structure and rhythm
Scoring Criteria:
- 90-100 points: Excellent, ready to publish directly
- 80-89 points: Good, only minor optimization needed
- 70-79 points: Qualified, revisions needed
- Below 70 points: Needs rewriting
Output: Review report (including issues and revision suggestions), recommended to save to:articles/<slug>/sources/review.md
Step 4: Polishing and Refinement
Goal: Fix issues and improve article quality
Polishing Operations:
-
Remove AI traces
- Replace vocabulary:
综上所述→总的来说总而言之→说到底由此可见→所以说不难看出→我们能发现众所周知→大家都知道
- Avoid overly formal expressions
- Replace vocabulary:
-
Enhance colloquial style
- Appropriately add:
其实、说实话、不得不说 - Use short sentences, avoid long and complex sentences
- Add transition words to enhance fluency
- Appropriately add:
-
Optimize rhythm
- Combine long and short sentences
- Appropriately use exclamatory and rhetorical questions
- Control paragraph length (recommended no more than 5 lines)
-
Fix review issues
- Fix item by item according to the review report
- Supplement missing data or cases
- Adjust unreasonable structure
Output: Final article
Mandatory Requirements (New):
- The final article must retain or complete
## 参考资料/来源 - References are recommended to retain 5-10 items, preferably grouped by
official/community/practiceGrouping is better
Step 5: Save and Output
Operations:
- Create output directory (if it does not exist):
articles/<slug>/
- Save article:
articles/<slug>/article.md
- Output execution summary:
article_pathsources_path- Word count
- Review score
Step 6: Automatic illustration (optional, call article-illustrator)
Trigger conditions:with_illustrations=true
Goal: Generate high-completion illustrations with a consistent style for the article, and produce an illustrated version of the article
Default strategy:
article_path: Usearticles/<slug>/article.mdslug: Reuse the current article slugdensity:illustration_density(default balanced)upload:illustration_upload(default false)aspect_ratio:illustration_aspect_ratio(default 16:9)prompt_profile:illustration_prompt_profile(default nano-banana)text_language:illustration_text_language(default zh-CN)english_terms_whitelist:illustration_english_terms_whitelist(default empty)image_provider:illustration_image_provider(default xiaomi)image_model:illustration_image_model(default gemini-3.1-flash-image-preview)image_size:illustration_image_size(default 1K)image_base_url:illustration_image_base_url(default Xiaomi API address, also supports Gemini native proxy)
Execution method:
- Prefer to call
article-illustrator's one-click workflow script:node <article-illustrator>/scripts/illustrate-article.ts \ --article articles/<slug>/article.md \ --slug <slug> \ --density <illustration_density> \ --aspect-ratio <illustration_aspect_ratio> \ --prompt-profile <illustration_prompt_profile> \ --text-language <illustration_text_language> \ --image-provider <illustration_image_provider> \ --image-model <illustration_image_model> \ [--image-size <illustration_image_size>] \ [--image-base-url <illustration_image_base_url>] \ [--upload] - If
illustration_english_terms_whitelistis not empty, append--term <value>to each term, for example:--term Playwright --term Chromium --term Firefox --term WebKit - By default, follow the new illustration strategy:
- First generate the article-level
visual-bible.md - then generate
outline.mdandprompts/ - By default, the text in images is Simplified Chinese, and only whitelisted terms remain in English
- All images in the same article share a unified style system
- First generate the article-level
- Writing skills should follow the following field mapping when integrated:
article_path -> --articleslug -> --slugillustration_density -> --densityillustration_aspect_ratio -> --aspect-ratioillustration_prompt_profile -> --prompt-profileillustration_text_language -> --text-languageillustration_image_provider -> --image-providerillustration_image_model -> --image-modelillustration_image_size -> --image-sizeillustration_image_base_url -> --image-base-urlillustration_upload=true -> --upload
Output:
illustrated_article_path:articles/<slug>/article.illustrated.mdillustrations_dir:articles/<slug>/illustrations/<slug>/articles/<slug>/illustrations/<slug>/visual-bible.mdarticles/<slug>/illustrations/<slug>/outline.mdarticles/<slug>/illustrations/<slug>/prompts/
Failure handling: A single failure can be retried once; if it still fails, record it and continue, and finally output the failure list. If some images fail, the article.illustrated.mdshould also be retained, and image placeholder comments inserted.
Step 7: HTML theme style output (optional, call markdown2wechat)
Trigger conditions:with_html_theme=true
Goal: Use the markdown2wechat skill to convert Markdown into HTML with WeChat inline styles
Operations:
- Select the input file:
- If
with_illustrations=trueandarticles/<slug>/article.illustrated.mdexist, use that file - Otherwise use
articles/<slug>/article.md
- If
- Record the selected Markdown file as
<input_markdown> - Call the
markdown2wechatskill and execute the conversion script:node <markdown2wechat>/scripts/convert.js \ <input_markdown> \ <markdown2wechat>/resources/themes/default.css \ articles/<slug>/article.super.html- The script has zero dependencies (pure Node.js) and does not require
npm install; it automatically processes in a temporary directory and cleans up afterward - The output contains the
<section id="MdWechat">container and complete inline CSS styles - If you want to change the skin, you can replace the second parameter with another theme file under
resources/themes/(apple.css/blue.css/dark.css/green.css/notion.css/vibrant.css) <markdown2wechat>indicates the installation directory of this skill in the current environment; the actual path should prevail at runtime
- The script has zero dependencies (pure Node.js) and does not require
- Input file examples:
- If an illustrated version of the article exists:
<input_markdown>=articles/<slug>/article.illustrated.md - If an illustrated version of the article does not exist:
<input_markdown>=articles/<slug>/article.md
- If an illustrated version of the article exists:
Output:html_article_path(articles/<slug>/article.super.html)
Failure handling: Record the error and note the reason in the execution summary, skip this step and continue with the subsequent process
Step 8: Save to the official account draft box (optional, call wechat-publish)
Trigger conditions:post_to_wechat=true
Default behavior: Save to the draft box via the official WeChat API, without making the final publish submission
Prerequisites:
wechat-publishThe.envin the skill directory has been configured withWECHAT_APP_IDandWECHAT_APP_SECRET- The public IP of the running machine has been added to the IP whitelist in the WeChat official account backend
- If a cover is to be generated automatically, the image generation environment that the publishing skill depends on must also be available (provided by
article-illustrator)
How to call:
- The body must be an HTML file with inline styles
- Prefer to use the
article.super.htmlgenerated in Step 7; if it does not exist, skip this step (or first perform Step 7) - The default recommended stable entry point is to directly call
wechat_draft.js:node <wechat-publish>/scripts/wechat_draft.js \ --title "文章标题" \ --file "articles/<slug>/article.super.html" \ [--author "作者"] \ [--digest "摘要"] \ [--thumb "封面media_id"] \ [--source-url "原文链接"] \ [--need-open-comment "1"] \ [--only-fans-can-comment "1"] - If you want to automatically generate a cover and publish, you can also call:
node <wechat-publish>/scripts/publish_with_cover.js \ --article "articles/<slug>/article.md" \ --html "articles/<slug>/article.super.html" \ [--title "文章标题"] \ [--author "作者"] \ [--source-url "原文链接"] \ [--need-open-comment "1"] \ [--only-fans-can-comment "1"] <wechat-publish>indicates the installation directory of this skill in the current environment; the actual path should prevail at runtimewechat_draft.jsWhen--thumbis not provided, it will automatically read.envfromWECHAT_DEFAULT_THUMB_MEDIA_IDpublish_with_cover.jswill automatically extract the title/summary from the article, generate a single 16:9 cover, upload the cover, and use the returnedmedia_idas thethumb_media_id- Before uploading, the publishing script will automatically expand the
var(--xxx)style variables in the HTML to prevent the WeChat draft box from losing colors and border styles - Before uploading, the publishing script will automatically upload the images in the body to the WeChat body image API and replace
<img src>with the image URL returned by WeChat - Before uploading, the publishing script will downgrade the native list structure to "ordinary paragraphs + bullets/numbers" to be compatible with the list parsing problem when the WeChat draft box re-enters edit mode
Note:
- The script has zero dependencies (pure Node.js >= 16), no need for
npm install - When using
publish_with_cover.js,bunmust be available locally, because cover generation reuses the existing image generation script - After the draft is saved, it will not be automatically submitted for publication; manual confirmation in the WeChat Official Account backend is required
- The title length must not exceed 64 characters
- If there is no available image generation configuration in the current environment, switch to
wechat_draft.jsto upload HTML directly, avoiding failure in the automatic cover step
Success criteria: output 上传草稿成功! 草稿 MEDIA_ID: xxx
Failure troubleshooting checklist:
| Error message | Cause and handling |
|---|---|
[40013] invalid appid |
Incorrect AppID, check the .env |
[40164] invalid ip |
in the publishing skill directory. The current IP is not whitelisted; add the IP from the error message to the WeChat Official Account backend |
[40007] invalid media_id |
The cover image ID is invalid. Use upload_image.js to upload again and obtain a new one |
缺少 Xiaomi/Gemini/OpenAI API Key |
The image generation environment that automatic cover generation depends on is not configured. Check article-illustrator related .env |
article.super.html does not exist |
Step 7 was not executed or failed. Check with_html_theme=true |
| Title is too long | Keep the title <= 64 characters |
Data Flow
用户输入(topic, urls?, slug?, search_count?, time_range_days?, ...)
↓
Preflight(确定slug与目录)
↓
素材搜集(WebSearch + webfetch → evidence.md)
↓
初稿生成(article.md)
↓
智能审稿(含可追溯性/标题一致性)
↓
润色打磨(强制References)
↓
自动配图(article.illustrated.md + illustrations/)
↓
HTML 主题样式输出(markdown2wechat → article.super.html)
↓
保存到草稿箱(不提交发布)
Error Handling
| Exception | Handling method |
|---|---|
| Search returns no results | Prompt the user to provide more information or a reference URL |
| Reference article inaccessible | Skip that URL and continue processing other materials |
| Draft quality too low | Regenerate or prompt the user to provide more materials |
| Review score < 70 | Suggest the user check whether the topic is appropriate |
| Image insertion failed | Output a failure list; you may choose to add images before publishing |
| HTML conversion failed | Record the error and skip this step (Step 7), then continue the subsequent process |
| Publishing to drafts failed | Output a troubleshooting checklist (AppID/IP whitelist/cover media_id/title length) |
Example Usage
Input:
topic: "如何提高工作效率"
urls: ["https://mp.weixin.qq.com/xxx"]
search_count: 5
with_illustrations: true
with_html_theme: true
post_to_wechat: true
Execution process:
- Search for articles related to "how to improve work efficiency"
- Obtain the content of reference articles provided by the user
- Generate a draft (about 1500-2500 words)
- Review score: 85 points
- Save after polishing and optimization
Output:
article_path: articles/how-to-improve-work-efficiency/article.md
sources_path: articles/how-to-improve-work-efficiency/sources/evidence.md
illustrated_article_path: articles/how-to-improve-work-efficiency/article.illustrated.md
illustrations_dir: articles/how-to-improve-work-efficiency/illustrations/how-to-improve-work-efficiency/
html_article_path: articles/how-to-improve-work-efficiency/article.super.html
word_count: 2150
review_score: 92
wechat_draft_status: success
Notes
- The article style should match the WeChat Official Account tone: relaxed, useful, and resonant
- Avoid sensitive content and excessive marketing
- Maintain originality; do not directly copy material content