xiaohongshu
xiaohongshu
md2wechat
Convert Markdown articles to WeChat Official Account formatted HTML with styled CSS and optionally upload to draft box. Supports API mode for quick conversion and AI mode for beautiful themed layouts (autumn-warm, spring-fresh, ocean-calm). Also supports assisted writing with customizable creator...
Full skill instructions
Converts Markdown articles to WeChat Official Account formatted HTML with inline CSS and optionally uploads to draft box. Supports two modes:
# Preview HTML (API mode, fast)
bash skill/md2wechat/scripts/run.sh convert article.md --preview
# Preview HTML (AI mode, themed)
bash skill/md2wechat/scripts/run.sh convert article.md --mode ai --theme autumn-warm --preview
# Upload to WeChat draft box
bash skill/md2wechat/scripts/run.sh convert article.md --draft --cover cover.jpg
You can also ask me to generate images using natural language:
"Help me generate a product concept image at the beginning of article.md"
"Add an image showing the product features after the second paragraph"
"Create a diagram for the comparison section in article.md"
I will:
"Generate an image of a cute cat sitting on a windowsill"
"Create a product concept image: modern smart home device, white design"
"Make a diagram showing the user flow"
I will:
You can also ask me to help write articles using creator styles:
"Write an article about self-discipline using Dan Koe style"
"Help me write a post about productivity with a sharp, grounded tone"
"Create a story-style article about my travel experience"
I will:
"Rewrite this article with a more engaging style"
"Polish my article.md with Dan Koe's writing style"
"Make this content more profound and sharp"
I will:
"Generate a cover image for my article about self-discipline"
"Create a Victorian woodcut style cover for my philosophy piece"
"Remove AI traces from this article: article.md"
"Humanize this text to make it sound more natural"
"Remove AI writing traces with gentle intensity"
"Rewrite this to sound less like AI generated"
I will:
Humanizer can be combined with writing styles:
"Write with Dan Koe style and remove AI traces"
"Use dan-koe style, then humanize the result"
"Show me all available writing styles"
"What writing styles can I use?"
Available Writing Styles:
Users can add custom styles in writers/ directory. See writers/README.md for details.
Copy this checklist to track progress:
Progress:
- [ ] Step 1: Analyze Markdown structure and images
- [ ] Step 2: Confirm conversion mode (API/AI) and theme
- [ ] Step 3: Generate HTML with inline CSS
- [ ] Step 4: Process images (upload to WeChat)
- [ ] Step 5: Replace image URLs in HTML
- [ ] Step 6: Preview or upload to draft
Read the markdown file and extract:
| Element | How to Extract |
|---|---|
| Title | First # heading or filename |
| Author | Look for Author: or 作者: in frontmatter |
| Digest | First paragraph or generate from content (max 120 chars) |
| Images | Collect all  references |
| Structure | Headings, lists, code blocks, quotes, tables |
Image Reference Types:
| Type | Syntax | Processing |
|---|---|---|
| Local |  | Upload to WeChat |
| Online |  | Download then upload |
| AI Generate |  | Generate via AI then upload |
| Mode | Speed | Style | Best For |
|---|---|---|---|
| API | Fast (seconds) | Clean, standard | Quick publishing, technical content |
| AI | Slower (10-30s) | Beautiful themed | Important articles, brand content |
| Theme | Description | Best For |
|---|---|---|
| autumn-warm | Warm orange tones, emotional, literary | Stories, lifestyle, essays |
| spring-fresh | Fresh green tones, natural, vibrant | Travel, nature, outdoor |
| ocean-calm | Calm blue tones, professional, rational | Tech articles, business analysis |
| custom | Use custom prompt | Brand customization |
| Theme | Description | Best For |
|---|---|---|
| default | Default theme, clean and professional | General content |
| bytedance | ByteDance style | Tech news |
| apple | Apple minimalist style | Product reviews |
| sports | Active sports style | Sports content |
| chinese | Traditional Chinese culture style | Cultural articles |
| cyber | Cyberpunk style | Frontier tech |
Ask the user: "Which mode and theme would you like?" - Only ask if the user doesn't specify in their request.
Default: Use API mode if user doesn't specify.
Read detailed style prompts from references/themes.md
Call md2wechat CLI:
bash skill/md2wechat/scripts/run.sh convert article.md --mode api
Read the selected style prompt from references/themes.md and generate HTML with inline CSS.
Important Rules:
style attributes)<!-- IMG:0 -->, <!-- IMG:1 -->, etc.Safe HTML Tags:
<p>, <br>, <strong>, <em>, <u>, <a><h1> to <h6><ul>, <ol>, <li><blockquote>, <pre>, <code><table>, <thead>, <tbody>, <tr>, <th>, <td><section>, <span> (with inline styles)Avoid:
<script>, <iframe>, <form>Critical for WeChat:
<div> container immediately after <body> to hold all global stylescolor explicitly for each <p> tag (WeChat resets to black otherwise)<span> tags for heading symbols: one with color+text-shadow, one with solid colorThere are three ways to generate AI images:
Simply describe what you want in plain language:
User: "Generate a product concept image at the beginning of article.md"
User: "Add a comparison chart after the third paragraph"
User: "Create an image showing the workflow diagram in article.md"
How I process natural language requests:
 at the correct locationNote: Proceed directly with generation. Only ask for confirmation if the prompt is complex or ambiguous.
