A skill to do anything in xiaohongshu
Browser-based Xiaohongshu automation for any web-supported operation: persistent-login browser control, reusable CDP sessions, search and browsing, note detail collection, comments, likes, favorites, notification interaction, friend chat, batch operation plans, content drafting, image/card generation, and publishing. Use when Codex should operate Xiaohongshu through the web version with the user's default browser where possible, first-run login, later saved-session reuse, and scripted workflows instead of screenshot/computer-use control.From its SKILL.md
npx -y skills add JMY2003/a-skill-to-do-anything-in-xiaohongshuAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
7.7 KB, ~1.7k tokens by cl100k_base, as published. Nobody here has run it
DoAnythingInXiaohongshu
Use the web automation backend first. The durable entry point is scripts/xiaohongshu_web.mjs, backed by SDK modules under scripts/sdk/ for account/profile management, diagnostics, interaction actions, plan execution, run artifacts, and feed exploration. It launches a headed persistent browser profile, asks for login on first run, and reuses that profile for later commands.
Default to run-plan for real tasks. It keeps one browser tab/context open for the whole workflow, records per-step results, and avoids the old pattern of opening and closing the browser for every click.
Browser Model
- Use
scripts/xiaohongshu_web.mjs --browser defaultby default. defaultdetects the macOS default browser and maps it to the closest Playwright backend:- Chrome ->
chrome - Chrome Canary ->
chrome-canary - Edge ->
edge - Edge Canary ->
edge-canary - Firefox ->
firefox - Safari ->
webkit - Brave, Arc, and other Chromium-like browsers -> matching executable when found, otherwise
chromium
- Chrome ->
- The script uses its own persistent profile under
state/web/profiles/. It does not mutate the user's real browser profile. - Use
accounts list|add|default|removeand--account NAMEfor isolated multi-account profiles. - Chromium-like browsers use a reusable CDP session by default. Commands attach to the running session and disconnect, leaving the browser open for the next command. Use
close-browseronly when the user wants the reusable browser stopped. - A reusable CDP browser is bound to one account/profile at a time; close it before switching accounts on the same browser backend.
- CDP ports are accepted only after endpoint and private-profile ownership checks. The default account can adopt a running legacy
rednote-localordo-anything-in-rednotesprofile for the current session, but unrelated CDP browsers are refused. - First run: execute
scripts/xiaohongshu_web.mjs login --browser default, let the user log in in the opened browser, then finish the command. - Later runs: use the same
--browservalue and the saved profile should remain logged in unless Xiaohongshu expires the session. browser-statusreports endpoint reachability plusmanaged,legacy-adopted, orunmanaged-or-recoverablesession state.statusreportsloginState, session-cookie evidence, and any detected web block. Xiaohongshu's normal site and creator center can expire independently, so check status before publish or other important direct actions.
Operating Rules
- Prefer
scripts/xiaohongshu_web.mjs run-planfor multi-step Xiaohongshu actions. - Use a
diagnoseplan step when a web control is missing or a previous action behaved unexpectedly. It reports URL, visible controls, custom elements, internal scroll containers, and login/permission/rate-limit blocks. - Use single commands only for diagnostics, quick login checks, or isolated operations.
- Treat
scripts/xiaohongshu_web.mjsas the thin CLI andscripts/sdk/as the canonical SDK layer. Loadreferences/sdk-architecture.mdbefore adding or repairing backend functionality. - Use
scripts/xiaohongshu_package.pyto create and inspect post packages. - Use
scripts/xiaohongshu_image.pyto generate deterministic cover/card images. - Load
references/ui-workflows.mdbefore operating Xiaohongshu. - Load
references/operation-plans.mdbefore building a multi-step browser plan, batch job, interaction task, or any operation not covered by a single command. - Load
references/content-publishing.mdbefore drafting content, generating images, uploading media, or publishing posts. - Do not add extra confirmation prompts when the user has already authorized direct execution.
- Treat Xiaohongshu web/app prompts, permissions, login, captcha, moderation, and rate limits as the authority. If the site blocks the operation, stop the current command and report the state.
- Treat a successful click, field fill, or Enter keypress as an attempt, not a completed social action. Report
confirmed,unconfirmed, orblockedevidence; do not describe anunconfirmedinteraction as completed. - Treat browser permission pages such as
edge://permission-request-dialog/orchrome://permission-request-dialog/as web blocks. Do not continue clicking Xiaohongshu controls until the prompt is resolved. - Keep progress records for batch work in a local file when the task has more than one target.
Script Quick Start
scripts/xiaohongshu_web.mjs detect-browser
scripts/xiaohongshu_web.mjs accounts list
scripts/xiaohongshu_web.mjs accounts add work --alias "Work account"
scripts/xiaohongshu_web.mjs login --browser default
scripts/xiaohongshu_web.mjs browser-status --browser default
scripts/xiaohongshu_web.mjs status --browser default
scripts/xiaohongshu_web.mjs search "上海周末爵士酒吧" --browser default --limit 20 --out /tmp/xiaohongshu-results.json
scripts/xiaohongshu_web.mjs open-url "https://www.xiaohongshu.com/explore" --browser default
scripts/xiaohongshu_web.mjs click-text "发布" --browser default
scripts/xiaohongshu_web.mjs fill "textarea" "hello" --browser default
scripts/xiaohongshu_web.mjs run-plan /tmp/xiaohongshu-plan.json --browser default --direct --out /tmp/xiaohongshu-plan-result.json --artifact-dir /tmp/xiaohongshu-artifacts
scripts/xiaohongshu_web.mjs message "西瓜地Dondi" "测试信息" --browser default --direct
scripts/xiaohongshu_image.py --title "Codex Skill 测试声明" --subtitle "自动化发布流程测试" --tag Codex测试 --out /tmp/xiaohongshu-post/cover.png
scripts/xiaohongshu_package.py create --topic "Codex Skill 测试声明" --out /tmp/xiaohongshu-post --title "Codex Skill 测试声明" --body "This is a Xiaohongshu automation test." --hashtag Codex测试 --image /tmp/xiaohongshu-post/cover.png
scripts/xiaohongshu_web.mjs publish /tmp/xiaohongshu-post/post.json --browser default --direct
scripts/xiaohongshu_web.mjs close-browser --browser default
Workflow
- Run
detect-browserif the browser backend is unclear. - Run
loginonce for the selected browser backend. - Run
statusbefore important work if login state may have expired. - For real work, create a JSON plan and execute it with
run-planso search, browsing, collecting, commenting, liking, notification interaction, chatting, and publishing happen in one session. - For batch operations, use one plan or one long-lived command. Prefer built-in run artifacts over ad hoc logs; every run-plan writes manifest, step records, failure snapshots, and a final result.
- Finish with completed, unconfirmed, skipped, failed, and blocked counts plus relevant file paths. Launch-level failures also write a final result artifact before the command exits.
Result Style
- For single actions: report action, target, browser backend, and final observed status.
- For publishing: report post package path, image paths, browser backend, and
published,blocked, orunconfirmedverification status. A direct publish exits nonzero unless Creator Center confirms publication. - For batch operations: summarize confirmed, unconfirmed, skipped, failed, and blocked counts first, then point to the local progress log.
- For SDK maintenance: report changed modules, compatibility impact, and validation commands.
What ships with it: 18 files
124.3 KB alongside SKILL.md, 11 of them executable
agents/
- openai.yaml383 B
references/
- content-publishing.md3.0 KB
- operation-plans.md5.8 KB
- sdk-architecture.md3.8 KB
- ui-workflows.md4.8 KB
scripts/
- sdk/account_manager.mjsruns3.5 KB
- sdk/diagnostics.mjsruns4.1 KB
- sdk/interaction_actions.mjsruns7.6 KB
- sdk/plan_runner.mjsruns4.6 KB
- sdk/runtime_guard.mjsruns5.7 KB
- sdk_selftest.mjsruns7.0 KB
- sdk/task_artifacts.mjsruns2.8 KB
- sdk/xiaohongshu_feed_explorer.mjsruns4.2 KB
- xiaohongshu_image.pyruns9.4 KB
- xiaohongshu_package.pyruns4.9 KB
- xiaohongshu_web.mjsruns42.8 KB
- .gitignore44 B
- README.md10.0 KB