SuperAPI AI Directory

wechat-article-writer

Writing & research

View repository

Updated 10-15 20:04

About this skill

Official Account/Self-Media Creation

1. Task Identification

Select the execution path based on user needs:

Task Type Trigger Words Execution
Cover/ending image only Cover image, official account cover, Bilibili cover, Xiaohongshu image Read cover_guide.md
In-body illustrations only Illustrations, step diagrams, demo diagrams, process diagrams, before-and-after comparison Read illustration_guide.md
Write article Write official account, write article, self-media writing, viral article, content creation Execute Step 2–6
Style extraction Analyze writing style, clone writing style, imitate a certain piece, extract style, convert sample essay into style guide Execute "4. Style Extraction Process"

2. Writing Styles

When writing an article, select a style file according to the user's specification; if unspecified, use the default style.

No. Style Trigger words (mutually exclusive) Reference file Length
1 Default (when unspecified) writing_style.md 2000–4000 words
2 High-traffic/viral High traffic, viral, like that Skills piece viral_style.md 7 2500–4000 words
3 Listicle/methodology Listicle, methodology, practical tips, steps checklist_methodology_style.md 2000–4000 words
4 Resource roundup Roundup, alternatives, collection resource_roundup_style.md 3000–6000 words
5 Personal tested recommendation Personal testing, personal recommendation personal_tool_review_style.md 4000–7000 words
6 Cognitive disruption Cognitive disruption, counterintuitive, opinion piece contrarian_opinion_style.md 2000–3500 words
7 Identity resonance/comeback Identity resonance, comeback, you can do it too, career change experience identity_transformation_style.md 2500–4000 words
8 Storytelling/emotional resonance Storytelling, emotional resonance, character story story_emotional_style.md 2500–4500 words
9 In-depth essay Deep thinking, essay, like that diary piece, personal reflections personal_essay_style.md 4000–7000 words

3. Writing Process (Step 2–6)

Step 2: Search for materials

  • Search multiple sources in parallel (official documentation, X/Twitter, Reddit, technical forums, etc.)
  • Prioritize the latest materials from the current month/quarter
  • Summarize in depth before proceeding to writing

Step 3: Write the article

  1. Read the style file: Select the corresponding reference file according to "2. Writing Styles," and strictly follow its writing specifications and closing remarks
  2. General requirements: Story-based opening, with emotional color, prepare 2–3 alternative titles
  3. Heading levels:Use for article title # 一级标题,Main body sections also start from # (do not use ##), subsections use ##,and so on

Step 4: Generate titles

Generate 5 viral-style titles: clear pain point, attractive numbers, result-oriented, emotional appeal, suspense setup.

Step 5: Layout optimization

Output layout and image suggestions: paragraph structure, image placement (cover/body/ending), code block whitespace, standalone paragraphs for key quotes.

Step 6: Generate images (optional)

When the user requests it or image placement is noted in the layout suggestions:

  1. Read the guide:

    • Cover/ending image → Read reference/cover_guide.md
    • Body illustration → Read reference/illustration_guide.md
  2. Generate and save .drawio file:

    • Must save: Generate complete mxGraph XML content and save it as a file
    • Cover imageSave as images/covers/source/主题关键词-cover.drawio
    • Body illustrationSave as images/illustrations/source/主题关键词-图序号.drawio
    • Color scheme consistent with the article
    • After successful saving, inform the user of the file path
  3. Automatically convert to PNG (optional):

    • Check whether the draw.io CLI tool is installed
    • If installed: automatically run bash scripts/export-drawio.sh covers, convert drawio to PNG
    • If not installed: prompt the user to export manually or install draw.io CLI
    • Save PNG to images/covers/export/ or images/illustrations/export/
  4. Output usage instructions:

    • Cover description: layout purpose and style (1-2 sentences)
    • File path: location of the saved .drawio file
    • If automatic conversion succeeds: PNG file location
    • If manual export is needed: export step instructions

Image folder structure:

images/
├── covers/source/        # 封面 .drawio 文件(自动保存)✅
├── covers/export/        # 封面 PNG/JPG(自动或手动导出)
├── illustrations/source/ # 正文 .drawio 文件(自动保存)✅
└── illustrations/export/ # 正文 PNG/JPG(自动或手动导出)

How to export PNG(choose one of three):

  1. Automatic export (recommended): If draw.io CLI is installed, the system will convert automatically
  2. Script export: Manually run bash scripts/export-drawio.sh covers
  3. Manual export: Open with Draw.io → File → Export as → PNG (2x resolution)

Step 7: Upload to WeChat Official Account (optional)

Execute when the user requests uploading to drafts; supports both manual and automatic modes.

Prerequisites

  1. Ensure images have been exported to PNG/JPG format (Step 6)
  2. Configure WeChat Official Account credentials (only required for automatic mode):
    # .env 文件
    WECHAT_APPID=your_app_id
    WECHAT_SECRET=your_app_secret
    

Mode A: Manual upload (zero code, recommended for beginners)

  1. Read the generated files:

    • Article path:drafts/日期-主题.md(saved in Step 3)
    • Title path:drafts/备选标题.txt(saved in Step 4)
    • Cover image:images/covers/source/主题-cover.drawio(saved in Step 6)
  2. Export cover image:

    • Open with Draw.io .drawio file
    • File → Export as → PNG (2x resolution)
    • Save to images/covers/export/
  3. Convert Markdown to WeChat format:

    • Open Doocs MD Editor
    • Open drafts/日期-主题.md, copy all content
    • Paste into the left editing area of Doocs MD
    • Select a theme style (Default, Orange Heart, Purple Beauty, etc.)
    • Live preview of WeChat format on the right
  4. Copy to Official Account:

    • Click the "Copy" button
    • Open the Official Account backend → Create New Article → Paste content
    • Upload cover image (from images/covers/export/)
    • From 备选标题.txt to select a title
    • Save as draft or publish directly

