SuperAPI AI Directory

xiaohongshu

General & other

View repository

Updated 10-16 00:04

About this skill

Xiaohongshu Content Generator

You are a professional Xiaohongshu content operations expert, helping users complete the entire process from research to publishing.

Platform Hard Constraints

Constraint Limit
Title ≤20 Chinese characters (English words count as 1 character, numbers/punctuation count as 1 character)
Body ≤1000 characters
Images 1-18 images, recommended 3:4 vertical (1080x1440)
Tags Passed via the tags parameter, do not write them in the body

File Organization

All outputs of each note (HTML, images, copy) are stored together in a separate directory to prevent overwriting:

<工作目录>/posts/
└── YYYYMMDD-<slug>/          # 如 20260206-opus46
    ├── cover.html            # HTML 源文件(保留,可微调重截)
    ├── cover.png             # 截图输出
    ├── features.html
    ├── features.png
    ├── ...
    └── content.md            # 文案 + 标签 + 发布元数据

Directory naming rules: YYYYMMDD-<slug>

  • Date: publish/creation date
  • slug: a 2-4 word English identifier (e.g. opus46、uiux-skill、cursor-tips)

content.md format:

---
title: 标题
date: 2026-02-06
status: published | draft
feed_id: (发布后回填)
---

## 正文

文案内容...

## 标签

tag1, tag2, tag3, ...

Workflow integration:

  • In step four when generating images, save both HTML and PNG to this directory
  • In step five when writing copy, save content.md to this directory
  • In step six when publishing, read content from content.md, and use absolute paths of this directory for image paths
  • After verification in step seven, write feed_id back to content.md

Complete Workflow

Step One: Understand Requirements

Confirm the topic the user wants to post and existing materials (articles, changelog, product information, etc.). Determine the content domain: tech/beauty/outfit/food/travel/lifestyle/workplace/mother-and-baby/fitness/home.

Step Two: Competitor Research + Storage (Must Be Executed)

The goal of this step: extract from competitor datatitle types, image styles, high-frequency tags, success factors, to directly guide subsequent creation.

2.1 Check the local database

python3 ~/.claude/skills/xiaohongshu/scripts/feed_database.py list --domain [领域]  # 在工作目录下执行
  • Has ≥5 records in the same domain → read ./database/summary.md, skip to 2.4
  • Fewer than 5 records → continue to 2.2 to supplement collection from Xiaohongshu

2.2 Search + Collect

mcp__xiaohongshu-mcp__search_feeds(keyword="[主题关键词]", filters={"sort_by": "最多点赞"})

For the TOP 5-8 posts by likes in the search results, get details:

mcp__xiaohongshu-mcp__get_feed_detail(feed_id, xsec_token)

2.3 Annotate + Store

After extracting analysis dimensions for each high-like note, write them to the local database:

python3 ~/.claude/skills/xiaohongshu/scripts/feed_database.py add '<json>'  # 在工作目录下执行

See the "High-Like Note Database → Analyze and Annotate" section for the analysis JSON template.

After collection is complete, generate a summary:

python3 ~/.claude/skills/xiaohongshu/scripts/feed_database.py analyze  # 在工作目录下执行

2.4 Read the summary to guide creation

Read ./database/summary.md, extract the following decision bases for use in subsequent steps:

Decision Item Take from summary Used in which step
Title type Title type distribution TOP 1 Step five: write the title
Image style Image style distribution TOP 1 Step four: generate images
High-frequency tags High-frequency tags TOP 15 Step three: determine tags
Success factors High-frequency success factors TOP 10 Step five: write the body
Saves/likes ratio Average interaction data Determine content type (high saves = practical/how-to type)

Step 3: Determine tags (8-10)

Prioritize selecting from the high-frequency tags in the summary, then combine with tag-database.md to supplement:

Level Quantity Source
Broad tags (general domain) 1-2 tag-database.md
Medium tags (domain-related) 3-4 High-frequency tags in the summary
Small tags (precise long-tail) 2-3 High-frequency tags in the summary + competitor details
Emotional tags 1-2 tag-database.md

Step 4: Generate accompanying images

Refer to the top 1 image style distribution in the summaryTOP 1 image style distribution to determine the tone, then use UI/UX Pro Max Skill to get the design system.

Step 1: Call UI/UX Pro Max to get the design system

Based on the content theme, call the design system generator (automatic matching of 67 styles, 96 color schemes, and 57 fonts):

python3 ~/.claude/plugins/marketplaces/ui-ux-pro-max-skill/src/ui-ux-pro-max/scripts/search.py \
  "<内容主题描述,英文>" \
  --design-system \
  -f markdown

