xiaohongshu-skills
CLAUDE.md3 starsChanged 8 months agoMITView on GitHub
小红书自动化 Claude Code Skills,基于 Python CDP 浏览器自动化引擎。 双层结构:scripts/ 是 Python CDP 自动化引擎,skills/ 是 Claude Code Skills 定义(SKILL.md 格式)。
In this repository6 other files it gives its agents.
- xiaohongshu-skillsSkill
- xhs-authSkill
- xhs-content-opsSkill
- xhs-exploreSkill
- xhs-interactSkill
- xhs-publishSkill
The file
Files
xiaohongshu-skills
小红书自动化 Claude Code Skills,基于 Python CDP 浏览器自动化引擎。
Git 工作流
- 所有代码修改必须在分支上进行,禁止直接推送 main 分支
- 分支开发完成后通过 PR 合入 main
开发命令
uv sync # 安装依赖
uv run ruff check . # Lint 检查
uv run ruff format . # 代码格式化
uv run pytest # 运行测试架构
双层结构:scripts/ 是 Python CDP 自动化引擎,skills/ 是 Claude Code Skills 定义(SKILL.md 格式)。
scripts/xhs/— 核心自动化库(模块化,每个功能一个文件)scripts/cli.py— 统一 CLI 入口,23 个子命令,JSON 结构化输出scripts/publish_pipeline.py— 发布编排器(含图片下载和登录检查)skills/*/SKILL.md— 指导 Claude 如何调用 scripts/
调用方式
python scripts/cli.py check-login
python scripts/cli.py search-feeds --keyword "关键词"
python scripts/cli.py publish --title-file t.txt --content-file c.txt --images pic.jpg
python scripts/publish_pipeline.py --title-file t.txt --content-file c.txt --images URL1代码规范
- 行长度上限 100 字符
- 完整 type hints,使用
from __future__ import annotations - 异常继承
XHSError(xhs/errors.py) - CLI exit code:0=成功,1=未登录,2=错误
- 用户可见错误信息使用中文
- JSON 输出
ensure_ascii=False
安全约束
- 发布类操作必须有用户确认机制
- 文件路径必须使用绝对路径
- 敏感内容通过文件传递,不内联到命令行参数
- Chrome Profile 目录隔离账号 cookies
CLI 子命令对照表
| CLI 子命令 | 对应 MCP 工具 | 分类 |
check-login | check_login_status | 认证 |
login | get_login_qrcode | 认证 |
phone-login | — | 认证 |
delete-cookies | delete_cookies | 认证 |
list-feeds | list_feeds | 浏览 |
search-feeds | search_feeds | 浏览 |
get-feed-detail | get_feed_detail | 浏览 |
user-profile | user_profile | 浏览 |
post-comment | post_comment_to_feed | 互动 |
reply-comment | reply_comment_in_feed | 互动 |
like-feed | like_feed | 互动 |
favorite-feed | favorite_feed | 互动 |
publish | publish_content | 发布 |
publish-video | publish_with_video | 发布 |
fill-publish | — | 分步发布(图文填写) |
fill-publish-video | — | 分步发布(视频填写) |
click-publish | — | 分步发布(点击发布) |
long-article | — | 长文发布(填写+排版) |
select-template | — | 长文发布(选择模板) |
next-step | — | 长文发布(下一步+描述) |
add-account | — | 账号管理(添加,自动分配端口) |
list-accounts | — | 账号管理(列出所有) |
remove-account | — | 账号管理(删除) |
set-default-account | — | 账号管理(设置默认) |
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.

