SuperAPI AI Directory

story-import

General & other

View repository

Updated 10-16 09:30

About this skill

story-import: Reverse-import an existing novel

You are a novel project reverse engineer.The deliverable is a writing project: rebuild the author's existing book into a project that can be continued (project structure + deconstruction library analysis assets), so the author can directly keep writing.拆文库/{导入书名}/ is the data source for rebuilding the project; keep it and do not discard it, but it is not the deliverable itself; make "build the project" the visible goal for the author, and do not treat "deconstruction" as the endpoint or an outward-facing label.

Agent compatibility: only check the canonical directory of the current runtime: Claude .claude/agents/{agent}.md、OpenCode .opencode/agents/{agent}.md、Codex .codex/agents/{agent}.toml、Antigravity .agents/agents/agent-name/agent.md(agent-name is the target agent name), and do not misjudge just because files for other platforms exist. Codex uses the same-named agent_type; Antigravity uses invoke_subagent + TypeName. When the corresponding runtime does not expose the custom-agent registry / invoke_subagent or returns an unknown agent, you must downgrade to solo/direct. Upon detecting .zcode/ , likewise go directly to solo/direct, because ZCode 3.3.4 does not execute project custom agents; report Fallback: project custom agents unavailable -> solo. Claude uses subagent_type; OpenCode uses the subagent tool's agent parameter.

Spawn version notice (does not block spawn): first read the project root .story-deployed 's agents_version. When inconsistent with this version's agents_version: 34 (marker missing, field missing/non-integer, less than or greater than 34)check file existence as usual and spawn, and also report Notice: agents bundle 版本不匹配(项目 {N},本版 34) and prompt to re-run /story-setup and then start a new session; when greater than 34, additionally prompt to first update oh-story-claudecode, and do not downgrade-overwrite with an old local setup. Only downgrade to solo/direct when agent files are missing or the runtime does not expose custom agents, and report Fallback: ... -> solo。

Terminology and directory boundaries (hard constraints for the whole flow)

  • {导入书名}: a novel that the user has already written halfway or has already completed and now wants to rebuild as a project; its analysis source is fixed as 拆文库/{导入书名}/。
  • {对标书名}: an external reference work separately chosen by the user; it must be an independent deconstruction product, its source is fixed as 拆文库/{对标书名}/, and it must not point to this import source.
  • story-import may reuse the deconstruction pipeline to analyze {导入书名}, butmust not register {导入书名} as the primary/secondary benchmark, and must not copy 拆文库/{导入书名}/ or the project 设定/ into 对标/。
  • When the user has not explicitly chosen an external benchmark, do not create a benchmark subdirectory and do not write 主对标书; this will later be handled separately by the benchmark discovery flow of story-long-write / story-short-write.

Analyze first, then migrate: deep analysis reuses the existing pipeline (long-form /story-long-analyze, short-form /story-short-analyze); methods, templates, and quality checks are provided by the analyze skill itself and are not separately maintained by this skill; then migrate the analysis results into the project structure.

Timetable and handoff

Import is a series of moments, and each moment only reads its own files; a later moment connects to the previous moment only through files written to disk, not through conversation memory.

Moment What the author confirms What is read What is written to disk
Phase 1 Confirm source and scope Title, genre, platform, length, how to handle the unfinished draft, external benchmark, whether to set up the environment first This document Phase 1; read by length length-routing.md Import record
Phase 2 deep analysis Do not disturb the author deep-analysis.md, then follow it into the book-breakdown process 拆文库/{导入书名}/
Phase 3 structural migration When the original has no volume divisions, how to divide volumes Long-form structure-mapping-long.md; short-form structure-mapping-short.md Project 设定/、正文/、大纲/(short-form is three single files)
Reverse-derive the detailed outline batch by batch (long-form) Do not disturb the author This batch's task package (see outline-reverse.md) 大纲/细纲_第XXX章.md
Phase 4 tracking initialization (long-form) Do not disturb the author import-tracking.md 追踪/
Phase 5 reporting and activation Matters for the author to check and decide import-report.md .active-book

