agentsclimarketplace

A skill to do anything in xiaohongshu

Skill JMY2003/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

Install
npx -y skills add JMY2003/a-skill-to-do-anything-in-xiaohongshu

Assembled 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 default by default.
  • default detects 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
  • 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|remove and --account NAME for 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-browser only 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-local or do-anything-in-rednotes profile 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 --browser value and the saved profile should remain logged in unless Xiaohongshu expires the session.
  • browser-status reports endpoint reachability plus managed, legacy-adopted, or unmanaged-or-recoverable session state. status reports loginState, 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-plan for multi-step Xiaohongshu actions.
  • Use a diagnose plan 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.mjs as the thin CLI and scripts/sdk/ as the canonical SDK layer. Load references/sdk-architecture.md before adding or repairing backend functionality.
  • Use scripts/xiaohongshu_package.py to create and inspect post packages.
  • Use scripts/xiaohongshu_image.py to generate deterministic cover/card images.
  • Load references/ui-workflows.md before operating Xiaohongshu.
  • Load references/operation-plans.md before building a multi-step browser plan, batch job, interaction task, or any operation not covered by a single command.
  • Load references/content-publishing.md before 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, or blocked evidence; do not describe an unconfirmed interaction as completed.
  • Treat browser permission pages such as edge://permission-request-dialog/ or chrome://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

  1. Run detect-browser if the browser backend is unclear.
  2. Run login once for the selected browser backend.
  3. Run status before important work if login state may have expired.
  4. For real work, create a JSON plan and execute it with run-plan so search, browsing, collecting, commenting, liking, notification interaction, chatting, and publishing happen in one session.
  5. 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.
  6. 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, or unconfirmed verification 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/

Keep looking

Skills are one crate of 326,835. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.