MCPInstall

xiaohongshu-images

Transform markdown/HTML into styled 3:4 ratio images for Xiaohongshu 新手引导:输入 /小红书配图 新手、「这个怎么用」「第一次用」「能干嘛」时,走 SKILL.md 的〈新手上路〉,不要直接开始干活。

Installs
2K
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/iamzifei/xiaohongshu-images-skill --skill xiaohongshu-images
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads xiaohongshu-images automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Xiaohongshu Images Skill

This skill transforms markdown, HTML, or text content into beautifully styled HTML pages with AI-generated cover images, then captures them as sequential screenshots at 3:4 ratio for Xiaohongshu posting.

Overview

The skill performs the following workflow:

  1. Accept Content: Receives markdown, HTML, or txt format content from the user
  2. Load Prompt Template: Reads the prompt template from prompts/default.md in this skill's directory
  3. Determine Output Account: Determines which account folder to use (see Account Folder Resolution below)
  4. Generate Cover Image: Uses /baoyu-cover-image skill to generate a cover image based on the article content
  5. Generate HTML: Creates a beautifully styled HTML page following the prompt template specifications
  6. Save Output: Saves the HTML to ~/Dev/obsidian/{account_folder}/articles/<date-title>/xhs-preview.html
  7. Capture Screenshots: Takes sequential 3:4 ratio screenshots of the entire page without cutting text

Account Folder Resolution

The skill determines the output account folder using the following priority:

Priority 1: Explicit --account Parameter

If the user specifies --account, use the corresponding folder:

/xiaohongshu-images <article> --account james-cn      # → 10_在悉尼和稀泥
/xiaohongshu-images <article> --account james-en      # → 11_BuildWithJames
/xiaohongshu-images <article> --account mom-reading-club  # → 12_妈妈在读

Priority 2: Infer from Input File Path

If no --account is specified, try to infer from the input file path:

Input: ~/Dev/obsidian/12_妈妈在读/articles/2026-01-20-xxx/index.md
       → Output to: ~/Dev/obsidian/12_妈妈在读/articles/2026-01-20-xxx/

Input: ~/Dev/obsidian/10_在悉尼和稀泥/articles/2026-01-20-xxx/index.md
       → Output to: ~/Dev/obsidian/10_在悉尼和稀泥/articles/2026-01-20-xxx/

Priority 3: Fallback to Template Mapping

If the account cannot be determined from the path (e.g., raw content input), use template-based mapping:

TemplateAccount Folder
default10_在悉尼和稀泥
mom-reading-club12_妈妈在读

Account Folder Mapping Reference

AccountFolder
james-cn10_在悉尼和稀泥
james-en11_BuildWithJames
mom-reading-club12_妈妈在读

Usage

When the user invokes this skill, follow these steps:

Step 1: Identify the Input

The user will provide one of the following:

  • A file path to a markdown, HTML, or txt file (e.g., /path/to/article.md)
  • Raw content directly in the conversation
  • A URL to fetch content from

If the input is unclear, ask the user to provide either a file path, URL, or paste the content directly.

Step 2: Read the Prompt Template

Read the prompt template from this skill's directory:

{{SKILL_DIR}}/prompts/default.md

Use the Read tool to get the prompt template content. This template defines the HTML/CSS styling specifications.

Step 3: Extract Article Title, Date, and Determine Account

From the content, extract:

  • Title: The main heading (h1) or first significant title in the content
  • Date: Current date in YYYY-MM-DD format
  • Account Folder: Determine using the priority rules above (--account → path inference → template mapping)

Create the output folder path as: ~/Dev/obsidian/{account_folder}/articles/<date>-<sanitized-title>/

  • Replace spaces with hyphens
  • Remove special characters
  • Keep the title reasonably short (max 50 characters)
  • All images go in _attachments/ subfolder

Step 4: Generate Cover Image with baoyu-cover-image Skill

⚠️ COMPLIANCE CHECK: Before generating, ensure the image concept complies with Xiaohongshu community guidelines (Section 11 of the prompt template). The image must:

  • Be age-appropriate with no revealing clothing or suggestive poses
  • Avoid political symbols, violence, gambling, smoking, or alcohol abuse
  • Convey positive, constructive messages
  • Be culturally sensitive and original

Use the /baoyu-cover-image skill to generate the cover image:

  1. Invoke the skill with the article content:
/baoyu-cover-image ~/Dev/obsidian/{account_folder}/articles/<date>-<title>/index.md --style <auto-or-specified> --no-title