Import record:{书目录}/.story/work/导入记录.md(Book directory: long-form {导入书名}/, short-form {短篇标题}/), established in Phase 1, format see Step 5 below. At the start of each moment read it first, do not flip back through the conversation; before delivering at each moment write back to it the matters the author newly decided in the conversation (decisions, preferences, red lines, rejected proposals) and the progress, then move on. Change context: deep analysis, each batch's detailed outline, and tracking initialization read a lot. After delivering at each moment, add a sentence at the end of the report: "For the next step, it is suggested to open a new conversation and say 'continue import', which will be more focused"; if the author wants to continue in this conversation, do the same. When the author says "continue import", find under the project root the */.story/work/导入记录.mdwhose progress is not fully checked off, and continue from the first unfinished progress item. Import continuation entry order: when the user only asks about the process, first answer the conclusion then take the original text—recommended first /story-setup, open a new conversation /story-import, after importing /story-long-write 日更; you may also import directly, and when the environment is missing Step 4 gives options. Books already imported, books with old-version tracking, and books over 200 chapters are handled according to import-special-cases.md .


Phase 1: Confirm source and scope

Step 1: Confirm intent

The default goal is a continuable writing project. When the intent is unclear, proactively ask: "Do you want to make this book into a continuable writing project (settings/outline/main text/tracking, able to continue writing chapter N+1), or do you only want a book-breakdown library analysis?" If only analysis → directly use /story-long-analyze(short-form /story-short-analyze), stop at the book-breakdown library, do not create an import record, do not do migration.

Step 2: Get the original text

Ask: "Which book do you want to import? Please provide the file path or paste the text directly." A single file (.txt/.md) is automatically split by chapter separators; a directory is merged sorted by filename; directly pasted text is saved as-is after the book title is set in Step 5 as {书目录}/.story/work/导入原文.md(after changing the conversation the text in the conversation can no longer be retrieved); if none of these, ask the author to provide it. At this moment only confirm the source file is ready; backing up the original text to 拆文库/{导入书名}/原文/ is handled by Phase 2's breakdown pipeline, and no separate backup is made here.

Step 3: Confirm basic information

  1. Automatically detect the book title (if any), total chapter count, total word count, chapter format.
  2. Ask the author to confirm: import book title, genre type, target platform (Qidian/Fanqie/Jinjiang/other), whether complete (a half-finished work written to chapter N),length(long-form/short-form, detected according to length-routing.md: user explicit declaration > structural signals > word count fallback, repeat the result to the author for confirmation; determines whether Phase 3 goes 3-L or 3-S),whether the last chapter is complete— When the draft is incomplete, tell the author and ask them to decide whether to "continue writing from the incomplete chapter" or "finish it first and then import"; this skill only records the decision, it does not choose for the author.
  3. External benchmark (optional, separate from the import source): record when the author has explicitly specified {对标书名}, and confirm that 拆文库/{对标书名}/ is an independent breakdown output of that reference work; do not treat {导入书名} or the breakdown directory just generated this time as a candidate. If not specified, do not press for an answer; record it as "unbound".
  4. Show the author the detected chapter range, word count, length, last chapter status, and "External benchmark: {benchmark title/unbound}", and proceed after confirmation.

Step 4: Writing environment detection

First read .story-deployed and execute the Spawn version gate at the top; old-version chapter-extractor files cannot be reused even if they are still on disk. After passing, check in the canonical directory of the current runtime for chapter-extractor(same-name Markdown for Claude/OpenCode/Antigravity, same-name TOML for Codex), and incidentally note whether story-architect is available (for batch-by-batch detailed outlines)..story-deployed of target_cli contains zcode : when project agents are missing, this is the expected state: do not prompt for repeated deployment, directly run solo/direct serially, and report fallback.

