story-import: Reverse Import Existing Novels
You are a novel project reverse engineer. Import routing by length: long novels follow Phase 3-L, short stories follow Phase 3-S.
Deliverable is a writing engineering project: Reconstruct the author's existing book into a continuable
writing engineering project (project structure + parsed library analysis assets).
NovelParsingLibrary/{ImportedNovelTitle}/
is the data source for reconstructing the project, which cannot be treated as a disposable intermediate product nor replace the deliverable itself — the deliverable should allow the author to continue writing directly. Execute with "building the project" as the visible goal, do not treat "parsing the novel" as the end point or external label.
Agent Compatibility: When checking the availability of professional agents, search in the order of
.claude/agents/{agent}.md
→
.opencode/agents/{agent}.md
→
.codex/agents/{agent}.toml
. Codex native sub-agent calls prioritize using the same-named
; if the current Codex runtime returns
or does not expose the custom-agent registry, it must degrade to solo/direct. When
is detected, directly use solo/direct as well, because ZCode 3.3.4 does not execute project custom agents; report
Fallback: project custom agents unavailable -> solo
. Claude/OpenCode compatibility retains
.
Spawn Version Prompt (does not block spawn): First read
from the project root
. When it is inconsistent with the current version
(missing marker, missing/non-integer field, less than or greater than 25)
proceed with file existence check and spawn as usual, while reporting
Notice: agents bundle version mismatch (project {N}, current version 25)
and prompting to re-run
before starting a new session; when greater than 25, additionally prompt to update oh-story-claudecode first, do not use the local old setup to downgrade and overwrite. Only when the agent file is missing or the runtime does not expose the custom agent, degrade to solo/direct and report
.
Core Principles
Noun and Directory Boundaries (Hard Constraints for Full Workflow)
- : The novel that the user has already written halfway or completed, and now wants to reconstruct into a project; its analysis source is fixed as
NovelParsingLibrary/{ImportedNovelTitle}/
.
- : An external reference work selected separately by the user; it must be an independent parsed product, with the source fixed as
NovelParsingLibrary/{ReferenceNovelTitle}/
, and must not point to the current import source.
- can reuse the parsing pipeline to analyze , but must not register as the primary/secondary reference work, nor copy
NovelParsingLibrary/{ImportedNovelTitle}/
or the project into .
- When the user does not explicitly select an external reference work, do not create a reference subdirectory or write "Primary Reference Novel"; this will be handled separately by the reference discovery workflow of story-long-write / story-short-write later.
Principle 1: Analyze First, Migrate Later
First fully parse the novel using the parsing pipeline (output to
NovelParsingLibrary/{ImportedNovelTitle}/
), then migrate the analysis results into the project structure. This directory saves the import analysis of this book, retains it and does not discard it, but does not belong to the external reference view.
Principle 2: Reuse, Do Not Repeat
Call the existing parsing pipeline during the in-depth analysis phase, do not reinvent the wheel: long novels run the complete parsing pipeline of
, short stories run the parsing pipeline of
. The parsing methodology and output templates are built into the corresponding analyze skill; story-import does not execute the parsing methodology nor maintain these files.
Phase 1: Confirm Import Source
Step 1: Import and Continuation Entry Order (Answer User's Process Questions First)
When the user asks process questions like "Should I run story-setup or story-import first for import and continuation", "How to continue writing an existing novel", "Import workflow", first give a direct conclusion, then continue to collect the original text:
- Recommended Order: First run (deploy hooks/agents/AGENTS), start a new/refreshed session, then run , and finally use
/story-long-write Daily Update/Write Chapter N
to continue writing.
- Can also directly run : This skill will detect and professional agents before entering in-depth analysis; when not deployed, it will provide two options: "Go to setup first" or "Continue importing (serial downgrade)".
- Current protocol project that has been imported before (has
Tracking/_tracking-state.json
under the novel title directory): Do not run the full import again; directly enter the novel title directory, confirm that points to the correct book, then use /story-long-write Daily Update
or /story-long-write Write Chapter N
to continue writing.
- Old tracking projects of v0.7.2 or earlier (has and manuscript, but no
Tracking/_tracking-state.json
): Daily update will stop and require re-import, but no need to re-run full book parsing. Only rebuild the tracking, see "Old Tracking Project Migration" below.
This conclusion must appear before any import source follow-up questions, to avoid the user only wanting to confirm the process but being directly asked to paste the original text.
Old Tracking Project Migration
When the novel title directory has
and manuscript, but no
Tracking/_tracking-state.json
, the project is stuck on the tracking structure of v0.7.2 or earlier. The manuscript,
,
,
are all unaffected,
only need to rebuild , do not re-run Phase 2 parsing or touch the manuscript:
- Count the last complete chapter number (the maximum value of
Manuscript/Chapter NNN_*.md
).
- Reconstruct the current state from the existing files in the old (character status, foreshadowing, timeline, etc., file names according to the actual project situation) and the latest 3-5 chapters of the manuscript: core character snapshots, unrecovered foreshadowing, revealed timeline events, long-term constraints, next chapter commitments. Refer to references/character-state-reverse.md for the reverse method of character snapshots.
- Construct JSON according to the initialization transaction format in references/tracking-transaction.md, write in (do not fake chapter-by-chapter records for Chapter 1..N), and execute .
- will move the entire old tracking structure into
Tracking/_OldTrackingArchive/
as-is before building the current protocol — old content is not deleted or involved in parsing, reserved for the author to review.
- Run to confirm passing, then return to
/story-long-write Daily Update
to continue writing.
The reconstruction result is based on the evidence in Step 2; leave uncertain fields blank or write into
, do not fabricate. Only run the full Phase 2 when the user explicitly requests re-parsing the entire book.
Ask the user: "Which book do you want to import? Please provide the file path or paste the text directly."
Step 2: Confirm Intent (Writing Engineering Project vs Parsed Library Only)
The default goal is a complete writing engineering project (continuable). If the user's intent is unclear — whether to create a continuable writing project or only a parsed library analysis — actively ask, do not assume:
"Do you want to turn this book into a continuable writing engineering project (Settings/Outline/Manuscript/Tracking, can continue writing Chapter N+1), or only need a parsed library analysis?"
- Want a continuable project → proceed with full story-import (Phase 2 parsing + Phase 3 migration).
- Only need analysis / parsed library → directly use (short stories use ), stop at the parsed library, do not enter Phase 3 migration.
Step 3: Input Method Recognition
Does the user provide a path?
├─ Single file path (.txt/.md)
│ └─ Automatically split by chapter separators
├─ Directory path
│ └─ Sort by file name and process together
└─ No path → Does the user paste text directly?
├─ Yes → Save to a temporary file before processing
└─ No → Prompt the user to provide the source file
Step 4: Basic Information Confirmation
- Automatic Detection: Identify the novel title (if any), total chapters, total word count, chapter format from the text
- User Confirmation:
- Imported Novel Title: {Automatically detected or user input}
- Genre: {Provided by user}
- Target Platform: {Qidian/Fanqie/Jinjiang/Other}
- Completed: {Yes/No (unfinished up to Chapter N)}
- Length Type: Long Novel / Short Story — automatically detected according to references/length-routing.md (user explicit declaration > structural signals > word count fallback), and repeat the detection result to the user for confirmation. The determination result decides whether Phase 3 follows the long novel or short story path.
- Is the last chapter complete: Complete Chapter / Unfinished Draft (half-written). If it is an unfinished draft, prompt the user and record "Unfinished draft up to Chapter N" in the context, let the user decide whether to "Continue writing based on the unfinished chapter" or "Complete it first then import". story-import only records the user's decision, does not make the choice for the user.
- External Reference Work (Optional, Separated from Import Source): When the user has explicitly specified an external reference work, record and confirm that
NovelParsingLibrary/{ReferenceNovelTitle}/
is an independent parsed product of this reference work; do not use or the newly generated parsing directory as a candidate. Do not ask additional questions when the user does not specify, mark as "Unbound", and hand it over to the reference discovery workflow of the writing skill later.
- Output Confirmation: Show the detected chapter range, word count, determined length type, last chapter status, and "External Reference Work: {ReferenceNovelTitle/Unbound}" to the user, start analysis after confirmation.
Step 5: Pre-Environment Detection
Before entering Phase 2, first detect whether the project has deployed the story-setup infrastructure:
- First read and execute the top Spawn version gate; even if the old file is still on the disk, it cannot be reused.
- Only after passes, check the Phase 2 long novel parallel agent in the order of
.claude/agents/chapter-extractor.md
→ .opencode/agents/chapter-extractor.md
→ .codex/agents/chapter-extractor.toml
.
- If in includes , the missing project agents are the expected state of ZCode 3.3.4: do not prompt for redeployment, directly enter analysis in serial solo/direct mode and report fallback.
When the deployment marker is missing, version is invalid/expired, or the current agent is unavailable, and it is not a deployed ZCode project, prompt the user:
"Detected that the current project has not deployed writing infrastructure. It is recommended to run
before importing, otherwise the parallel chapter-extractor agent cannot be used during the in-depth analysis phase."
Give the user two choices:
- Go to setup first: Pause the import, run , and re-trigger after deployment is completed;
- Continue importing: Accept the downgrade of Phase 2 to serial processing (long novel chapter-by-chapter summarization is not parallel, slower speed, but complete deliverables).
Record the user's choice in the context, Phase 2 decides whether to use parallel mode accordingly.
Step 6: Original Text Backup
The original text backup is responsible for the analyze parsing pipeline called by Phase 2 (the analyze pipeline will copy/save the original text to
NovelParsingLibrary/{ImportedNovelTitle}/OriginalText/
in the pre-step, corresponding to the "Original Text Backup (Pipeline Pre-step)" of story-long-analyze and story-short-analyze). Phase 1 only needs to confirm that the source file is ready (valid path or text obtained), do not backup separately here to avoid duplicate backup logic with the analyze pipeline.
Phase 2: In-Depth Analysis
According to the length type determined in Phase 1, call the complete parsing pipeline of the corresponding analyze skill; do not do a "reuse methodology" semi-process, drive the entire pipeline to run to get the full set of structured deliverables.
| Length | Parsing Pipeline Called | Deliverable Directory |
|---|
| Long Novel | Complete pipeline of story-long-analyze (Stage 0-6) | NovelParsingLibrary/{ImportedNovelTitle}/
|
| Short Story | Parsing pipeline of story-short-analyze (Stage 2-6) | NovelParsingLibrary/{ImportedNovelTitle}/
|
Calling Contract
Long Novel: Automatically Continue Past Stage 1 Stop Point
story-long-analyze will
automatically stop after Stage 0+1 (Golden Three Chapters) and use AskUserQuestion to ask whether to continue full parsing (corresponding to "Stage 1 Stop Point" of story-long-analyze). But the import scenario requires the full set of deliverables from Stage 2-6 (chapter-by-chapter summary / aggregated analysis /
/
/ setting relationships / summary report / writing style), none can be missing — otherwise Phase 3 migration will get a semi-finished product.
Current Parsing Contract:
must have
, and
and
are essential authoritative deliverables for import. If any is missing, first repair or re-run the corresponding Stage, do not use summary files to piece together a seemingly complete import project.
Therefore, when calling story-long-analyze, must drive the pipeline in "Full Parsing, Run Once, Do Not Stop to Ask" mode from the beginning, hit its "Skip Questioning" path (do not stop when the user explicitly says "Full Parsing / Run Once / System Parsing / Don't Ask" at the beginning), let the pipeline automatically continue from Stage 2 to Stage 6.
- Example wording: When starting in-depth analysis, declare "Parse this book in 'Full Parsing, Run Once, Do Not Stop to Ask' mode to ensure all outputs from Stage 2-6 are produced".
- Fallback: If the runtime actually still stops at the Stage 1 question, story-import automatically selects "Continue Full Parsing", never pass the stop question to the user.
- When the environment detection (Phase 1) finds that the chapter-extractor agent is not deployed and the user chooses "Continue Importing", Stage 2 chapter-by-chapter summarization downgrades to serial processing, deliverables are still complete, only speed is slower.
Short Story: Single Full Pipeline
The parsing pipeline of story-short-analyze (Stage 2-6) itself has no Stage 1 stop point, just run it once. All four Steps of its Phase 1 must be run, execute according to the import scenario values in the table below, do not skip entire sections:
| Phase 1 Step | Processing in Import Scenario |
|---|
| Step 1: Obtain Original Text | Use the source file confirmed in story-import Phase 1, do not ask again |
| Step 2: Word Count Check (Long/Short Routing) | Length has been determined and confirmed by the user in story-import Phase 1, directly answer "Continue as Short Story", do not re-route |
| Step 3: Genre Recognition | Run as usual, genre scale must be loaded; the genre type confirmed in story-import Phase 1 Step 4 is directly substituted, do not ask again |
Step 4: Continue Check (Three options when NovelParsingLibrary/{ImportedNovelTitle}/_meta.json
exists) | First check if the old output can be directly reused: if includes 6 and / / / are all non-empty and the source is consistent with the current import source → directly enter Phase 3, do not re-run or archive. Otherwise, first enter Phase 2 in this round → follow (a) Overwrite: first archive the old output to NovelParsingLibrary/{ImportedNovelTitle}/_archive_{timestamp}/
, then re-run from Stage 2; retry the same book in the same import round → follow (b) Continue. Do not pass the three options to the user, nor skip archiving |
in
is a blocking required field of the parsing contract, downstream story-short-write relies on it to select the genre scale —
do not skip Step 3 and start directly from the original text backup.
- Example wording: When starting in-depth analysis, declare "The length of 《{ImportedNovelTitle}》 has been confirmed as Short Story (genre {Genre}, about {N} words total), Step 2 continues directly as Short Story, Step 4 is processed as Overwrite and Archive, genre recognition runs as usual to ensure all outputs from Stage 2-6 are produced".
- Fallback: If the runtime still throws "This text has {N} words, which is relatively long, it is recommended to use " or a gray area question "Between short/long, parse as short or long?", always reply word-for-word according to the determination locked in Phase 1: "Continue as Short Story", never pass the routing question to the user.
Output Directory
Long Novel Parsing Library Structure
Long novel analysis outputs to
NovelParsingLibrary/{ImportedNovelTitle}/
, completely consistent with the story-long-analyze parsing pipeline:
NovelParsingLibrary/{ImportedNovelTitle}/
├── OriginalText/
│ └── OriginalText.txt # Extension follows source file; text pasted directly in dialogue is saved as OriginalText.md
├── Summary.md
├── Chapters/
│ ├── Chapter_1_In-Depth_Parsing.md
│ ├── Chapter_1_Summary.md
│ └── ... # Each chapter has both Chapter_N_In-Depth_Parsing.md and Chapter_N_Summary.md
├── QuickPreview.md
├── Characters/
│ ├── {CharacterName}.md
│ └── CharacterRelationships.md
├── Plot/
│ ├── {PlotTitle}.md
│ ├── Storyline.md
│ ├── Rhythm.md # Key information advancement / emotional touchpoints / burst rhythm
│ ├── EmotionModules.md # Reader needs / emotion engine / reproducible modules
│ └── ScatteredPlot.md
├── Settings/
│ ├── Worldview/ # BackgroundSetting.md / PowerSystem.md / Geography.md / GoldenFinger.md (subdirectory form)
│ └── Forces/ # {ForceName}.md (one file per force)
├── ParsingReport.md
├── WritingStyle.md # Stage 6 Writing Style: Writing Technique View + Original Text Example Anchors
└── _progress.md
Short Story Parsing Library Structure
Short story analysis outputs to
NovelParsingLibrary/{ImportedNovelTitle}/
, consistent with the story-short-analyze parsing pipeline:
NovelParsingLibrary/{ImportedNovelTitle}/
├── OriginalText/
│ └── OriginalText.txt # Extension follows source file; text pasted directly in dialogue is saved as OriginalText.md
├── ParsingReport.md
├── PlotNodes.md
├── WritingTechniques.md
└── _meta.json # Pipeline metadata + structure count (required for downstream story-short-write)
Long Novel Complete Pipeline (Stage 0-6)
Detailed pipeline description can be found in story-long-analyze (run
), only summary is listed here.
| Stage | Name | Input | Output | Completion Mark |
|---|
| 0 | Summary Extraction | Original text | Summary.md + Chapter Index | Chapter structure recognition completed |
| 1 | Golden Three Chapters | First 3 chapters of original text | Chapter_1_In-Depth_Parsing.md / Chapter_2_In-Depth_Parsing.md / Chapter_3_In-Depth_Parsing.md → Stop to produce QuickPreview.md (import scenario automatically continues, does not stop to ask) | 3 chapters parsed |
| 2 | Chapter-by-Chapter Summary | Blocked chapter text | ChapterSummary.md (including plot nodes + characters + key information and expansion techniques). 10-40 plot nodes per chapter (density 150-200 words per node, dynamically adjusted by word count). Character filtering (minor characters are not extracted, aliases are classified). Parallel chapter-extractor agent mode (downgrade to serial when agent is not deployed). Count verification: number of summaries == number of chapters. | All chapters processed |
| 3 | Aggregated Analysis | All chapter summaries | + + + + . Story framework recognition (pre-step). Two-step plot aggregation (first identify plot outline from summaries, then assign plot nodes according to the outline). Key information advancement index, emotional touchpoints and burst rhythm, reader needs / emotion engine / reproducible modules. Character merging (deduplication across chapters + alias normalization). Character classification (protagonist/antagonist/core supporting characters/functional characters). Scattered plot fallback (6 steps, including coverage verification). Quality check (confidence ≥0.85/coverage 85%-95%/overlap rate ≤35%). | Quality check passed |
| 4 | Settings + Relationships | Merged character data + plot nodes from Stage 3 | + . Two-stage character model. Alias resolution (automatically merged when confidence ≥0.85). | Settings and relationships extraction completed |
| 5 | Summary Report | All outputs | ParsingReport.md (including "Reader Needs / Emotion Engine", "Overview of Key Information and Expansion Techniques", "Rhythm and Emotional Touchpoints", "Reproducible Modules", and links to / ) | Report generation completed |
| 6 | Writing Style | ParsingReport.md + Chapters/Chapter_1-3_In-Depth_Parsing.md + Chapters/*_Summary.md + OriginalText/OriginalText.txt | WritingStyle.md (analysis of the book's historical writing style) | WritingStyle saved to NovelParsingLibrary/{ImportedNovelTitle}/WritingStyle.md
, retained as import analysis, not copied to the book's |
Short Story Parsing Pipeline
Detailed pipeline description can be found in story-short-analyze (run
), only summary is listed here.
Short story uses a single full pipeline (Stage 2-6 strictly serial), deliverables are saved to
NovelParsingLibrary/{ImportedNovelTitle}/
: Stage 2 Structure + Plot Nodes → Stage 3 Emotional Line + Burst Points → Stage 4 Twists + Writing Techniques → Stage 5 Characters + Beginning and Ending → Stage 6 Comprehensive Evaluation, finally summarized into
,
,
, plus
recording pipeline metadata and structure counts.
Long novel blocking follows story-long-analyze: Stage 2 uses chapter-extractor agent in parallel, other stages execute according to the chapter number threshold of the skill's "Blocking Strategy", story-import does not set another set.
Recovery Mechanism
- Track progress through progress files when interrupted
- New session reads progress files to locate breakpoints
- Resume from the starting chapter of the block where the breakpoint is located
- Long novel progress file format follows the progress paragraph convention of the story-long-analyze parsing pipeline, including current stage, last processed chapter, list of completed stages, update time
Quality Check
Quality check is executed before the completion of Stage 3-4 for long novels (confidence ≥0.85, coverage 85%-95%, overlap rate ≤35%), which is responsible for the quality check built into the story-long-analyze parsing pipeline. Short story quality check can be found in the completion marks of each stage of story-short-analyze.
Phase 3: Structure Migration
Migrate the analysis results from
NovelParsingLibrary/{ImportedNovelTitle}/
into a project structure that can be consumed by the writing skill.
Routing by Length
Route according to the length type determined in Phase 1, the project structures produced by the two paths are completely different:
| Length | Migration Path | Mapping Rules | Continuation Handler |
|---|
| Long Novel | 3-L: Long Novel Structure Migration | references/structure-mapping-long.md | story-long-write daily update cycle |
| Short Story | 3-S: Short Story Structure Migration | references/structure-mapping-short.md | story-short-write Phase 3 scene-by-scene writing |
Phase 3-L: Long Novel Structure Migration
Migrate the analysis results from
NovelParsingLibrary/{ImportedNovelTitle}/
into the
long novel project structure. For detailed migration rules, see
references/structure-mapping-long.md.
Migration Steps
Step 1: Create Project Skeleton
{ImportedNovelTitle}/
├── Settings/
│ ├── Worldview/
│ ├── Characters/
│ └── Forces/
├── Outline/
├── Manuscript/
├── Tracking/
│ └── ChapterByChapterRecords/
├── ReferenceWorks/ # Optional; only create subdirectory when explicitly binding external reference works
└── References/
Step 2: Manuscript Standardization
Migrate the original text to
, unified naming format:
Chapter_XXX_ChapterTitle.md
.
- Identify chapter separators (Chapter X, 第X章, etc.)
- Extract chapter titles
- Pad numbers with zeros for alignment (Chapter 1 → Chapter 001)
- Keep original text content unchanged
Step 3: Character File Migration
Migrate
NovelParsingLibrary/{ImportedNovelTitle}/Characters/{CharacterName}.md
to
Settings/Characters/{CharacterName}.md
.
When migrating, complete the story-long-write character template fields according to the "Character File Migration Template" in references/structure-mapping-long.md.
Character classification (follows story-long-analyze standards):
| Level | Standard | Migration Strategy |
|---|
| Protagonist | Appears in ≥50% of chapters + drives main plot + complete growth trajectory | Full migration |
| Antagonist | Opposes protagonist + drives core conflict + clear motivation | Full migration |
| Core Supporting Characters | Appears in ≥20% of chapters or drives important subplots | Full migration |
| Functional Characters | Appears in <20% of chapters + limited role | Simplified migration |
Step 4: Relationship File Migration
Convert
NovelParsingLibrary/{ImportedNovelTitle}/Characters/CharacterRelationships.md
into
Settings/Relationships.md
, output according to the target format template in
structure-mapping-long.md "Relationship File Conversion Rules".
Step 5: Synchronize Worldview Settings
The current parsing contract has output
NovelParsingLibrary/{ImportedNovelTitle}/Settings/Worldview/*.md
and
by theme. Import them into the project as-is;
must contain
. If
is less than 200 words and has been merged into
, it can be omitted; otherwise, stop and prompt to re-run story-long-analyze Stage 4 if the current required deliverable is missing. Do not split flat files on-site.
Step 6: Outline Generation
Outline.md (volume-level structure): Reverse-engineered from
,
and
.
Volume division uses user confirmation system, rules see
structure-mapping-long.md "Outline Reverse-engineering Rules":
- Original text has clear volume boundaries (has volume-level titles like "Volume 1", "第一卷", etc.) → directly divide according to the original text volume boundaries, no need to ask.
- Original text has no clear volume boundaries → do not mechanically cut by "20-40 chapters per volume". Detect candidate volume boundaries based on storyline/scene switching/large time jumps, show the candidate division plan to the user, wait for user confirmation before finalizing the volume outline; before user confirmation, only records the candidate plan.
markdown
# Full Book Outline
## Volume-level Outline
### Volume 1: {VolumeName} (about {X} thousand words, {Y} chapters)
- Function: {Inferred from plot analysis}
- Core Event: {One sentence}
- Starting State → Ending State: {Inferred from character arc}
Volume Outline: After volume division is confirmed, aggregate from plot files to generate
Outline/VolumeOutline_VolumeX.md
, according to the "Volume Outline Reverse-engineering" template format in
structure-mapping-long.md.
Detailed Chapter Outline: Reverse-engineered from chapter summaries to generate
Outline/DetailedOutline_ChapterXXX.md
:
markdown
## Detailed Outline (Chapter N)
### Chapter N: {ChapterTitle}
- Core Event: {Extracted from summary}
- Word Count Target: {Actual word count of original text}
- Target Emotion: {Extracted from chapter tone/emotion curve; write [To be supplemented] if unknown}
- Chapter Opening Hook: [To be supplemented]
- Highlight: {Inferred from plot nodes; write [To be supplemented] if no clear evidence}
#### Content Summary (Five-part Structure)
- Cause: {Summarized from plot nodes; write [To be supplemented] if unknown}
- Development: {Summarized from plot nodes; write [To be supplemented] if unknown}
- Twist: {Summarized from plot nodes; write [To be supplemented] if unknown}
- Climax: {Summarized from plot nodes; write [To be supplemented] if unknown}
- Ending: {What action/scene/line the original text ends with; write [To be supplemented] if unknown}
#### Plot Arrangement (Multi-line)
- Main Plot Advancement: {Reverse-engineered from plot unit index/summary}
- Subplot Advancement: {Write "None" or [To be supplemented] if no evidence}
- Event Line / Task Line: {External event chain}
- Emotional Line / Relationship Line: {Write only if there is evidence; otherwise "No explicit" or [To be supplemented]}
- Logical Line: Cause → Action → Result → Consequence/New Problem
#### Character Relationships and Appearance Order
- Appearance Order: {Order of appearance of characters/forces/key objects in the summary}
- Character Relationship Changes: {Before this chapter → After this chapter; write [To be supplemented] if unknown}
- Perspective/Information Gap: {Who knows what; readers know what; protagonist misjudges what; write [To be supplemented] if unknown}
#### Plot Refinement
- Plot Node Sequence (Fill in the table below line by line; reverse-engineered from summary plot nodes):
|---|---|---|---|---|
| 1 | {} | {Write [To be supplemented] if function is unknown} | {Archived according to the actual length of this section in the original text} | {[To be supplemented]} |
- Action Cost (Optional)/Benefit Attribution: {Write only if there is evidence; action cost can be omitted, do not force creation; write [To be supplemented] if unknown}
#### Ending Setting and Hook
- Ending Setting: {What action or scene the original text ends with; unresolved issues; motivation for next chapter; write [To be supplemented] if unknown}
- Chapter Closing Hook: [To be supplemented]
Fields that cannot be stably judged from the original text summary, such as hooks, character relationship changes, subplots/emotional lines, action cost/benefit attribution, are uniformly marked
; story-import only reverse-engineers blueprints with evidence, does not fabricate relationships or subplots to fill fields.
Step 7: Tracking File Generation
The imported project must generate the tracking status in one go through the
scripts/tracking_commit.py init
built into this skill, prohibit the model from writing final files separately. For complete fields and commands, see
references/tracking-transaction.md. The semantic preparation order is as follows:
-
Import Cut-off Chapter: Write the last complete chapter N into
of the initialization transaction. The tool records
imported_through_chapter=N
in meta; there are no daily update transactions for imported old chapters, do not fake chapter-by-chapter increments for Chapter 1..N, and start continuation from N+1. If it is mistakenly written as 50 during init, Chapter 51..N can still be added chapter-by-chapter with
(one transaction per chapter, chapter numbers must be consecutive), but it is necessary to construct transactions for each written old chapter; do not delete
and start over —
is also inside.
-
Current Core Character Snapshots: Reverse-engineer the status of protagonists, antagonists, and core supporting characters up to Chapter N from the parsed book deliverables, write into
of the initialization JSON. The output is generated by the tool to
Tracking/CharacterStatus/{CharacterName}.md
; algorithm see
references/character-state-reverse.md.
-
Current Foreshadowing Status: Generate
from foreshadowing/recovery events with manuscript evidence. Only keep one line of current status per ID; future designs that have not been actually laid out are kept in the outline, not written into
.
-
Facts and Reader Perception: Generate key events into
. Write objective facts, what readers know up to Chapter N, and actual revelation status for the same event; future planned revelation chapters must not be disguised as occurred facts.
-
Continuation Status Card Input: Prepare current position, long-term constraints, active core characters, quick notes of the last three chapters, next chapter commitments, and continuity risks.
is generated by the tool with fixed 7 columns, do not stuff writing style, file indexes, general to-dos, or quality check counts into the continuation status card.
-
Execute Initialization: Detect Python 3 according to the current platform (
→
→
), execute:
When there are early files in the project
that do not belong to the current protocol, there is no need to manually clean them:
will first move them all into
Tracking/_OldTrackingArchive/
as-is, then build the current protocol in place. Old content is retained for the author to review, not involved in parsing, and the current status is completely determined by the current import input; if
fails verification, no files are moved.
text
{PYTHON} {story-import skill root}/scripts/tracking_commit.py init --project {project root} --input {initialization transaction.json}
{PYTHON} {story-import skill root}/scripts/tracking_commit.py check --project {project root}
Take the demo "You Were Asked to Manage the Account, and Your High-energy Edit Blows Up the Entire Network" imported up to Chapter 10 as an example: The continuation status card should clearly state that Jiang Chen's original mobile version of "Gentlemen, Listen to the Dragon's Roar" was re-shot in high definition by a professional team, but after watching the film, the senior management believed that the new version "lacks soul", and finally continued to use the original version; Jiang Chen's quick response reflects that his military propaganda creation value has been confirmed by Zhou Bosen and Zhang Yaozu; the reader timeline only writes the conclusion of the film viewing meeting that readers have seen, and the training arrangement behind Zhong Jiajia "only guessed half" can only appear in the author's truth, not leaked to the reader view.
After successful initialization, you should get:
text
Tracking/
├── _tracking-state.json
├── Context.md
├── ChapterByChapterRecords/ # No files are added for imported old chapters, continuation starts from Chapter N+1
├── CharacterStatus/{CharacterName}.md
├── Foreshadowing.md
├── Timeline/
│ ├── AuthorTruth.md
│ └── ReaderKnown.md
When the last chapter of the semi-finished product is an unfinished draft,
, character snapshots, and other current semantic checkpoints are all up to the last complete chapter; the unfinished draft processing strategy is written into continuity risks, do not register unfinished actions as established facts.
Step 8: Genre Positioning Generation
Extract core findings from the parsing report to generate
Settings/GenrePositioning.md
(according to the "Genre Positioning Generation" template format in
structure-mapping-long.md).
The book's genre, core gimmick, emotion and rhythm summary in
Settings/GenrePositioning.md
come from
NovelParsingLibrary/{ImportedNovelTitle}/
, but these fields are not reference registrations. Only when an external reference work is explicitly bound in Phase 1, add the "Reference Works List + Primary Reference Work" section; there can be at most 1 primary reference work, no limit on secondary references / reference works. Omit the entire reference registration section when unbound, do not use
as a placeholder. The format of this section can be found in the "Reference Works List" of the above "Genre Positioning Generation" template.
If a quick overview is needed later, a "Reference Analysis (Derived Summary)" table can be written separately; this table is not an authoritative registry, and cannot replace the
and complete
. All registered items must be traceable to the corresponding
NovelParsingLibrary/{ReferenceNovelTitle}/
, and must not reference the book root
.
Step 9: Synchronize Structured Reference Assets
This step only handles external reference works explicitly bound in Phase 1. Synchronize the structured analysis assets of
NovelParsingLibrary/{ReferenceNovelTitle}/
to the project reference view
{Project}/ReferenceWorks/{ReferenceNovelTitle}/
, for story-long-write to read preferentially. Skip this step when no external reference work is bound, do not create empty directories; strictly prohibit using
NovelParsingLibrary/{ImportedNovelTitle}/
or the project
as the copy source. For the complete synchronization mapping from source path to target path, see
structure-mapping-long.md "Reference View Synchronization Rules".
Missing Handling:
- The selected external reference work lacks or → do not register or generate a half-set reference view; report
module_or_rhythm_required_missing
and prompt to re-run Stage 3+ for . The core project migration of this book is not rolled back due to this.
- Other structured subdirectories are missing → prompt according to existing import missing items, do not block project creation
Step 10: Writing Style Synchronization
When the external reference work has passed Step 9 verification, copy
NovelParsingLibrary/{ReferenceNovelTitle}/WritingStyle.md
to
{Project}/ReferenceWorks/{ReferenceNovelTitle}/WritingStyle.md
. Pure copy, no re-generation; skip when no external reference work is bound.
Missing Handling:
- No writing style file in the parsing library (analyze did not run Stage 6) → prompt the user to re-run before synchronization in the import report; missing writing style will be fail-fast blocked before daily update
- Old writing style file already exists in the project reference → overwrite (latest parsed deliverable takes precedence), inform in the import report
Phase 3-S: Short Story Structure Migration
Migrate the short story parsing deliverables from
NovelParsingLibrary/{ImportedNovelTitle}/
into the
short story project structure, for story-short-write Phase 3 scene-by-scene writing to take over seamlessly. For detailed migration rules, see
references/structure-mapping-short.md.
Short story projects are completely different from long novels: The short story manuscript is a single file
(no chapter splitting),
does not generate long novel-specific directories like
,
,
. Do not mistakenly create these directories during migration.
Short Story Target Project Structure
{ShortStoryTitle}/
├── Settings.md ← Contains core framework + book continuation baseline
├── SectionOutline.md ← Reverse-engineered from paragraph-section structure
├── Manuscript.md ← Single file full manuscript
└── ReferenceWorks/{ReferenceNovelTitle}/ ← Optional: only external reference view
├── ParsingReport.md
├── PlotNodes.md
└── WritingTechniques.md
Migration Steps
Step 1: Manuscript Migration
Migrate the full text from
NovelParsingLibrary/{ImportedNovelTitle}/OriginalText/
into a single file
, standardized according to
format-and-structure.md (section markers
, only single line breaks between paragraphs, dialogue quotes unified according to project/platform conventions).
The original text is already a finished draft, do not rewrite content, only standardize the format.
Step 2: Settings Generation
Reverse-engineer
from
and
, including two blocks:
- Core Framework: Aligns with the story-short-write core framework template (basic information, one-sentence synopsis, core twist, emotion design, character sketch).
- Book Continuation Baseline: Write the story structure, emotion rhythm, core twist mechanism, and existing writing techniques of the written content into the continuation baseline section; this is the book's internal context, not a reference summary.
Step 3: Section Outline Generation
Reverse-engineer
{Title}/SectionOutline.md
from the functional sections in
, map according to opening section/setup section/escalation section/twist section/ending section; short stories only make lightweight blueprints: for each section, write "Structure Section/Five-part Function", main event, 3-5 sub-events, target emotion, character/relationship changes, cause-and-effect/logic chain, ending transition/small hook. Mark
when hooks or relationships cannot be judged, do not apply the full chapter blueprint of long novels.
Step 4: External Reference View (Optional)
Only when an external
is explicitly bound in Phase 1, synchronize
NovelParsingLibrary/{ReferenceNovelTitle}/
to
{Title}/ReferenceWorks/{ReferenceNovelTitle}/
; skip when no binding. Do not copy the entire
NovelParsingLibrary/{ImportedNovelTitle}/
into
.
Phase 4: Project Activation
Step 1: Quality Check
Check against the corresponding quality check list according to length:
- Long Novel: Complete import quality list can be found at the end of references/structure-mapping-long.md (including manuscript file count comparison, independent core character snapshots, author/reader timeline isolation, passed, volume division confirmed by user, etc.).
- Short Story: Quality list can be found in the quality check list at the end of references/structure-mapping-short.md (including single file exists and format is compliant, contains core framework + book continuation baseline, no long novel-specific directories mistakenly created, etc.).
Step 2: Missing Items Prompt
Output the import result summary and items to be supplemented, according to the length branch.
Long Novel Import Completion Report:
=== Import Completion Report (Long Novel) ===
Novel Title: {ImportedNovelTitle}
Source File: {X} chapters, {Y} thousand words
Project Directory: {Path}
## Generated Files
- Manuscript: {N} chapters
- Character Files: {M} pieces
- Outline: Outline.md + {V} volume outlines + {N} detailed chapter outlines
- Tracking: Unique structured state + independent derived snapshots of core characters + current foreshadowing view + dual timeline views + empty chapter-by-chapter records directory + fixed 7-column context
- Settings: {Number of worldview files} pieces
- External Reference Works: {Unbound / Synchronized from `NovelParsingLibrary/{ReferenceNovelTitle}/` to `ReferenceWorks/{ReferenceNovelTitle}/` / Binding failed and repair actions}
## Items to be Supplemented
- [ ] Chapter opening/closing hooks in detailed outlines need to be supplemented
- [ ] The three-part classification of core gimmicks in genre positioning needs to be confirmed
- [ ] Foreshadowing in foreshadowing tracking has been reviewed
- [ ] `Tracking/Timeline/ReaderKnown.md` does not reveal facts in `AuthorTruth.md` that have not been disclosed yet
- [ ] Volume division has been confirmed (when original text has no clear volume boundaries)
- [ ] `NovelParsingLibrary/{ImportedNovelTitle}/` has not been copied to the project `ReferenceWorks/`, and this book has not been registered as its own reference work
- [ ] If an external reference work is bound, the `Primary Reference Work` and `Reference Works List` in `Settings/GenrePositioning.md` only include independent `{ReferenceNovelTitle}`, and the synchronization source is consistent with the directory name
## Next Steps
- Run `/story-review lean` to review the import result
- Run `/story-long-write` + "Daily Update" to start continuation
Short Story Import Completion Report:
=== Import Completion Report (Short Story) ===
Title: {ShortStoryTitle}
Source File: {Y} words
Project Directory: {Path}
## Generated Files
- Manuscript.md (single file, {Y} words)
- Settings.md (core framework + book continuation baseline)
- SectionOutline.md ({N} sections)
- External Reference Works: {Unbound / `ReferenceWorks/{ReferenceNovelTitle}/` synchronized / Binding failed and repair actions}
## Items to be Supplemented
- [ ] All files marked [To be supplemented] have been reviewed
- [ ] Chapter opening/closing hooks in section outlines need to be supplemented
- [ ] Foreshadowing clues of core twists have been confirmed
## Next Steps
- Run `/story-short-write` Phase 3 to start continuation
Step 3: Project Activation
- Set to point to the imported novel/title directory
- Confirm that the project can be recognized by the corresponding writing skill (long novel → story-long-write, short story → story-short-write)
- Optional Verification: If the project has deployed the story-explorer agent (first check if exists under ; if not, check , then ), spawn
Agent(subagent_type: "story-explorer", prompt: "Project Directory: {dir}\nQuery Type: progress\nQuery Parameters: Import Verification")
to cross-verify the integrity of migrated data
Environment deployment detection has been completed in Phase 1 "Pre-Environment Detection", no repeated detection here.
Handling Large Works (>200 Chapters)
This section only applies to long novel imports. Short stories are full migrated as single files, no incremental import needs.
For works with more than 200 chapters, parsing can be done in batches, but tracking initialization must cover all written chapters at once:
- Batch Parsing: In the first phase, only deeply parse the first 50 chapters + full book summary, then parse more chapters into as needed.
- Tracking in One Go: Write the last written chapter number N into of the initialization transaction, not 50 of the first phase parsing. is written once by and not updated later; chapter-by-chapter transactions only accept chapter numbers starting from N+1; do not fake chapter-by-chapter records for Chapter 1..N, start continuation from N+1. If it is mistakenly written as 50 during init, Chapter 51..N can still be added chapter-by-chapter with (one transaction per chapter, chapter numbers must be consecutive), but it is necessary to construct transactions for each written old chapter; do not delete and start over — is also inside.
- Context Summary: Generate simplified summaries (200 words per chapter) for chapters that have not been deeply parsed, for reverse-engineering the current state.
Reference Index
Load by phase, not all at once.
All reference files built into this skill are located in
, loaded by scenario. When involving methodologies/templates of other skills, story-import does not load files directly, but runs the corresponding
for the skill to load itself.
Phase 1: Confirm Import Source
| Scenario | Loaded File |
|---|
| Length Routing Determination | references/length-routing.md
|
| Chapter Format Recognition | Responsible by Stage 1 of the story-long-analyze parsing pipeline (run ) |
Phase 2: In-Depth Analysis
| Scenario | Loaded File / Related Skill |
|---|
| Long Novel In-Depth Analysis (methodology, quality check, output templates are built-in) | Run to call the long novel parsing pipeline |
| Short Story In-Depth Analysis (methodology, quality check, output templates are built-in) | Run to call the short story parsing pipeline |
Phase 3: Structure Migration
| Scenario | Loaded File |
|---|
| Long Novel Migration Mapping Rules | references/structure-mapping-long.md
|
| Short Story Migration Mapping Rules | references/structure-mapping-short.md
|
| Character State Reverse-engineering Rules (Long Novel) | references/character-state-reverse.md
|
| Character State Rules (character-state-reverse.md dependency) | references/state-tracking.md
|
| Short Story Manuscript Format Specification | references/format-and-structure.md
|
The detailed chapter outline template format for long novels can be found in story-long-write (Phase 3 Detailed Outline section); the short story core framework template can be found in story-short-write (Core Framework section). These are plain text guidelines, story-import does not load files from the corresponding skills.
Phase 4: Project Activation
| Scenario | Description |
|---|
| Long Novel Project Structure Specification | See story-long-write (Phase 4 Project File Structure) |
| Short Story Project Structure Specification | See story-short-write (Phase 3 Project Structure) |
| Environment Deployment | Deployment template is provided by , story-import is not responsible for deployment |
Workflow Connection
Pipeline: Long Novel / Short Story
Position: Import (Before Starting a New Book)
| Timing | Jump To | Command |
|---|
| Want to continue writing after import (Long Novel) | story-long-write | + "Daily Update" |
| Want to continue writing after import (Short Story) | story-short-write | |
| Want to review quality after import | story-review | |
| Want to deeply analyze reference works (Long Novel) | story-long-analyze | |
| Want to deeply analyze reference works (Short Story) | story-short-analyze | |
| Start a new book from scratch (Long Novel) | story-long-write | + "Start Book" |
| Start a new book from scratch (Short Story) | story-short-write | |
| Project has no deployed environment | story-setup | |
Language
- Reply in the user's language, use the same language as the user
- Chinese replies follow the Chinese Copywriting Guidelines