技能圖譜SKILLSGROVE
技能圖譜/短影片與自媒體/burn374/xhs-note-auto-workflow/小红书图文笔记自动化

小红书图文笔记自动化

安裝

$npx skills add https://github.com/burn374/xhs-note-auto-workflow --skill '小红书图文笔记自动化'
$git clone --depth 1 https://github.com/burn374/xhs-note-auto-workflow.git /tmp/xhs-note-auto-workflow && mkdir -p ~/.claude/skills && cp -r /tmp/xhs-note-auto-workflow/. ~/.claude/skills/小红书图文笔记自动化
請幫我安裝這個 Agent Skill:https://github.com/burn374/xhs-note-auto-workflow/tree/9a052fb4cd64b9fc934c88f25a15aff1080419d9/ ,先閱讀它的 SKILL.md 和指令碼,確認安全後再安裝到我的技能目錄。

簡介

原文描述 · MIT解析一条公开的小红书图文笔记,采集全部图片,使用 local 浏览器 ChatGPT 或 api 文案接口改写内容,再按原顺序逐张生成新图,最后保存到小红书创作者中心为电脑端草稿(不自动发布、不挂商品)。支持 macOS 与 Windows。
以下 SKILL.md 內容轉載自 burn374/xhs-note-auto-workflow(提交 9a052fb),依據 MIT 許可證轉載正文(文字未改動;僅省略檔案頭後設資料、將圖片顯示為連結,超長內容會截斷);版權歸 2026 xhs-note-auto-workflow contributors 所有。許可證:LICENSE。僅展示說明檔案,附帶指令碼請在原倉庫檢視。

XHS Note Auto Workflow

Use this repository as a self-contained workflow. Do not read or modify any private production Skill, legacy project, personal folder, browser ID, account name, Cookie, token, API key, or machine-specific absolute path unless the user explicitly supplies a runtime value for the current task.

Required runtime inputs

  • Public Xiaohongshu note URL.
  • BitBrowser environment ID supplied for the current run.
  • Image mode: local or api.

Account requirements

The selected BitBrowser environment must already have Xiaohongshu Creator Center logged in. Local mode additionally requires ChatGPT to be logged in and capable of image generation.

  • Xiaohongshu Creator Center logged in and able to open the image-note publishing page.

For api, configure the image API. The text API defaults to the same key/base, or can be configured separately with XHS_TEXT_API_*. API mode does not use the ChatGPT website. Do not print keys.

Cross-platform execution

Detect the host OS first.

macOS

For a person launching the workflow from Finder or an ordinary Terminal, use:

  • scripts/run_local.command
  • scripts/run_api.command

For Codex, WorkBuddy, or any other Agent, run python3 -u main.py ... directly in the Agent shell. Default execution stays in the background and writes a log under logs/; do not create or open a temporary .command launcher.

Windows

Preferred interactive launchers:

  • scripts\\run_local.bat
  • scripts\\run_api.bat

Run through cmd.exe when executing from an agent or terminal.

Proxy / agent-environment note

Some agent hosts (for example WorkBuddy) inject HTTP_PROXY / HTTPS_PROXY pointing at their own local service proxy when running shell commands, and may not set NO_PROXY for loopback addresses. This can hijack Selenium's connection to the local BitBrowser chromedriver and fail with unhandled request.

The interactive launchers in scripts/ clear these proxy variables. Agent hosts must run main.py directly; the Python browser layer also isolates local BitBrowser/ChromeDriver traffic from inherited proxy settings. Clearing proxy variables in the Agent command is still recommended, for example on macOS:

unset HTTP_PROXY HTTPS_PROXY http_proxy https_proxy ALL_PROXY all_proxy
export NO_PROXY="127.0.0.1,localhost,::1"
export no_proxy="127.0.0.1,localhost,::1"
python3 -u main.py --note-url "<PUBLIC_XHS_NOTE_URL>" --browser-id "<BITBROWSER_ID>" --image-mode local

On Windows (cmd.exe):

set "HTTP_PROXY=" & set "HTTPS_PROXY=" & set "http_proxy=" & set "https_proxy=" & set "ALL_PROXY=" & set "all_proxy=" & set "NO_PROXY=127.0.0.1,localhost"

Image-count contract

For a normal real workflow, parse every image from the single supplied note URL and redesign them in original order, one source image to one generated image.

  • Do not pass --image-count for a normal run; default 0 means all images.
  • --image-count N is only a test/debug cap for the first N images.
  • Never silently skip a failed source image or failed generation and then save an incomplete draft.

Prompt contract

Default prompts are part of this repository:

  • prompts/rewrite_note.txt
  • prompts/redesign_image.txt

Use them when the user has not configured anything. Custom prompt files may be selected with XHS_REWRITE_PROMPT_FILE and XHS_IMAGE_PROMPT_FILE in .env.

Before editing prompts, read docs/SETUP_GUIDE.md or docs/AI_SETUP.md for the supported placeholders. Prefer changing prompt files instead of changing Python workflow logic.

Validation order

  1. Run python main.py --privacy-check before public release.
  2. Run python main.py --browser-id <ID> --image-mode <local|api> --preflight before a real workflow.
  3. Run the real note workflow only after preflight succeeds.
  4. After image generation, every generated image must pass the repository's dark-watermark cleanup step before draft upload.
  5. Success means all parsed images were regenerated, cleaned, and the note is saved as a draft; never publish automatically.

Privacy rules

Never commit or expose:

  • personal absolute paths or usernames;
  • browser IDs;
  • Cookies, tokens, API keys;
  • account names;
  • local logs, screenshots, outputs, or state containing private runtime data.

Use relative paths, .env, command-line arguments, and generic placeholders only.

Dark-watermark cleanup

Before uploading generated images to Xiaohongshu, run the built-in cleanup step for every generated image. The workflow must stop if any image fails cleanup; never silently upload an uncleared image. Terminal-facing wording should stay simple and use 清除暗水印 rather than exposing low-level cleanup terminology. wmr is discovered from PATH, or may be configured with XHS_WMR_PATH.

檢視許可證全文(MIT)
MIT License

Copyright (c) 2026 xhs-note-auto-workflow contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.