小红书 Publisher
Create, format, and publish posts to 小红书 (Xiaohongshu/RED) through browser automation.
Requirements
- - Python 3 with Pillow (
pip install Pillow or apt install python3-pil) - CJK fonts —
fonts-noto-cjk on Linux (apt install fonts-noto-cjk), or Noto Sans CJK via Homebrew on macOS - OpenClaw browser tool — access to a browser with the user logged into 小红书 creator portal
- A connected OpenClaw node (or sandbox browser) with Chrome/Chromium for browser automation
Overview
This skill handles the complete 小红书 publishing pipeline:
- 1. Draft — Write post content in 小红书 style
- Cover — Generate a cover image (1080×1440)
- Review — Send draft to user for approval via messaging channel
- Publish — Use browser automation to post (or deliver for manual posting)
Workflow
Step 1: Draft Content
Create post content following 小红书 style. See references/content-guide.md for formatting rules, structure, and examples.
Key rules:
- - Title ≤20 chars, with emoji hook
- Use
--- section breaks, emoji bullets, short paragraphs - End with question CTA + hashtags (8-12 tags)
- Save draft to INLINECODE5
Step 2: Generate Cover Image
Run the cover generation script:
CODEBLOCK0
Options:
- -
--title — Main title (large text, required) - INLINECODE7 — Subtitle line (medium text, optional)
- INLINECODE8 — Comma-separated feature tags shown as pills (optional)
- INLINECODE9 — Top-right badge text (default: "OpenClaw")
- INLINECODE10 — Output path (default:
cover.png) - INLINECODE12 — Color scheme:
purple (default), blue, green, orange, INLINECODE17
Output: 1080×1440 PNG with gradient background, decorative elements, CJK text.
Step 3: Send for Review
Send the draft content + cover image to the user's messaging channel for review. Format:
CODEBLOCK1
Never auto-publish. Always wait for explicit user approval.
Step 4: Publish via Browser
After user approval, publish using browser automation on the configured node.
See references/browser-publish.md for the complete browser automation steps.
Summary:
- 1. Navigate to INLINECODE18
- Enter title and body text
- Upload cover image via browser
upload action - Click publish
Fallback: Manual Publishing
If browser automation is unavailable (CDP issues, node offline, etc.), send the complete post to the user's channel with all content formatted for easy copy-paste:
CODEBLOCK2
Known Limitations
- - Mac Chrome CDP: Chrome launched via SSH/node may fail to bind
--remote-debugging-port on macOS (GUI session required). If browser start fails, fall back to manual publishing. - Login state: 小红书 creator portal requires login. If the session has expired, ask the user to re-login in their browser before proceeding.
- Pillow emoji: Pillow cannot render color emoji (NotoColorEmoji.ttf) — use text/icon alternatives in cover images.
Cron Integration
This skill works with cron jobs for scheduled daily posting. Typical cron setup:
CODEBLOCK3
The cron job message should reference this skill and include the content plan/topic for the day.
小红书 Publisher
通过浏览器自动化创建、格式化和发布帖子到小红书。
要求
- - Python 3 及 Pillow 库(pip install Pillow 或 apt install python3-pil)
- CJK 字体 — Linux 系统安装 fonts-noto-cjk(apt install fonts-noto-cjk),macOS 系统通过 Homebrew 安装 Noto Sans CJK
- OpenClaw 浏览器工具 — 可访问已登录小红书创作者中心的浏览器
- 已连接的 OpenClaw 节点(或沙箱浏览器),需安装 Chrome/Chromium 以支持浏览器自动化
概述
本技能处理完整的小红书发布流程:
- 1. 草稿 — 按小红书风格撰写帖子内容
- 封面 — 生成封面图片(1080×1440)
- 审核 — 通过消息渠道将草稿发送给用户审批
- 发布 — 使用浏览器自动化发布(或提供内容供手动发布)
工作流程
第一步:撰写内容
按照小红书风格创建帖子内容。格式规则、结构和示例请参考 references/content-guide.md。
关键规则:
- - 标题 ≤20 字,带 emoji 钩子
- 使用 --- 分段、emoji 列表符号、短段落
- 结尾使用提问式行动号召 + 标签(8-12 个标签)
- 将草稿保存至 memory/xiaohongshu-draft.md
第二步:生成封面图片
运行封面生成脚本:
bash
python3 /scripts/gen_cover.py --title 主标题 --subtitle 副标题 --tags 标签1,标签2,标签3 --output /path/to/cover.png
选项:
- - --title — 主标题(大号文字,必填)
- --subtitle — 副标题行(中号文字,可选)
- --tags — 以逗号分隔的特色标签,显示为药丸样式(可选)
- --badge — 右上角徽章文字(默认:OpenClaw)
- --output — 输出路径(默认:cover.png)
- --gradient — 配色方案:purple(默认)、blue、green、orange、dark
输出:1080×1440 PNG 图片,包含渐变背景、装饰元素和 CJK 文字。
第三步:发送审核
将草稿内容 + 封面图片发送至用户的消息渠道进行审核。格式如下:
📝 小红书草稿 — [主题]
标题:[标题]
[正文内容]
封面图已生成:[路径]
请确认:
✅ 可以发布
✏️ 需要修改
❌ 不发
切勿自动发布。 始终等待用户明确批准。
第四步:通过浏览器发布
用户批准后,在配置的节点上使用浏览器自动化发布。
完整的浏览器自动化步骤请参考 references/browser-publish.md。
概要:
- 1. 导航至 https://creator.xiaohongshu.com/publish/publish
- 输入标题和正文
- 通过浏览器的 upload 操作上传封面图片
- 点击发布
备用方案:手动发布
如果浏览器自动化不可用(CDP 问题、节点离线等),将完整帖子内容发送至用户频道,所有内容格式化为便于复制粘贴:
📋 小红书发帖内容(请手动发布)
【标题】[标题]
【正文】
[正文内容]
【标签】[hashtags]
封面图:[封面图片路径]
已知限制
- - Mac Chrome CDP:通过 SSH/节点启动的 Chrome 在 macOS 上可能无法绑定 --remote-debugging-port(需要 GUI 会话)。如果 browser start 失败,请回退到手动发布。
- 登录状态:小红书创作者中心需要登录。如果会话已过期,请让用户在其浏览器中重新登录后再继续。
- Pillow emoji:Pillow 无法渲染彩色 emoji(NotoColorEmoji.ttf)——请在封面图片中使用文字/图标替代。
定时任务集成
本技能可与定时任务配合,实现每日定时发布。典型的定时任务设置:
计划:0 8 *(北京时间)
会话:独立代理轮次
投递:通知用户频道
定时任务消息应引用本技能,并包含当天的内容计划/主题。