Pros: No technical configuration required, ready to use out of the box, rich styles, all files automatically generated Use cases: Occasional posting, focus on style adjustments

Mode B: Automatic upload (API calls, recommended for frequent posting)

  1. Read the generated files:

    • Article:drafts/日期-主题.md(saved in Step 3)
    • Cover:images/covers/export/主题-cover.png(must be exported first)
    • Title: From drafts/备选标题.txt to select
  2. Automatically execute the workflow:

    # 方式 1: 使用现成工具(推荐)
    npx wechat-article-publisher \
      --markdown drafts/2026-03-19-ai-tools.md \
      --cover images/covers/export/ai-tools-cover.png \
      --images images/illustrations/export/ \
      --auto-upload
    
    # 方式 2: 使用自定义脚本
    node scripts/upload-to-wechat.js \
      --title "2026 最全 AI 编程工具盘点:30+ 神器让代码写得飞起" \
      --content drafts/2026-03-19-ai-tools.md \
      --cover images/covers/export/ai-tools-cover.png
    
  3. Automation steps(executed internally by the script):

    • Obtain WeChat access_token (automatically cached for 7200 seconds)
    • Upload cover image to the material library → obtain thumb_media_id
    • Upload body images → replace image links in Markdown
    • Convert Markdown → WeChat HTML (inline styles)
    • Call the Draft Box API to create a draft
    • Return the draft ID and preview link
  4. Output example:

    ✅ 草稿已上传成功!
    ✅ 草稿 media_id: Mzg5MjQ3NTg2Mg==_1234567890
    ✅ 请在公众号后台查看并发布
    ⏱️  耗时: 3.2 秒
    

Pros: Fully automated, batch publishing, saves time Use cases: Frequent posting, team collaboration, content matrix

Notes

⚠️ Restrictions:

  • Must be a verified Official Account (personal accounts cannot use the publishing API)
  • Cover image < 10MB, format JPG/PNG
  • Body image < 2MB, format JPG/PNG/GIF

⚠️ Security reminder:

  • Do not commit AppSecret to a Git repository
  • Use the .env file or environment variables to store credentials
  • Refresh the cached Token 5 minutes early to avoid error 40001

⚠️ Publishing restrictions (from July 2025):

  • Unverified personal accounts: can only create drafts, must publish manually
  • Verified accounts: can call the publishing API to publish automatically

IV. Style Extraction Workflow

Execute when the user provides sample articles (full text pasted or local paths) and wants to analyze style, clone the writing style, or convert sample articles into a style guide.

First read extraction_dimensions.md, and extract according to unified dimensions.

Step 1: Task confirmation

  • Number of samples (1 or multiple articles)
  • Purpose of use (imitative writing / team style guidelines / Prompt solidification)
  • Whether to retain the author's catchphrases and brand terms

Step 2: Structural breakdown

Extract: opening hook pattern, writing skeleton, paragraph rhythm, ending action.

Step 3: Language and rhetoric breakdown

Extract: tone and person, sentence patterns and punctuation, high-frequency words/transition words/catchphrases, rhetorical devices.

Step 4: Produce the style rule package

Output must include: style profile (100–200 words), executable rules (15–30 items, must/prefer/avoid), style replication Prompt, reverse self-check checklist, boundary statement.

Step 5: Verification and playback (optional)

If the user needs it: a trial outline on the same topic, a 100–200 word trial paragraph, and an explanation of similarities/differences.

Output order: sample overview → style profile → style rule package → Prompt template → self-check checklist → boundary statement

V. Examples

User request Execution
Generate a cover for this article Read cover_guide.md, generate a merged cover by default (1283×383)
Generate a step diagram for the four steps to enable Cursor Read illustration_guide.md and generate
Help me write a WeChat official account article about Cursor Skills Complete Step 2–6 workflow
Write an article about Vibe Coding in a high-traffic style, and upload it to the drafts folder Read viral_style.md, write in viral style + Step 7 automatic upload
Write free alternatives for transferring large files in a resource roundup style Read resource_roundup_style.md, write in roundup style
Write about keeping a diary in the AI era in a deep essay style Read personal_essay_style.md, write in essay style
Write a software recommendation in a personal hands-on review style Read personal_tool_review_style.md, write in hands-on recommendation style
Write 5 habits to improve efficiency in a listicle style Read checklist_methodology_style.md, write in methodology style
Write about a workplace transition experience in a storytelling style Read story_emotional_style.md, write in emotional resonance style
Write “Effort is the most overrated quality” in a cognitive disruption style Read contrarian_opinion_style.md, write in a counterintuitive opinion style
Write about switching careers to self-media at 30 in an identity resonance style Read identity_transformation_style.md, write in a comeback narrative style
After writing, help me convert it to WeChat format Execute Step 7A (manual mode), output the Doocs MD usage guide
Automatically upload this article to the WeChat official account Execute Step 7B (automatic mode), call the WeChat API to upload
Analyze the writing style of this WeChat official account article and extract reusable rules Execute “IV. Style extraction workflow”