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
Sourcezhylq/yuan-skills
Added on
NPX Install
npx skill4agent add zhylq/yuan-skills zhy-wechat-writingTags
Translated version includes tags in frontmatterSKILL.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 is purely Chinese and no
topicis provided, it is recommended to supplement with an English/pinyin kebab-case directory name; otherwise, the ASCII downgrade scheme will be usedslug
Workflow
Execute in the following order (products are saved to by default, facilitating re-running and traceability):
articles/<slug>/...Phase 0: Preflight
Goal: Determine stable and reusable directory and path specifications
Operations:
- Calculate
slug- If the user provides : use it directly (recommended: English/pinyin kebab-case)
slug - If contains Latin letters/numbers: convert it to kebab-case
topic - Otherwise, downgrade to:
wechat-article-YYYYMMDD
- If the user provides
- Create directories:
articles/<slug>/articles/<slug>/sources/
- 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:
- If the user provides : use
urlsin parallel to obtain content, extract key points, and record the URL and available publication datewebfetch - If the user does not provide : use
urlsin parallel for multi-source retrieval (recommended coverage: official documents / X(Twitter) / Reddit / technical forums / WeChat official accounts / engineering practices)WebSearch- 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 - (WeChat official accounts)
{topic} site:mp.weixin.qq.com - (Chinese engineering practices)
{topic} practical review pitfalls 2025 2026
- 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 tool built into the runtime environment.
WebSearch - If no available is present in the current environment: use
WebSearchto crawl public search results pages (SERP), extract the URL list from the results, then usewebfetchin parallel to obtain the main content.webfetch
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 ), or switch to crawling blogs/forum reposts with the same viewpoint;
confidence=low/medium - If original posts must be cited: only use WebSearch result summaries + other independent sources for corroboration, do not fabricate details.
- Prioritize publicly accessible mirrors/references (second-hand reports must be marked
- SERP crawling/parsing failure (when no WebSearch fallback path is available):
- Switch to the "site-specific retrieval" strategy: directly use to crawl the official site's search/blog index page or GitHub search page;
webfetch - If coverage is still not possible: ask the user for 3-5 key URLs or a specified list of information sources.
- Switch to the "site-specific retrieval" strategy: directly use
- Deduplication and credibility:
- At least 2 independent sources to corroborate the same fact;
- Official/primary documents are prioritized as ; community discussions without implementation details or cross-validation are marked
high.low
Output: (evidence pool path)
sources_pathStep 2: First Draft Generation
Goal: Generate the first draft of the official account article based on materials
Writing Requirements:
-
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...
- Number type:
-
Opening (First 3-5 lines):
- Present pain points or resonate with readers
- Set suspense or raise questions
- Clarify the value of the article
-
Main Content Structure:
- Use subheadings for segmentation (## or ###)
- 200-300 words per paragraph
- Include cases and data support
- Use lists to enhance readability
-
Conclusion:
- Summarize core viewpoints
- Guide interaction (likes, "read later", comments)
- Can add golden sentences or calls to action
-
Word Count Requirement: 1500-2500 words
-
Traceability Requirement (New Hard Constraint):
- Key facts/data/conclusions must be supported by the evidence pool
- The end of the article must append (5-10 links, preferably with dates)
## References/Sources
Output: First draft in Markdown format, saved to:
articles/<slug>/article.mdStep 3: Intelligent Review
Goal: Review the article from four dimensions to identify issues
Review Dimensions:
| Dimension | Check Points | Weight |
|---|---|---|
| Logic | Clear arguments, sufficient evidence, reasonable reasoning | 30% |
| Expression | Fluent language, no AI traces, appropriate colloquialism | 25% |
| Data | Accurate data, appropriate cases, standardized citations | 25% |
| Structure | Eye-catching title, clear paragraphs, echo between beginning and end | 20% |
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:
- Check logical coherence paragraph by paragraph
- Mark AI trace vocabulary (such as "To sum up", "It is not difficult to see", etc.)
- Verify the accuracy of data and cases
- 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.mdStep 4: Polishing
Goal: Fix issues and improve article quality
Polishing Operations:
-
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
- Replace vocabulary:
-
Enhance Colloquialism
- Appropriately add: ,
Actually,To be honestI have to say - 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 exclamations and rhetorical questions
- Control paragraph length (recommended no more than 5 lines)
-
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/communityis betterpractice
Step 5: Saving and Output
Operations:
- Create output directory (if not exists):
articles/<slug>/
- Save article:
articles/<slug>/article.md
- Output execution summary:
article_pathsources_path- Word count
- Review score
Step 6: Automatic Illustration (Optional, call zhy-article-illustrator)
Trigger Condition:
with_illustrations=trueGoal: Generate high-quality illustrations with a unified style for the article, and produce an illustrated version of the article
Default Strategy:
- : Use
article_patharticles/<slug>/article.md - : Reuse the current article slug
slug - :
density(default balanced)illustration_density - :
upload(default false)illustration_upload - :
aspect_ratio(default 16:9)illustration_aspect_ratio - :
prompt_profile(default nano-banana)illustration_prompt_profile - :
text_language(default zh-CN)illustration_text_language - :
english_terms_whitelist(default empty)illustration_english_terms_whitelist - :
image_provider(default xiaomi)illustration_image_provider - :
image_model(default gemini-3.1-flash-image-preview)illustration_image_model - :
image_size(default 1K)illustration_image_size - :
image_base_url(default Xiaomi API address, also supports Gemini native proxy)illustration_image_base_url
Execution Method:
- Prioritize calling the one-click process script of :
zhy-article-illustratorbashnode <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] - If is not empty, append
illustration_english_terms_whitelistfor each term, for example:--term <value>bash--term Playwright --term Chromium --term Firefox --term WebKit - Default to the new illustration strategy:
- First generate the article-level
visual-bible.md - Then generate and
outline.mdprompts/ - Default text in images is Simplified Chinese, only whitelisted terms retain English
- All images in the same article share a unified style system
- First generate the article-level
- When integrating writing skills, follow the following field mapping:
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_patharticles/<slug>/article.illustrated.md - :
illustrations_dirarticles/<slug>/illustrations/<slug>/ articles/<slug>/illustrations/<slug>/visual-bible.mdarticles/<slug>/illustrations/<slug>/outline.mdarticles/<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, should still be retained, and image placeholder comments inserted.
article.illustrated.mdStep 7: HTML Theme Style Output (Optional, call zhy-markdown2wechat)
Trigger Condition:
with_html_theme=trueGoal: Use the skill to convert Markdown to HTML with WeChat inline styles
zhy-markdown2wechatOperations:
- Select input file:
- If and
with_illustrations=trueexists, use this filearticles/<slug>/article.illustrated.md - Otherwise, use
articles/<slug>/article.md
- If
- Record the selected Markdown file as
<input_markdown> - Call the skill and execute the conversion script:
zhy-markdown2wechatbashnode <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 , automatically processes in a temporary directory and cleans up afterwards
npm install - Output includes a container and complete inline CSS styles
<section id="MdWechat"> - 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 - refers to the installation directory of this skill in the current environment, use the actual path during runtime
<zhy-markdown2wechat>
- The script has zero dependencies (pure Node.js), no need for
- 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
- If illustrated article exists:
Output: ()
html_article_patharticles/<slug>/article.zhy.htmlFailure 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=trueDefault Behavior: Save to the draft box via the official WeChat API, no final publication submission
Prerequisites:
- and
WECHAT_APP_IDhave been configured in theWECHAT_APP_SECRETfile under the.envskill directoryzhy-wechat-publish - 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 generated in Step 7; if it does not exist, skip this step (or first complete Step 7)
article.zhy.html - The recommended stable entry is to directly call :
wechat_draft.jsbashnode <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"] - refers to the installation directory of this skill in the current environment, use the actual path during runtime
<zhy-wechat-publish> - When is not provided in
--thumb, it will automatically readwechat_draft.jsfromWECHAT_DEFAULT_THUMB_MEDIA_ID.env - will automatically extract the title/abstract from the article, generate a 16:9 cover image, upload the cover image, and use the returned
publish_with_cover.jsasmedia_idthumb_media_id - The publishing script will automatically expand style variables in the HTML before uploading to avoid loss of colors and border styles in the WeChat draft box
var(--xxx) - The publishing script will automatically upload images in the main content to the WeChat main content image interface before uploading, and replace with the image URL returned by WeChat
<img src> - 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.jsmust be available locally, as the cover image generation reuses existing image generation scriptsbun - 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 to directly upload HTML to avoid failure in the automatic cover image step
wechat_draft.js
Success Criteria: Output
Upload draft successfully! Draft MEDIA_ID: xxxFailure Troubleshooting List:
| Error Message | Cause and Handling |
|---|---|
| Incorrect AppID, check |
| Current IP not in whitelist, add the IP in the error message to the official account backend |
| Invalid cover image ID, re-upload using |
| Image generation environment dependent on automatic cover image generation not configured, check |
| Step 7 not executed or failed, check |
| Title too long | Control 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
| Exception | Handling Method |
|---|---|
| No search results | Prompt user to provide more information or reference URLs |
| Reference article inaccessible | Skip this URL and continue processing other materials |
| Low quality of first draft | Regenerate or prompt user to provide more materials |
| Review score <70 | Suggest user check if the topic is appropriate |
| Illustration failure | Output failure list; can choose to supplement images before publishing |
| HTML conversion failure | Record error and skip this step (Step 7), continue with subsequent processes |
| Failure to save to draft box | Output 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: trueExecution Process:
- Search for articles related to "How to Improve Work Efficiency"
- Obtain content of the reference article provided by the user
- Generate first draft (about 1500-2500 words)
- Review score: 85 points
- 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: successNotes
- 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