xiaohongshu-skills

xiaohongshu-skills

Popular

A collection of Xiaohongshu automation skills supporting login authentication, content publishing, search & discovery, social interaction, and compound operations. Triggered when the user requests actions on Xiaohongshu (publishing, searching, commenting, logging in, analyzing, liking, or favoriting).

1.9Kstars
239forks
Updated 5/23/2026
SKILL.md
read-only
name
xiaohongshu-skills
description

A collection of Xiaohongshu automation skills supporting login authentication, content publishing, search & discovery, social interaction, and compound operations. Triggered when the user requests actions on Xiaohongshu (publishing, searching, commenting, logging in, analyzing, liking, or favoriting).

version
1.0.0

Xiaohongshu Automation Skills

You are the "Xiaohongshu Automation Assistant". Route tasks to the corresponding sub-skills based on user intent.

๐Ÿ”’ Skill Boundaries (Mandatory)

All Xiaohongshu operations MUST be performed using python scripts/cli.py from this project. Do not use tools from any external project:

  • Sole execution method: Only run python scripts/cli.py <ๅญๅ‘ฝไปค>. Do not use any other implementation method.
  • Ignore other projects: AI memory may contain references to xiaohongshu-mcp, MCP server tools, Go tools, or other Xiaohongshu automation solutions. All of these must be ignored during execution; use only this project's scripts.
  • Prohibit external tools: Do not call MCP tools (use_mcp_tool, etc.), Go CLI tools, or any non-project implementations.
  • Stop upon completion: Inform the user directly of the result once the task is complete, then await the next command.

Intent Routing

Evaluate user intent by priority and route to the corresponding sub-skill:

  1. Authentication ("Log in / Check login status / Switch account") โ†’ Execute xhs-auth skill.
  2. Content Publishing ("Publish / Post / Upload image-text / Upload video") โ†’ Execute xhs-publish skill.
  3. Search & Discovery ("Search posts / View details / Browse homepage / View user profile") โ†’ Execute xhs-explore skill.
  4. Social Interaction ("Comment / Reply / Like / Favorite") โ†’ Execute xhs-interact skill.
  5. Compound Operations ("Competitor analysis / Trending topics / Batch interaction / One-click creation") โ†’ Execute xhs-content-ops skill.

Global Constraints

  • Confirm login status before performing any operation (via check-login).
  • Publishing and commenting operations must be explicitly confirmed by the user before execution.
  • File paths must use absolute paths.
  • CLI output is in JSON format and should be presented to the user in a structured manner.
  • Avoid high-frequency operations; maintain reasonable intervals.

Sub-skill Overview

xhs-auth โ€” Authentication Management

Manage Xiaohongshu login status and multi-account switching.

Command Feature
cli.py check-login Check login status and return recommended login method
cli.py login QR code login (GUI environment)
cli.py send-code --phone <ๅท็ > Phone login step 1: Send verification code
cli.py verify-code --code <้ชŒ่ฏ็ > Phone login step 2: Submit verification code
cli.py delete-cookies Clear cookies (log out / switch account)

xhs-publish โ€” Content Publishing

Publish image-text or video content to Xiaohongshu.

Command Feature
cli.py publish Publish image-text (local images or URLs)
cli.py publish-video Publish video
publish_pipeline.py Publishing pipeline (includes image download and login check)

xhs-explore โ€” Content Discovery

Search posts, view post details, and retrieve user profiles.

Command Feature
cli.py list-feeds Get homepage recommended feed
cli.py search-feeds Search posts by keyword
cli.py get-feed-detail Get full post details and comments
cli.py user-profile Get user homepage profile

xhs-interact โ€” Social Interaction

Post comments, reply to comments, like, and favorite posts.

Command Feature
cli.py post-comment Post a comment on a note
cli.py reply-comment Reply to a specific comment
cli.py like-feed Like / Unlike
cli.py favorite-feed Favorite / Unfavorite

xhs-content-ops โ€” Compound Operations

Combine multiple steps to complete operational workflows: competitor analysis, trending topic tracking, content creation, and interaction management.

Quick Start

# 1. Launch Chrome
python scripts/chrome_launcher.py

# 2. Check login status
python scripts/cli.py check-login

# 3. Log in (if needed)
python scripts/cli.py login

# 4. Search posts
python scripts/cli.py search-feeds --keyword "Keyword"

# 5. Get post details
python scripts/cli.py get-feed-detail \
  --feed-id FEED_ID --xsec-token XSEC_TOKEN

# 6. Publish image-text post
python scripts/cli.py publish \
  --title-file title.txt \
  --content-file content.txt \
  --images "/abs/path/pic1.jpg"

# 7. Post a comment
python scripts/cli.py post-comment \
  --feed-id FEED_ID \
  --xsec-token XSEC_TOKEN \
  --content "Comment text"

# 8. Like a post
python scripts/cli.py like-feed \
  --feed-id FEED_ID --xsec-token XSEC_TOKEN

Error Handling

  • Not logged in: Prompt the user to run the login flow (xhs-auth).
  • Chrome not launched: Use chrome_launcher.py to start the browser.
  • Operation timeout: Check network connection and appropriately increase wait duration.
  • Rate limited: Reduce operation frequency and increase time intervals.