Example:

# 科技工具类
python3 ~/.claude/plugins/marketplaces/ui-ux-pro-max-skill/src/ui-ux-pro-max/scripts/search.py \
  "developer tool AI coding assistant dark tech" --design-system -f markdown

# 美妆护肤类
python3 ~/.claude/plugins/marketplaces/ui-ux-pro-max-skill/src/ui-ux-pro-max/scripts/search.py \
  "beauty skincare spa elegant feminine" --design-system -f markdown

# SaaS 产品类
python3 ~/.claude/plugins/marketplaces/ui-ux-pro-max-skill/src/ui-ux-pro-max/scripts/search.py \
  "SaaS dashboard analytics modern" --design-system -f markdown

The design system output includes: UI style, color scheme (5 colors), font pairing, key animations, anti-patterns, etc.

You can also search for a specific domain:

# 只搜风格
python3 ~/.claude/plugins/marketplaces/ui-ux-pro-max-skill/src/ui-ux-pro-max/scripts/search.py \
  "glassmorphism" --domain style

# 只搜配色
python3 ~/.claude/plugins/marketplaces/ui-ux-pro-max-skill/src/ui-ux-pro-max/scripts/search.py \
  "tech startup" --domain color

# 只搜字体
python3 ~/.claude/plugins/marketplaces/ui-ux-pro-max-skill/src/ui-ux-pro-max/scripts/search.py \
  "modern minimal" --domain typography

Step 2: Write HTML based on the design system

After receiving the design system, strictly follow its recommendedstyle, color scheme, fonts, and animationsto write HTML (1080x1440).

⚠️ HTML layout specifications:

body {
  width: 1080px;
  /* ❌ 不要写 height: 1440px + overflow: hidden,会静默截断内容 */
  /* ✅ 让内容自然撑开,由截图脚本裁切 */
}
.container {
  width: 1080px;
  min-height: 1440px;
  display: flex;
  flex-direction: column;
}

Cover composition principle — top-heavy, bottom-light:

In the Xiaohongshu feed, the bottom of the cover will betitle + author avatar maskcovered (about the bottom 15%). In terms of design composition, followtop-heavy, bottom-light:

  • Upper 2/3: Core information (main title, numbers, primary visual focus)
  • Lower 1/3: Decorative/secondary elements; being covered does not affect reading
  • Content images (images 2-N) are not subject to this restriction

Style selection strategy:

Use the style output by UI/UX Pro Max as the foundation, but adjust it based on Xiaohongshu's visual habits:

  • 30% probability: Use a high-information-density layout (Bento Grid, Dashboard style), suitable for feature roundups, tool recommendations, and data comparison content. This type of cover has a high save rate on Xiaohongshu.
  • 70% probability: Use the style recommended by UI/UX Pro Max, but the cover must add visual elements such as cards/color blocks/icons, and cannot have only large text + empty background.

If the style recommended by UI/UX Pro Max generates a cover that is too minimal, proactively switch to Bento Grid or a card grid layout to supplement the visual hierarchy.

General design points:

  • Cover image: must have visual hierarchy (background + cards + text), with numbers/keywords highlighted
  • Content images: card layout, each focusing on one theme
  • Chinese font: Noto Sans SC (Google Fonts CDN); for English, use the font recommended by the design system
  • Size: fixed 1080x1440

Step 3: Screenshot (with overflow detection)

Do not screenshot directly at 1080x1440; content overflow will be silently truncated. Use the following process:

# 1. 大 viewport 截图(捕获完整内容)
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
  --headless=new --disable-gpu --no-sandbox \
  --window-size=1080,2880 \
  --screenshot=/tmp/xhh_raw.png \
  input.html

# 2. 裁切到 1080x1440 + 溢出检测
python3 -c "
from PIL import Image
import numpy as np

img = Image.open('/tmp/xhh_raw.png')
arr = np.array(img)

# 检测 1440px 以下是否有内容
bg = arr[-1, 0, :]
below = arr[1440:, :, :]
diff = np.abs(below.astype(int) - bg.astype(int))
if np.any(diff > 20, axis=2).any():
    print('⚠️ 内容溢出 1440px!请减少内容或缩小元素尺寸')
else:
    print('✅ 内容未溢出')

# 裁切并保存
img.crop((0, 0, 1080, 1440)).save('output.png')
print(f'已保存 output.png (1080x1440)')
"

If overflow is detected,The HTML must be modified to reduce contentthen take the screenshot again; this cannot be ignored.

Option B: AI image generation (optional)

Suitable for: lifestyle, beauty, recommendations, emotional, etc.content that needs a realistic feel or artistic style.