Example conversation:
User: "Add a product image at the start of my article"
Claude: "I'll add a product concept image at the beginning of article.md.
Based on your article about 'Smart Home Hub', I'll use this prompt:
'A modern smart home hub device, sleek white design with LED indicator
lights, minimalist product photography on a clean white background'
I'll proceed with generating the image."
Generate an image without any article:
User: "Generate an image of a cute cat sitting on a windowsill"
User: "Create a product concept: modern smart home device"
User: "Make a diagram showing user signup flow"
I will:
bash skill/md2wechat/scripts/run.sh generate_image "prompt"Use when: You just need an image, not for any article.
Write the image generation syntax directly in Markdown:

Syntax format: 
For each image reference in order:
bash skill/md2wechat/scripts/run.sh upload_image "/path/to/image.png"
Response:
{"success": true, "wechat_url": "https://mmbiz.qpic.cn/...", "media_id": "xxx"}
bash skill/md2wechat/scripts/run.sh download_and_upload "https://example.com/image.png"
# Generate with default size (2048x2048 square)
bash skill/md2wechat/scripts/run.sh generate_image "A cute cat sitting on a windowsill"
# Generate with 16:9 ratio for WeChat cover (recommended)
bash skill/md2wechat/scripts/run.sh generate_image --size 2560x1440 "prompt"
WeChat Cover Images: For article covers, use 16:9 horizontal ratio (2560x1440 recommended) as it displays better in WeChat's feed and article list. Square images (2048x2048) are cropped in preview.
Note: AI image generation requires IMAGE_API_KEY environment variable.
Image Processing Pipeline:
wechat_url and media_idReplace placeholders in HTML:
<!-- Before -->
<!-- IMG:0 -->
<!-- IMG:1 -->
<!-- After -->
<img src="https://mmbiz.qpic.cn/..." />
<img src="https://mmbiz.qpic.cn/..." />
Use the WeChat URLs returned from image processing.
Ask user:
Display HTML in markdown code block for user to copy.
Create draft and run:
bash skill/md2wechat/scripts/run.sh convert article.md --draft --cover cover.jpg
Required for draft:
WECHAT_APPID environment variableWECHAT_SECRET environment variable--cover or first image in content)Response:
{"success": true, "media_id": "draft_media_id", "draft_url": "https://mp.weixin.qq.com/..."}
| Variable | Description | Required |
|---|---|---|
WECHAT_APPID | WeChat Official Account AppID | Yes, for draft upload |
WECHAT_SECRET | WeChat API Secret | Yes, for draft upload |
| Variable | Description | Required |
|---|---|---|
IMAGE_API_KEY | Image generation API key | For AI images |
IMAGE_API_BASE | Image API base URL | For AI images |
COMPRESS_IMAGES | Compress images > 1920px (true/false) | No, default true |
MAX_IMAGE_WIDTH | Max width in pixels | No, default 1920 |
Warning: AppSecret is very important, keep it secure!
~/.config/md2wechat/config.yaml # Global config
./md2wechat.yaml # Project config (higher priority)
| Error | Action |
|---|---|
| Missing config | Ask user to set environment variable or run md2wechat config init |
| Image upload fails | Log error, continue with placeholder |
| WeChat API fails | Show error message, return HTML for manual upload |
| Markdown parse error | Ask user to check file format |
| IP not in whitelist | Guide user to add IP to WeChat whitelist (see Troubleshooting) |
Input: simple.md
# My First Article
This is a simple article with no images.
Process:
Input: with-images.md
# Travel Diary
Day 1 in Paris:

Process:
<!-- IMG:0 --> placeholderupload_image "./photos/eiffel.jpg"Input: story.md
# The Old Library
A story about memories...
Process:
User Request:
"Help me add a product concept image at the beginning of article.md"
Process:
 at line 2Result: Image generated and uploaded to WeChat
