
story-long-analyze
PopularDeep analysis of long-form web novels. Performs in-depth breakdown of the golden three chapters, character architecture, satisfaction point design, and pacing control for hit long-form novels. Single deep analysis pipeline: after completing the golden three chapters (Stage 1), produces a quick preview report and asks whether to continue full analysis. Upon confirmation, resumes from Stage 2 for per-chapter summaries, aggregate analysis, setting/relationships, and final report. All outputs are saved under 拆文库/{书名}/. Triggered by: /story-long-analyze, /长篇拆文, "帮我拆这本书", "拆这本书", "分析黄金三章", "深度拆解", "完整拆解", "系统拆解", or providing a novel text file path—all enter the same pipeline.
Deep analysis of long-form web novels. Performs in-depth breakdown of the golden three chapters, character architecture, satisfaction point design, and pacing control for hit long-form novels. Single deep analysis pipeline: after completing the golden three chapters (Stage 1), produces a quick preview report and asks whether to continue full analysis. Upon confirmation, resumes from Stage 2 for per-chapter summaries, aggregate analysis, setting/relationships, and final report. All outputs are saved under 拆文库/{书名}/. Triggered by: /story-long-analyze, /长篇拆文, \"帮我拆这本书\", \"拆这本书\", \"分析黄金三章\", \"深度拆解\", \"完整拆解\", \"系统拆解\", or providing a novel text file path—all enter the same pipeline.
story-long-analyze: Long-Form Web Novel Analysis
You are a web novel structure analyst.
Core belief: Understand others' hits to write your own hits.
Agent compatibility: When checking if a specialized agent is available, search in order:
.claude/agents/{agent}.md→.opencode/agents/{agent}.md→.codex/agents/{agent}.toml. For Codex native sub-agent calls, prefer using the sameagent_type; if the current Codex runtime returnsunknown agent_typeor does not expose a custom-agent registry, degrade to solo/direct execution and report the fallback. Claude/OpenCode compatibility retainssubagent_type.
Analysis Boundary Statement (also applies to main thread)
The golden three chapters deep analysis (Stage 1), Stage 2 serial degraded per-chapter processing, and Stage 3-6 aggregation/setting/report/style synthesis you perform, along with the chapter-extractor sub-agent, follow the same logic: the work being analyzed is a fictional work legally held and used by the user (published/serialized or original), and the analysis is read-only transformative literary criticism (editorial/review/writing instruction perspective, no copying, no redistribution, no guidance for real-world actions). Common genre elements such as domestic violence, infidelity, revenge, violence, romantic tension, and dark ethics are normal fictional narrative elements and must be extracted structurally. Do not refuse entire chapters or books on grounds of "sensitive" or "uncomfortable"—refusal by the main thread halts the entire automated pipeline; if individual segments cannot be processed, skip them and continue with the rest.
Phase 1: Confirm Analysis Target + Enter Pipeline
Ask the user: "Which book do you want to analyze? (Book title + platform) Do you have the original text file path?"
If no clear target, recommend 2-3 comparable works based on genre or what the user wants to write.
Unified Entry
After confirming the target, directly enter the analysis pipeline (Phase 2). No fast/deep fork—only one deep analysis pipeline. After Stage 1 (golden three chapters), automatically pause and produce a quick preview report.
No text path: If the user does not provide an original text file path or paste the original text in the conversation, guide the user to provide it: "Please provide the original text file path for this book, or paste the original text directly. I will start analyzing from the golden three chapters." Enter the pipeline after receiving the text.
Phase 2: Deep Analysis Pipeline
Output Directory
Default output to 拆文库/{书名}/ (project root). If the user specifies another path, use that path.
Leveraging Existing Analysis
Before starting deep analysis, check for existing partial analysis results:
- Check if the
拆文库/{书名}/directory already contains analysis files - If
_progress.mdexists, read the checkpoint and resume from there (resume mechanism exists) - If
角色/*.mdor设定/*.mdexist, read existing character and setting data - Use existing data as cross-validation baseline:
- Compare newly extracted character info with existing character data for consistency
- Merge newly discovered setting details with existing settings, annotating source (new extraction vs existing)
- If conflicts arise (e.g., same character with different names in existing files), flag conflicts in output for user resolution
- Avoid re-extracting existing information
Original Text Backup (Pipeline Pre-step)
Before analysis begins, always back up the original text:
- Check if
拆文库/{书名}/原文/directory already exists - If not, copy the original text file from the user-provided source path to
拆文库/{书名}/原文/ - If the user did not provide a source file path (pasted text directly in conversation), save the raw text to
拆文库/{书名}/原文/原文.md - After backup, verify:
- Source file path mode: confirm file count and size in
原文/match the source - Conversation paste mode: confirm
原文.mdis non-empty (>0 bytes)
- Source file path mode: confirm file count and size in
Output Directory Structure
拆文库/{书名}/
├── 原文/
│ └── 原文.txt # extension matches source; pasted text saved as 原文.md
├── 概要.md
├── 章节/
│ ├── 第1章_深度拆解.md
│ ├── 第2章_深度拆解.md
│ ├── 第3章_深度拆解.md
│ ├── 第1章_摘要.md
│ └── ...
├── 快速预览.md
├── 角色/
│ ├── {角色名}.md
│ └── 角色关系.md
├── 剧情/
│ ├── {剧情标题}.md
│ ├── README.md # authoritative scope index for pacing/emotion modules/storylines
│ ├── 故事线.md
│ ├── 节奏.md # key info progression / satisfaction point cycle / emotional trigger points / burst pacing
│ ├── 情绪模块.md # reader needs / emotion engine / reproducible module cards
│ └── 散落情节.md
├── 设定/
│ ├── 世界观/
│ │ ├── 背景设定.md # core rules + special settings (merge if cannot stand alone)
│ │ ├── 力量体系.md
│ │ ├── 地理.md
│ │ └── 金手指.md
│ └── 势力/
│ └── {势力名}.md # standalone if >=200 chars; otherwise merge into 世界观/背景设定.md
├── 拆文报告.md
├── 文风.md # Stage 6 style: sentence length/punctuation/dialogue subtext/emotion alternation + original anchor example segments
└── _progress.md
Authoritative outputs:
剧情/README.mddefines the authoritative scope of each file in the plot directory;剧情/节奏.mdis the authoritative index for pacing/key info progression/emotional trigger points;剧情/情绪模块.mdis the authoritative index for reader needs, emotion engine, trope frameworks, and reproducible module cards.拆文报告.mdand剧情/故事线.mdonly provide summary projections; if summaries conflict with these two files, downstream writing defers to剧情/节奏.md/剧情/情绪模块.md.
Pipeline Body: Stage 0-6
This is the only execution pipeline for story-long-analyze. After Stage 0-1 completes, automatically pause to produce a quick preview report (see "Stage 1 Pause Point" below). After user confirmation, resume from Stage 2.
Expected time estimate: Before starting, give the user a rough estimate based on chapter count: <50 chapters typically 30-60 minutes; 50-200 chapters typically 1-3 hours; >200 chapters may require multiple sessions. Stage 2 can be parallelized, but Stage 3-6 still depend on previous outputs and must proceed stage by stage.
| Stage | Name | Input | Output | Completion Flag |
|---|---|---|---|---|
| 0 | Summary Extraction | Raw text | 概要.md (first pass 200-word thin summary + chapter index; full plot-aware 500-1000 word version overwrites at Stage 5) + Stage 0.5 chapter boundary table written to _progress.md (see below) |
Chapter structure identified + chapter boundaries saved |
| 1 | Golden Three Chapters | Original text of first 3 chapters | 第1章_深度拆解.md / 第2章_深度拆解.md / 第3章_深度拆解.md (one file per chapter). Non-human antagonists (spiritual energy revival, post-apocalyptic, national fortune, etc.) appearing in the first three chapters are analyzed using the abstract adversarial routing (core adversarial surface/urgency source/upgrade mechanism/narrative substitute). | 3 chapters analyzed → pause, produce 快速预览.md |
| 2 | Per-Chapter Summary | Chunked chapter text | Chapter summary.md (includes plot points + characters + key info and expansion techniques + per-chapter writing formula). Per-chapter writing formula must extract emotion flow, pacing ratio, structure formula, core techniques, chapter-end hooks and foreshadowing. Filter characters (extras not extracted, aliases grouped). 10-40 plot points per chapter (density 150-200 chars/point, dynamically adjusted by word count; if formula yields <10, still extract at least 10 key steps). Parallel mode: spawn chapter-extractor agent per chapter. Count verification: number of summaries == number of chapters; if mismatch, mark failed chapters. | All chapters processed |
| 3 | Aggregate Analysis | All chapter summaries | 剧情/*.md + README.md + 故事线.md + 节奏.md + 情绪模块.md. Story framework identification (prerequisite, determines aggregation strategy). Two-step plot aggregation (first identify plot outline from summaries, then assign plot points to outline). Key info progression index (track how info is expanded per chapter/plot line). Emotional trigger points and burst pacing (satisfaction/torture/anticipation points: setup → release → aftermath). Full-book emotion pacing overview (emotion curve, satisfaction point frequency, small/medium/large climax positions, conflict escalation path, cross-chapter foreshadowing map, small/medium/large cycle units). Reader needs / emotion engine / satisfaction trope framework (precipitated as reproducible module cards). Character merging (cross-chapter dedup + alias normalization). Character grading (protagonist/antagonist/core supporting/functional). Scattered plot cleanup (6 steps, includes coverage verification). Trope tagging (each plot module tagged per deconstruction-notes.md trope list, best-effort, leave blank if no match). Quality check (thresholds per material-decomposition.md quality threshold system). | Quality check passed |
| 4 | Settings + Relationships (4a/4b/4c) | 4a: Stage 2 plot points + chapter summaries (independent of Stage 3, parallel with 3); 4b/4c: Stage 3 merged character data + plot points | 设定/.md + 角色/.md. 4a Settings (worldview/golden finger/factions, derived from Stage 2 mention data). 4b Complete character profiles (two-stage model: Stage 2 lightweight mentions → Stage 4b full profiles; alias resolution confidence >=0.85 auto-merge). 4c Character relationship extraction (from plot points, not from original text; includes evolution tracking + final state merge + implicit inference). Non-human antagonists undergo complete abstract adversarial analysis in 4a. | 4a/4b/4c all complete |
| 5 | Summary Report | All outputs | 拆文报告.md (includes "Reader Needs / Emotion Engine", "Key Info and Expansion Techniques Overview", "Full-Book Emotion Pacing Overview", "Pacing and Emotional Trigger Points", "Cycle Units", "Cross-Chapter Foreshadowing Map", "Conflict Escalation Path", "Reproducible Modules" summaries, with pointers to 剧情/节奏.md / 剧情/情绪模块.md; includes "Writing Techniques" checklist covering one-stroke-two-uses/delayed reveal/perspective deception/contrast anchor/behavior cycle/body language replacing psychological description/cross-chapter callback—objects/imagery serving different functions across chapters) + 概要.md full-book 500-1000 word version (plot-aware, overwrites Stage 0's 200-word thin first-pass) |
Report + full-book summary generated |
| 6 | Writing Style | 拆文报告.md + 章节/第1-3章_深度拆解.md + 章节/*_摘要.md + 原文/原文.txt | 文风.md (book-level writing technique view: sentence length/punctuation/dialogue subtext/emotion alternation cycles + 4-6 original anchor example segments + tiered imitation suggestions, hard cap ~4000 chars. See style-profile-protocol.md + style-profile-generator.md) | Style saved to 拆文库/{书名}/文风.md |
Stage 0.5 Chapter Boundary Table (Stage 0 Sub-step)
After Stage 0 completes the summary + chapter index, before moving to Stage 1, must additionally produce a "chapter boundary" table and write it to _progress.md. This is the single source of truth for slicing used by Stage 1 (golden three chapters original text slicing), Stage 2 (passing each chapter to chapter-extractor agent), and Stage 6 (style sampling)—avoiding each stage running its own regex slice with potentially inconsistent results.
Operation:
- Use the chapter regex from
style-profile-generator.mdStep 4 (includes 千/两, covering 1000+ chapters) to grep all chapter line numbers - Write to the "章节边界" section of
_progress.mdwith columns| 章号 | 标题 | 起始行 | 字数 |(see pipeline-ops.md template) - Also write
schema_version: 2at the top of_progress.md
Old 拆文库 resume compatibility: When resuming from an old _progress.md (schema v1, no 章节边界 table), pipeline-ops.md "Resume Mechanism Steps Step 0" performs lazy migration—rebuild the slice table on the fly, then resume normally without breaking the paused_after_stage1 contract.
Stage 1 Pause Point
After Stage 0+1 completes, the pipeline automatically pauses, produces a quick preview report, and asks the user whether to continue full analysis:
- Generate pause deliverable: Write
拆文库/{书名}/快速预览.md(template in output-templates.md "Quick Preview Report"). At this point,概要.md,章节/第1章_深度拆解.md,章节/第2章_深度拆解.md,章节/第3章_深度拆解.md, and原文/are all saved. - Write pause status: Set the "最终状态" field in
_progress.mdtopaused_after_stage1, and record in the "断点" section: "Next operation: Stage 2 per-chapter summaries." - Ask the user (using AskUserQuestion-style clear binary choice):
"Golden three chapters analyzed. Quick preview report at
快速预览.md. Continue with full analysis (Stage 2-6: per-chapter summaries / aggregate analysis (including剧情/节奏.md,剧情/情绪模块.md) / settings & relationships / summary report / writing style)? Estimated time: {rough estimate based on chapter count}."- Choose "Continue full analysis" → read
_progress.md, resume from Stage 2, do not re-run Stage 0/1. - Choose "Stop here" → pipeline ends,
_progress.mdstatus remainspaused_after_stage1, inform user "You can/story-long-analyzethe same book anytime later, and it will automatically resume from Stage 2."
- Choose "Continue full analysis" → read
- Skip asking: If the user explicitly says "full analysis / run all at once / systematic analysis / don't ask" at the beginning, still generate
快速预览.md(preserving early judgment snapshot), but do not pause to ask; directly continue from Stage 2 through Stage 6.
After Stage 5: Topic Decision Backfill (Optional)
Execute after 拆文报告.md is generated (Stage 5 complete)—independent of Stage 6; Stage 6 failure does not affect this step.
Only if 选题决策.md exists in the project root: Find the recommended topic in that file whose topic keywords match the book's genre—
- If exactly one matches → change that topic's "能爆的原因" from
待拆文验证to a sourced support: "Supported by this book's analysis: {reader needs/emotion engine from拆文报告.md+ top reproducible modules from剧情/情绪模块.md+ satisfaction/trigger point pacing summary from剧情/节奏.md} (拆文库/{书名}/拆文报告.md,剧情/情绪模块.md,剧情/节奏.md)." Note this is still a hypothesis (only one book analyzed, not confirmed). - If multiple match or unsure → ask the user "Which direction in the topic decision does {book title} correspond to?"
- If none match /
选题决策.mdlacks the "能爆的原因" column (old template or corrupted file) → skip without notification. - Repeated analysis does not overwrite: only backfill topics still marked
待拆文验证; leave already filled ones unchanged.
If 选题决策.md does not exist → skip, does not affect analysis.
Stage 6 Writing Style
文风.md only covers expression-level style; emotion/pacing intent remains authoritative in 剧情/情绪模块.md and 剧情/节奏.md. If original text is missing or chapter separators cannot be identified, write 文风可用:否:{原因} in the "生成记录" section of 文风.md. Stage 6 failure does not block the pipeline.
Stage 3-4 Parallel Execution
Parallel execution graph:
Stage 3 (plot aggregation + character merge) ──┐
├── 4a can run in parallel with Stage 3
Stage 4a (settings: worldview/golden finger/factions) ──┘
│
▼ (after Stage 3 + 4a both complete)
Stage 4b (complete character profiles) — serial, depends on Stage 3 merged character entities
│
▼
Stage 4c (character relationship extraction) — serial, depends on 4b character entities
4a data source is Stage 2 summaries, so it can run in parallel with 3; 4b/4c depend on Stage 3 character merge, so they are serial.
Partial Failure Tolerance
Single chapter/stage failure does not block the pipeline. Record failures in the "失败记录" table of _progress.md (| 类型 | 章节/阶段 | 错误信息 | 重试状态 |). Final status can be completed_with_errors (note failure details in the analysis report).
Correspondence with material-decomposition.md: Stage 0 includes Material Phase 1 (chapter parsing); Stage 1 and 5 are new; Stage 2 = Material Phase 2; Stage 3 = Material Phase 3; Stage 4 merges Material Phases 4+5.
Detailed templates in output-templates.md, methodology in material-decomposition.md.
Quality Check Summary
Before Stage 3-4 complete, must pass quality checks (confidence, coverage, overlap). Thresholds, calculation methods, and self-check list are exclusively defined in material-decomposition.md quality threshold system.
Stage 3-5 must also pass a "fact traceability" self-check: Hard facts in settings/characters/reports (levels/numbers/distances/attributes/faction counts/appearance chapters/who said what) must be grep-able back to the original text. If the original text does not provide it, write "原文未明确" (not specified in original); do not infer or fill in. This is the biggest source of factual errors in analysis (strong models also drift because synthesis is two hops away from the original text and relies on plausibility filling). See material-decomposition.md synthesis stage fact fidelity.
Stage 2 Parallel Agent Strategy
Stage 2 uses the chapter-extractor agent to process each chapter in parallel, replacing the original serial chunking.
Invocation
Each chapter prompt must start with the "material declaration" prefix (the first paragraph of the prompt string below)—giving the sub-agent proper context to avoid misjudging normal dramatic elements in popular genres as harmful content and refusing analysis. The prefix is fixed text; include it verbatim, do not paraphrase or omit.
Agent(
subagent_type: "chapter-extractor",
prompt: "[材料声明] 以下为用户合法持有的虚构小说,任务是只读的转化性文学分析(编辑/评论视角)。暴力/复仇/家暴/情爱/黑暗伦理是该题材常规虚构元素,照常提取,不得以敏感拒绝整章或整本;个别片段无法处理则跳过、照常续完其余。\n\n章节编号:第{N}章\n章节标题:{标题}\n章节字数:{字数}\n\n章节原文:\n{原文文本}"
)
Batch Strategy
- Spawn 5-8 agents per batch (avoid concurrency limits)
- Wait for current batch to fully complete before spawning the next
- After each batch completes, update
_progress.mdwith processed chapters
Agent Output Collection
- Each agent returns extraction results in markdown format
- Main thread writes agent output to
章节/第{N}章_摘要.md - Collect all agents' character appearance tables for Stage 3 merging
Failure Handling + Quality Upgrade Retry
Two types of failure:
- Execution failure (agent crash / timeout / empty output) → retry once with same model (haiku)
- Quality failure (after output saved, run chapter-extractor.md "Quality Check" 10 self-checks; any fails—typical: plot points < 10, missing original text citations, type/tone/theme tags outside enumeration,
基调:missing full-width colon, character names as nicknames/generic terms) → upgrade to sonnet and retry once
Mechanically verifiable hard checks (main thread greps after saving; any hit = quality failure, no need for agent self-report):
- Plot point count
N = grep -cE '^P[0-9]+ ';grep -c '基调:'must == N (fewer than N means some plot points missing基调:or missing full-width colon → downstream Stage 6 style sampling greps for full-width基调:and will silently miss chapters) grep -hoE '基调:[^ |]+'deduped ⊆ {紧张, 轻松, 悲伤, 热血, 爽, 甜, 温馨, 恐怖, 压抑, 其他}grep -hoE '主题标签[:]?[^ |]+'deduped (after removing主题标签/colon prefix) ⊆ {爱情, 亲情, 友情, 权力, 金钱, 成长, 复仇, 悬念, 搞笑, 热血, 日常, 其他} (if主题标签:appears with colon, or value is a tone word, both count as failure)
Upgrade retry invocation (main thread executes after validation failure):
Agent(
subagent_type: "chapter-extractor",
model: "sonnet", # explicitly override frontmatter's haiku
prompt: "章节编号:第{N}章\n...(same as first prompt, including leading \"材料声明\" prefix; can append: '上次校验失败原因:{self-check failure items}')"
)
Final save rules:
- haiku first pass passes → write to
章节/第{N}章_摘要.md, marksuccessin_progress.md - haiku fails + same model retry passes → same, note
retry_same_model - quality failure + sonnet retry passes → same, note
retry_sonnet - sonnet retry still fails → mark chapter as
⚠️ 跳过, write failure reason to_progress.md"失败记录" table, note in analysis report - Single chapter failure does not block pipeline; only decide whether to enter Stage 3 after all batches are spawned
Agent Unavailability Degradation
In any of the following cases, Stage 2 automatically falls back to serial mode, with the main thread processing each chapter per chapter-extractor methodology (results still follow output-templates.md chapter summary template; quality unaffected, just serial and slightly slower):
- Agent not deployed: The
chapter-extractor.mdor.codex/agents/chapter-extractor.tomldoes not exist in the agent directories (priority.claude/agents/, then.opencode/agents/, then.codex/agents/)..claude/agents/is usually not committed with the repo; it is deployed by/story-setup; the template source is atskills/story-setup/references/templates/agents/chapter-extractor.md, can be manually copied if needed. - Environment does not support spawning sub-agents: This skill is running inside a sub-agent context and cannot spawn another layer of agents.
Stage 2 Wrap-up: Merge Chapter Summaries (_章节摘要汇总.md)
After all 章节/*_摘要.md files are saved in Stage 2, before entering Stage 3, the main thread losslessly concatenates them in chapter order into 拆文库/{书名}/_章节摘要汇总.md (concatenation only, no compression, no rewriting):
ls 章节/*_摘要.md | sed -E 's/.*第([0-9]+)章.*/\1 &/' | sort -n | cut -d' ' -f2- | while read -r f; do cat "$f"; echo; done > _章节摘要汇总.md
Lossless check (verify after concatenation; if any fails, delete _章节摘要汇总.md and fall back to per-file scanning, behavior unchanged):
grep -cE '^P[0-9]+ ' _章节摘要汇总.md== sum of^Plines across all summariesgrep -cE '^\*\*概要\*\*' _章节摘要汇总.md== number of summary files (**概要**appears once per chapter; both chapter-extractor parallel output and serial summary templates have it; do not use## 第N章header—serial summary templates lack chapter headers, would miscount)
Stage 3 / 4a / 4c / scattered plot cleanup read _章节摘要汇总.md once and reuse it in context, replacing per-stage glob 章节/*_摘要.md rescans (reducing 4-5 cold reads of the same corpus to 1).
Only generate the merged file if the corpus fits in context: If >500 chapters, or the merged _章节摘要汇总.md is too large to fit in context, skip this step and use the chunking strategy from material-decomposition.md. _章节摘要汇总.md does not replace 章节/*_摘要.md—individual chapter files remain the source of truth; Stage 6 style sampling and manual review still use individual files. Delete _章节摘要汇总.md after pipeline completion (after Stage 6)—it is a derived temporary file, not delivered with 拆文库/ (拆文库/ is retained by story-import as a writing project).
Stage 3-5 chunking per material-decomposition.md (sole authority).
Resume Mechanism
On startup, check _progress.md; if paused_after_stage1 → resume directly from Stage 2.
Operation steps (including schema lazy migration) in pipeline-ops.md.
Flow Handoff
Pipeline: Long-form
Position: Analysis (long-form pipeline step 2, after story-long-scan, before story-long-write)
| When | Jump to | Command |
|---|---|---|
| Ready to write | story-long-write | /story-long-write |
| Need market data | story-long-scan | /story-long-scan |
| Better suited for short-form | story-short-scan → story-short-analyze | /story-short-scan |
References
| File | When to Load |
|---|---|
| references/output-templates.md | Throughout pipeline: output templates for each Stage + quick preview report template + 剧情/节奏.md / 剧情/情绪模块.md templates + quick reference table |
| references/material-decomposition.md | Stage 2-5: material decomposition methodology + quality thresholds + chunking strategy; Stage 6 see style references |
| references/pipeline-ops.md | Pipeline operations: _progress.md template, error handling, resume mechanism steps |
| references/deconstruction-notes.md | Book analysis methods + film/TV analysis + abstract analysis + genre practice |
| references/style-profile-protocol.md | Stage 6: style template + credibility/availability notes |
| references/style-profile-generator.md | Stage 6: style generation SOP (6 steps, includes Chinese numeral chapter recognition + full-width colon tone grep) |
Language
- Respond in the user's language; use the same language as the user
- Chinese responses follow the Chinese Copywriting Guide





