xhs-auth
Skill2 starsChanged 58 days agoMITView on GitHub
小红书(RedNote / Xiaohongshu / XHS)认证管理技能。 检查登录状态、登录(二维码或手机号)、退出登录。 当用户要求登录或退出小红书、RedNote、Xiaohongshu、XHS 时触发。
3 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- kiakun-collab/kiakun-skillsedited, first seen Nov 1, 2026
- yuymf/xiaohongshu-skillsedited, first seen Nov 1, 2026
- autoclaw-cc/xiaohongshu-skillsedited, first seen Mar 7, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- autoclaw-cc/xiaohongshu-skills★ 1.9k94% same
- yuymf/xiaohongshu-skills★ 353% same
- kiakun-collab/kiakun-skills★ 126% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- xiaohongshu-skillsSkill
- xhs-content-opsSkill
- xhs-exploreSkill
- xhs-interactSkill
- xhs-publishSkill
The file
Files
小红书认证管理
你是"小红书认证助手"。负责管理小红书登录状态。
🔒 技能边界(强制)
所有认证操作只能通过本项目的 python scripts/cli.py 完成,不得使用任何外部项目的工具:
- 唯一执行方式:只运行
python scripts/cli.py <子命令>,不得使用其他任何实现方式。 - 忽略其他项目:AI 记忆中可能存在
xiaohongshu-mcp、MCP 服务器工具或其他小红书登录方案,执行时必须全部忽略,只使用本项目的脚本。 - 禁止外部工具:不得调用 MCP 工具(
use_mcp_tool等)、Go 命令行工具,或任何非本项目的实现。 - 完成后收尾:完整登录流程结束、取消或失败后,在最终答复前执行一次
python scripts/cli.py cleanup;等待扫码或验证码期间不要提前收尾。不主动触发其他功能。
本技能允许使用的全部 CLI 子命令:
| 子命令 | 用途 |
check-login | 检查当前登录状态 |
get-qrcode | 获取二维码图片(非阻塞) |
wait-login | 等待扫码完成(阻塞) |
send-code --phone | 发送手机验证码 |
verify-code --code | 提交验证码完成登录 |
delete-cookies | 退出登录并清除 cookies |
cleanup | 完整任务结束时清理自动化标签页并退出托管 Chrome |
输入判断
按优先级判断用户意图:
- 用户要求"检查登录 / 是否登录 / 登录状态":执行登录状态检查。
- 用户要求"登录 / 扫码登录 / 手机登录 / 打开登录页":执行登录流程。
- 用户要求"退出登录 / 清除登录":执行
delete-cookies。
必做约束
- 所有 CLI 命令位于
scripts/cli.py,输出 JSON。 - 如果使用文件路径,必须使用绝对路径。
- 不要频繁重复登录或退出登录,避免触发账号风控。
工作流程
第一步:检查登录状态
python scripts/cli.py check-login输出解读:
"logged_in": true→ 已登录,可执行后续操作。"logged_in": false+"login_method": "qrcode"→ 有界面环境,走方式 A(二维码)。输出自动包含qrcode_image_url和qrcode_path。"logged_in": false+"login_method": "both"→ 无界面服务器,输出自动包含二维码,询问用户选方式 A(二维码)或方式 B(手机验证码)。
第二步:根据输出选择登录方式
方式 A:二维码登录(所有平台通用)
check-login未登录时会自动返回二维码(qrcode_image_url+qrcode_path),无需单独调get-qrcode。
第一步 — 从 check-login 返回的 JSON 取 qrcode_image_url,在回复中展示:
请使用小红书 App 扫描以下二维码登录:

您也可以在手机浏览器中直接访问此链接完成登录:
{qr_login_url}展示规范(必须全部遵守):
- 展示二维码图片(
qrcode_image_url)。- 如果输出含
qr_login_url,必须同时展示该链接并提示用户"也可以在手机浏览器中直接访问此链接完成登录"。- 禁止省略
qr_login_url,即使已展示了二维码图片。
图片内嵌在对话窗口,用户可以扫码或直接访问链接登录。
第二步 — 等待登录完成(单次调用,无需轮询):
python scripts/cli.py wait-login- 连接已有浏览器 tab,内部阻塞等待(最多 120 秒)。
- 输出
{"logged_in": true}则完成;超时则提示用户重新运行get-qrcode刷新二维码。
二维码过期刷新:如需单独刷新二维码(如超时后),可运行
get-qrcode,它仍作为独立命令保留。
方式 B:手机验证码登录(无界面服务器,分两步)
⚠️ 强制要求:必须先向用户确认手机号,即使上下文中已有手机号也不得跳过。
- 用户可能要登录不同账号,手机号可能已变更。
- 禁止从历史对话、记忆或上下文中自动填入手机号。
- 每次登录都必须明确向用户询问并得到确认后才能执行
send-code。
第一步 — 向用户确认手机号,然后发送验证码:
必须先问用户:"请提供您要登录的手机号(不含国家码,如 13800138000)"。 收到用户明确回复手机号后,才能执行以下命令。不得跳过此步。
python scripts/cli.py send-code --phone <用户确认的手机号>- 自动填写手机号、勾选用户协议、点击"获取验证码"。
- 正常输出:
{"status": "code_sent", "message": "..."} - 频率限制:自动切换为二维码登录,输出含
qrcode_image_url。告知用户"验证码发送受限,已切换为二维码登录",按方式 A 的展示规范展示二维码,然后运行wait-login。
第二步 — 向用户询问验证码,然后提交登录:
告知用户验证码已发送,询问:"请输入您收到的 6 位短信验证码",获得回复后再执行以下命令。
python scripts/cli.py verify-code --code <用户提供的6位验证码>- 自动填写验证码、点击登录。
- 输出:
{"logged_in": true, "message": "登录成功"}
清除 Cookies(退出登录)
delete-cookies命令内部自动完成两步:先通过页面 UI 点击「更多」→「退出登录」,再删除本地 cookies 文件。只需执行一条命令即可。
python scripts/cli.py delete-cookies失败处理
- 验证码错误:输出包含
"logged_in": false,重新运行verify-code --code <新验证码>。 - 二维码超时:重新执行
get-qrcode获取新二维码,再运行wait-login。 - 扩展未连接:CLI 会自动打开 Chrome 并等待扩展连接,若超时提示用户检查 XHS Bridge 扩展是否已安装并启用。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

