SuperAPI AI Directory

pw-redbook-image

Design & creation

View repository

Updated 10-15 21:52

About this skill

Xiaohongshu-style image generation

Intelligently break down article content into a series of images in Xiaohongshu style, including cover images, content images, and ending images.

Core Features

  • Intelligently break down articles into multiple images (2-10 images)
  • Automatically generate image prompts that match Xiaohongshu style
  • Supports multiple input sources (URL, file path, text content)
  • Automatically create a structured working directory
  • Supports post-processing (merge into long image, PPT, PDF)

When to Use

When the user explicitly requests Xiaohongshu-style images:

  • "Generate Xiaohongshu images"
  • "Create a Xiaohongshu image series"
  • "Turn this article into Xiaohongshu images"
  • "Help me make Xiaohongshu-style image-and-text content"

Not applicable when:

  • The user is only asking how to make it (just provide suggestions)
  • The user needs a single cover image (use pw-cover-image)
  • The user needs images in other styles (use a general image generation tool)

How to Use

# 从 URL 生成
/pw-redbook-image https://example.com/article

# 从文本内容生成
/pw-redbook-image "文章内容..."

# 从 markdown 文件生成
/pw-redbook-image path/to/article.md

Parameter Description

  • Input source (required): supports three formats
    • URL: a web address starting with http:// or https://
    • File path: relative or absolute path, supports text files such as .md and .txt
    • Text content: the article content string passed in directly

Xiaohongshu Style Characteristics

  • Aspect ratio: vertical (3:4 or 9:16)
  • Style: cartoon style, hand-drawn style
  • Color scheme: Morandi colors, cream, off-white, light pink, mint green
  • Text: hand-drawn style text, prominent large headings, highlighted with highlighter underlines
  • Decorations: cartoon elements, emoji icons, hand-drawn stickers, speech bubbles
  • Layout: concise information, ample whitespace, key points presented in bullet form

Content Breakdown Principles

  • Cover image: strong visual impact, includes the core title
  • Content images: each focuses on 1 core point
  • Ending image: summary/call to action/memorable quote

Number of images:

  • Simple point: 2-3 images
  • Medium complexity: 4-6 images
  • In-depth practical content: 7-10 images

File Management

Output directory

Create a separate directory named after the topic for each session:

redbook-{topic-slug}/
├── source.md              # 源文章
├── prompts/               # 提示词文件
│   ├── 01_封面图.md
│   ├── 02_内容图_核心观点1.md
│   ├── 03_内容图_核心观点2.md
│   └── 04_结尾图.md
└── images/                # 生成的图片
    ├── 01_封面图.png
    ├── 02_内容图_核心观点1.png
    ├── 03_内容图_核心观点2.png
    └── 04_结尾图.png

Topic naming rules:

  1. Extract the topic from the article title/content (2-4 words, kebab-case)
  2. Example: "How to improve work efficiency" → improve-work-efficiency

Conflict resolution

If redbook-{topic-slug}/ already exists:

  • Append a timestamp: {topic-slug}-YYYYMMDD-HHMMSS
  • Example: improve-work-efficiency already exists → improve-work-efficiency-20260123-143052

Source file

Use source.md or source-{原文件名} to save the source article.

Workflow

Step 1: Obtain the article content

Process the input source:

  • URL: Use WebFetch to scrape the webpage content
  • File path: Use Read to read the file content
  • Text: Directly use the provided content

Save source content:

  • Create working directory redbook-{topic-slug}/
  • Save source file to source.md or source-{原文件名}

Step 2: Analyze and break down the article

Use ${SKILL_DIR}/references/文章拆解模板.md to analyze the article:

  • Extract the theme and core viewpoints
  • Determine the number of images (2-10)
  • Generate a breakdown plan, clarifying the core content of each image

Image count suggestions:

  • Simple viewpoint: 2-3 images
  • Medium complexity: 4-6 images
  • In-depth practical content: 7-10 images

