SuperAPI AI Directory

wechat-writing

Writing & research

View repository

Updated 10-16 08:49

About this skill

WeChat Official Account Writing System

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 topic is pure Chinese and no slugis provided, it is recommended to add an English/pinyin kebab-case directory 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:

  1. Calculate slug
    • If the user provides slug: use it directly (recommended: English/pinyin kebab-case)
    • If topic contains Latin letters/digits: convert it to kebab-case
    • Otherwise fall back:wechat-article-YYYYMMDD
  2. Create directory:
    • articles/<slug>/
    • articles/<slug>/sources/
  3. 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:

  1. If the user provides urls: use in parallel webfetch to obtain content, extract key points, and record the URL and publication date if available
  2. If the user does not provide urls: use in parallel WebSearch for 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)
  3. 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 WebSearch tool included with the runtime environment.
  • If the current environment does not have an available WebSearch: use webfetch to fetch public search engine result pages (SERP), extract the URL list from the results, and then in parallel webfetch the 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.
  • SERP scraping/parsing failure (when there is no WebSearch fallback path):
    • Switch to a "site search" strategy: directly use webfetch to 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.
  • 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 labeled low。

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:

  1. Title: Eye-catching; the following techniques may be used

    • Numeric type:5个方法让你...
    • Question type:为什么...?
    • Contrast type:A与B的区别...
    • Suspense type:你不知道的...
  2. Opening(first 3-5 lines):

    • Present a pain point or create resonance
    • Set up suspense or ask a question
    • Clarify the article's value
  3. Body structure:

    • Use subheadings to divide sections (## or ###)
    • Each section 200-300 characters
    • Include cases and data support
    • Use lists to enhance readability
  4. Ending:

    • Summarize the core viewpoint
    • Guide interaction (likes, Wow, comments)
    • May add a memorable quote or call to action
  5. Word count requirement: 1500-2500 characters

  6. 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:

  1. Check logical coherence paragraph by paragraph
  2. Flag AI-tell vocabulary (such as "in conclusion", "it is not hard to see", etc.)
  3. Verify the accuracy of data and cases
  4. 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:

  1. Remove AI traces

    • Replace vocabulary:
      • 综上所述 → 总的来说
      • 总而言之 → 说到底
      • 由此可见 → 所以说
      • 不难看出 → 我们能发现
      • 众所周知 → 大家都知道
    • Avoid overly formal expressions
  2. Enhance colloquial style

    • Appropriately add:其实、说实话、不得不说
    • Use short sentences, avoid long and complex sentences
    • Add transition words to enhance fluency
  3. Optimize rhythm

    • Combine long and short sentences
    • Appropriately use exclamatory and rhetorical questions
    • Control paragraph length (recommended no more than 5 lines)
  4. 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 / practice Grouping is better

Step 5: Save and Output

Operations:

  1. Create output directory (if it does not exist):
    • articles/<slug>/
  2. Save article:
    • articles/<slug>/article.md
  3. Output execution summary:
    • article_path
    • sources_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: Use articles/<slug>/article.md
  • slug: Reuse the current article slug
  • density: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:

  1. 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]
    
  2. If illustration_english_terms_whitelist is not empty, append --term <value>to each term, for example:
    --term Playwright --term Chromium --term Firefox --term WebKit
    
  3. By default, follow the new illustration strategy:
    • First generate the article-level visual-bible.md
    • then generate outline.md and prompts/
    • 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
  4. Writing skills should follow the following field mapping when integrated:
    • article_path -> --article
    • slug -> --slug
    • illustration_density -> --density
    • illustration_aspect_ratio -> --aspect-ratio
    • illustration_prompt_profile -> --prompt-profile
    • illustration_text_language -> --text-language
    • illustration_image_provider -> --image-provider
    • illustration_image_model -> --image-model
    • illustration_image_size -> --image-size
    • illustration_image_base_url -> --image-base-url
    • illustration_upload=true -> --upload

Output:

  • illustrated_article_path: articles/<slug>/article.illustrated.md
  • illustrations_dir: articles/<slug>/illustrations/<slug>/
  • articles/<slug>/illustrations/<slug>/visual-bible.md
  • articles/<slug>/illustrations/<slug>/outline.md
  • articles/<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:

  1. Select the input file:
    • If with_illustrations=true and articles/<slug>/article.illustrated.md exist, use that file
    • Otherwise use articles/<slug>/article.md
  2. Record the selected Markdown file as <input_markdown>
  3. Call the markdown2wechat skill 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
  4. 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

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-publish The .env in the skill directory has been configured with WECHAT_APP_ID and WECHAT_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 runtime
  • wechat_draft.js When --thumb is not provided, it will automatically read .env from WECHAT_DEFAULT_THUMB_MEDIA_ID
  • publish_with_cover.js will automatically extract the title/summary from the article, generate a single 16:9 cover, upload the cover, and use the returned media_id as the thumb_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.js to 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:

  1. Search for articles related to "how to improve work efficiency"
  2. Obtain the content of reference articles provided by the user
  3. Generate a draft (about 1500-2500 words)
  4. Review score: 85 points
  5. 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