How forsonny/claude-code-novel-writer works
Purpose and entry points
This is a Claude Code–oriented autonomous novel-writing workspace, not a conventional application service. Claude is the primary runtime and executes repository instructions to plan, generate, review, and maintain a long-form manuscript. Bootstrap and validation start at launch-novel.sh and verify-system.sh; the operational contract is centered on CLAUDE.md. Human operators can observe state through automation/dashboard.py.
Orchestration and agent layer
CLAUDE.md acts as the master orchestrator: it directs workflow decisions and delegates specialized work. Agent instruction files form the functional AI pipeline:
• Story structure and adaptive pacing: .claude/agents/plot-architect.md, .claude/agents/smart-planner.md
• Prose production and continuity review: .claude/agents/chapter-writer.md, .claude/agents/continuity-editor.md
• Domain enrichment and remediation: .claude/agents/worldbuilder.md, .claude/agents/character-developer.md, .claude/agents/error-recovery.md
Claude configuration and injected reminders reside in .claude/settings.json and .claude/context-injection.txt.
Canonical story state
The system persists narrative state as repository-managed JSON rather than a database. Planning is the principal control input: planning/novel-outline.json defines intended structure, while planning/chapter-status.json, planning/plot-progress.json, and planning/scene-tracker.json record execution progress. The orchestrator and planning agents should read these before generation and update them after completed work, making them the synchronization boundary between Claude sessions.
Narrative knowledge domains
Character and world facts are separated from planning state to support consistency checks and targeted agent work. characters/character-knowledge.json is the character/arc reference; worldbuilding/world-state.json captures setting rules and world changes. Manuscript-level metadata belongs in manuscript/metadata.json. Generated chapter content is implied to live under manuscript/, although no chapter files are present in the supplied tree.
Generation and quality loop
The intended loop is: initialize/health-check, synchronize state, assess plan and quality, generate a chapter, run checks, persist progress, and repeat. Chapter formatting and prose expectations are supplied by templates/chapter-template.md and output-styles/autonomous-novelist.md. automation/chapter-completed.sh is the likely post-generation integration boundary, with automation/quality-check.sh and automation/duplicate-checker.sh providing content validation.
Automation, recovery, and observability
Shell automation implements workspace maintenance around Claude-driven generation: session lifecycle in automation/session-init.sh and automation/session-summary.sh; state synchronization in automation/auto-sync-progress.sh; health and performance checks in automation/system-health-check.sh and automation/performance-monitor.sh. Recovery and durability are handled through automation/auto-backup.sh, automation/pre-compact-backup.sh, and automation/backup.sh. These scripts operate on local files; no external database, API, or deployed infrastructure is evidenced.
Runtime and operational boundaries
Required runtimes are a Unix-like shell, Claude Code CLI, and Python 3 for automation/dashboard.py. The dashboard is an observer/reporting interface over local project artifacts, including monitor and sync-report modes. Documentation is maintained separately in Documentation/System-Architecture.md and Documentation/User-Guide.md; it describes operation but is not part of the execution path.
Main entry points: chapter-writer.md Chapter writer · CLAUDE.md Master orchestrator · continuity-editor.md Continuity editor · chapter-status.json Progress trackers
Components 20
Claude Runtime
Claude Code follows repository instructions and agent roles.
- Master orchestrator · Directs the autonomous novel-writing workflow.
CLAUDE.md - Plot architect
.claude/agents/plot-architect.md - Adaptive planner
.claude/agents/smart-planner.md - Chapter writer
.claude/agents/chapter-writer.md - Continuity editor
.claude/agents/continuity-editor.md - World, character & recovery agents · Enrich narrative domains and remediate failures.
.claude/agents/worldbuilder.md
Local Story State
JSON files synchronize narrative work across sessions.
- Novel outline · Canonical intended story structure.
planning/novel-outline.json - Progress trackers · Chapter, plot, and scene execution status.
planning/chapter-status.json - Character knowledge
characters/character-knowledge.json - World state
worldbuilding/world-state.json - Manuscript · Generated chapter content and manuscript metadata.
Automation & Quality
Local shell and Python tools maintain and observe the workspace.
- Bootstrap & validation
launch-novel.sh - Chapter completion
automation/chapter-completed.sh - Content quality checks · Checks prose quality and duplicate content.
automation/quality-check.sh - Progress synchronization
automation/auto-sync-progress.sh - Backup & recovery · Creates local backups before recovery-sensitive operations.
automation/auto-backup.sh - Operations dashboard · Reports local artifact, monitor, and sync state.
automation/dashboard.py
Other components
- Human operator
- Chapter template
templates/chapter-template.md - Novel output style
output-styles/autonomous-novelist.md
Connections 26
- Human operator → Bootstrap & validation: starts
- Bootstrap & validation → Master orchestrator: initializes
- Master orchestrator → Plot architect: delegates planning
- Master orchestrator → Adaptive planner: delegates pacing
- Master orchestrator → Chapter writer: delegates generation
- Master orchestrator → Continuity editor: delegates review
- Master orchestrator → World, character & recovery agents: delegates enrichment
- Plot architect → Novel outline: reads and updates
- Adaptive planner → Progress trackers: assesses status
- Chapter writer → Novel outline: follows
- Chapter writer → Progress trackers: reads
- Chapter writer → Character knowledge: uses
- Chapter writer → World state: uses
- Chapter template → Chapter writer: formats
- Novel output style → Chapter writer: guides prose
- Chapter writer → Manuscript: generates chapters
- Continuity editor → Manuscript: reviews
- Continuity editor → Character knowledge: checks continuity
- Continuity editor → World state: checks continuity
- Manuscript → Content quality checks: validates
- Content quality checks → Chapter completion: passes to
- Chapter completion → Progress synchronization: triggers
- Progress synchronization → Progress trackers: persists
- Backup & recovery → Manuscript: backs up
- Operations dashboard → Progress trackers: observes
- Operations dashboard → Manuscript: reports on