Skip to content
Back to search

comeonzhj-Auto-Redbook-Skills

MarketplaceWorks with Claude CodeGitHub

小红书笔记自动创作插件:撰写内容、生成图片卡片、一键发布

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/comeonzhj-auto-redbook-skills/badge.svg)](/listings/comeonzhj-auto-redbook-skills)

HTML

<a href="/listings/comeonzhj-auto-redbook-skills"><img src="/api/listings/comeonzhj-auto-redbook-skills/badge.svg" alt="findsafeskills safety rating" /></a>

Install

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 23 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
  3. "name": "comeonzhj-Auto-Redbook-Skills",
  4. "owner": {
  5. "name": "ZhangJia"
  6. },
  7. "description": "小红书笔记自动创作插件:撰写内容、生成图片卡片、一键发布",
  8. "plugins": [
  9. {
  10. "name": "auto-redbook-skills",
  11. "source": "./",
  12. "description": "小红书笔记自动创作技能。支持 8 种排版主题和 4 种智能分页模式。",
  13. "category": "content",
  14. "keywords": [
  15. "xiaohongshu",
  16. "小红书",
  17. "redbook",
  18. "social-media",
  19. "content-creation"
  20. ]
  21. }
  22. ]
  23. }
README.md · README · 259 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ## 📕 Auto-Redbook-Skills(已重构版)
  2. ### ⚠️ 使用此工具前情确保已悉知官方 3 月 10 日发布的公告
  3. 公告地址:[关于打击AI托管运营账号的治理公告](http://xhslink.com/o/7WxTddvbmTu)
  4. ### 方式一:Claude Code Plugin 安装(推荐)
  5. ```bash
  6. # 添加本仓库为 marketplace
  7. /plugin marketplace add comeonzhj/Auto-Redbook-Skills
  8. # 安装插件
  9. /plugin install auto-redbook-skills@comeonzhj-Auto-Redbook-Skills
  10. ```
  11. 安装后运行 `/reload-plugins` 即可使用。
  12. ### 方式二:一句话安装
  13. 跟你的 Agent 说:
  14. > 拉取下面的项目,安装其中的技能:https://github.com/comeonzhj/Auto-Redbook-Skills
  15. ### 方式三:手动安装
  16. 详见下方[使用方式总览](#-使用方式总览)。
  17. ---
  18. > 自动撰写小红书笔记、生成多主题卡片、可选自动发布的 Skills
  19. > 当前版本对渲染脚本和样式系统做了**一次完整重构**,感谢 Cursor 的辅助开发 🙌
  20. ---
  21. ## ✨ 本次重构亮点
  22. - **🎨 8 套主题皮肤**:默认简约灰 + Playful Geometric / Neo-Brutalism / Botanical / Professional / Retro / Terminal / Sketch
  23. - **📐 4 种分页模式**:
  24. - `separator`:按 `---` 分隔手动分页
  25. - `auto-fit`:固定尺寸,自动整体缩放内容,避免溢出/大面积留白
  26. - `auto-split`:根据渲染后高度自动拆分为多张卡片
  27. - `dynamic`:根据内容动态调整图片高度
  28. - **🧱 统一卡片结构**:外层浅灰背景(`card-container`)+ 内层主题背景(`card-inner`)+ 纯排版层(`card-content`)
  29. - **🧠 封面与正文一体化**:封面背景、标题渐变和正文卡片背景都按主题自动匹配
  30. ---
  31. ## 🖼 主题效果示例
  32. > 所有示例均为 1080×1440px,小红书推荐 3:4 比例
  33. > 更多示例去 [demo](/demos) 中查看 
  34. |||
  35. |---|---|
  36. |![Playful Geometric](demos/playful-geometric/card_1.png)|![Retro](demos/retro/card_1.png)|
  37. |![Sketch](demos/Sketch/card_1.png)|![Terminal](demos/terminal/card_1.png)|
  38. ### Auto-fit 模式示例(自动缩放)
  39. ![Auto Fit](demos/auto-fit/card_1.png)
  40. ---
  41. ## 🚀 使用方式总览
  42. ### 1. 克隆项目
  43. ```bash
  44. git clone https://github.com/comeonzhj/Auto-Redbook-Skills.git
  45. cd Auto-Redbook-Skills
  46. ```
  47. 可以将本项目放到支持 Skills 的客户端目录,例如:
  48. - Claude:`~/.claude/skills/`
  49. - Alma:`~/.config/Alma/skills/`
  50. - TRAE:`/your-path/.trae/skills/`
  51. ### 2. 安装依赖
  52. **Python:**
  53. ```bash
  54. pip install -r requirements.txt
  55. playwright install chromium
  56. ```
  57. **Node.js:**
  58. ```bash
  59. npm install
  60. npx playwright install chromium
  61. ```
  62. > Node.js 18+ 同时用于图片渲染和内置的小红书 Creator 请求签名。
  63. ---
  64. ## 🎨 渲染图片(Python)
  65. 核心脚本:`scripts/render_xhs.py`
  66. ```bash
  67. # 最简单用法(默认主题 + 手动分页)
  68. python scripts/render_xhs.py demos/content.md
  69. # 使用自动分页(推荐:内容长短难控)
  70. python scripts/render_xhs.py demos/content.md -m auto-split
  71. # 使用固定尺寸自动缩放(auto-fit)
  72. python scripts/render_xhs.py demos/content_auto_fit.md -m auto-fit
  73. # 切换主题(例如 Playful Geometric)
  74. python scripts/render_xhs.py demos/content.md -t playful-geometric -m auto-split
  75. # 自定义尺寸和像素比
  76. python scripts/render_xhs.py demos/content.md -t retro -m dynamic --width 1080 --height 1440 --max-height 2160 --dpr 2
  77. ```
  78. **主要参数:**
  79. | 参数 | 简写 | 说明 |
  80. |------|------|------|
  81. | `--theme` | `-t` | 主题:`default`、`playful-geometric`、`neo-brutalism`、`botanical`、`professional`、`retro`、`terminal`、`sketch` |
  82. | `--mode` | `-m` | 分页模式:`separator` / `auto-fit` / `auto-split` / `dynamic` |
  83. | `--width` | `-w` | 图片宽度(默认 1080) |
  84. | `--height` | | 图片高度(默认 1440,`dynamic` 为最小高度) |
  85. | `--max-height` | | `dynamic` 模式最大高度(默认 2160) |
  86. | `--dpr` | | 设备像素比,控制清晰度(默认 2) |
  87. > 生成结果会包含:封面 `cover.png` + 正文卡片 `card_1.png`、`card_2.png`...
  88. ---
  89. ## 🎨 渲染图片(Node.js)
  90. 脚本:`scripts/render_xhs.js`,参数与 Python 基本一致:
  91. ```bash
  92. # 默认主题 + 手动分页
  93. node scripts/render_xhs.js demos/content.md
  94. # 指定主题 + 自动分页
  95. node scripts/render_xhs.js demos/content.md -t terminal -m auto-split
  96. ```
  97. ---
  98. ## 📤 发布到小红书
  99. ### 1. 配置 Creator Cookie
  100. ```bash
  101. cp env.example.txt .env
  102. ```
  103. 编辑 `.env`:
  104. ```env
  105. XHS_CREATOR_COOKIE=your_creator_cookie_string_here
  106. ```
  107. > 获取方式:浏览器登录[小红书创作服务平台](https://creator.xiaohongshu.com)
  108. > → F12 → Network → 刷新页面 → 选择发往 `creator.xiaohongshu.com` 的请求
  109. > → 复制 Request Headers 中的完整 Cookie。
  110. ### 2. 发布图文笔记(可选)
  111. ```bash
  112. python scripts/publish_xhs.py \
  113. --title "笔记标题" \
  114. --desc "笔记描述内容" \
  115. --images cover.png card_1.png card_2.png
  116. ```
  117. **可选参数:**
  118. | 参数 | 说明 |
  119. |------|------|
  120. | `--public` | 公开发布(默认仅自己可见) |
  121. | `--post-time "2026-08-14 10:00:00"` | 按本机时区定时发布,也支持 13 位毫秒时间戳 |
  122. | `--topics AI 效率工具` | 添加一个或多个话题,不要带 `#` |
  123. | `--location "上海"` | 添加地点 |
  124. | `--proxy http://127.0.0.1:7890` | 使用 HTTP/HTTPS 代理 |
  125. | `--dry-run` | 仅做本地参数验证,不登录、不上传、不发布 |
  126. 发布脚本已内置 Creator 纯 HTTP 签名、素材上传和发布链路,不依赖浏览器自动化、
  127. 外部 API 服务或其他项目目录。运行发布命令前请确保已经执行 `pip install -r requirements.txt`
  128. 和 `npm install`。
  129. ---
  130. ## 📁 项目结构(重构后)
  131. ```bash
  132. Auto-Redbook-Skills/
  133. ├── SKILL.md # 技能描述(Agent 使用说明)
  134. ├── README.md # 项目文档(你现在看到的)
  135. ├── requirements.txt # Python 依赖
  136. ├── package.json # Node.js 依赖
  137. ├── env.example.txt # Cookie 配置示例
  138. ├── vendor/xhs_publish_runtime/ # 内置 Creator 鉴权、签名与发布运行时
  139. ├── references/ # 技能参考文档
  140. │ └── params.md # 完整参数参考(主题/模式/发布参数)
  141. ├── assets/
  142. │ ├── cover.html # 封面 HTML 模板
  143. │ ├── card.html # 正文卡片 HTML 模板
  144. │ ├── styles.css # 共用容器样式(cover-inner / card-inner 等)
  145. │ └── example.md # 示例 Markdown
  146. ├── assets/themes/ # 主题样式(只控制排版 & 内层背景)
  147. │ ├── default.css
  148. │ ├── playful-geometric.css
  149. │ ├── neo-brutalism.css
  150. │ ├── botanical.css
  151. │ ├── professional.css
  152. │ ├── retro.css
  153. │ ├── terminal.css
  154. │ └── sketch.css
  155. ├── demos/ # 各主题示例渲染结果
  156. │ ├── content.md
  157. │ ├── content_auto_fit.md
  158. │ ├── auto-fit/
  159. │ ├── playful-geometric/
  160. │ ├── retro/
  161. │ ├── Sketch/
  162. │ └── terminal/
  163. └── scripts/
  164. ├── render_xhs.py # Python 渲染脚本(8 主题 + 4 分页模式)
  165. ├── render_xhs_v2.py # Python 渲染脚本 V2(7 渐变色彩风格)
  166. ├── render_xhs.js # Node.js 渲染脚本
  167. └── publish_xhs.py # 自包含的小红书 Creator 发布脚本(默认仅自己可见)
  168. ```
  169. ---
  170. ## ⚠️ 注意事项
  171. 1. **Cookie 安全**:不要把 `.env` 提交到 Git 或共享出去;请使用创作服务平台 Cookie。
  172. 2. **Cookie 有效期**:过期后发布失败是正常现象,重新抓一次 Cookie 即可。
  173. 3. **发布频率**:避免短时间内高频发布,以免触发平台风控。
  174. 4. **图片尺寸**:默认 1080×1440px,符合小红书推荐比例。
  175. ---
  176. ## 🙏 致谢
  177. - [Playwright](https://playwright.dev/) - 浏览器自动化渲染
  178. - [Marked](https://marked.js.org/) - Markdown 解析
  179. - ~~[xhs](https://github.com/ReaJason/xhs) - 原小红书 API 客户端(发布实现已停用)~~
  180. - [Spider_XHS](https://github.com/cv-cat/Spider_XHS) - 当前 Creator 纯 HTTP 登录、签名、上传与发布实现参考(基于提交 `2030f5d` 提取并内置)
  181. - **Cursor** - 本次重构过程中提供了极大帮助 ❤️
  182. ---
  183. ## 📄 License
  184. MIT License © 2026

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.