用于将“小红书/”目录内指定章节批量上传到小红书创作者后台并暂存草稿。支持按 README.md 读取作者笔名、小说名称与合集映射信息,自动执行登录状态检查(需用户手动登录)、按新增/修改分流填写标题与正文并“暂存离开”,同时回写无章节Id场景下的草稿追踪记录。关键词:小红书上传、长文笔记、暂存离开、草稿箱、长文合集、批量传章。
npx skills add https://github.com/lornshrimp/Lorn.NovelWriteSkills --skill 分发-小红书
<!-- ===== Layer 1: 永久缓存 ===== -->
用于把你指定的 1 章或多章,上传到小红书对应账号下,并全部执行“暂存离开”。
<!-- ===== Layer 3: 场景缓存 ===== -->
本 Skill 执行前,必须按以下规则确定工作目录:
Agents.md,检查其中 主输出平台 声明主输出平台 → 工作目录为 小说正文/主输出平台,或 Agents.md 不存在/未声明 主输出平台 → 工作目录为 小红书/后续所有章节文件路径、README.md、分发记录.md 均基于此工作目录。明确说明:
README.md、分发记录.md 均在 小说正文/ 下README.md、分发记录.md 均在 小红书/ 下> 路径说明:以下各节中所有 小红书/ 形式的路经(如 小红书/README.md、小红书/分发记录.md)均为工作目录的示例写法。实际目录由上方「工作目录路由规则」确定:本平台是主输出平台时,所有这些路径对应 小说正文/;不是主输出平台时,对应 小红书/。
小红书/ 目录。小红书/README.md 写好作者笔名、小说名称、合集映射等信息。小红书/ 下。# 1.1.3 三分钟,其中 1.1.3 表示 部号.卷号.章号;提取时必须只取最后一段 3 作为源章号,三分钟 作为“章节标题”。1.1.3、2.4.17 这类三级编号原样带入标题输入框;最终只能写成 第95章 三分钟 一类格式。第{绝对章节号}章 {章节标题}。章号 与 标题 之间必须保留 1 个空格,例如:第1章 天降奇缘。天降奇缘),则必须自动组装成 第{绝对章节号}章 天降奇缘。小红书/README.md,至少提取以下信息:README.md 中填写用户名和密码。读取 小红书/README.md 后,必须检查其第一行一级标题是否等于 # 小红书分发配置:
README.md 平台标识与当前 Skill 不符:预期"小红书分发配置",实际读取到"{实际读取到的标题}"。请检查是否将其他平台的 README.md 误放到了当前工作目录。小红书/分发记录.md:README.md 中的“小说名称(小说书名)”。> 小红书长文流程无法稳定获得章节Id,因此使用“章节唯一键 + 标题定位键 + 内容指纹”三元组跟踪是否已上传草稿。
章节唯一键:小红书合集名|分部名|绝对章号|章名(无分部时分部名填 NA)。草稿定位键:固定为 长文笔记::{标准标题},其中标准标题为 第{绝对章节号}章 {章节标题}。内容指纹:对正文执行“去首尾空白 + 连续空白归一 + 去零宽字符”后计算哈希(建议 SHA-1)。判定规则:
分发记录.md 中无该 章节唯一键:走新增模式。草稿定位键 精确查找同名草稿;x 为数字,表示当前“长文笔记”分类下草稿箱内的草稿数量;内容指纹 与台账不同,必须覆盖更新记录并标记“内容已更新”。分发记录.md 模板(首次创建直接使用)# 小红书分发记录
> 用途:记录“章节唯一键 -> 草稿定位键/内容指纹”映射,供分发流程判断“新增模式/修改模式”。
## 字段说明
- `章节唯一键`:固定格式 `小红书合集名|分部名|绝对章号|章名`(无分部时分部名填 `NA`)
- `小红书合集名`:对应 `小红书/README.md` 中目标合集名(按书名判定规则映射)
- `草稿定位键`:固定格式 `长文笔记::{标准标题}`
- `内容指纹`:规范化正文的哈希值(建议 SHA-1)
- `最近操作`:`新增` 或 `修改`
- `更新时间`:`YYYY-MM-DD HH:mm:ss`
- `备注`:可选
## 记录表
|章节唯一键|小红书合集名|草稿定位键|内容指纹|最近操作|更新时间|备注|
|:--|:--|:--|:--|:--|:--|:--|
README.md 模板(首次创建直接使用)当 小红书/README.md 不存在时,必须按以下模板创建:
# 小红书分发配置
> 用途:存储作者信息与合集映射。分发流程需要用户手动登录,不读取密码。
## 作者信息
- 作者笔名:`笔名`
## 书籍与合集映射
### 无分部小说
| 小说名称 | 目标长文合集名 |
|:--|:--|
| 作品名 | 合集名称 |
### 有分部小说
| 分部号 | 分部名 | 目标长文合集名 |
|:--|:--|:--|
| 第1部 | 分部一书名 | 合集名称一 |
| 第2部 | 分部二书名 | 合集名称二 |
## 卷名映射
### 分部一书名
| 卷号 | 卷名 |
|--:|:--|
| 1 | 第一卷 卷标题 |
| 2 | 第二卷 卷标题 |
### 分部二书名
| 卷号 | 卷名 |
|--:|:--|
| 1 | 第一卷 卷标题 |
| 2 | 第二卷 卷标题 |
## 字段说明
- `小说名称` / `分部名`:必须精确匹配 SKILL 中的"书名判定规则"
- `分部号`:必须使用 `第N部` 规范格式(如 `第1部`、`第2部`),并与 `分部名` 一一对应,不得错位或复用
- `目标长文合集名`:小红书创作者中心已创建的长文合集名称
- `作者笔名`:用于元信息标记
## 登录方式
- **本文件不存储密码**。分发流程将在浏览器打开小红书,需要你在浏览器中**手动登录**。
- 确保登录账号拥有上述合集的写入权限。
## 注意事项
- 分发流程会检查登录状态;如未登录,需要你手动完成登录后再继续。
- 小红书无稳定的章节ID获取方式,草稿追踪将使用"标题+内容指纹"方案。
小红书/README.md。小红书/分发记录.md,建立“章节唯一键 -> 草稿定位键/内容指纹”映射。分发记录.md 中同一目标合集下全部已记录章节;绝对章号排序后,计算当前章节的绝对序号。绝对章节号 = 前面各卷章节数之和 + 该章节在所在卷的相对章号。分发记录.md 不存在或无历史记录,则按上述公式从已知卷章结构计算;无法确定前卷章数时需先补齐台账后再发布。https://creator.xiaohongshu.com/new/homehttps://creator.xiaohongshu.com/publish/publish?from=menu&target=article小红书/分发记录.md:章节唯一键 无记录:走新增模式。草稿定位键 查找,找到走修改模式,找不到回退新增。https://creator.xiaohongshu.com/publish/publish?from=menu&target=article;x 为数字,表示当前该分类草稿数量);第{绝对章节号}章 {章节标题}。小红书/分发记录.md:章节唯一键小红书合集名草稿定位键(长文笔记::{标准标题})内容指纹最近操作(新增/修改)更新时间备注(必要时记录“草稿箱未命中后回退新增”等)> 目标:在不放松现有强制规则的前提下,减少重复点击、重复粘贴与重复判定成本。
分发记录.md)。{平台目录}/.cache/content_parts/no_part/v{卷号}/*.txt、{平台目录}/.cache/content_parts/p{分部号}/v{卷号}/*.txt + 映射表),浏览器阶段只做“取数据→填写→保存”。1) 打开目标地址(按记录走新建或修改);
2) 填标题;
3) 填正文;
4) 填平台扩展字段(如作者话/发布设置);
5) 保存草稿;
6) 提取章节Id;
7) 回写记录。
5–10 章为一个小批次执行:分发记录.md;> D / E / F 三节统一执行口径:优先保证批次连续性与可回滚性;安全验证类提示一律按阻断处理;数据通道异常必须可降级。
scripts/content_parts_server.mjs:/parts/v/{卷号}/{章号}/parts/p/{分部号}/v/{卷号}/{章号}/parts/{章号} 仅限单批次临时使用。分发记录.md 的实时查询。content_parts_server)时必须提供降级路径:服务不可用时自动回退到本地文件读取,不中断批次执行。计划章数 = 成功章数 + 失败章数,且成功章均完成 章节Id 回写。https://creator.xiaohongshu.com/new/home。README.md 维护账号密码。https://creator.xiaohongshu.com/publish/publish?from=menu&target=article。第X章 标题文本(X 为绝对章节号,章号与标题之间有 1 个空格)。小红书/分发记录.md。分发记录.md 写入失败:流程标记为“部分失败(记录未落盘)”,并提示人工补录。标准标题/正文/内容指纹,浏览器阶段只做“取数据→填写→暂存”,显著降低错章与漏填概率。分发记录.md,确保“新增/修改”判定和指纹比对有据可依。# 标题格式,曾被错误生成为 第36章 # 作者有话说。1) # 数字编号 标题;
2) # 标题;
3) 无 # 时使用“首个非空行/文件名回退”策略。
暂无笔记标题;第X章 # 作者有话说 等异常标题;^第\d+章\s.+,不符合则禁止暂存。1) 计划章数 = 成功章数 + 失败章数;
2) 成功章都能在草稿箱命中标准标题;
3) 台账记录数与成功章数一致。
小红书/README.md 并提取必需字段(不含账号密码)。小红书/分发记录.md,正确区分新增/修改模式。小红书/分发记录.md(含草稿定位键与内容指纹)。Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks
Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.
Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.
Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.
Use this skill any time a .pptx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates, layouts, speaker notes, or comments. Trigger whenever the user mentions \"deck,\" \"slides,\" \"presentation,\" or references a .pptx filename, regardless of what they plan to do with the content afterward. If a .pptx file needs to be opened, created, or touched, use this skill.
Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes.
Take lornshrimp/分发-小红书 from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.