gitnexus-cli
Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki,…
小红书内容发布技能。支持两种发布模式:(1) 上传图文模式 - 图片+短文;(2) 写长文模式 - 长篇文章+排版模板。 支持两种输入方式:用户提供完整内容和图片/图片URL,直接发布;或提供网页URL,自动提取内容和图片。 用户说"发长文"时使用长文模式,否则默认图文模式。
Claude Code
$ npx -y skills add xpzouying/xiaohongshu-mcp --skill post-to-xhs --agent claude-code
Codex
$ npx skills add xpzouying/xiaohongshu-mcp --skill post-to-xhs -a codex -y
Cursor
$ npx skills add xpzouying/xiaohongshu-mcp --skill post-to-xhs -a cursor -y
Gemini CLI
$ npx skills add xpzouying/xiaohongshu-mcp --skill post-to-xhs -a gemini-cli -y
GitHub Copilot
$ npx skills add xpzouying/xiaohongshu-mcp --skill post-to-xhs -a github-copilot -y
OpenCode
$ npx skills add xpzouying/xiaohongshu-mcp --skill post-to-xhs -a opencode -y
Windsurf
$ npx skills add xpzouying/xiaohongshu-mcp --skill post-to-xhs -a windsurf -y
name: post-to-xhs description: > 小红书内容发布技能。支持两种发布模式:(1) 上传图文模式 - 图片+短文;(2) 写长文模式 - 长篇文章+排版模板。 支持两种输入方式:用户提供完整内容和图片/图片URL,直接发布;或提供网页URL,自动提取内容和图片。 用户说"发长文"时使用长文模式,否则默认图文模式。
根据用户输入自动判断发布方式和发布模式,简化发布流程。
用户输入
│
├─ 完整内容 + 图片/图片URL → 判断模式 → 发布流程
│
└─ 网页 URL → WebFetch 提取内容和图片
│
├─ 有图片 → 适当总结内容 → 判断模式 → 发布流程
│
└─ 无图片 → 提示用户手动下载图片
│
└─ 用户提供图片后 → 发布流程根据用户输入判断:
如果不确定,询问用户。
直接使用用户提供的标题和正文,跳到 Step 3。
1. 使用 WebFetch 提取网页内容 2. 提取关键信息:标题、正文、图片URL 3. 适当总结内容,保持:
如果从网页中提取不到图片URL,或图片URL无法访问,**必须**:
1. 告知用户图片提取失败 2. 提供原网页链接,请用户手动访问 3. 指导用户:
4. 等待用户提供图片后再继续发布流程
**示例提示语**:
从网页中未能提取到可用的图片。请手动获取: 1. 打开原文链接:[URL] 2. 找到合适的配图,右键另存为本地,或复制图片地址 3. 将图片路径或URL发给我 拿到图片后我们继续发布。
标题长度必须 ≤ 38,计算规则:
如果超长,自动生成符合长度要求的新标题,保持语义一致。
完整发布流程参考: [references/publish-workflow.md](references/publish-workflow.md)
通过 `AskUserQuestion` 向用户展示即将发布的内容(标题、正文、图片),获得明确确认后再继续。
通过 `AskUserQuestion` 让用户选择发布模式:
AskUserQuestion 示例: 问题:选择发布模式 选项: - 无头模式(推荐):后台快速发布,无需预览 - 有窗口模式:显示浏览器,可预览确认
将标题和正文写入临时 UTF-8 文本文件。不要在 `python -c` 中内联中文文本。
根据用户选择的模式执行发布脚本:
**无头模式**(添加 `--headless` 参数):
python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\publish_pipeline.py" --headless --title-file title.txt --content-file content.txt --image-urls "URL1" "URL2"
**有窗口模式**(不添加 `--headless`):
python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\publish_pipeline.py" --title-file title.txt --content-file content.txt --image-urls "URL1" "URL2"
**其他参数**:
# 发布到指定账号 python ... --account myaccount ... # 使用本地图片 python ... --images "C:\path\to\image.jpg"
处理输出:
**Step B.1 — 填写长文内容 + 一键排版:**
python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" long-article --title-file title.txt --content-file content.txt
可选 `--images img1.jpg img2.jpg` 插入图片到编辑器中。
输出中包含 `TEMPLATES: [...]` JSON 数组,为可用的排版模板名称列表。
**Step B.2 — 让用户选择模板:**
使用 `AskUserQuestion` 将模板名称作为选项展示给用户选择(从 TEMPLATES 输出中解析)。
**Step B.3 — 选择模板:**
python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" select-template --name "用户选择的模板名"
**Step B.4 — 点击下一步并填写发布页正文描述:**
python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" click-next-step --content-file content.txt
注意:发布页有独立的正文描述编辑器,必须通过 `--content` 或 `--content-file` 传入内容填写。 如果正文超过 1000 字,应压缩到 800 字左右再填入,保持语义不变。
**Step B.5 — 用户预览确认并发布:** 进入下方 4.5 步骤。
**仅当用户选择有窗口模式或使用长文模式时**,使用 `AskUserQuestion` 请用户在浏览器中检查预览,确认后再发布。
无头模式的图文发布跳过此步骤,直接进入 4.6。
点击发布按钮:
python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" click-publish
根据命令输出告知用户发布是否成功。
系统支持多个小红书账号,每个账号有独立的 Chrome profile。
python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" list-accounts
python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" add-account myaccount --alias "我的账号"
# 默认账号 python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" login # 指定账号 python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" --account myaccount login
python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" switch-account python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" --account otheraccount switch-account
python "C:\Users\admin\AI\.claude\skills\post-to-xhs\scripts\cdp_publish.py" set-default-account myaccount
Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki,…
Query and invoke tools on MCP servers using fastmcp list and fastmcp call. Use when you need to discover what tools a server…
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain,…