Research To Wechat
by @clarezoe
A native research-first pipeline that turns a topic, notes, article, URL, or transcript into a sourced article with an evidence ledger, polished Markdown, in...
clawhub install research-to-wechat📖 About This Skill
name: research-to-wechat description: A native research-first pipeline that turns a topic, notes, article, URL, or transcript into a sourced article with an evidence ledger, polished Markdown, inline visuals, cover image, WeChat-ready HTML, browser/API-ready draft assets, and optional multi-platform distribution. Use when the user wants 深度研究、改写成公众号、写作、排版、配图、HTML 转换、公众号草稿生成、多平台分发. metadata: openclaw: emoji: "🔬" homepage: "https://github.com/Fei2-Labs/skill-genie" requires: anyBins: ["python3"] primaryEnv: "WECHAT_APPID" version: "0.5.4" category: "content-generation" author: "Skill Genie" license: "MIT"
Research to WeChat
Use this skill as a native, research-first article system. It does not route execution to external skills.
Core Rules
text into text (url) because WeChat forbids clickable links.Operating Paths
Path A: research-first articlePath B: source-to-WeChat editionDefault routing:
tutorialdeep-analysisnewsletterAccepted Inputs
PDF policy:
imgs/source-fig-*.pngsource.mdVideo policy:
Output
Create one workspace per article:
research-to-wechat/YYYY-MM-DD-
Required assets:
source.mdbrief.mdresearch.mdarticle.mdarticle-formatted.mdarticle.htmlmanifest.jsonimgs/cover.pngRequired frontmatter in final markdown:
titleauthordescriptiondigestcoverImagestyleModesourceTypestructureFramedisclosuremanifest.json must capture:
pathModestyleModestructureFramesourceTypeconfidencedraftStatusmanifest.json.outputs.wechat must include:
markdownhtmlcover_imagetitleauthordigestimagesScript Directory
Determine this SKILL.md directory as SKILL_DIR, then use ${SKILL_DIR}/scripts/.
| Script | Purpose |
|--------|---------|
| scripts/fetch_wechat_article.py | WeChat article fetch (mobile UA) |
| scripts/wechat_delivery.py | Native WeChat delivery entrypoint (check, design-catalog, render, upload-images, save-draft) |
| scripts/install-openclaw.sh | OpenClaw skill installer |
Native Capability Contract
This skill executes every stage itself:
python3 "${SKILL_DIR}/scripts/wechat_delivery.py" design-catalogpython3 "${SKILL_DIR}/scripts/wechat_delivery.py" renderpython3 "${SKILL_DIR}/scripts/wechat_delivery.py" upload-imagespython3 "${SKILL_DIR}/scripts/wechat_delivery.py" save-draftUse the internal contract in capability-map.md.
Delivery Ladder
Resolve WeChat draft delivery in this order:
1. L0 official-http: WECHAT_APPID and WECHAT_SECRET are ready, so bundled scripts call the official media and draft APIs directly
2. L1 assisted-browser: only use a browser when the account setup or draft inspection needs human help
3. L2 manual-handoff: stop with exact file paths and required API fields when official delivery cannot proceed
Author Config (EXTEND.md)
The renderer reads an optional EXTEND.md for author-specific CTA content and preferences. This keeps the skill generic — CTA text, QR codes, and blog URLs belong to the author, not the skill.
Lookup order: project dir → ~/.config/research-to-wechat/ → ~/.research-to-wechat/
See author-config.md for the full format and field reference.
When EXTEND.md is present with a cta section, the renderer appends a styled CTA block after the article body. When absent, no CTA is rendered.
Style Resolution
Resolve style in this order: 1. explicit user instruction 2. preset mode 3. author mode 4. custom brief
Use the full style system in style-engine.md.
Visual rendering is decided by:
styleModestructureFramelight or dark output modeExecution
Run the article through these phases: 1. intake and route selection 2. source packet, brief, and strategic clarification 3. research architecture with structured question lattice 4. research merge and evidence ledger 5. frame-routed master draft with normalization checklist, writing self-check, and machine-verified Chinese de-AI scan (Phase 5 must not proceed without running these):
# negation-contrast patterns (must be 0 hits)
grep -n '不是.*而是\|不仅.*而且\|不只.*更\|不再.*而是\|已经不是' article-formatted.md
# em-dash count (≤5 in body)
grep -c '——' article-formatted.md
# exclamation marks (must be 0)
grep -c '!' article-formatted.md
6. 微信敏感词合规检查(⛔ 必须通过才能继续):用 wechat-compliance-check 扫描 article-formatted.md,有命中则改写后重新扫描,直到零违规。
7. refinement, visual strategy, and image evaluation ⛔ Pre-delivery compliance gate (BLOCKING — must execute before Phase 8):
Long sessions cause attention decay on early-loaded rules. Before proceeding to HTML rendering and draft save, you MUST:
1. Re-read the project's AGENTS file (cat the file, do not rely on memory). For WeChat projects this is ../AGENTS-wechat.md or the path specified in AGENTS.md.
2. Walk every rule in the AGENTS file line by line and verify the current article/HTML against it. Check file location, typography, HTML constraints, CTA, image rules — every single one.
3. Output a checklist to the terminal with ✅/❌ per rule. Any ❌ must be fixed before continuing.
This step exists because context-window attention decay will cause you to forget rules loaded at session start. Do not skip it. Do not check from memory.
8. native WeChat HTML rendering via wechat_delivery.py render, image upload, draft save, and manifest.
Image upload rules:
- If imgs/cdn-urls.json already exists from a previous upload, skip re-uploading unchanged images. Only upload new or modified files (compare filename + file size/mtime).
- wechatqr.png (CTA QR code) must reuse the existing CDN URL from project-level images/wechatqr.png or a previous cdn-urls.json. Never re-upload the same QR code per article.
- After upload, always merge new CDN URLs into the existing cdn-urls.json (not overwrite).
Draft save rules:
- If manifest.json already contains a media_id, pass --media-id to save-draft to update the existing draft. Never create a duplicate.
- If a duplicate draft was accidentally created, delete it via API (draft/delete) immediately and keep only the original media_id.
- manifest.json is the single source of truth for media_id.
Before draft save, run HTML compliance check (must all pass):
grep -c 'class=' article.html # must be 0
grep -c '