SuperAPI AI Directory

xhs-note-creator

General & other

View repository

Updated 10-15 20:14

About this skill

Xiaohongshu Note Creation Skill

Based on the materials or needs provided by the user, create Xiaohongshu note content, generate exquisite image cards, and optionally publish to Xiaohongshu.

See detailed parameter documentation at references/params.md


Workflow

Step 1: Write Xiaohongshu note content

Based on user needs and materials, create content that fits the Xiaohongshu style:

Title: no more than 20 characters, eye-catching, can use numbers/questions/exclamation marks to enhance appeal.

Body: clear paragraphs, embellished with a small number of Emoji (1-2 per paragraph), short sentences and short paragraphs, with 5-10 SEO tags at the end.


Step 2: Generate Markdown document for rendering

Note: This Markdown is designed specifically for image rendering; do not directly use the note body from the previous step.

Document structure:

---
emoji: "🚀"
title: "封面大标题(≤15字)"
subtitle: "封面副标题(≤15字)"
---

# 正文内容...

---

# 第二张卡片内容...(使用 --- 手动分隔时)

Pagination strategy selection:

  • Content needs precise segmentation → use --- for manual separation, together with -m separator
  • Content length is unstable → generate normal Markdown, use -m auto-split

Step 3: Render image cards

python scripts/render_xhs.py <markdown_file> [options]

Default theme:sketch(hand-drawn sketch style)
Default pagination:separator(separated by --- )

Common examples:

# 默认(sketch 主题 + 手动分页)
python scripts/render_xhs.py content.md

# 自动分页(推荐内容长短不定时)
python scripts/render_xhs.py content.md -m auto-split

# 切换主题
python scripts/render_xhs.py content.md -t playful-geometric -m auto-split

# 固定尺寸自动缩放
python scripts/render_xhs.py content.md -m auto-fit

Generated results:cover.png(cover) + card_1.png、card_2.png... (body cards)

Available themes(-t):sketch、default、playful-geometric、neo-brutalism、botanical、professional、retro、terminal

Pagination modes(-m):separator、auto-fit、auto-split、dynamic

See complete parameter descriptions at references/params.md


Step 4: Publish Xiaohongshu note (optional)

Prerequisites: Install Python and Node.js dependencies, and configure .env in XHS_CREATOR_COOKIE. The Cookie must come from a logged-in https://creator.xiaohongshu.com(see references/params.md)。

# 默认仅自己可见(推荐先预览确认)
python scripts/publish_xhs.py --title "笔记标题" --desc "笔记描述" \
  --images cover.png card_1.png card_2.png

# 确认无误后公开发布
python scripts/publish_xhs.py --title "笔记标题" --desc "笔记描述" \
  --images cover.png card_1.png card_2.png --public

By default, publish as "visible only to yourself", add --public parameter to make it public. The publishing pipeline is built into the current skill and does not depend on external API services or other project directories.


Skill resources

Scripts

  • scripts/render_xhs.py — rendering script (primary, 8 themes + 4 pagination modes)
  • scripts/render_xhs_v2.py — rendering script V2 (backup, 7 gradient color styles)
  • scripts/publish_xhs.py — publishing script

Templates and styles

  • assets/cover.html — cover HTML template
  • assets/card.html — body card HTML template
  • assets/styles.css — common container styles
  • assets/themes/ — CSS files for each theme

Reference documentation

  • references/params.md — complete parameter reference (themes/modes/publishing parameters)