agentleFS
CatsMansionCatsMansion/xiaohongshu-post/llms.txt

xiaohongshu-post

llms.txt1 starsChanged 21 days agoMITView on GitHub

An agent skill for publishing image-and-text notes to Xiaohongshu (小红书 / RED) from a logged-in Chrome profile via Playwright over CDP. For AI agents: load this when the user asks to post/publish a note to 小红书 / RED, or wants a public share link for a note they published.

The file

We split this llms.txt into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do NOT use for: video notes, live, comment automation, multi-account matrix publishing.

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 3,592 llms.txt files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
llms.txt
# xiaohongshu-post

An agent skill for publishing image-and-text notes to Xiaohongshu (小红书 / RED) from a
logged-in Chrome profile via Playwright over CDP.

For AI agents: load this when the user asks to post/publish a note to 小红书 / RED, or wants a
public share link for a note they published.

## What it gives you
- A browser bootstrap that keeps the **login** across agent turn boundaries. The browser
  *process* is reaped no matter how you start it (measured twice) — what persists is the
  **profile directory** (`$PROFILE_DIR/Default/Cookies`, holds `id_token`). Re-launch Chrome
  against the same profile dir each turn and it comes back logged in. Never use a fresh
  profile per turn.
- `scripts/publish_note.js`: image upload, title/body filling, insertion of REAL topic tags via
  the Tiptap suggestion dropdown, draft screenshots. Does not publish unless `--publish` is passed.
- `scripts/verify_note.js`: extracts note id / `xsec_token` / short link and proves public
  visibility from a fresh logged-out context (curl cannot — the page is client-rendered).
- `references/selectors.md`: every selector, API field, and pitfall with its root cause.
- `references/copy-guide.md`: title/body/image specs (title ≤20 chars, body ≤1000, cover 3:4).

## When to activate (triggers)
- "发小红书" / "上传小红书" / "帮我发个笔记" / post to Xiaohongshu / RED.
- Automating a publish where the account is already logged in.
- Recovering a working public link for a published note.
Do NOT use for: video notes, live, comment automation, multi-account matrix publishing.

## Files (read these)
- SKILL.md — the workflow, the three mandatory pre-checks, and the pitfall quick-reference.
- references/selectors.md — selectors, API endpoints, field meanings, verified platform limits.
- references/copy-guide.md — copy template + image spec + cover layout.
- scripts/bootstrap_browser.sh — start Chrome with CDP + attach playwright-cli.
- scripts/publish_note.js — fill the draft (add `--publish` to click 发布).
- scripts/verify_note.js — extract links + verify public visibility.

## Run it
    bash scripts/bootstrap_browser.sh .tmp/xhs-cdp 9222
    node scripts/publish_note.js --title "..." --body-file body.txt --images a.png,b.png --topics "X,Y"
    node scripts/verify_note.js --expect "标题前几个字"
Exit 0 = ok, 1 = error, 2 = bad input, 3 = published but NOT publicly visible.

## Install
    npx skills add CatsMansion/xiaohongshu-post
Repo: https://github.com/CatsMansion/xiaohongshu-post

## License
MIT.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.