Or if the content is not yet saved, pass the content directly to the skill.

  1. Style Selection:

    • Let baoyu-cover-image auto-select based on content signals, OR
    • Specify a style that matches the article tone:
      • tech - AI, coding, digital topics
      • warm - Personal stories, emotional content
      • bold - Controversial, attention-grabbing topics
      • minimal - Simple, zen-like content
      • playful - Fun, casual, beginner-friendly content
      • nature - Wellness, health, organic topics
      • retro - History, vintage, traditional topics
      • elegant - Business, professional content (default)

    Special: Mom Reading Club Template

    When using the mom-reading-club template, override the default cover style with calligraphy & ink-wash illustration (书法水墨风):

    /baoyu-cover-image <article> --style minimal --no-title --custom-prompt "Chinese calligraphy and ink-wash illustration style (书法水墨风). Zen-like simplicity with generous white space (留白). Include subtle ink-wash brush strokes as background texture. Minimalist botanical elements (bamboo, plum blossoms, orchids, lotus) when appropriate. Color palette: ink black (#1a1a1a), warm gray (#666666), subtle gold accents (#C9A962), warm off-white background (#F5F3EE). If human figures are included, depict an elegant woman aged 30-45 with a contemplative, refined demeanor. NO TEXT on the cover."
    
  2. Use --no-title flag since Xiaohongshu covers typically use visual-only images without embedded text.

  3. Move the generated image to the correct location:

    • baoyu-cover-image saves to imgs/cover.png relative to the article
    • Move/copy to ~/Dev/obsidian/{account_folder}/articles/<date>-<title>/_attachments/cover-xhs.png
mv ~/Dev/obsidian/{account_folder}/articles/<date>-<title>/imgs/cover.png ~/Dev/obsidian/{account_folder}/articles/<date>-<title>/_attachments/cover-xhs.png

Step 5: Generate HTML

⚠️ COMPLIANCE CHECK: Before generating HTML, review the text content for compliance:

  • No absolute/superlative claims (最好、第一、国家级、最高级、全网最低价)
  • No exaggerated effect claims (一分钟见效、吃完就变白)
  • No false or unverified medical/financial advice
  • No defamatory or offensive language
  • If health/investment topics are involved, add disclaimer text

Using the prompt template and the user's content:

  1. Parse the content to identify:

    • Title (h1)
    • Subtitles (h2-h6)
    • Paragraphs
    • Lists
    • Code blocks
    • Links
    • Emphasis/bold text
    • Blockquotes
  2. Generate complete HTML following the template specifications:

    • Dark gradient background
    • 600px × 800px cream-colored card
    • Proper typography with Google Fonts (Noto Serif SC, Inter, JetBrains Mono)
    • Cover image at the top
    • All specified styling for text, links, lists, code blocks, etc.
    • Responsive design for mobile
  3. Important HTML Structure:

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Article Title</title>
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@700&family=Inter:wght@300;400;700;800&family=JetBrains+Mono:wght@400;700&display=swap" rel="stylesheet">
    <style>
        /* All CSS styles inline */
    </style>
</head>
<body>
    <div class="container">
        <img src="_attachments/cover-xhs.png" class="cover-image" alt="Cover">
        <div class="content">
            <!-- Article content -->
        </div>
    </div>
</body>
</html>
  1. Save the HTML to ~/Dev/obsidian/{account_folder}/articles/<date>-<title>/xhs-preview.html

Step 6: Take Screenshots

After generating the HTML, capture sequential screenshots of the .container element at exact 3:4 aspect ratio:

Screenshot Specifications:

  • Container viewport: 600px × 800px (3:4 ratio)
  • Output resolution: 1200px × 1600px (2x device scale factor)
  • Each screenshot captures exactly the .container element, not the full page

Capture Process:

  1. Open the HTML page using Playwright browser with viewport larger than container
  2. Configure browser context:
    • Viewport: 800px × 1000px (larger than container to ensure full visibility)
    • Device scale factor: 2x for high-resolution output
  3. Scroll within the container:
    • The .container element has overflow-y: auto, making it internally scrollable
    • Start from scrollTop = 0 and increment through the content
    • Each scroll position captures one 3:4 ratio screenshot
  4. Smart text boundary detection:
    • Before each screenshot, analyze visible block elements (p, h1-h6, li, blockquote, pre, img)
    • If an element would be cut at the bottom boundary, end the current screenshot before that element
    • Add whitespace mask to cover partial content, maintaining clean 3:4 frame
    • Next screenshot starts with the cut element at the top
  5. Capture the complete .container content:
    • Use container.screenshot() to capture only the container element (excludes page background)
    • Continue until all content is captured (scrollTop reaches scrollHeight - clientHeight)
  6. Save screenshots to ~/Dev/obsidian/{account_folder}/articles/<date>-<title>/_attachments/:
    • Sequential naming: xhs-01.png, xhs-02.png, xhs-03.png, etc.

Use the screenshot script:

cd {{SKILL_DIR}} && python scripts/screenshot.py ~/Dev/obsidian/{account_folder}/articles/<date>-<title>/xhs-preview.html

