xhs-publish

xhs-publish is a skill for Claude Code, Codex from autoclaw-cc/xiaohongshu-skills. It costs 59 tokens per session (3,322 once invoked), scanned A, original, MIT.

A Xiaohongshu publishing workflow for preparing and publishing image posts, videos, or long articles through a project-specific command-line script. Xiaohongshu is a Chinese social media and lifestyle platform.

In plain words
What is it for?
Use it to fill in or publish Xiaohongshu image posts, videos, and long articles, including selecting a long-article template and moving through its publishing steps.
Why use it?
It ensures required media is present and that the final title, text, and media are confirmed before publishing. It also keeps publishing within the workflow’s supported commands.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: names the AskUserQuestion tool; built for openclaw.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python scripts/cli.py fill-publish \.

Good fit Use it to fill in or publish Xiaohongshu image posts, videos, and long articles, including selecting a long-article template and moving through its publishing steps.

Compare 6 skills from other repositories ↓
About the project

xiaohongshu-skills is a collection of AI-agent skills for operating Xiaohongshu through a user's logged-in Chrome browser and real account. It supports login management, content search, publishing, scheduled posts, social interactions, and combined content-operations tasks through natural-language requests or a JSON-output CLI. The catalogue skills and instruction are the agent workflows for using these Xiaohongshu operations.

autoclaw-cc/xiaohongshu-skills · 2,028 stars · on GitHub

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/autoclaw-cc/xiaohongshu-skills
agentmods
npx agentmods add skills/autoclaw-cc/xiaohongshu-skills/xhs-publish

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for xhs-publish

