zhy-wechat-writing

Original🇨🇳 Chinese
Translated

Use when generating a complete WeChat article from a topic, with optional source research, evidence tracking, illustration, HTML conversion, and draft-box publishing.

10installs
Added on

NPX Install

npx skill4agent add zhylq/yuan-skills zhy-wechat-writing

SKILL.md Content (Chinese)

View Translation Comparison →

WeChat Official Account Writing System

Purpose

Automatically complete the full process of official account article writing based on the topic provided by the user (optional reference URLs): multi-source retrieval and evidence pool organization, first draft generation, self-review and polishing, reference material organization, with optional automatic illustration and saving to the official account draft box (no submission for publication).

When to Use

  • User requests "Write a WeChat official account article about XXX"
  • User requests "Generate a WeChat official account article with the topic XXX"
  • User needs a complete WeChat official account article creation process
  • User hopes to "automatically add illustrations after writing" or "send to the official account draft box after writing"

Prerequisites

Before execution, confirm:
  • The user has provided the article topic (
    topic
    )
  • If there are reference article URLs, they can be provided together (
    urls
    )
  • If
    topic
    is purely Chinese and no
    slug
    is provided, it is recommended to supplement with an English/pinyin kebab-case directory name; otherwise, the ASCII downgrade scheme will be used

Workflow

Execute in the following order (products are saved to
articles/<slug>/...
by default, facilitating re-running and traceability):

Phase 0: Preflight