Script Output:

  • Each screenshot: exactly 1200×1600 pixels (3:4 ratio at 2x scale)
  • Only the cream-colored card content is captured
  • No text is cut off between screenshots

Step 7: Report Results

After completion, report to the user:

  • HTML file location
  • Number of screenshots generated
  • Screenshots folder location
  • Preview of the first screenshot (if possible)

Directory Structure

{{SKILL_DIR}}/
├── SKILL.md              # This file
├── prompts/
│   └── default.md        # Default HTML/CSS styling prompt
│   └── mom-reading-club.md  # Mom Reading Club styling prompt
├── scripts/
│   └── screenshot.py     # Screenshot capture script
└── .gitignore

Output directory (outside skill folder):
~/Dev/obsidian/{account_folder}/articles/<date>-<title>/
├── xhs-preview.html          # Styled HTML preview page
├── imgs/                     # Created by baoyu-cover-image
│   ├── prompts/
│   │   └── cover.md          # Cover image prompt
│   └── cover.png             # Generated cover (moved to _attachments/)
└── _attachments/             # Obsidian-style attachments folder
    ├── cover-xhs.png         # Cover image (moved from imgs/cover.png)
    ├── xhs-01.png            # Screenshot page 1 (1200×1600)
    ├── xhs-02.png            # Screenshot page 2
    └── ...

Account folder mapping:
- james-cn → 10_在悉尼和稀泥
- james-en → 11_BuildWithJames
- mom-reading-club → 12_妈妈在读

Dependencies

This skill depends on:

  • /baoyu-cover-image skill for cover image generation (must be installed in ~/.claude/skills/)

Example Workflow

User: Create a styled article page from this markdown:

# My Article Title

This is the introduction paragraph...

## Section 1

Content for section 1...

Assistant Actions:

  1. Read prompt template from prompts/default.md
  2. Extract title: "My Article Title"
  3. Determine account folder (no --account specified, no path to infer from, using default template → 10_在悉尼和稀泥)
  4. Create output folder: ~/Dev/obsidian/10_在悉尼和稀泥/articles/2024-01-14-my-article-title/
  5. Invoke /baoyu-cover-image skill with --no-title flag to generate cover image
  6. Move generated cover from imgs/cover.png to _attachments/cover-xhs.png
  7. Generate styled HTML following template specifications
  8. Save to ~/Dev/obsidian/10_在悉尼和稀泥/articles/2024-01-14-my-article-title/xhs-preview.html
  9. Open in browser and take 3:4 ratio screenshots
  10. Save screenshots to ~/Dev/obsidian/10_在悉尼和稀泥/articles/2024-01-14-my-article-title/_attachments/xhs-01.png, etc.
  11. Report completion with file locations

Example with --account parameter:

/xiaohongshu-images ~/path/to/article.md --account mom-reading-club --template mom-reading-club

Assistant Actions:

  1. --account mom-reading-club specified → use 12_妈妈在读
  2. Output to: ~/Dev/obsidian/12_妈妈在读/articles/2024-01-14-article-title/

Example with path inference:

/xiaohongshu-images ~/Dev/obsidian/12_妈妈在读/articles/2024-01-14-xxx/index.md

Assistant Actions:

  1. No --account specified
  2. Input path contains 12_妈妈在读 → infer account folder
  3. Output to same folder: ~/Dev/obsidian/12_妈妈在读/articles/2024-01-14-xxx/

Custom Prompt Templates

Users can provide custom prompt templates by:

  1. Placing a .md file in the prompts/ directory
  2. Specifying the template name when invoking the skill

Example: "Use the xiaohongshu-style template for this article"

Available Templates

TemplateDescriptionBest For
defaultStandard style with New Yorker-style illustrationsGeneral articles
mom-reading-clubCalligraphy & ink-wash style with TsangerJinKai02 fontMom Reading Club (妈妈读书会) brand content

Mom Reading Club Template

Use this template for all "Mom Reading Club" branded content:

/xiaohongshu-images <article> --template mom-reading-club