Step 3: Generate prompt files

Create redbook-{topic-slug}/prompts/ directory, and choose a template based on the image type:

  • Cover image: ${SKILL_DIR}/references/封面图模板.md
  • Content image: ${SKILL_DIR}/references/内容图模板.md
  • Ending image: ${SKILL_DIR}/references/结尾图模板.md

Generate a separate prompt file for each image:

  • Naming format: 01_封面图.md, 02_内容图_关键词.md, 03_结尾图.md
  • Use English for prompts, avoid Markdown format
  • Include style keywords and color scheme

Step 4: Generate images

Check available image generation skills:

  • Prefer using pw-danger-gemini-web
  • If multiple skills are available, ask the user to choose

Generate images one by one:

  • Output directory: redbook-{topic-slug}/images/
  • Show generation progress
  • Sort images by number
  • After the first image is generated, confirm the style before continuing batch generation

Step 5: Post-processing (optional)

Merge into a long image (requires ImageMagick):

brew install imagemagick
node ~/.claude/skills/pw-image-generation/scripts/merge-to-long-image.js \
  redbook-{topic-slug}/images \
  redbook-{topic-slug}/长图.png

Merge into PPT:

node ~/.claude/skills/pw-image-generation/scripts/merge-to-pptx.js \
  redbook-{topic-slug}/images \
  redbook-{topic-slug}/配图.pptx

Merge into PDF:

node ~/.claude/skills/pw-image-generation/scripts/merge-to-pdf.js \
  redbook-{topic-slug}/images \
  redbook-{topic-slug}/配图.pdf

Step 6: Output summary

After generation is complete, output:

小红书系列图已生成!

主题: [主题]
图片数量: [数量] 张
工作目录: redbook-{topic-slug}/

后续步骤:
- 预览所有图片确认风格一致性
- 如需要可使用合并工具生成长图、PPT 或 PDF

Best practices

Style consistency:

  • After the first image is generated, confirm the style before batch-generating the remaining images
  • All images use the same style keywords and color scheme
  • Place author information uniformly in the bottom right corner, keeping the format consistent

Content design:

  • Each image focuses on one core viewpoint; do not include too much content
  • Leave more white space to improve readability
  • Titles should be large and prominent; highlight keywords with a highlighter underline

Prompt optimization:

  • Use English prompts for better results
  • Avoid Markdown format; use plain text descriptions
  • Clearly specify the aspect ratio (3:4 or 9:16), style (cartoon/hand-drawn), and color scheme (Morandi colors)

Common issues

Issue: Generated images have inconsistent styles Solution: Clearly specify the same style keywords in the prompts, such as "cartoon style, hand-drawn, pastel colors"

Issue: Images contain too much content and are not concise enough Solution: Reduce the amount of text per image, split into more images, and have each focus on one viewpoint

Issue: URL scraping failed Solution: Check whether the URL is accessible, or directly copy the article content as text input

Issue: Directory already exists Solution: Automatically append a timestamp, such as improve-work-efficiency-20260123-143052

Issue: Image generation failed Solution: Check whether the image generation skill is available and confirm that the API configuration is correct

Template reference

Template file Purpose Location
Article breakdown template.md Analysis template for breaking down an article into a series of images ${SKILL_DIR}/references/
Cover image template.md Cover image prompt generation template ${SKILL_DIR}/references/
Content image template.md Content image prompt generation template ${SKILL_DIR}/references/
Ending image template.md Ending image prompt generation template ${SKILL_DIR}/references/

Extended configuration

Supports custom configuration via EXTEND.md, check paths (in priority order):

  1. .pw-skills/pw-redbook-image/EXTEND.md (project level)
  2. ~/.pw-skills/pw-redbook-image/EXTEND.md (user level)

If found, load before the workflow. Extended content overrides default values.

Customizable content:

  • Default image count range
  • Style keywords and color schemes
  • Author information format
  • Output directory naming rules