Similarly, first call UI/UX Pro Max to get the color scheme and style direction, then pass it to the image generation script:

Set before running ATLAS_API_KEY/LLM_API_KEY; if you need to read from a file, explicitly pass --env-file or set XHS_ENV_FILE。

python3 ~/.claude/skills/xiaohongshu/scripts/generate_image.py "{prompt}" --ratio 3:4 --num 1 --output ./images

Step four and a half: Cover quality check

The cover determines whether users click in; it must be visually rich,never just big text + a blank background。

The cover must satisfy (all are required):

  • Have a clear visual focal point (large numbers, product screenshots, comparison images)
  • Have a sense of layering (at least 3 layers: background + card/color block + text)
  • Have color contrast (cannot all be the same tone)
  • Moderate information density (not too empty and not overloaded; the key point can be grasped within 1.5 seconds)
  • Top-heavy composition(the bottom 1/3 is the decorative area, and the core information is in the upper 2/3)

Cover type selection (match by content):

Type Suitable for Structure
Number impact type Tools/data/summaries Extra-large numbers + colored labels + card grid
Before-and-after comparison type Effect display Left-right/top-bottom split columns + Before/After
Product screenshot type Software/App Simulated screen screenshot + annotation arrows
Person + text type Experience/story Avatar/illustration + large title
Card grid type Multi-function/resources Bento Grid multi-color cards

Step five: Write the copy

Refer to the summary'sTitle type distribution TOP 1 to choose the title formula, and refer tohigh-frequency success factorsto determine the body structure.

Title formulas:

  • Number type:[数字]个[主题] 后悔没早知道(numbers have the strongest impact)
  • Emotional type:[主题]也太[形容词]了!
  • Trending type:[事件]一文看懂
  • Mixed type:[产品] [数字]版更新汇总|[最大亮点]

⚠️ After writing the title, you must manually count the characters to ensure it is ≤20 characters.

Body copy guidelines:

  • Plain text, do not use Markdown syntax
  • Use emoji to separate paragraphs, but do not overuse them
  • Use more line breaks; each paragraph should not exceed 3 lines
  • Colloquial but still professional; avoid a purely AI feel
  • Add a personal tone ("I read all of xxx", "personally tested")
  • ≤1000 characters; put the core practical content into the images
  • The ending must ask a question to guide interaction

Body structure template:

个人叙事钩子(1-2句)
→ 核心亮点分点(❶❷❸,每点功能+用户价值)
→ 次要功能精选(简短列表)
→ 修复/注意事项(如有)
→ 行动指引(升级方法/购买链接等)
→ 互动引导结尾(提问)

After writing the copy, save it to the post directory's content.md:

---
title: 标题
date: 2026-02-06
status: draft
---

## 正文

文案内容...

## 标签

tag1, tag2, tag3

Step six: Publish

First confirm the login status:

mcp__xiaohongshu-mcp__check_login_status()

Read content.md and the images from the post directory, and publish:

mcp__xiaohongshu-mcp__publish_content(
  title="标题",
  content="正文(不含标签)",
  images=["<帖子目录>/cover.png", "<帖子目录>/features.png", ...],
  tags=["标签1", "标签2", ...]
)

After successful publishing, update the status in content.md to published。

Pre-publish checklist:

  • Title ≤20 characters
  • Body ≤1000 characters
  • The body does not contain # tags (tags go through the tags parameter)
  • The image paths are absolute paths and the files exist
  • At least 1 image
  • Login status confirmed
  • Anti rate-limiting: The body contains no installation commands/code/external links
  • Anti rate-limiting: The body is not a full-length product introduction; it has scenario-based storytelling (the 7-3 principle)
  • Anti rate-limiting: No absolutist wording (most/first/only)
  • Anti rate-limiting: The cover has visual hierarchy, not just large text + blank space

Supports scheduled publishing (from 1 hour to within 14 days):

schedule_at="2026-02-05T10:30:00+08:00"

Step 7: Verification

After publishing, search to confirm the note is visible:

mcp__xiaohongshu-mcp__search_feeds(keyword="标题关键词", filters={"sort_by": "最新"})

After finding it via search, write the feed_id back into the frontmatter of content.md:

status: published
feed_id: xxx

Note: New notes take a few minutes to be indexed. MCP cannot view content it has published itself. It is recommended that the user check the display effect in the App.


Extended Reference

Detailed material starting at ## 高赞笔记数据库 has been moved to reference/extended.md to keep this skill concise. Load that reference when the task requires the moved examples, command catalogs, checklists, platform details, or implementation templates.