Features:

  • Font: TsangerJinKai02 (仓耳今楷02) for titles - requires local installation
  • Cover style: Chinese calligraphy & ink-wash illustration (书法水墨风)
  • Aesthetic: Zen simplicity, elegant restraint, generous white space
  • Color accent: Subtle gold (#C9A962)
  • Target audience: Cultured mothers aged 30-45

Error Handling

If the /baoyu-cover-image skill fails:

  1. Display the error message to the user
  2. Offer to retry or proceed without cover image
  3. If proceeding without image, use a placeholder or omit the cover

If screenshot capture fails:

  1. Verify the HTML file exists and is valid
  2. Check browser dependencies
  3. Report the specific error to the user

System Requirements

This skill requires:

  • Python 3.8+
  • Playwright for screenshot capture (installed via pip: pip install playwright && playwright install chromium)
  • /baoyu-cover-image skill installed in ~/.claude/skills/

Install dependencies:

pip install playwright
playwright install chromium

Notes

  • The skill preserves all original content exactly as provided
  • No modifications, simplifications, or deletions to the content
  • The cover image is generated based on the article's main theme
  • Screenshots are optimized for Xiaohongshu's 3:4 aspect ratio
  • Text is never cut off in screenshots - boundaries are adjusted intelligently

Community Compliance (社区规范合规)

IMPORTANT: All generated content must comply with Xiaohongshu community guidelines.

Quick Reference - Prohibited Content:

CategoryExamplesAction
Absolute claims最好、最佳、第一、国家级Remove or rephrase
Exaggerated effects一分钟见效、立刻瘦10斤Remove or add disclaimers
Medical/Financial adviceHealth tips, investment suggestionsAdd disclaimer: "本内容不构成医疗/投资建议"
Inappropriate imageryNudity, violence, political symbolsRegenerate with appropriate content
False informationPseudoscience, unverified claimsVerify or remove
Defamatory contentAttacks on brands/individualsRemove entirely

Official Guidelines:

Compliance Workflow:

  1. Before image generation: Review theme for appropriateness
  2. Before HTML generation: Scan text for prohibited phrases
  3. Before final output: Run through compliance checklist in prompt template (Section 11.5)

新手上路(用户不知道该输入什么时,走这里)

触发:/小红书配图 新手、「这个怎么用」「第一次用」「能干嘛」「带我走一遍」, 以及用户输入了技能名却没有给任何任务的时候。

这个模式的铁律:不假设、不索取。用户可能什么都没准备, 不要一上来就问他要文件、要 API key、要具体需求。按下面四步走:

一、先说清楚这是什么(三句话以内)

一句话:把一段内容拆成一组小红书能直接发的 3:4 图片。 自动分页、排版、生成封面,出来就是能用的图, 不用再去改模板或者调字号。

二、给编号选项,让他按回车就能继续

不要问开放式问题(「你想做什么?」对新手是负担)。给 3 个选项加一个默认:

想先看哪个?(直接回车 = 1)
  1. 先看看做出来长什么样(示例)
  2. 把我的这段内容做成图
  3. 有哪些风格可以选

三、直接演示一遍,边做边解释

选完立刻做给他看,用示例数据,不需要他提供任何东西。 每做完一步,加一行「💡 刚才发生了什么」,一句话说明这步的意义。

四、毕业

演示完只问一个是非题:「要不要用你自己的内容真跑一遍?」 答是就进正常流程;答否就告诉他随时回来输 /小红书配图 新手。

FAQ

What does the xiaohongshu-images skill do?

Transform markdown/HTML into styled 3:4 ratio images for Xiaohongshu 新手引导:输入 /小红书配图 新手、「这个怎么用」「第一次用」「能干嘛」时,走 SKILL.md 的〈新手上路〉,不要直接开始干活。

How do I install xiaohongshu-images?

Run npx skills add https://github.com/iamzifei/xiaohongshu-images-skill --skill xiaohongshu-images in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/xiaohongshu-images/ (personal) or .claude/skills/xiaohongshu-images/ (project).

Which AI agents can use xiaohongshu-images?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is xiaohongshu-images safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains xiaohongshu-images?

It is published by iamzifei in iamzifei/xiaohongshu-images-skill. It has 1,974 recorded installs.

Popular media & creative skills

View category →

hyperframes

heygen-com/hyperframes

Read first to make, edit, animate or render any video with HyperFrames (HTML rendered to video), including launch films, explainers, music videos, charts, maps, vertical clips, title cards, captions and overlays. Holds the render contract, the work loop and what each kind of video needs.

Media & Creative1.2M installs

media-use

heygen-com/hyperframes

Get or make any media for a HyperFrames video - music, sound effects, images, icons, logos, voiceover, avatar and generated video, transcripts, cutouts, colour grades and looks - with HeyGen or free local tools, and mix placed audio. Also for footage that looks dark, flat or dull, or should be stylized or hidden.

Media & Creative1.1M installs

hyperframes-registry

heygen-com/hyperframes

About 450 ready-made HyperFrames blocks and components installed as editable source - transitions, overlays, titles, kinetic type, captions, charts, map overlays, 3D, camera moves. Use it before hand-building any named visual (CRT scanlines, glitch, film grain, a chart); also for hyperframes add and catalog.

Media & Creative1M installs

hyperframes-creative

heygen-com/hyperframes

Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use hyperframes-animation.

Media & Creative916.5K installs

ai-video-generation

101-skills/superpowers

Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse

Media & Creative881.5K installs

ai-image-generation

101-skills/superpowers

Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image

Media & Creative880.3K installs