xhs-skill小红书(创作者中心)登录拿 cookies、发布笔记、导出数据的单一入口技能(浏览器交互委托 agent-browser-stealth)
Install via ClawdBot CLI:
clawdbot install leeguooooo/xhs-skill本技能是 xhs-* 的合并版,目标是让用户只需要 clawhub install xhs-skill 一次即可开始使用。
约束:
agent-browser-stealth。publish_from_payload);发布动作必须在会话中由 agent-browser-stealth 执行。agent-browser(旧通道禁用,统一使用 agent-browser-stealth)。data/ 目录,不要粘贴到聊天里。执行硬约束(稳定性):
agent-browser-stealth session 禁止并发操作(串行执行),否则容易触发 os error 35 假失败。snapshot 的 ref 会漂移:关键动作前后必须重抓 snapshot -i,并用 placeholder/role/text 做二次定位兜底。clawhub install xhs-skill
cd skills/xhs-skill
npm i
说明:npm i 仅用于本技能自带的本地 CLI(二维码解码、cookies 工具)。如果你不需要解码二维码/转换 cookies,也可以只用 agent-browser-stealth 完成扫码与导出。
建议在你运行命令的工作目录下准备:
data/xhs_login_qr.png:登录页二维码截图(PNG)data/raw_cookies.json:导出的原始 cookies(JSON)data/xhs_cookies.json:归一化后的 cookies(JSON)data/exports// :导出数据(CSV/XLSX/截图)data/assets// :发布笔记用的图标/配图素材与来源记录mkdir -p data
目标:登录小红书创作者中心并导出 cookies,避免频繁重复登录。
agent-browser-stealth 打开登录页:https://creator.xiaohongshu.com/loginagent-browser-stealth 截图保存二维码(PNG)到 data/xhs_login_qr.pngnode ./bin/xhs-skill.mjs qr show --in ./data/xhs_login_qr.png
OpenClaw 回传规范(强制):
data/xhs_login_qr.png)。node ./bin/xhs-skill.mjs qr show --in ./data/xhs_login_qr.png,然后把输出的二维码文本 + ASCII 二维码直接发给用户。推荐回传模板:
请用小红书 App 扫这个二维码登录。
二维码文本: <qr_text>
<ASCII QR>
data/raw_cookies.json(不走 DevTools):agent-browser-stealth cookies --json > ./data/raw_cookies.json
data/xhs_cookies.json:node ./bin/xhs-skill.mjs cookies normalize --in ./data/raw_cookies.json --out ./data/xhs_cookies.json
node ./bin/xhs-skill.mjs cookies status --in ./data/xhs_cookies.json
5.1 推荐用脚本做后验校验(可执行门禁):
# 例:先让 agent-browser-stealth 记录当前 URL 与后台探测后的 URL
CURRENT_URL="$(agent-browser-stealth get url)"
agent-browser-stealth open https://creator.xiaohongshu.com/creator/home
PROBE_FINAL_URL="$(agent-browser-stealth get url)"
node ./scripts/verify_login.mjs \
--cookies ./data/xhs_cookies.json \
--current-url "$CURRENT_URL" \
--probe-final-url "$PROBE_FINAL_URL" \
--json
登录成功判定(强制):
web_session 不再作为硬依赖):/loginweb_session,或 cookie 名含 session)。没有也可能可用,但稳定性更差。登录结果输出契约(JSON):
{
"task": "xhs_login",
"ok": true,
"checks": {
"left_login": true,
"backend_not_rejected": true,
"has_session_like_cookie": true
},
"artifacts": {
"qr_png": "data/xhs_login_qr.png",
"raw_cookies": "data/raw_cookies.json",
"normalized_cookies": "data/xhs_cookies.json"
}
}
失败时 ok=false,并给出失败项(例如仍在 /login、或 probe 回跳),禁止输出“已完成”。
Cookie: header:node ./bin/xhs-skill.mjs cookies to-header --in ./data/xhs_cookies.json
失败回退:
agent-browser-stealth 放大后重新截图(仍为 PNG)。data/raw_cookies.json,后续再扩展兼容分支。核心结论:小红书风控主要看“节奏 + 指纹 + 行为 + IP + 账号权重”。工具本身不是主因,使用方式才是主因。
强制策略:
1.2s~7s)。type --delay(逐字),避免全量瞬时 fill。--profile,并启用 --headed。24h <= 3 篇。30 分钟。3~7 天。profile + IP + 设备环境。输入(用户提供):
YYYY-MM-DD)发布硬门禁(强制):
data/publish_payload.json(示例):{
"topic": "今日热点:xxxx",
"source": {
"name": "央视新闻",
"url": "https://example.com/news",
"date": "2026-02-12",
"evidence_snippet": "2月12日该媒体报道提到:......",
"key_facts": ["关键事实1(含日期/数字)", "关键事实2(含日期/数字)"]
},
"post": {
"title": "20字内标题示例",
"body": "不少于 80 字的正文......",
"tags": ["#热点", "#今日新闻", "#小红书运营"],
"real_topics": ["#人工智能", "#AI资讯", "#科技观察"],
"media": ["/abs/path/cover.png", "/abs/path/card_1.png"]
}
}
# 普通模式
node ./scripts/verify_publish_payload.mjs --in ./data/publish_payload.json --policy ./config/verify_publish_policy.json --tag-registry ./data/tag_registry.json --min-registry-tags 12 --require-source-evidence on --strict-anti-ai on --json
# 今天热点模式(强制 source.date = 今天)
node ./scripts/verify_publish_payload.mjs --in ./data/publish_payload.json --policy ./config/verify_publish_policy.json --tag-registry ./data/tag_registry.json --min-registry-tags 12 --require-source-evidence on --strict-anti-ai on --mode hot --json
node ./scripts/review_publish_payload.mjs --in ./data/publish_payload.json --policy ./config/review_policy.json --taxonomy ./config/review_taxonomy.json --ai-provider auto --require-ai off --mode hot --json
ok=true 才允许进入发布页点击“发布/提交”。 校验策略在 ./config/verify_publish_policy.json,审核策略在 ./config/review_policy.json,分层风险路径在 ./config/review_taxonomy.json。
禁止链接(强制):
http/https、www.、xxx.com/.cn/...)。否则有封禁风险。反 AI 识别与真实标签(强制):
review_publish_payload 审核门禁,要求 decision=pass,并输出 risk_path、证据和 review_queue 供复核。source.evidence_snippet 与 source.key_facts 必填,且能回溯到来源事实。post.real_topics 都必须来自真实话题池 data/tag_registry.json,禁止自造标签。#标签 拼进正文冒充话题。agent-browser-stealth 执行最终点击发布。示例:准备真实标签池(建议每天更新):
cat > ./data/tag_registry.json <<'JSON'
{
"updated_at": "2026-02-24",
"source": {
"platform": "xiaohongshu",
"method": "manual_from_publish_topic_picker",
"url": "https://creator.xiaohongshu.com/creator/publish"
},
"tags": ["#AI热点", "#人工智能", "#行业观察", "#科技新闻", "#AI资讯", "#科技观察"]
}
JSON
发布执行方式(唯一):
agent-browser-stealth 串行执行:打开发布页 -> 上传素材 -> 填写标题/正文/标签 -> 手动选择真实话题 -> 人工确认预览 -> 点击发布。verify/review 非 ok=true),必须停止在“发布前”,禁止继续点击提交。发布可靠性 Checklist(照这个执行,避免“看似发了其实没发/字段没落库”):
\\n 规范化为真实换行(text.replaceAll("\\\\n", "\n")),填完立刻读回校验正文 innerText 不包含字面量 \\n。<= 20;正文是否非空且长度达标;标签是否至少 3 个且都以 # 开头、并来自 tag_registry。post.real_topics 一并校验(>=3,且都命中 tag_registry),避免“假话题”。snapshot -i 确认可编辑区域,再写入并读回校验。1280x720 会让预览很差;发布前用门禁校验图片为竖版 3:4(推荐 1242x1660)。agent-browser-stealth session 严格串行,必要时 sleep/wait,避免 os error 35 假失败。发布成功闭环(强制):
title/body/imgCount/tags 都存在且符合门禁(否则判失败重试)。素材准备(可选,省去用户自己找图标/配图):
agent-browser-stealth 搜索并挑选 3-5 个候选(优先免版权/可复用来源)。2.1 配图“内容一致性”门禁(强烈建议):
agent-browser-stealth get title/读 h1 检查页面内容确实包含目标关键词(否则可能是误点/错页)。title/h1 的低成本校验。agent-browser-stealth 直接截图保存到:data/assets//icons/.png data/assets//sources.txt 流程(浏览器侧全部由 agent-browser-stealth 完成):
data/publish_payload.json(必须 ok=true)。8~20 字(超过 20 字先裁剪或提示用户改短)>= 80 字# 开头post.real_topics 至少 3 个,且与标签都必须命中 data/tag_registry.json(真实话题池)screenshot/login_qr 等截图文件)snapshot -i 再定位可编辑区6.1 发布前手动选择至少 3 个真实话题,再由 agent-browser-stealth 点击提交。
发布结果输出契约(JSON):
{
"task": "xhs_publish",
"ok": true,
"result_url": "https://creator.xiaohongshu.com/....",
"content_checks": {
"title_len": 18,
"body_len": 136,
"tag_count": 3,
"topic": "今日热点:xxxx",
"source_date": "2026-02-12"
},
"artifacts": {
"payload_json": "data/publish_payload.json",
"media_inputs": ["..."],
"error_screenshot": null
}
}
发布失败时 ok=false,并返回 error_message、error_screenshot 路径和未通过的 missing_checks。
目标:把创作者中心关键数据导出到 data/exports/,用于后续分析。
agent-browser-stealth 进入创作者中心的常用分析页(仪表盘/内容分析/粉丝分析)。data/exports// 命令:
node ./bin/xhs-skill.mjs qr show --in node ./bin/xhs-skill.mjs cookies normalize --in --out node ./bin/xhs-skill.mjs cookies status --in node ./bin/xhs-skill.mjs cookies to-header --in node ./scripts/verify_publish_payload.mjs --in --policy ./config/verify_publish_policy.json --tag-registry ./data/tag_registry.json --min-registry-tags 12 --require-source-evidence on --strict-anti-ai on [--mode hot] node ./scripts/review_publish_payload.mjs --in --policy ./config/review_policy.json --taxonomy ./config/review_taxonomy.json --ai-provider auto --require-ai off [--mode hot] npm run check:constraintsnpm testgit status --shortdocs(skill): 补充发版前快速自检清单clawhub sync --all --bump patch --changelog "docs: 补充发版前快速自检清单"Generated Mar 1, 2026
Agencies managing multiple Xiaohongshu creator accounts can use this skill to automate login and posting workflows, ensuring consistent content delivery while adhering to platform rules. It helps scale operations by handling repetitive tasks like cookie management and post validation, allowing teams to focus on strategy and creative direction.
Brands selling products on Xiaohongshu can automate promotional note publishing, such as showcasing new items or running campaigns tied to daily trends. The skill enforces content checks to avoid bans and includes anti-AI measures to maintain authentic engagement, supporting sales growth through regular, compliant posts.
Media organizations can leverage this skill to quickly publish news highlights on Xiaohongshu, using the hot-topic mode to align with trending events. It ensures source verification and evidence-based content, helping reach younger audiences while minimizing manual effort in content preparation and posting.
Individual influencers or content creators can use this skill to streamline their posting process, from secure login with cookie persistence to automated media uploads. It includes safety features like rate limiting and fingerprint management to protect accounts from being flagged, enabling more efficient content scheduling.
Firms analyzing Xiaohongshu trends can automate data exports from creator dashboards, such as performance metrics or user engagement stats. The skill ensures data is saved locally and handles login reliably, supporting regular data collection for insights without manual intervention.
Offer this skill as part of a subscription-based tool for social media managers, providing automated posting, compliance checks, and analytics. Revenue comes from monthly fees based on usage tiers, such as number of accounts or posts, with premium features like advanced AI review.
Build a service agency that uses this skill to manage Xiaohongshu accounts for clients, handling everything from login to content publishing. Revenue is generated through retainer contracts or per-campaign pricing, leveraging automation to serve multiple clients efficiently while ensuring platform compliance.
Distribute the skill as a free open-source tool with basic features, then monetize through paid add-ons like enhanced verification scripts, priority support, or custom policy configurations. This model attracts users from small businesses or individual creators who later upgrade for advanced capabilities.
💬 Integration Tip
Integrate this skill with existing content management systems by automating payload generation from scheduled posts, ensuring all validations pass before publishing to avoid platform penalties.
Automate Xiaohongshu (RedNote) content operations using a Python client for the xiaohongshu-mcp server. Use for: (1) Publishing image, text, and video content, (2) Searching for notes and trends, (3) Analyzing post details and comments, (4) Managing user profiles and content feeds. Triggers: xiaohongshu automation, rednote content, publish to xiaohongshu, xiaohongshu search, social media management.
Feishu-integrated wrapper for the capability-evolver. Manages the evolution loop lifecycle (start/stop/ensure), sends rich Feishu card reports, and provides...
The Baidu Baike Component is a knowledge service tool designed to query authoritative encyclopedia explanations for various nouns. Its core function is given a specific "noun" (object, person, location, concept, event, etc.) provided by the user, it returns a standardized, detailed entry explanation sourced from Baidu Baike.
Draft and publish posts to 小红书 (Xiaohongshu/RED). Use when creating content for 小红书, drafting posts, generating cover images, or publishing via browser automation. Covers the full workflow from content creation to browser-based publishing, including cover image generation with Pillow.
AI-assisted creation, rendering, and automated publishing of Xiaohongshu-style content with support for Markdown to image cards and data tracking.
小红书全能助手 — 文案生成、封面制作、内容发布与管理。当用户要求写小红书笔记、生成小红书文案/标题/封面、发小红书、搜索小红书、评论点赞收藏等任何小红书相关操作时使用。支持一站式从文案创作到自动发布的完整流程。封面AI生图需配置可选环境变量(GEMINI_API_KEY 或 IMG_API_KEY 或 HUNY...