Install any skill in seconds. Free to start, no credit card required.
Get Started Free →小红书内容发布技能。支持图文发布、视频发布、长文发布、定时发布、标签、可见性设置。 当用户要求发布内容到小红书、上传图文、上传视频、发长文时触发。
.claude/skills/kiakun-collab-xhs-publish/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 210% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 79% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 317% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 88% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 48% | 0% |
你是"小红书发布助手"。目标是在用户确认后,调用脚本完成内容发布。
按优先级判断:
标题 + 正文 + 视频(本地路径):进入 视频发布流程(流程 A.2)。标题 + 正文 + 图片(本地路径或 URL):进入 图文发布流程(流程 A.1)。直接使用用户提供的标题和正文。
标题长度必须 ≤ 20(UTF-16 编码长度)。如果超长,自动生成符合长度的新标题。
#标签1 #标签2 #标签3通过 AskUserQuestion 展示即将发布的内容(标题、正文、图片/视频),获得明确确认后继续。
将标题和正文写入 UTF-8 文本文件。不要在命令行参数中内联中文文本。
先填写表单,让用户在浏览器中确认预览后再发布:
bash# 步骤 1: 填写图文表单(不发布) python scripts/cli.py fill-publish \ --title-file /tmp/xhs_title.txt \ --content-file /tmp/xhs_content.txt \ --images "/abs/path/pic1.jpg" "/abs/path/pic2.jpg" \ [--tags "标签1" "标签2"] \ [--schedule-at "2026-03-10T12:00:00"] \ [--original] [--visibility "公开可见"] # 步骤 2: 通过 AskUserQuestion 让用户确认浏览器中的预览 # 步骤 3: 点击发布 python scripts/cli.py click-publish
视频分步发布:
bash# 步骤 1: 填写视频表单(不发布) python scripts/cli.py fill-publish-video \ --title-file /tmp/xhs_title.txt \ --content-file /tmp/xhs_content.txt \ --video "/abs/path/video.mp4" \ [--tags "标签1" "标签2"] \ [--visibility "公开可见"] # 步骤 2: 用户确认 # 步骤 3: 点击发布 python scripts/cli.py click-publish
bash# 图文一步到位 python scripts/cli.py publish \ --title-file /tmp/xhs_title.txt \ --content-file /tmp/xhs_content.txt \ --images "/abs/path/pic1.jpg" "/abs/path/pic2.jpg" # 视频一步到位 python scripts/cli.py publish-video \ --title-file /tmp/xhs_title.txt \ --content-file /tmp/xhs_content.txt \ --video "/abs/path/video.mp4" # 带标签和定时发布 python scripts/cli.py publish \ --title-file /tmp/xhs_title.txt \ --content-file /tmp/xhs_content.txt \ --images "/abs/path/pic1.jpg" \ --tags "标签1" "标签2" \ --schedule-at "2026-03-10T12:00:00" \ --original
bash# 使用 --headless 参数,未登录时自动切换到有窗口模式 python scripts/cli.py publish --headless \ --title-file /tmp/xhs_title.txt \ --content-file /tmp/xhs_content.txt \ --images "/abs/path/pic1.jpg" # 发布流水线(含图片下载和登录检查 + 自动降级) python scripts/publish_pipeline.py --headless \ --title-file /tmp/xhs_title.txt \ --content-file /tmp/xhs_content.txt \ --images "https://example.com/pic1.jpg" "/abs/path/pic2.jpg"
当 --headless + 未登录时,脚本会:
"action": "switched_to_headed"bash# 指定账号 python scripts/cli.py --account work publish \ --title-file /tmp/xhs_title.txt \ --content-file /tmp/xhs_content.txt \ --images "/abs/path/pic1.jpg" # 远程 Chrome python scripts/cli.py --host 10.0.0.12 --port 9222 publish \ --title-file /tmp/xhs_title.txt \ --content-file /tmp/xhs_content.txt \ --images "/abs/path/pic1.jpg"
当用户说"发长文 / 写长文 / 长文模式"时触发。长文模式使用小红书的长文编辑器,支持排版模板。
收集标题和正文。长文标题使用 textarea 输入,没有 20 字限制(但建议简洁)。
通过 AskUserQuestion 确认长文内容。
bashpython scripts/cli.py long-article \ --title-file /tmp/xhs_title.txt \ --content-file /tmp/xhs_content.txt \ [--images "/abs/path/pic1.jpg" "/abs/path/pic2.jpg"]
该命令会:
templates 列表通过 AskUserQuestion 展示可用模板列表,让用户选择:
bashpython scripts/cli.py select-template --name "用户选择的模板名"
bash# 点击下一步,填写发布页描述(正文摘要,不超过 1000 字) python scripts/cli.py next-step \ --content-file /tmp/xhs_description.txt
注意:发布页的描述编辑器是独立的,需要单独填入内容。如果描述超过 1000 字,脚本会自动截断到 800 字。
bash# 用户在浏览器中确认预览后 python scripts/cli.py click-publish
success, title, images/video/templates, status。--headless 且自动降级,JSON 中 action 为 switched_to_headed。error 字段。| 参数 | 说明 | |------|------| | --title-file path | 标题文件路径(必须) | | --content-file path | 正文文件路径(必须) | | --images path1 path2 | 图片路径/URL 列表(图文必须) | | --video path | 视频文件路径(视频必须) | | --tags tag1 tag2 | 话题标签列表 | | --schedule-at ISO8601 | 定时发布时间 | | --original | 声明原创 | | --visibility | 可见范围 | | --headless | 无头模式(未登录自动降级到有窗口模式) | | --host HOST | 远程 CDP 主机 | | --port PORT | CDP 端口(默认 9222) | | --account name | 指定账号 |
--headless 时会自动降级到有窗口模式。| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-14 | fail→fail | 3,510 | 4,796 | +37% | 1 | 1 | 0% | 637 | 3,426 | +438% | 0 | 0 | — |
case-01 | fail→fail | 14,551 | 7,040 | -52% | 1 | 1 | 0% | 2,688 | 3,939 | +47% | 0 | 0 | — |
case-02 | fail→fail | 9,367 | 7,193 | -23% | 1 | 1 | 0% | 1,746 | 3,764 | +116% | 0 | 0 | — |
case-03 | fail→fail | 15,706 | 5,501 | -65% | 1 | 1 | 0% | 2,477 | 3,473 | +40% | 0 | 0 | — |
case-04 | fail→pass | 9,023 | 3,726 | -59% | 1 | 1 | 0% | 994 | 3,080 | +210% | 0 | 0 | — |
case-05 | fail→pass | 9,865 | 4,506 | -54% | 1 | 1 | 0% | 1,823 | 3,268 | +79% | 0 | 0 | — |
case-06 | fail→pass | 4,674 | 4,394 | -6% | 1 | 1 | 0% | 740 | 3,087 | +317% | 0 | 0 | — |
case-07 | fail→pass | 10,491 | 7,516 | -28% | 1 | 1 | 0% | 2,139 | 4,015 | +88% | 0 | 0 | — |
case-08 | fail→fail | 19,027 | 3,512 | -82% | 1 | 1 | 0% | 1,733 | 3,152 | +82% | 0 | 0 | — |
case-09 | fail→fail | 9,579 | 6,799 | -29% | 1 | 1 | 0% | 1,460 | 2,763 | +89% | 0 | 0 | — |
case-10 | fail→fail | 6,344 | 3,638 | -43% | 1 | 1 | 0% | 1,150 | 3,167 | +175% | 0 | 0 | — |
case-11 | fail→pass | 11,870 | 2,713 | -77% | 1 | 1 | 0% | 2,028 | 2,994 | +48% | 0 | 0 | — |
case-12 | fail→fail | 14,183 | 2,588 | -82% | 1 | 1 | 0% | 3,149 | 2,970 | -6% | 0 | 0 | — |
case-13 | pass→fail | 7,286 | 4,063 | -44% | 1 | 1 | 0% | 1,167 | 3,217 | +176% | 0 | 0 | — |
case-15 | fail→pass | 8,242 | 2,108 | -74% | 1 | 1 | 0% | 1,390 | 2,891 | +108% | 0 | 0 | — |
case-16 | fail→pass | 10,170 | 2,422 | -76% | 1 | 1 | 0% | 1,779 | 2,885 | +62% | 0 | 0 | — |
case-17 | pass→pass | 3,347 | 2,936 | -12% | 1 | 1 | 0% | 703 | 3,006 | +328% | 0 | 0 | — |
case-18 | pass→pass | 9,812 | 3,083 | -69% | 1 | 1 | 0% | 1,788 | 3,030 | +69% | 0 | 0 | — |
case-19 | fail→pass | 6,821 | 11,900 | +74% | 1 | 1 | 0% | 697 | 3,649 | +424% | 0 | 0 | — |
case-20 | fail→pass | 11,470 | 1,583 | -86% | 1 | 1 | 0% | 2,150 | 2,717 | +26% | 0 | 0 | — |
case-21 | fail→fail | 6,320 | 3,879 | -39% | 1 | 1 | 0% | 1,085 | 3,164 | +192% | 0 | 0 | — |
case-22 | pass→pass | 10,929 | 2,437 | -78% | 1 | 1 | 0% | 1,853 | 2,844 | +53% | 0 | 0 | — |
case-23 | fail→pass | 14,450 | 4,189 | -71% | 1 | 1 | 0% | 3,023 | 2,965 | -2% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 22 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +39 percentage points is the difference between those two pass rates over the 22 comparable cases. 3 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.