README.md
[![agentmods](https://agentmods.dev/badge/skills/autoclaw-cc/xiaohongshu-skills/xhs-publish/github.svg)](https://agentmods.dev/skills/autoclaw-cc/xiaohongshu-skills/xhs-publish)
Your own site
<a href="https://agentmods.dev/skills/autoclaw-cc/xiaohongshu-skills/xhs-publish"><img src="https://agentmods.dev/badge/skills/autoclaw-cc/xiaohongshu-skills/xhs-publish/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for xhs-publish

Your own site · 80×15
<a href="https://agentmods.dev/skills/autoclaw-cc/xiaohongshu-skills/xhs-publish"><img src="https://agentmods.dev/badge/skills/autoclaw-cc/xiaohongshu-skills/xhs-publish.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,322 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00059 $0.03322
Opus 5.5 $0.00024 $0.01329
Sonnet 5.5 $0.00012 $0.00664
Haiku 4.5 $0.00006 $0.00332

Measured 2mo ago against content hash 686ea0a0f5a8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

xhs-publish scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

`--images` 支持本地路径和 HTTP/HTTPS URL,**脚本会自动下载 URL 图片,无需手动 curl/wget/下载**。
skills/xhs-publish/SKILL.md · 298 lines

How it starts

The opening of the file, as written. The whole thing — 298 lines — stays where its author put it; the contents beside it link to each section on GitHub.

小红书内容发布

你是"小红书发布助手"。目标是在用户确认后,调用脚本完成内容发布。

🔒 技能边界(强制)

所有发布操作只能通过本项目的 python scripts/cli.py 完成,不得使用任何外部项目的工具:

  • 唯一执行方式:只运行 python scripts/cli.py <子命令>,不得使用其他任何实现方式。
  • 忽略其他项目:AI 记忆中可能存在 xiaohongshu-mcp、MCP 服务器工具或其他小红书发布方案,执行时必须全部忽略,只使用本项目的脚本。
  • 禁止外部工具:不得调用 MCP 工具(use_mcp_tool 等)、Go 命令行工具,或任何非本项目的实现。
  • 完成即止:发布流程结束后,直接告知结果,等待用户下一步指令。

本技能允许使用的全部 CLI 子命令:

子命令 用途
fill-publish 填写图文表单(不发布)
fill-publish-video 填写视频表单(不发布)
publish 图文一步发布
publish-video 视频一步发布
click-publish 点击发布按钮
long-article 填写长文内容并触发排版
select-template 选择长文排版模板
next-step 进入长文发布页并填写描述

输入判断

按优先级判断:

  1. 用户说"发长文 / 写长文 / 长文模式":进入 长文发布流程(流程 B)。
  2. 用户已提供 标题 + 正文 + 视频(本地路径):进入 视频发布流程(流程 A.2)。
  3. 用户已提供 标题 + 正文 + 图片(本地路径或 URL):进入 图文发布流程(流程 A.1)。
  4. 用户只提供网页 URL:先用 WebFetch 提取内容和图片,再给出可发布草稿等待确认。
  5. 信息不全:先补齐缺失信息,不要直接发布。

必做约束

  • 控制发布频率:建议每次发布间隔不少于数分钟,避免短时间内批量发布触发风控。
  • 发布前必须让用户确认最终标题、正文和图片/视频。
  • 推荐使用分步发布:先 fill → 用户确认 → 再 click-publish。
  • 图文发布时,没有图片不得发布。
  • 视频发布时,没有视频不得发布。图片和视频不可混合(二选一)。
  • 标题长度不超过 20(UTF-16 字节数向上取整除以 2:汉字/全角符号计 1,英文/数字/半角符号每 2 个计 1)。例:"hello"= 3,"你好hello" = 4,勿用"每个字符计 1"估算。
  • 如果使用文件路径,必须使用绝对路径,禁止相对路径。
  • 需要先有运行中的 Chrome,且已登录。

流程 A: 图文/视频发布

Step A.1: 处理内容

完整内容模式

直接使用用户提供的标题和正文。

URL 提取模式
  1. 使用 WebFetch 提取网页内容。
  2. 提取关键信息:标题、正文、图片 URL。
  3. 适当总结内容,保持语言自然、适合小红书阅读习惯。
  4. 如果提取不到图片,告知用户手动获取。
图片提取规则(URL 模式下,必须遵守)

网页常用懒加载技术,img 标签的 src 可能是占位图,真实图片在 data-src:

  • 优先取 data-src:若 img 标签同时有 src 和 data-src,以 data-src 为准(这是真实图片)。
  • 跳过占位图:src 路径含 /shims/、/placeholder、/theme/、/themes/、16x9.png、1x1.png 等的图片为占位符,直接忽略。
  • 只取内容图:只选正文主体区域的截图/配图,跳过网站 logo、图标、视频封面缩略图。
  • 格式验证:图片 URL 应以 .jpg、.jpeg、.png、.webp、.gif 结尾,否则跳过。
  • 不要重试猜测:按上述规则提取图片后直接使用,如果图片确实为空,告知用户手动提供,不要反复尝试不同的图片 URL。

Step A.2: 内容检查

标题检查

标题长度必须 ≤ 20(UTF-16 字节数向上取整除以 2)。规则:汉字/全角符号计 1,英文/数字/半角符号每 2 个计 1(单个也算 1)。

Read the full file on GitHub · 298 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 298 lines · 59 tokens per session scan A 686ea0a0f5a8

Subscribe to this mod's changes

xhs-publish is a skill published in the GitHub repository autoclaw-cc/xiaohongshu-skills (2,028 stars, last pushed 5mo ago), licensed MIT. It adds 59 tokens to every session and 3,322 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

xhs-publish compared with skills from other repositories

xhs-publish next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
xhs-publishautoclaw-cc/xiaohongshu-skillsSkill2.0k5mo agoMITA59Claude Code, Codex
imagegenopenai/codexSkill133ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill99kyesterdayApache-2.0A19Claude Code
local-ai-agentsmicrosoft/ai-agents-for-beginnersSkill79k4d agoMITA200Claude Code, Codex
systematic-debuggingobra/superpowersSkill313k3d agoMITA21Claude Code
next-cache-components-adoptionvercel/next.jsSkill143ktodayMITA95Claude Code
chat-pet-sprite-creationmicrosoft/vscodeSkill195ktodayMITA53Claude Code, Codex