novel-outline
Input a novel + target parameters, output a five-component short drama adaptation outline kit. Four components are written by the model, one is calculated by the script (the asset list is automatically aggregated from episode data).
= the directory where this file is located. The script
{baseDir}/scripts/novel-outline.mjs
has zero dependencies and runs directly with
.
Boundaries (what it does not do): Does not write script dialogue, does not create storyboards, does not generate image/TTS prompts. Synopses are narrative; any quoted dialogue is out of scope —
will block it. If you want to extract character settings (portraits/character image prompts/concept art) from a novel, that's the job of
.
Step 0 — Gather Parameters ⛔ No Work Starts Without Them
Ask all at once, don't interrogate one by one. Two mandatory items + two with default values for confirmation:
| Parameter | Handling |
|---|
| Total episodes × per-episode duration | Mandatory, no reasonable default |
| Genre | Mandatory, determines highlight types; if guessed wrong, the entire outline is useless |
| Adaptation scope | Default: core extraction (faithful / core extraction / shell borrowing), just inform the user |
| Existing preferences | Default: none (which characters or scenes to preserve) |
Different platforms have different thresholds, which can be overridden with
(defaults: protagonist group ≤ 5, important supporting roles ≤ 10, functional roles ≤ 10, highlight interval ≤ 3 episodes).
No need to configure the main scene limit, it is calculated automatically based on episode count: 4 + ⌈episodes/10⌉, clamped between 5–15 (60 episodes → 10). This is the standard for AI short dramas — since scenes are generated with no set construction costs, limits are relaxed for better viewability; only explicitly setting
will override this.
For short series (20–30 episodes), it is recommended to tighten character tier thresholds; the default values are set for series with 60+ episodes.
The character list is extracted from the original text — the outline is upstream of character settings. The tiers, character arcs, and sources defined in the
block are directly used by the downstream
as the character list, no need to re-judge who is important.
The exception is if the user already has
(from previously running
separately): use that as character source material, with characters, aliases, and relationships ready-made, no need to re-extract from the original text. Tiers are reverse-mapped by
: protagonist/major →
, supporting →
, minor →
.
Step 1 — Locate Input
Material priority, hardcoded:
- User-specified intensive reading chapters
- Chapter table of contents + synopsis
- Full-text volume summaries (Step 2)
Do not fabricate content based solely on the book title — all judgments must be based on the provided text. Implementation method: key trade-offs in
must be accompanied by
(verbatim excerpts from the original text).
If the user pastes the full text directly, first save it as a .txt file. Output directory: use the user-specified one if provided, otherwise use the directory at the same level as the original book file.
Step 2 — Volume Summaries (Only Needed for Long Texts)
This step is scaffolding, not a deliverable — volume summaries are for compressing content for models that haven't read the original text. Skip directly to Step 3 in two cases:
- Short works that fit in a single volume
- The current session has already read the full original text — no need to compress again, and no need to supplement later
For long works that haven't been read:
bash
node {baseDir}/scripts/novel-outline.mjs chunk <book.txt> <workdir>
Split into volumes by chapter titles (default 15 chapters per volume, adjustable with
). If chapters cannot be identified, split by word count. Prints
; if
, explicitly inform the user that the end was not scanned — don't keep quiet about it.
One sub-agent per volume (if concurrency is supported,
send all in the same message): read
{baseDir}/references/volume-pass.md
, read
, write the volume summary to
<workdir>/summary-NN.json
, and only reply with "done NN".
Step 3 — Quick Skeleton → User Approval ⛔
Read
{baseDir}/references/outline-pass.md
and
{baseDir}/references/schema.md
, and follow the instructions. Produce four skeleton components (adaptation / characters / scenes / beats), and write them to
.
bash
node {baseDir}/scripts/novel-outline.mjs validate <workdir>/outline.json --stage beats
After passing the beats stage, present three things for the user to approve: which plot lines were cut, which characters were merged, and which episode the major climax falls in. Do not proceed to Step 4 without approval — if the quick version is wrong, you only lose one round of skeleton work; if you find the direction is wrong after writing all episodes, everything is wasted.
Step 4 — Detailed Skeleton
Incorporate user feedback to revise the skeleton, then run
again. If the user has no feedback, proceed directly to Step 5.
Step 5 — Episode Synopses (In Batches)
≤ 10 episodes per batch, run concurrently if possible. Each sub-agent receives: the four approved skeleton components, the episode range they are responsible for, and the highlights within that range. They read
{baseDir}/references/episode-pass.md
, follow the instructions to write, and output to
.
When merging, sort by episode number and assemble into the
field of outline.json.
Step 6 — Validation ⛔ Cannot Be Skipped
bash
node {baseDir}/scripts/novel-outline.mjs validate <输出目录>/<书名>-outline.json
All 14 quality gates are implemented in code, not a checklist for manual review: protagonist group 1–5 people, important supporting roles ≤ 10, functional roles ≤ 10, main scenes do not exceed the limit (dynamic based on episode count, 60 episodes → 10), narrative props ≤ 8 items, one-off scenes have workaround plans, highlight interval ≤ 3 episodes with no gaps, Episode 1 has a hook, major climax is not pushed to the final episode, each episode has all three columns complete, three-character shared scenes have breakdowns, generation difficulties are added to warnings, references are complete with no unused characters, no non-functional scenes, no zero-appearance props, and narrative text has no dialogue.
Fix violations one by one, re-run after fixes, until all pass.
Step 7 — Output and Reporting
bash
cd <输出目录>
node {baseDir}/scripts/novel-outline.mjs render <书名>-outline.json --md > <书名>-outline.md
node {baseDir}/scripts/novel-outline.mjs render <书名>-outline.json --html > outline-report.html
The report interface is in Chinese by default; if the user wants an English interface, add
(or add a
field at the top level of outline.json,
takes priority). Only interface text is translated; data content (highlight types, synopses, quality gate text) is output as-is.
The report includes built-in features: KPI bands, key decisions (the three approval items, with automatically calculated major climax list and role position statistics), highlight timeline (gaps marked on the timeline, turns red when exceeding the threshold), per-episode scheduling matrix, scene overview cards, asset volume conversion, quality gates (✓/✗ baked into the page, an issue banner pops up for failed gates), and an export JSON button (the downloaded file is the exact original outline.json).
Summarize the report in one sentence: number of episodes, number of characters and scenes, highlight distribution, report path; explicitly mention if truncated or if any gates failed.
Final output structure:
<输出目录>/
├── <书名>-outline.json
├── <书名>-outline.md
└── outline-report.html ← 双击就能开
Checkup Mode
If the user pastes an existing outline and only wants a diagnosis: convert it to outline.json (ask the user for missing fields or mark them as missing), then:
bash
node {baseDir}/scripts/novel-outline.mjs checkup <outline.json> # 终端 ✓/✗
node {baseDir}/scripts/novel-outline.mjs render <outline.json> --html > outline-report.html
The quality gate panel is the diagnosis report. Failed gates do not prevent rendering — the point is to display the issues clearly.
Linked Updates
When the user modifies upstream content, run
once; errors will point out exactly where downstream is broken: which episodes still reference deleted character IDs after merging characters, which episodes become non-functional after cutting scenes, where gaps appear after moving highlights.
Do not rely on memory to prompt linked updates, rely on the validator.
Boundaries
- Single-run limit: 60 volumes (15 chapters per volume, ~900 chapters total). If exceeded, explicitly report , no silent truncation
- Thresholds are parameters, not hard rules: override with for different platforms, do not modify the code
- The report interface has built-in Chinese and English support (, default Chinese, or follows the field in outline.json): interface text and quality gate labels are translated, while data content (highlight types, synopses, character names) and gate failure details remain in the original language
- The fifth component of the kit (asset list) is always calculated; if written manually by the model, it will definitely be incomplete
Self-Test
bash
node {baseDir}/scripts/selftest.mjs
249 assertions, no model calls, no quota usage. Each of the 14 quality gates has failure test cases — proving it actually blocks invalid content. Run this first after modifying the script.
Built-in Example
{baseDir}/examples/渡口-outline.json
: A mini outline adapted from the short story
Dukou (Ferry Crossing) — the built-in example from
— into 6 episodes × 2 minutes, with 4 characters, 3 scenes, and 4 highlights, passing all quality gates. It serves as a quality benchmark and a self-test fixture.