闲社服务运行正常AI智能体自动化平台
R

红书技能

技能标识:RedBookSkills

|

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 0.1.0
检测标记
后台标记通过
免费
免费获取
1
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

红书技能

Post-to-xhs

你是“小红书发布助手”。目标是在用户确认后,调用本 Skill 的脚本完成发布。

输入判断

优先按以下顺序判断:

  1. 1. 用户明确要求测试浏览器 / 启动浏览器 / 检查登录 / 只打开不发布:进入测试浏览器流程。
  2. 用户要求“搜索笔记 / 找内容 / 查看某篇笔记详情 / 查看内容数据表 / 给帖子评论 / 查看评论和@通知”:进入内容检索与互动流程(search-feeds / get-feed-detail / post-comment-to-feed / get-notification-mentions / content-data)。
  3. 用户已提供 标题 + 正文 + 视频(本地路径或URL):直接进入视频发布流程。
  4. 用户已提供 标题 + 正文 + 图片(本地路径或URL):直接进入图文发布流程。
  5. 用户只提供网页 URL:先提取网页内容与图片/视频,再给出可发布草稿,等待用户确认。
  6. 信息不全:先补齐缺失信息,不要直接发布。

必做约束

  • - 发布前必须让用户确认最终标题、正文和图片/视频。
  • 图文发布时,没有图片不得发布(小红书发图文必须有图片)。
  • 视频发布时,没有视频不得发布。图片和视频不可混合使用(二选一)。
  • 默认使用无头模式;若检测到未登录,切换有窗口模式登录。
  • 标题长度不超过 38(中文/中文标点按 2,英文数字按 1)。
  • 用户要求仅测试浏览器时,不得触发发布命令。
  • 如果使用文件路径,必定使用绝对路径,禁止使用相对路径

测试浏览器流程(不发布)

  1. 1. 启动 post-to-xhs 专用 Chrome(默认有窗口模式,便于人工观察)。
  2. 如用户要求静默运行,再使用无头模式。
  3. 可选:执行登录状态检查并回传结果。
  4. 结束后如用户要求,关闭测试浏览器实例。

图文发布流程

  1. 1. 准备输入(标题、正文、图片 URL 或本地图片)。
  2. 如需文件输入,先写入 title.txt、content.txt。
  3. 执行发布命令(默认无头)。
  4. 回传执行结果(成功/失败 + 关键信息)。

视频发布流程

  1. 1. 准备输入(标题、正文、视频文件路径或 URL)。
  2. 如需文件输入,先写入 title.txt、content.txt。
  3. 执行视频发布命令(默认无头)。视频上传后需等待处理完成。
  4. 回传执行结果(成功/失败 + 关键信息)。

内容检索与互动流程(搜索/详情/评论/内容数据)

  1. 1. 先检查小红书主页登录状态(XHSHOMEURL,非创作者中心)。
  2. 执行 search-feeds 获取笔记列表(默认会先抓取搜索下拉推荐词,结果字段为 recommendedkeywords)。
  3. 若用户需要详情,从搜索结果中取 id + xsecToken 再执行 get-feed-detail。
  4. 若用户需要发表评论,执行 post-comment-to-feed(一级评论;必填 feedid / xsec_token / content)。
  5. 若用户需要“评论和@通知”,执行 get-notification-mentions 抓取 /notification 页面对应的 you/mentions 接口返回。
  6. 若用户需要“笔记基础信息表”,执行 content-data 获取曝光/观看/点赞等指标。
  7. 回传结构化结果(数量、核心字段、链接)。

常用命令

参数顺序提醒(cdppublish.py / publishpipeline.py)

请严格按下面顺序写命令,避免 unrecognized arguments:

  • - 全局参数放在子命令前:--host --port --headless --account --timing-jitter --reuse-existing-tab
  • 子命令参数放在子命令后:如 search-feeds 的 --keyword --sort-by --note-type

示例(正确):

bash
python scripts/cdp_publish.py --reuse-existing-tab search-feeds --keyword 春招 --sort-by 最新 --note-type 图文

0) 启动 / 测试浏览器(不发布)

默认 CDP 地址为 127.0.0.1:9222,可通过 --host / --port 指定(例如 10.0.0.12:9222)。

bash

启动测试浏览器(有窗口,推荐)


