ray-wechat

Format finalized Chinese articles into WeChat official account drafts with verification.

160|18|Updated Jul 13, 2026
One-click install
npx skills add https://github.com/imraywang/rayskills --skill ray-wechat-imraywang
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ray-wechat
Source: https://github.com/imraywang/rayskills/tree/main/skills/ray-wechat
Command: npx skills add https://github.com/imraywang/rayskills --skill ray-wechat-imraywang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Pillow, certifi, and includes scripts (resource) and references (resource) components.

What problem does it solve? Publishing long-form Chinese articles to WeChat official accounts involves fragile manual steps: mobile-friendly rich text formatting, image uploads, UTF-8 encoding pitfalls, duplicate drafts, and silent content corruption. This Skill turns that into a gated, verifiable workflow that never publishes without explicit authorization. ## Core Features & Use Cases - Theme-based rendering: Converts Markdown articles into clean inline-styled HTML fragments using three built-in themes (ray-judgment, ray-method, ray-deepread) plus a mobile-width preview page with a copy button. - Local delivery gate: Validates the HTML against the source Markdown—checking chapter counts, empty paragraphs, signature policy, mojibake, split English words, and translation attribution—before anything touches the WeChat API. - Safe draft management: Uploads body images via media/uploadimg with sha256 caching, updates existing drafts by media ID (never creating duplicates), reads back the full draft for verification, and records state in article frontmatter. - Use Case: You have a finalized article and its cover image. Ask to update the existing WeChat draft; the Skill renders the theme, validates locally, uploads images through a fixed egress route, updates the original draft, and reads it back to confirm title, cover, body, and encoding. ## Quick Start Use ray-wechat to format this finalized article with the ray-method theme and update my existing WeChat official account draft, then verify the result.

Frequently Asked Questions about ray-wechat

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format a Markdown article for WeChat official accounts?▼

Render the Markdown into a single inline-styled HTML section using a theme such as ray-judgment, ray-method, or ray-deepread, then generate a mobile-width preview. WeChat requires inline CSS and forbids scripts, external stylesheets, and empty paragraphs.

How do I update an existing WeChat draft without creating duplicates?▼

Read the wechat_draft_media_id from the article frontmatter, call draft/get to load the original, then call draft/update with the same media ID while preserving the cover, author, and comment settings. Never call draft/add when an ID already exists.

Why does my WeChat draft show garbled Chinese characters like Ã¥?▼

This mojibake happens when HTTP responses are decoded with the wrong charset. Always decode response bytes as UTF-8 before parsing JSON, write payloads with UTF-8 non-ASCII characters, and read back the draft to verify title, digest, and body.

Can this Skill publish or mass-send WeChat articles?▼

No. It only creates or updates drafts through draft/add and draft/update, and never calls freepublish or mass-send endpoints. Even when users say publish, it stops at the draft stage and asks them to review on a real phone.

What happens when WeChat API returns an IP whitelist error?▼

The scripts route through a fixed SSH egress and verify the public IP before requesting a token. On a 40164 error, confirm the fixed address is in the official account's IP whitelist, then retry the same command without switching to a dynamic address.

How are article body images uploaded to WeChat?▼

Images are uploaded via media/uploadimg, which returns permanent mmbiz URLs without consuming material library quota. Files over 1MB or in unsupported formats are re-encoded to JPEG with Pillow, and uploads are cached by content sha256.