From novel-writing
Autonomous batch writing loop — write up to 5 consecutive chapters with full state sync. Use when you want to generate a block of chapters without manual intervention between each.
How this skill is triggered — by the user, by Claude, or both
Slash command
/novel-writing:autoThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Sequentially write up to 5 consecutive chapters with real-time state synchronization.
Sequentially write up to 5 consecutive chapters with real-time state synchronization.
--batch=N — number of chapters to write (default: 5, max: 5)--start=N — override starting chapter number (default: from meta.json.activeChapter)Sequential only. Never write multiple chapters in parallel. Each chapter informs the next through shared context loaded at the start of the batch.
node scripts/lib/state-manager.js active
If no project exists, abort with: "No active project. Create one with node scripts/lib/state-manager.js create \"项目名称\""
node scripts/lib/state-manager.js load {projectId}
Check and auto-create missing files in data/{projectId}/:
If world.json missing:
meta.jsonIf characters.json missing:
If outline.json has zero chapters:
/outline first or include story premise in arguments."Read meta.json and outline.json. Determine chapters to write:
activeChapter in meta.json (or --start=N override)outline.json.chapters sequentiallystatus === 'outline'--start=N is given, override but still skip complete/draft/revision chaptersReport batch scope before starting:
Batch plan:
- Chapter 3: "归途" (outline) — ~3500 words
- Chapter 4: "重逢" (outline) — ~3000 words
(2 of 5 — only 2 outline chapters remain)
Read ALL state files from data/{projectId}/:
meta.json — project name, genre, tone, target word count, activeChapteroutline.json — chapter structure, act breaks, key events, word count targetscharacters.json — character details, relationships, character arcsworld.json — locations, factions, lore, timeline, magic systemstyle-profile.json — if exists, for voice preservationbeats.json — if exists, for beat-level scene guidanceFor each chapter in the batch (in order):
=== Writing Chapter {N}: "{title}" ===
Summary: {summary}
POV: {POV character}
Location: {location}
Key events: {keyEvents list}
Word target: ~{wordTarget} words
Assemble the full writing prompt from all loaded state:
CONTEXT FOR CHAPTER {N}:
--- STORY OUTLINE ---
Act: {actName}
--- CHAPTER BRIEF ---
{chapter.summary}
Key events to include:
- {keyEvent 1}
- {keyEvent 2}
--- CHARACTERS IN THIS CHAPTER ---
{character.name}: {character arc description}
--- WORLD ---
Location: {location.description}
--- STYLE PROFILE ---
{sentence_length: mixed, dialogue_ratio: ~30%, description_density: moderate}
Opening: {technique from style-profile}
Closing: {technique from style-profile}
--- RECENT CHAPTERS (callback) ---
Previous chapter {N-1} ended with:
{last 2 paragraphs of previous chapter}
Write to chapters/{N}.md:
01.md, 02.md ... (zero-padded)# 第{N}章 {title}pre-chapter-chinese-count hook will verify >= 3000 Chinese characterspost-chapter-state-update hook will auto-update state files after WriteChapter {N} written: {word count} words
Status: draft
Next: Chapter {N+1} / {batch total}
If the Write tool fails or the hook blocks:
[ABORT] Chapter {N} failed: {reason}
Batch stopped. {X} of {Y} chapters completed.
Completed: {list}
Failed at: Chapter {N}
Retry with: /novel:auto --start={N} --batch={remaining}
After the batch completes or aborts:
Update meta.json:
activeChapter = startChapter + writtenCountcurrentWordCount += totalWrittenWordsupdatedAt = nowUpdate outline.json:
status = 'draft', wordCount, sceneCount setUpdate beats.json (if exists):
status = 'written'Update style-profile.json (conditional):
=== Batch Complete ===
Chapters written: Chapter 3 (3542w), Chapter 4 (3108w)
Total words added: 6650
Active chapter: 5
Time elapsed: {duration}s
State files updated:
- meta.json
- outline.json
- beats.json
Progress: 4 / 15 chapters (26.7%)
| Scenario | Behavior |
|---|---|
--batch=0 or negative | Error: "Batch size must be between 1 and 5" |
--start=N beyond outline | Error: "Chapter {N} does not exist in outline" |
--start=N on complete chapter | Skip with warning, find next outline chapter |
| 0 outline chapters remain | "All chapters have been drafted. No outline chapters remaining." |
| Hook blocks a chapter write | Abort batch, report partial results |
| Project does not exist | Error: "No active project. Create one with state-manager.js create" |
style-profile.json doesn't exist when writing first chapter | Auto-extract after first chapter |
beats.json doesn't exist | Skip beat updates silently |
activeChapter past outline length | Error: "No outline chapters beyond Chapter {N}" |
After successful batch:
meta.json.activeChapter points to chapter AFTER the last written onemeta.json.currentWordCount is sum of all chapter word countsoutline.json.chapters[i].status === 'draft' for all written chaptersoutline.json.chapters[i].wordCount > 0 for all written chaptersmeta.json.updatedAt is always most recentnpx claudepluginhub yuzhoujishu/novel-writing --plugin novel-writingWrites story chapters using an outline-first workflow. Activates on requests like 'write a chapter' or 'draft chapter' to maintain consistency with existing story elements.
Generates first-draft novel prose from Crucible outlines via scene-by-scene drafting, style matching, continuity tracking, and hallucination prevention. Use after planning/outlining on write/draft requests.
创作期续写工具,基于场景规划逐章生成小说正文。当用户说"续写"、"写章节"、"生成章节"、"写下一章"、"批量生成"、"继续写"、"写正文"时自动激活。