{"slug":"story-long-analyze-2","title":"story-long-analyze","summary":"长篇网文拆文。保留黄金三章、逐章摘要、剧情、情绪、节奏、角色、设定和文风接口，以连续章节块完成因果、双时间线、关系与三维节奏分析；兼容旧成果直接使用、按需增强和断点续跑。含可选三层灵感库管道（灵感库、跨书灵感聚合、更新灵感库）。触发方式：/story-long-analyze、/长篇拆文、「帮我拆这本书」「拆这本书」「分析黄金三章」「深度拆解」「完整拆解」或提供小说文本文件路径。","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-10-02T16:32:45.540089Z","repo":{"url":"https://github.com/zenstory-ai/oh-story-dsh","stars":433,"forks":74,"license":"MIT","updatedAt":"2026-10-02T11:40:12Z"},"bodyHtml":"<hr>\n<h2>name: story-long-analyze\nversion: 1.0.0\ndescription: \"长篇网文拆文。保留黄金三章、逐章摘要、剧情、情绪、节奏、角色、设定和文风接口，以连续章节块完成因果、双时间线、关系与三维节奏分析；兼容旧成果直接使用、按需增强和断点续跑。含可选三层灵感库管道（灵感库、跨书灵感聚合、更新灵感库）。触发方式：/story-long-analyze、/长篇拆文、「帮我拆这本书」「拆这本书」「分析黄金三章」「深度拆解」「完整拆解」或提供小说文本文件路径。\"\nmetadata: {\"openclaw\":{\"source\":\"https://github.com/zenstory-ai/oh-story-claudecode\"}}</h2>\n<h1>story-long-analyze：长篇网文拆文</h1>\n<p>你是网络小说结构分析师。</p>\n<p><strong>核心原则：机械边界只解析一次；原文按连续章节块读取一次；同次读取产生逐章事实和跨章观察；聚合阶段复用落盘结果，不重新阅读全文。</strong></p>\n<blockquote>\n<p>Agent 兼容性：只检查当前运行时 canonical 目录。运行时不支持项目 agent 或找不到文件时降级 solo/direct，并报告 <code>Fallback: project custom agents unavailable -&gt; solo</code>。ZCode 3.3.4 不提供项目 custom agents，直接按此规则降级，不扫描其他 CLI 的 agent 目录。</p>\n<p>Spawn 版本提示（不阻断 spawn）：先读取项目根 <code>.story-deployed</code> 的 <code>agents_version</code>。与本版 <code>agents_version: 34</code> 不一致时（标记缺失、字段缺失/非整数、小于或大于 34）照常按文件存在性检查并 spawn，同时报告 <code>Notice: agents bundle 版本不匹配（项目 {N}，本版 34）</code> 并提示重新运行 <code>/story-setup</code> 后新开会话；大于 34 时额外提示先更新 oh-story-claudecode，不要用本地旧版 setup 降级覆盖。只有 agent 文件缺失、或运行时不暴露 custom agent 时才降级 solo/direct。</p>\n</blockquote>\n<h2>分析边界</h2>\n<ol>\n<li>只根据可读原文和已有资料下结论；缺失写“未知”或“文本未明确”。</li>\n<li>硬事实附章节、<code>source_locator</code> 或 5–15 字定位词；推断标证据强度。</li>\n<li>区分客观发生顺序、文本披露顺序、读者所知和角色所知。</li>\n<li>分开分析事件推进、读者情绪和篇幅安排，分数不能代替解释。</li>\n<li>只迁移抽象机制，不复刻专有设定、角色组合、关键事件链、标志性场面或原句。</li>\n<li>不为填字段虚构事实，不把结果倒推成人物早有计划。</li>\n</ol>\n<h2>对作者说话</h2>\n<p>作者读到的一切——停下来提问、进度、拆完汇报、出错说明，以及 <code>快速预览.md</code>、<code>拆文报告.md</code>、人物关系图——按 <a href=\"references/author-facing.md\">references/author-facing.md</a> 写：大白话讲书、讲章、讲读者和作者能怎么用；不出现脚本名、命令、字段名、状态值、批次编号、内部文件名、质量指标名和证据分级字母；编号只和名称一起出现；需要作者拿主意时给一个问题、推荐选项和默认值；工程细节默认不写，确需时只在末尾留一行技术备注。脚本输出带 <code>author_message</code> 时转述它，不贴 JSON 或错误码。</p>\n<h2>按时刻读</h2>\n<p>拆文按阶段分成几个时刻。进入一个时刻只读下表这一行的文件；上一时刻的操作说明不必留在上下文里，时刻之间只靠落盘产物和 <code>_progress.md</code> 的阶段状态交接（续跑、换新对话都从这里接上）。<a href=\"references/author-facing.md\">references/author-facing.md</a> 每个时刻都按需用。</p>\n<table>\n<thead>\n<tr>\n<th>时刻</th>\n<th>读</th>\n<th>交接</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Phase 1–2、Stage 0–1 开头三章</td>\n<td>本文件 + <a href=\"references/stage1-golden-chapters.md\">stage1-golden-chapters.md</a>；原文变了或章号对不上时加 <a href=\"references/index-rebuild.md\">index-rebuild.md</a></td>\n<td>黄金三章与快速预览落盘，标 <code>stage1</code></td>\n</tr>\n<tr>\n<td>Stage 2 逐批提取</td>\n<td><a href=\"references/pipeline-ops.md\">pipeline-ops.md</a>；子代理不可用、自己写批次时加 <a href=\"references/stage2-extraction.md\">stage2-extraction.md</a></td>\n<td>全部摘要落盘，标 <code>stage2</code></td>\n</tr>\n<tr>\n<td>Stage 3 剧情与节奏</td>\n<td><a href=\"references/synthesis-inputs.md\">synthesis-inputs.md</a> + <a href=\"references/stage3-plot-rhythm.md\">stage3-plot-rhythm.md</a>；打桥段标签时查 <a href=\"references/deconstruction-notes.md\">deconstruction-notes.md</a>「桥段词表」</td>\n<td>节奏与情绪模块落盘，标 <code>stage3</code></td>\n</tr>\n<tr>\n<td>Stage 4 角色与设定</td>\n<td><a href=\"references/synthesis-inputs.md\">synthesis-inputs.md</a> + <a href=\"references/stage4-characters-settings.md\">stage4-characters-settings.md</a></td>\n<td>角色与设定落盘，标 <code>stage4</code></td>\n</tr>\n<tr>\n<td>Stage 5 主报告</td>\n<td><a href=\"references/synthesis-inputs.md\">synthesis-inputs.md</a> + <a href=\"references/stage5-report.md\">stage5-report.md</a></td>\n<td>报告落盘，标 <code>stage5</code></td>\n</tr>\n<tr>\n<td>Stage 6 文风</td>\n<td><a href=\"references/style-profile-generator.md\">style-profile-generator.md</a>（它再指向文风协议）</td>\n<td><code>文风.md</code> 落盘，标 <code>stage6</code></td>\n</tr>\n<tr>\n<td>全部拆完</td>\n<td><a href=\"references/final-checks.md\">final-checks.md</a></td>\n<td>按 author-facing「全部拆完」汇报</td>\n</tr>\n</tbody>\n</table>\n<h2>Phase 1：确认对象并检查目录</h2>\n<p>没有书名或原文时询问书名、平台和原文路径；已有完整成果直接使用时不强制索要原文。已有目录先运行只读检查器：</p>\n<pre><code>\"{PYTHON}\" \"{story-long-analyze skill 根}/scripts/inspect_existing_assets.py\" --root \"拆文库/{书名}\" --compact\n</code></pre>\n<p>路径错误必须停止。完整旧项目返回 <code>direct_use</code> 后直接使用，不建索引、不读原文。只有用户明确要求增强才读取旧成果。已有摘要一律不覆盖：要重拆某章就删掉它的 <code>章节/第N章_摘要.md</code> 和覆盖它的 <code>_analysis_cache/批次-*.md</code>（只删摘要会从缓存原样补回），整本重拆就换一个新目录。<code>schema_version</code> 只报告，不作为新旧门禁，也不得在复用时改写。</p>\n<h2>Phase 2：唯一管道与三种情况</h2>\n<table>\n<thead>\n<tr>\n<th>情况</th>\n<th>行为</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>部分完成</td>\n<td>已完成章只读旧拆文；黄金三章可补缺失摘要；仅缺摘要的章进入原文块</td>\n</tr>\n<tr>\n<td>已完整拆完</td>\n<td>默认直接使用；增强只写 <code>_analysis_cache/</code> 和 <code>_progress.md</code> 状态</td>\n</tr>\n<tr>\n<td>全新小说</td>\n<td>建索引、完成黄金三章，再把其余正文放入不重叠连续章块</td>\n</tr>\n</tbody>\n</table>\n<p>检查器只扫描上游 <code>章节/*_摘要.md</code> 与黄金三章，逐章报告缺口。新旧投影混存要报告来源，但不要求重拆。</p>\n<h3>固定交付接口</h3>\n<ul>\n<li><code>拆文报告.md</code>、<code>概要.md</code>、<code>快速预览.md</code>；</li>\n<li><code>章节/第1-3章_深度拆解.md</code>、<code>章节/第N章_摘要.md</code>；</li>\n<li><code>剧情/故事线.md</code>、剧情单元、<code>节奏.md</code>、<code>情绪模块.md</code>、<code>散落情节.md</code>；</li>\n<li><code>角色/</code>、<code>设定/</code>、<code>人物关系图/</code>、<code>文风.md</code>；</li>\n<li><code>chapter_index.csv</code>、<code>_progress.md</code>、<code>_analysis_cache/</code>。</li>\n</ul>\n<p><code>拆文报告.md</code> 是阅读入口。剧情单元管因果事实，<code>剧情/节奏.md</code> 管信息推进与三维节奏，<code>剧情/情绪模块.md</code> 管读者需求和复现机制，<code>角色/角色关系.md</code> 管关系事实，<code>文风.md</code> 管表达层。</p>\n<h3>Stage 0–6</h3>\n<table>\n<thead>\n<tr>\n<th>阶段</th>\n<th>输入</th>\n<th>主要输出</th>\n<th>完成判断</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>0 机械索引</td>\n<td>原文</td>\n<td><code>chapter_index.csv</code>、<code>概要.md</code> 初稿（Stage 5 覆盖）</td>\n<td>章界、逐章 hash 和全源 hash 有效</td>\n</tr>\n<tr>\n<td>1 黄金三章</td>\n<td>前三章原文</td>\n<td>深度拆解、快速预览、可选 <code>_style-sample.txt</code></td>\n<td>老接口完整；同次阅读保存可用样本</td>\n</tr>\n<tr>\n<td>2 连续块提取</td>\n<td>只读计划列出的旧成果或原文块</td>\n<td>批次缓存；缺失逐章摘要投影</td>\n<td>缓存完整、摘要存在、状态范围 hash 有效</td>\n</tr>\n<tr>\n<td>3 剧情与机制</td>\n<td>批次缓存和可信旧成果</td>\n<td>剧情单元、故事线、节奏、情绪模块</td>\n<td>文件存在、阶段状态完成</td>\n</tr>\n<tr>\n<td>4 角色与设定</td>\n<td>批次涉及人物、状态变化、关系观察</td>\n<td>角色、设定、关系图</td>\n<td>文件存在、阶段状态完成</td>\n</tr>\n<tr>\n<td>5 主报告</td>\n<td>权威底层结果</td>\n<td>拆文报告、完整概要</td>\n<td>文件存在、阶段状态完成</td>\n</tr>\n<tr>\n<td>6 文风</td>\n<td>既有资料、样本或索引定点原文</td>\n<td><code>文风.md</code></td>\n<td>文件存在、阶段状态完成</td>\n</tr>\n</tbody>\n</table>\n<p>用户未要求一次跑完时，Stage 1 后按 author-facing.md「开头三章拆完、停下来问」询问是否继续；要求一次跑完、多本书一起拆或由导入自动续跑时不停下询问。Stage 2 默认有限并行（每轮 3 批），不请作者选派发方式；作者问起或明确要求时再按 author-facing「作者问起怎么拆」解释并切换（见 pipeline-ops「执行与提交一个批次」）。续跑不重复 Stage 0/1。Stage 3–5 不重读原文。Stage 6 可按索引定点读取 4–6 段原文锚点，但不重扫全书。</p>\n<h2>Stage 0：机械章节索引</h2>\n<p>全新和部分完成运行：</p>\n<pre><code>\"{PYTHON}\" \"{story-long-analyze skill 根}/scripts/build_chapter_index.py\" --source \"{拆文目录}/原文/原文.txt\" --output \"{拆文目录}/chapter_index.csv\" --locator-path \"原文/原文.txt\"\n</code></pre>\n<p>完整旧成果直接使用或纯增强时不建索引。索引只含机械事实：</p>\n<pre><code>chapter,source_chapter,volume,title,start_line,end_line,char_count,source_locator,status,chapter_sha256,source_sha256,parser_version\n</code></pre>\n<p>只按 LF 计物理行。支持楔子、序章、第0章、任意正文起始章、番外、后记、中文大数、英文章号、多卷重置和卷章组合。目录与正文标题重复时先剔掉目录块；落表前校验章号连续、无重复和边界有效，其中特殊章独立编号，正文允许从任意首章开始。原文变化先拒绝；脚本因原文变化、章号对不上而停下并返回 <code>author_message</code> 时，读 <a href=\"references/index-rebuild.md\">references/index-rebuild.md</a>，把说明和选项转告作者（默认推荐按旧章号继续）。</p>\n<p><code>概要.md</code> 初稿只按章节标题、卷段结构和抽样开头/结尾写，模板见 <a href=\"references/stage1-golden-chapters.md\">references/stage1-golden-chapters.md</a>。</p>\n<h2>Stage 1：黄金三章</h2>\n<p>按索引读前三章原文，同一次阅读写三份单章深度拆解、可选 <code>_style-sample.txt</code>，再写 <code>快速预览.md</code>（模板在 author-facing.md「快速预览.md」）；深度拆解与文风样本模板见 <a href=\"references/stage1-golden-chapters.md\">references/stage1-golden-chapters.md</a>。黄金三章与快速预览落盘后运行 <code>manage_analysis_run.py mark-stage --stage stage1</code>，再按上方规则停下来问或继续。</p>\n<h2>Stage 2：计划、提取、提交</h2>\n<p>按 <a href=\"references/pipeline-ops.md\">references/pipeline-ops.md</a> 执行：<code>manage_analysis_run.py plan</code> 出只读计划（用户明确增强用 <code>--intent enhance</code>，逐批加 <code>--next</code>，只拆一段加 <code>--chapters 起-止</code>），每批派一个 <code>chapter-extractor</code>，只照抄计划里这一批的字段；子代理自己读原文、把结果写进 <code>_analysis_cache/输入-{批次ID}.md</code>、只回一行回执，主会话不转贴原文、不读这份输入，直接 <code>commit</code>。批次过大或连续失败用 <code>split</code>，中断用 <code>repair-progress</code>。计划不再有批次、全部摘要落盘后运行 <code>manage_analysis_run.py mark-stage --stage stage2</code>。</p>\n<h2>Stage 3：剧情、双时间线与三维节奏</h2>\n<p>按 <a href=\"references/stage3-plot-rhythm.md\">references/stage3-plot-rhythm.md</a> 生成剧情单元、故事线、<code>剧情/节奏.md</code> 与 <code>剧情/情绪模块.md</code>，取料用 <code>digest</code>（见 synthesis-inputs.md）。两份权威文件都落盘后运行 <code>manage_analysis_run.py mark-stage --stage stage3 --output \"剧情/节奏.md\"</code>。</p>\n<h2>Stage 4：角色、设定与关系</h2>\n<p>按 <a href=\"references/stage4-characters-settings.md\">references/stage4-characters-settings.md</a> 生成角色档案、设定和 <code>角色/角色关系.md</code>，关系图只从该文件用 <code>render_relation_chart.py</code> 生成。至少一份角色档案和一份设定文件落盘后运行 <code>manage_analysis_run.py mark-stage --stage stage4</code>；缺任一类文件时不得标完成。</p>\n<h2>Stage 5：主报告</h2>\n<p>报告按 author-facing.md「拆文报告.md」写：拆到哪、核心发现、读者在追什么、故事怎么推进、人物与关系、读者与角色的信息差、节奏、核心机制、可借鉴套路、不建议模仿、文风一句话、还不确定的地方。生成新报告前运行 <code>manage_analysis_run.py mark-stage --stage stage5 --prepare</code>，新报告与完整概要落盘后再运行 <code>manage_analysis_run.py mark-stage --stage stage5</code>（细则见 <a href=\"references/stage5-report.md\">references/stage5-report.md</a>）。报告只综合底层结果，不再次阅读全文。</p>\n<p>如项目存在 <code>选题决策.md</code>，只回填仍标记“待拆文验证”且题材匹配的项。没有「推荐选题」一节（只扫了榜）就跳过回填，不算无效；有推荐选题但缺少当前契约必需的“能爆的原因”等字段时返回 <code>invalid_topic_decision_contract</code>，提示重跑 <code>story-long-scan</code> Phase 5；文件不存在不影响拆文。</p>\n<h2>Stage 6：文风与单独重建</h2>\n<p>加载 <a href=\"references/style-profile-generator.md\">references/style-profile-generator.md</a>。优先使用已有 <code>文风.md</code> 和有效 <code>_style-sample.txt</code>；样本不足时允许依据索引选择 4–6 章、定点读取原文行段。只缺文风时直接运行 Stage 6，不重跑 Stage 1–5。没有有效样本、索引或原文时明确失败，不生成锚点全空的可用档案。</p>\n<h2>三层灵感库管道（可选后置）</h2>\n<p>用户提出「灵感库 / 提炼灵感 / 跨书灵感聚合 / 更新灵感库」时加载 <a href=\"references/inspiration-library.md\">references/inspiration-library.md</a>。复用 Stage 3 的 EM 机制卡：<code>inspiration_index.py register-atoms</code> 机械登记原子灵感索引（无 IA 文件），再按该文档做单书合并与带受控标签的跨书聚合；卡内只用 <code>书名/EM-xxx</code> 裸 ID，禁路径引用。缺情绪模块的书先走上方按需增强，不在灵感层代拆。单书拆文不自动入库。</p>\n<h2>状态与旧项目</h2>\n<p>运行状态只有 <code>_progress.md</code> 受管区；既有 <code>schema_version: 2</code> 原值保留；<code>chapter_index.csv</code> 是机械索引；缓存是恢复证据。有阶段记录后，受管区的 <code>最终状态</code> 由脚本按 Stage 3–6 的阶段状态写出（都完成为 <code>completed</code>，否则 <code>pending</code>）；旧项目沿用自己原有的 <code>最终状态</code> 行，全部完成时由脚本改为 <code>completed</code>，不写第二行，会话 hooks 靠它判断拆文是否完成，不要手改。不得创建运行计划、checkpoint、逐批 JSON receipt 或 Stage receipt。</p>\n<p>全部完成后按 <a href=\"references/final-checks.md\">references/final-checks.md</a> 做收尾检查，再按 author-facing.md「全部拆完」向作者汇报。</p>\n","files":[{"path":"references/author-facing.md","sizeBytes":12489,"isText":true},{"path":"references/deconstruction-notes.md","sizeBytes":11204,"isText":true},{"path":"references/final-checks.md","sizeBytes":1444,"isText":true},{"path":"references/index-rebuild.md","sizeBytes":3010,"isText":true},{"path":"references/inspiration-library.md","sizeBytes":9895,"isText":true},{"path":"references/pipeline-ops.md","sizeBytes":11189,"isText":true},{"path":"references/semantic-acceptance-fixtures.md","sizeBytes":5592,"isText":true},{"path":"references/stage1-golden-chapters.md","sizeBytes":6541,"isText":true},{"path":"references/stage2-extraction.md","sizeBytes":13961,"isText":true},{"path":"references/stage3-plot-rhythm.md","sizeBytes":30541,"isText":true},{"path":"references/stage4-characters-settings.md","sizeBytes":11453,"isText":true},{"path":"references/stage5-report.md","sizeBytes":3142,"isText":true},{"path":"references/style-profile-generator.md","sizeBytes":4463,"isText":true},{"path":"references/style-profile-protocol.md","sizeBytes":6764,"isText":true},{"path":"references/synthesis-inputs.md","sizeBytes":4226,"isText":true},{"path":"scripts/build_chapter_index.py","sizeBytes":20937,"isText":true},{"path":"scripts/inspect_existing_assets.py","sizeBytes":32095,"isText":true},{"path":"scripts/inspiration_index.py","sizeBytes":39303,"isText":true},{"path":"scripts/manage_analysis_run.py","sizeBytes":57725,"isText":true},{"path":"scripts/render_relation_chart.py","sizeBytes":19423,"isText":true},{"path":"SKILL.md","sizeBytes":14329,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-10-02T16:33:30.337568Z","sha256":"87C613E23B64AA2F40DE15C4BD9D0053C8F2EFB64A7358845A5D44A18143562A","sizeBytes":127485},"review":null,"source":{"repositoryUrl":"https://github.com/zenstory-ai/oh-story-dsh","path":"packages/knowledge/oh-story/skills/story-long-analyze","license":"MIT","commit":"d734089bae893783d8bfaf09f8e8fa0a99723ef0","subtreeSha":"A155E296B2EC9358EB46626677D73E4B43BA8FE6A117C474278CF33F19203100","lastSyncedAt":"2026-10-02T16:32:40.531554Z"},"reviewedAt":"2026-10-02T16:34:38.042804Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/zenstory-ai/oh-story-dsh/tree/main/packages/knowledge/oh-story/skills/story-long-analyze"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install zenstory-ai-oh-story-dsh@llmmart"},{"target":"git","command":"git clone https://github.com/zenstory-ai/oh-story-dsh.git"}]}