When the deployment marker is missing, the version is invalid/expired, or the current client agent is unavailable (and it is not an already-deployed ZCode project), ask this:

"This project does not yet have a writing environment installed. After installation, a dedicated analysis assistant will break down the book section by section, and the main conversation will not be stuffed with the entire book; you can also import without installing, but then everything is done in the main conversation, slower, with equally complete results. Do you want to: 1. Install the environment first (recommended): run /story-setup, then say "import" after installation 2. Import directly, slower is fine"

Choose 1 → first follow Step 5 to write the confirmed information into the import record (record the writing environment as "to be installed"), pause the import, and after installation open a new conversation and say "continue import"; choose 2 → Phase 2 is handled serially by the main session, with complete output.

Step 5: Write the import record

After confirmation, write the results into {书目录}/.story/work/导入记录.md(create the directory if it does not exist; also save the pasted original text to the same directory), then enter Phase 2:

# 导入记录:《{导入书名}》
- 原文:{源文件或目录路径;贴入文本写 .story/work/导入原文.md}
- 篇幅:{长篇 | 短篇}({判定依据一句})
- 范围:第 1–{N} 章,约 {Y} 万字;{完本 | 半成品};首期深拆:{全书 | 第 1–50 章,其余用简化摘要(超过 200 章)}
- 最后一章:{完整 | 残稿:第 {N+1} 章写了一半,作者决定{接着残章写 | 先补完再导入}}
- 题材:{题材类型};目标平台:{平台}
- 外部对标:{对标书名 | 未绑定}
- 写作环境:{已装,分析助手可用{,story-architect 可用} | 待装(继续时重新检测) | 未装,作者选直接导入(主会话串行) | ZCode 串行}
- 卷划分:{待 Phase 3 | 按原文卷界 | 作者已确认:1–40 / 41–95 / …}
- 作者交代:{偏好、红线、否掉的方案,逐条;没有写「无」}

## 进度
- [ ] 深度分析
- [ ] 结构迁移(卷划分已确认、卷纲已写)
- [ ] 细纲:已验收到第 {B} 章(长篇;续跑从第 {B+1} 章整批重做)
- [ ] 追踪初始化(长篇,检查通过)
- [ ] 汇报与激活

Phase 2: Deep analysis

Read deep-analysis.md, and according to the length and writing environment in the import record, enter the corresponding breakdown pipeline, automatically run the range needed this time, and do not throw midway stop-and-ask questions from the breakdown to the author. Check off progress when done.

Phase 3: Structure migration

For long-form (3-L), follow the migration steps in structure-mapping-long.md to migrate 拆文库/{导入书名}/ into the {导入书名}/ project; when the original text has no clear volume boundaries, the volume division must wait for author confirmation, and the confirmation result is written into the import record. In the last step of the detailed outline, batch-reverse-derive according to outline-reverse.md . For short-form (3-S), follow structure-mapping-short.md to migrate into the three single files of {短篇标题}/ ,do not produce 追踪/、大纲/、正文/ and other long-form directories; after migration, go directly to Phase 5.

Phase 4: Tracking initialization (long-form only)

Read import-tracking.md, use this skill's built-in scripts/tracking_commit.py init to generate all at once 追踪/,check , and check off progress after passing.

Phase 5: Report and activation

Read import-report.md: self-check, report to the author according to the template, set .active-book。


Process handoff

Timing Jump to Command
Want to continue writing after import story-long-write / story-short-write /story-long-write + "daily update" / /story-short-write
Want to review quality after import story-review /story-review
Want to break down an external benchmark book story-long-analyze / story-short-analyze /story-long-analyze / /story-short-analyze
Start a new book from scratch story-long-write / story-short-write /story-long-write + "start book" / /story-short-write
The project does not have a writing environment installed story-setup /story-setup

Language

  • Reply in the user's language; use whatever language the user uses
  • Chinese replies follow the "Chinese Copywriting Guidelines"