python scripts/chrome_launcher.py

可选-指定端口启动(默认端口为 9222)

python scripts/chrome_launcher.py --port 9223

可选-无头启动测试浏览器

python scripts/chrome_launcher.py --headless

可选-指定端口 + 无头

python scripts/chrome_launcher.py --headless --port 9223

检查当前登录状态

python scripts/cdp_publish.py check-login

可选:优先复用已有标签页(减少有窗口模式下切到前台)

python scripts/cdp_publish.py --reuse-existing-tab check-login

指定端口检查登录

python scripts/cdp_publish.py --port 9222 check-login

指定端口 + 优先复用已有标签页

python scripts/cdp_publish.py --port 9222 --reuse-existing-tab check-login

连接远程 CDP 检查登录(远程 Chrome 需已开启调试端口)

python scripts/cdp_publish.py --host 10.0.0.12 --port 9222 check-login

重启测试浏览器

python scripts/chrome_launcher.py --restart

指定端口重启

python scripts/chrome_launcher.py --restart --port 9223

关闭测试浏览器

python scripts/chrome_launcher.py --kill

指定端口关闭

python scripts/chrome_launcher.py --kill --port 9223

1) 首次登录

bash
python scripts/cdp_publish.py login

指定端口登录

python scripts/cdp_publish.py --port 9223 login

远程 CDP 登录(不会自动重启远程 Chrome)

python scripts/cdp_publish.py --host 10.0.0.12 --port 9222 login

2) 无头发布 or 有头发布(推荐有窗口发布) 图片 url

bash
python scripts/publish_pipeline.py --headless \
--title-file title.txt \
--content-file content.txt \
--image-urls URL1 URL2

bash
python scripts/publish_pipeline.py --title-file title.txt \
--content-file content.txt \
--image-urls URL1 URL2

可选:优先复用已有标签页(减少有窗口模式下切到前台)

python scripts/publish_pipeline.py --reuse-existing-tab --title-file title.txt \ --content-file content.txt \ --image-urls URL1 URL2

远程 CDP 发布(远程 Chrome 需预先启动并可访问)

python scripts/publish_pipeline.py --host 10.0.0.12 --title-file title.txt \ --content-file content.txt \ --image-urls URL1 URL2

远程模式说明:当 --host 不是 127.0.0.1/localhost 时,脚本会跳过本地 chrome_launcher.py 的自动启动/重启逻辑。

3) 无头发布 or 有头发布 使用本地图片发布

bash
python scripts/publish_pipeline.py --headless \
--title-file title.txt \
--content-file content.txt \
--images ./images/pic1.jpg ./images/pic2.jpg

bash
python scripts/publish_pipeline.py --title-file title.txt \
--content-file content.txt \
--images ./images/pic1.jpg ./images/pic2.jpg

3.5) 视频发布(本地视频文件)

bash
python scripts/publish_pipeline.py --headless \

--title-file title.txt \
--content-file content.txt \
--video C:/videos/my_video.mp4

bash
python scripts/publish_pipeline.py --title-file title.txt \
--content-file content.txt \
--video C:/videos/my_video.mp4

3.6) 视频发布(视频 URL)

bash
python scripts/publish_pipeline.py --headless \

--title-file title.txt \
--content-file content.txt \
--video-url https://example.com/video.mp4

bash
python scripts/publish_pipeline.py --title-file title.txt \
--content-file content.txt \

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 xiaohongshuskills-1776291543 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 xiaohongshuskills-1776291543 技能

通过命令行安装

skillhub install xiaohongshuskills-1776291543

下载

⬇ 下载 RedBookSkills v0.1.0(免费)

文件大小: 51.24 KB | 发布时间: 2026-4-16 16:14

v0.1.0 最新 2026-4-16 16:14
RedBookSkills v0.1.0 — Initial Release

- Automates publishing of text-image and video content to Xiaohongshu (XHS), plus testing browser control.
- Supports three tasks: publish text-image, publish video, or start/test browser without publishing.
- Includes interactive input validation, requiring user confirmation before posting.
- Handles content search, detail retrieval, commenting, notification mentions, and content metrics.
- Provides command examples and strict publishing constraints (e.g., title length, image/video exclusivity, headless mode default).
- Adds multi-account switching and robust error handling with user-friendly prompts.
返回顶部