Goal: Determine stable and reusable directory and path specifications
Operations:
  1. Calculate
    slug
    • If the user provides
      slug
      : use it directly (recommended: English/pinyin kebab-case)
    • If
      topic
      contains Latin letters/numbers: convert it to kebab-case
    • Otherwise, downgrade to:
      wechat-article-YYYYMMDD
  2. Create directories:
    • articles/<slug>/
    • articles/<slug>/sources/
  3. Specification: Markdown image references must use relative paths and
    /
    separators

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
    webfetch
    in parallel to obtain content, extract key points, and record the URL and available publication date
  2. If the user does not provide
    urls
    : use
    WebSearch
    in parallel for multi-source retrieval (recommended coverage: official documents / X(Twitter) / Reddit / technical forums / WeChat official accounts / engineering practices)
    • official/authority: official documents, standards/specifications, authoritative media interpretations
    • community: X(Twitter), Reddit, forums/discussions
    • practice: GitHub issues, engineering blogs, case reviews
    • Recommended parallel query templates (combine as needed, try to add years/time ranges to emphasize recent content):
      • {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:mp.weixin.qq.com
        (WeChat official accounts)
      • {topic} practical review pitfalls 2025 2026
        (Chinese engineering practices)
  3. Merge and deduplicate, grade by credibility (high/medium/low), form an evidence pool, and save it to:
    • articles/<slug>/sources/evidence.md
Tool Mapping:
  • "Search" in this process uses:
    WebSearch
  • "Fetch web page content" in this process uses:
    webfetch
About WebSearch (Implementation Notes):
  • Priority is given to using the
    WebSearch
    tool built into the runtime environment.
  • If no available
    WebSearch
    is present in the current environment: use
    webfetch
    to crawl public search results pages (SERP), extract the URL list from the results, then use
    webfetch
    in parallel to obtain the main content.
Evidence Pool Entry Format (Each entry must include):
  • title
  • url
  • published_at (if available)
  • source_type (official/community/practice)
  • key_takeaways (3-6 key points, preferably directly adaptable to main content materials)
  • confidence (high/medium/low)
Stop Conditions (Recommended):
  • 8-12 candidate sources, with medium/high >= 5 sources
Common Failure Handling (Newly Added):
  • X/Reddit login wall or inability to crawl main content:
    • Prioritize publicly accessible mirrors/references (second-hand reports must be marked
      confidence=low/medium
      ), or switch to crawling blogs/forum reposts with the same viewpoint;
    • If original posts must be cited: only use WebSearch result summaries + other independent sources for corroboration, do not fabricate details.
  • SERP crawling/parsing failure (when no WebSearch fallback path is available):
    • Switch to the "site-specific retrieval" strategy: directly use
      webfetch
      to crawl the official site's search/blog index page or GitHub search page;
    • If coverage is still not possible: ask the user for 3-5 key URLs or a specified list of information sources.
  • Deduplication and credibility:
    • At least 2 independent sources to corroborate the same fact;
    • Official/primary documents are prioritized as
      high
      ; community discussions without implementation details or cross-validation are marked
      low
      .
Output:
sources_path
(evidence pool path)

Step 2: First Draft Generation

Goal: Generate the first draft of the official account article based on materials
Writing Requirements:
  1. Title: Eye-catching, can use the following techniques
    • Number type:
      5 Methods to Help You...
    • Question type:
      Why...?
    • Comparison type:
      Differences Between A and B...
    • Suspense type:
      Things You Don't Know About...
  2. Opening (First 3-5 lines):
    • Present pain points or resonate with readers
    • Set suspense or raise questions
    • Clarify the value of the article
  3. Main Content Structure:
    • Use subheadings for segmentation (## or ###)
    • 200-300 words per paragraph
    • Include cases and data support
    • Use lists to enhance readability
  4. Conclusion:
    • Summarize core viewpoints
    • Guide interaction (likes, "read later", comments)
    • Can add golden sentences or calls to action
  5. Word Count Requirement: 1500-2500 words
  6. Traceability Requirement (New Hard Constraint):
    • Key facts/data/conclusions must be supported by the evidence pool
    • The end of the article must append
      ## References/Sources
      (5-10 links, preferably with dates)
Output: First draft in Markdown format, saved to:
articles/<slug>/article.md

Step 3: Intelligent Review

Goal: Review the article from four dimensions to identify issues
Review Dimensions:
DimensionCheck PointsWeight
LogicClear arguments, sufficient evidence, reasonable reasoning30%
ExpressionFluent language, no AI traces, appropriate colloquialism25%
DataAccurate data, appropriate cases, standardized citations25%
StructureEye-catching title, clear paragraphs, echo between beginning and end20%
New Hard Checks:
  • Traceability: Whether key assertions are supported by the evidence pool
  • Title Consistency: Whether the title's promise is clearly fulfilled in the main content
Review Operations:
  1. Check logical coherence paragraph by paragraph
  2. Mark AI trace vocabulary (such as "To sum up", "It is not difficult to see", etc.)
  3. Verify the accuracy of data and cases
  4. Check structure and rhythm
Scoring Standards:
  • 90-100 points: Excellent, can be published directly
  • 80-89 points: Good, minor optimizations needed
  • 70-79 points: Qualified, needs revision
  • Below 70 points: Needs rewriting
Output: Review report (including issues and revision suggestions), recommended to be saved to:
articles/<slug>/sources/review.md

Step 4: Polishing

Goal: Fix issues and improve article quality
Polishing Operations:
  1. Remove AI Traces
    • Replace vocabulary:
      • 综上所述
        All in all
      • 总而言之
        To put it simply
      • 由此可见
        So we can see
      • 不难看出
        We can find that
      • 众所周知
        As we all know
    • Avoid overly formal expressions
  2. Enhance Colloquialism
    • Appropriately add:
      Actually
      ,
      To be honest
      ,
      I have to say
    • Use short sentences, avoid long and complex sentences
    • Add transition words to enhance fluency
  3. Optimize Rhythm
    • Combine long and short sentences
    • Appropriately use exclamations and rhetorical questions
    • Control paragraph length (recommended no more than 5 lines)
  4. Fix Review Issues
    • Fix items one by one according to the review report
    • Supplement missing data or cases
    • Adjust unreasonable structures
Output: Final article
Mandatory Requirements (Newly Added):
  • The final article must retain or supplement
    ## References/Sources
  • It is recommended to keep 5-10 references, grouped by
    official
    /
    community
    /
    practice
    is better

Step 5: Saving and Output

Operations:
  1. Create output directory (if not exists):
    • 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 zhy-article-illustrator)

Trigger Condition:
with_illustrations=true
Goal: Generate high-quality illustrations with a unified 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. Prioritize calling the one-click process script of
    zhy-article-illustrator
    :
    bash
    node <zhy-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>
    for each term, for example:
    bash
    --term Playwright --term Chromium --term Firefox --term WebKit
  3. Default to the new illustration strategy:
    • First generate the article-level
      visual-bible.md
    • Then generate
      outline.md
      and
      prompts/
    • Default text in images is Simplified Chinese, only whitelisted terms retain English
    • All images in the same article share a unified style system
  4. When integrating writing skills, follow the following field mapping:
    • 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: Retry once for single image failure; if still failed, record and continue, finally output the failure list. If some images fail,
article.illustrated.md
should still be retained, and image placeholder comments inserted.

Step 7: HTML Theme Style Output (Optional, call zhy-markdown2wechat)

Trigger Condition:
with_html_theme=true
Goal: Use the
zhy-markdown2wechat
skill to convert Markdown to HTML with WeChat inline styles
Operations:
  1. Select input file:
    • If
      with_illustrations=true
      and
      articles/<slug>/article.illustrated.md
      exists, use this file
    • Otherwise, use
      articles/<slug>/article.md
  2. Record the selected Markdown file as
    <input_markdown>
  3. Call the
    zhy-markdown2wechat
    skill and execute the conversion script:
    bash
    node <zhy-markdown2wechat>/scripts/convert.js \
     <input_markdown> \
     <zhy-markdown2wechat>/resources/themes/default.css \
     articles/<slug>/article.zhy.html
    • The script has zero dependencies (pure Node.js), no need for
      npm install
      , automatically processes in a temporary directory and cleans up afterwards
    • Output includes a
      <section id="MdWechat">
      container and complete inline CSS styles
    • To change the theme, replace the second parameter with other theme files under
      resources/themes/
      (
      apple.css
      /
      blue.css
      /
      dark.css
      /
      green.css
      /
      notion.css
      /
      vibrant.css
      )
    • <zhy-markdown2wechat>
      refers to the installation directory of this skill in the current environment, use the actual path during runtime
  4. Input file examples:
    • If illustrated article exists:
      <input_markdown>=articles/<slug>/article.illustrated.md
    • If illustrated article does not exist:
      <input_markdown>=articles/<slug>/article.md
Output:
html_article_path
(
articles/<slug>/article.zhy.html
)
Failure Handling: Record the error and note the reason in the execution summary, skip this step and continue with subsequent processes

Step 8: Save to Official Account Draft Box (Optional, call zhy-wechat-publish)

Trigger Condition:
post_to_wechat=true
Default Behavior: Save to the draft box via the official WeChat API, no final publication submission
Prerequisites:
  • WECHAT_APP_ID
    and
    WECHAT_APP_SECRET
    have been configured in the
    .env
    file under the
    zhy-wechat-publish
    skill directory
  • The public IP of the running machine has been added to the IP whitelist in the WeChat official account backend
  • To automatically generate a cover image, the image generation environment dependent on the publishing skill must also be available (provided by
    zhy-article-illustrator
    )
Calling Method:
  • The main content must be an HTML file with inline styles
  • Prioritize using
    article.zhy.html
    generated in Step 7; if it does not exist, skip this step (or first complete Step 7)
  • The recommended stable entry is to directly call
    wechat_draft.js
    :
    bash
    node <zhy-wechat-publish>/scripts/wechat_draft.js \
      --title "Article Title" \
      --file "articles/<slug>/article.zhy.html" \
      [--author "Author"] \
      [--digest "Abstract"] \
      [--thumb "Cover media_id"] \
      [--source-url "Original Link"] \
      [--need-open-comment "1"] \
      [--only-fans-can-comment "1"]
  • To automatically generate a cover image and publish, you can also call:
    bash
    node <zhy-wechat-publish>/scripts/publish_with_cover.js \
      --article "articles/<slug>/article.md" \
      --html "articles/<slug>/article.zhy.html" \
      [--title "Article Title"] \
      [--author "Author"] \
      [--source-url "Original Link"] \
      [--need-open-comment "1"] \
      [--only-fans-can-comment "1"]
  • <zhy-wechat-publish>
    refers to the installation directory of this skill in the current environment, use the actual path during runtime
  • When
    --thumb
    is not provided in
    wechat_draft.js
    , it will automatically read
    WECHAT_DEFAULT_THUMB_MEDIA_ID
    from
    .env
  • publish_with_cover.js
    will automatically extract the title/abstract from the article, generate a 16:9 cover image, upload the cover image, and use the returned
    media_id
    as
    thumb_media_id
  • The publishing script will automatically expand
    var(--xxx)
    style variables in the HTML before uploading to avoid loss of colors and border styles in the WeChat draft box
  • The publishing script will automatically upload images in the main content to the WeChat main content image interface before uploading, and replace
    <img src>
    with the image URL returned by WeChat
  • The publishing script will automatically downgrade the native list structure to "ordinary paragraphs + dots/numbers" before uploading to resolve the list parsing issue when re-entering edit mode in the WeChat draft box
Notes:
  • The script has zero dependencies (pure Node.js >= 16), no need for
    npm install
  • When using
    publish_with_cover.js
    ,
    bun
    must be available locally, as the cover image generation reuses existing image generation scripts
  • After saving the draft, it will not be automatically submitted for publication; manual confirmation in the official account backend is required
  • The title length cannot exceed 64 characters
  • If no available image generation configuration exists in the current environment, prioritize using
    wechat_draft.js
    to directly upload HTML to avoid failure in the automatic cover image step
Success Criteria: Output
Upload draft successfully! Draft MEDIA_ID: xxx
Failure Troubleshooting List:
Error MessageCause and Handling
[40013] invalid appid
Incorrect AppID, check
.env
under the publishing skill directory
[40164] invalid ip
Current IP not in whitelist, add the IP in the error message to the official account backend
[40007] invalid media_id
Invalid cover image ID, re-upload using
upload_image.js
to obtain a new one
Missing Xiaomi/Gemini/OpenAI API Key
Image generation environment dependent on automatic cover image generation not configured, check
.env
related to
zhy-article-illustrator
article.zhy.html
does not exist
Step 7 not executed or failed, check
with_html_theme=true
Title too longControl title <= 64 characters

Data Flow

User Input (topic, urls?, slug?, search_count?, time_range_days?, ...)
Preflight (Determine slug and directory)
Material Collection (WebSearch + webfetch → evidence.md)
First Draft Generation (article.md)
Intelligent Review (including traceability/title consistency)
Polishing (Mandatory References)
Automatic Illustration (article.illustrated.md + illustrations/)
HTML Theme Style Output (zhy-markdown2wechat → article.zhy.html)
Save to Draft Box (No submission for publication)

Error Handling

ExceptionHandling Method
No search resultsPrompt user to provide more information or reference URLs
Reference article inaccessibleSkip this URL and continue processing other materials
Low quality of first draftRegenerate or prompt user to provide more materials
Review score <70Suggest user check if the topic is appropriate
Illustration failureOutput failure list; can choose to supplement images before publishing
HTML conversion failureRecord error and skip this step (Step 7), continue with subsequent processes
Failure to save to draft boxOutput troubleshooting list (AppID/IP whitelist/cover media_id/title length)

Example Usage

Input:
topic: "How to Improve Work Efficiency"
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 content of the reference article provided by the user
  3. Generate first draft (about 1500-2500 words)
  4. Review score: 85 points
  5. Polish and optimize, then save
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.zhy.html
word_count: 2150
review_score: 92
wechat_draft_status: success

Notes

  • The article style should conform to the official account's tone: relaxed, useful, and resonant
  • Avoid sensitive content and excessive marketing
  • Maintain originality, do not directly copy material content