SuperAPI AI Directory

story-import

Writing & research

View repository

Updated 10-16 09:45

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 continue writing.拆文库/{导入书名}/ It is the data source for rebuilding the project; keep it, do not discard it, but it is not the deliverable itself; for the author, make "build the project" the visible goal, and do not treat "deconstruct the text" as the endpoint or the external 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 as the target agent name), and do not misjudge based on the existence of files from other environments. 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. When .zcode/ is detected, 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 parameter of the agent tool.

Spawn version hint (does not block spawn): first read the .story-deployed of the project root agents_version. If it is inconsistent with this version's agents_version: 34 (marker missing, field missing/non-integer, less than or greater than 34)check and spawn normally based on file existence, and at the same time report Notice: agents bundle 版本不匹配(项目 {N},本版 34) and prompt to rerun /story-setup then start a new session; if greater than 34, additionally prompt to first update oh-story-claudecode, and do not downgrade and overwrite with an old local version of setup. Only downgrade to solo/direct when the agent file is missing, or the runtime does not expose a custom agent, and report Fallback: ... -> solo。

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

  • {导入书名}:A novel 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 The deconstruction pipeline can be reused to analyze {导入书名}, butmust not register {导入书名} as the primary/secondary benchmark, and must not copy 拆文库/{导入书名}/ or the project's 设定/ 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 process 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), and the methods, templates, and quality checks come with the analyze skill; this skill does not maintain them separately; then migrate the analysis results into the project structure.

Timetable and handoff

Importing is a sequence of moments; each moment only reads its own files; the next moment connects to the previous moment only through files written to disk, not through conversational memory.

Moment What the author confirms What to read Write to disk
Phase 1 Confirm source and scope Title, genre, platform, length, how to handle the unfinished manuscript, external benchmark, whether to set up the environment first This document Phase 1; judge length and read length-routing.md import record
Phase 2 Deep Analysis Don't disturb the author deep-analysis.md, then follow it into the book breakdown process 拆文库/{导入书名}/
Phase 3 Structural Migration When the original text 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)
Batch-by-batch reverse-engineer the detailed outline (long-form) Don't disturb the author This batch's task package (see outline-reverse.md) 大纲/细纲_第XXX章.md
Phase 4 Tracking Initialization (long-form) Don't disturb the author import-tracking.md 追踪/
Phase 5 Report and Activation Things for the author to verify 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 session, read it first; don't scroll back through the conversation; before delivering at each session, write back to it the things the author newly decided in the conversation (decisions, preferences, red lines, rejected proposals) and the progress, then continue. Switch context: deep analysis, each batch of detailed outlines, and tracking initialization read a lot. After delivering at each session, add a line at the end of the report: "For the next step, it's recommended to open a new conversation and say 'continue import'; it 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 and then collect the original text—recommended to first /story-setup, open a new conversation /story-import, after importing /story-long-write 日更; you can also import directly; when the environment is missing, Step 4 gives options. Books that have been 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 turn 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, don't create an import record, don't do migration.

Step 2: Obtain 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; directories are merged after sorting by filename; directly pasted text is saved as-is after the book title is settled in Step 5 as {书目录}/.story/work/导入原文.md(after switching conversations, the text in the conversation can no longer be retrieved); if none of these, ask the author to provide it. At this session, only confirm that the source file is ready; backing up the original text to 拆文库/{导入书名}/原文/ is the responsibility of the Phase 2 breakdown pipeline, no separate backup here.

Step 3: Confirm Basic Information

  1. Automatically detect the book title (if any), total chapter count, total word count, and chapter format.
  2. Ask the author to confirm: imported book title, genre type, target platform (Qidian/Fanqie/Jinjiang/other), whether it is complete (if a work-in-progress, up to chapter N),length(long-form/short-form, detected according to length-routing.md: user's explicit declaration > structural signals > word count fallback; restate the result to the author and ask them to confirm; determines whether Phase 3 follows 3-L or 3-S),whether the last chapter is complete——When there is an incomplete draft, 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 and 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 product of that reference work; do not treat {导入书名} or the breakdown directory just generated this time as a candidate. If not specified, do not ask further and record it as "unbound".
  4. Show the author the detected chapter range, word count, length, status of the last chapter, 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 also note whether story-architect is available (for batch detailed outlines)..story-deployed 's target_cli contains zcode ; when project agents are missing this is an expected state: do not prompt for repeated deployment, directly run solo/direct serially and report the fallback.

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

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

Choose 1 → first write the confirmed information into the import record according to Step 5 (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 processed serially by the main session, and the output is complete.

Step 5: Write the import record

After confirmation, write the result into {书目录}/.story/work/导入记录.md(create the directory if it does not exist; also save the pasted original text in 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 dump mid-breakdown stop-and-ask questions onto the author. Check off progress after completion.

Phase 3: Structure migration

For long-form (3-L), follow the migration steps of structure-mapping-long.md to migrate 拆文库/{导入书名}/ into the {导入书名}/ project; when the original text has no clear volume boundaries, the volume division must wait for the author's confirmation, and the confirmation result is written into the import record. The last step of the detailed outline is reverse-derived in batches 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, and 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 追踪/,check in one go, 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 connection

Timing Jump to Command
After import, want to continue writing story-long-write / story-short-write /story-long-write + "daily update" / /story-short-write
After import, want to review quality 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