Input: mixed.md
# Tech Review



Process:
Q: "AppID not configured" error
A: Set WECHAT_APPID and WECHAT_SECRET environment variables, or run:
bash skill/md2wechat/scripts/run.sh config init
Q: Config file not working A: Check config file location. Supported locations:
./md2wechat.yaml (current directory, highest priority)~/.md2wechat.yaml~/.config/md2wechat/config.yamlQ: Image upload fails with "invalid filetype" A: WeChat supports JPG, PNG, GIF. Ensure image is in correct format:
# Convert using ImageMagick
convert input.tiff output.jpg
Q: Images not showing in draft
A: Images must use WeChat-hosted URLs (mmbiz.qpic.cn), not external URLs.
Q: AI image generation fails
A: Check IMAGE_API_KEY is set and API base URL is correct.
Q: "IP not in whitelist" error A: Add your server IP to WeChat whitelist:
curl ifconfig.me
# or
curl ip.sb
Q: "access_token expired" error A: Program auto-refreshes tokens. If persists:
# Check config
bash skill/md2wechat/scripts/run.sh config show
# Re-init if needed
bash skill/md2wechat/scripts/run.sh config init
Q: "create draft failed" error A: Possible causes:
Q: "content size out of limit" error (errcode=45002) A: WeChat draft API has content limits:
If you encounter this error:
API mode generates more inline CSS which increases content size. For very long articles, consider manual editing or splitting.
Q: API rate limit exceeded A: WeChat has API limits. Wait and retry:
# Wait 60 seconds
sleep 60
# Retry
bash skill/md2wechat/scripts/run.sh convert article.md --draft
Q: Styles not working in WeChat editor A: Check:
style attributes (not <style> tags)Q: Background color lost in WeChat
A: WeChat strips <body> styles. Use main container:
<div style="background-color: #faf9f5; padding: 40px 10px;">
<!-- All content here -->
</div>
Q: Text color not as expected
A: WeChat resets <p> color to black. Always specify:
<p style="color: #4a413d;">Your text here</p>
Q: "command not found: md2wechat"
A: The run.sh script will auto-download the binary on first run. If you want to install manually:
# Use the script - it will handle installation
bash skill/md2wechat/scripts/run.sh --help
# Or download from releases
# Visit: https://github.com/geekjourneyx/md2wechat-skill/releases
Q: AI mode very slow A: AI mode requires Claude API call and takes 10-30 seconds. For faster results, use API mode.
All commands go through the run.sh wrapper, which handles auto-installation:
# Show help
bash skill/md2wechat/scripts/run.sh --help
# Convert and preview
bash skill/md2wechat/scripts/run.sh convert article.md --preview
# Convert with AI theme
bash skill/md2wechat/scripts/run.sh convert article.md --mode ai --theme autumn-warm --preview
# Convert and upload to draft
bash skill/md2wechat/scripts/run.sh convert article.md --draft --cover cover.jpg
# Upload single image
bash skill/md2wechat/scripts/run.sh upload_image photo.jpg
# Download and upload online image
bash skill/md2wechat/scripts/run.sh download_and_upload https://example.com/image.jpg
# Generate AI image (requires IMAGE_API_KEY)
bash skill/md2wechat/scripts/run.sh generate_image "A cute cat sitting on a windowsill"
# Generate with 16:9 ratio for WeChat cover (recommended)
bash skill/md2wechat/scripts/run.sh generate_image --size 2560x1440 "prompt"
# Initialize config
bash skill/md2wechat/scripts/run.sh config init
# Show config
bash skill/md2wechat/scripts/run.sh config show
# List available writing styles
bash skill/md2wechat/scripts/run.sh write --list
# Write with creator style (interactive)
bash skill/md2wechat/scripts/run.sh write
# Write with specific style (via stdin/piped)
echo "你的想法或内容" | bash skill/md2wechat/scripts/run.sh write --style dan-koe
# Write with title and heredoc
bash skill/md2wechat/scripts/run.sh write --style dan-koe --title "文章标题" <<EOF
你的内容
EOF
# Write with specific style
bash skill/md2wechat/scripts/run.sh write --style dan-koe
# Generate cover prompt only
bash skill/md2wechat/scripts/run.sh write --style dan-koe --cover-only
# Remove AI writing traces (humanize)
bash skill/md2wechat/scripts/run.sh humanize article.md
# Humanize with intensity
bash skill/md2wechat/scripts/run.sh humanize article.md --intensity aggressive
# Write with humanize
bash skill/md2wechat/scripts/run.sh write --style dan-koe --humanize
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience