From a vague idea to a KDP-ready novel β fully autonomous.
β οΈ Alpha Release (v0.1.0): This is a working pipeline with a complete architecture, passing tests, and validated imports. It has not yet been battle-tested with hundreds of end-to-end runs. Expect to iterate. The writing quality depends heavily on your LLM provider, model choice, and the prompts β which you can customise.
π° Cost Warning: A full novel run makes hundreds of LLM API calls (ideation, world-building, outlining, writing 8β12 chapters, reviewing each chapter twice, enhancing, compiling, formatting). With Claude Sonnet on Anthropic's API, expect $30β$150+ per novel depending on chapter count, enhancement loops, and word count targets. Start with a short test run (2β3 chapters, low word count) to gauge your costs before committing to a full novel.
β±οΈ Runtime Estimate: A full 10-chapter novel with review loops takes 2β6 hours depending on model speed, rate limits, and how many enhancement iterations each chapter needs. The pipeline is resumable β you can stop and restart without losing progress.
AutoNovelClaw is an autonomous novel-writing pipeline that takes a raw story idea and produces a publication-ready manuscript. It is not a single prompt that asks an AI to "write a book." It is a 30-stage, 10-phase pipeline with four distinct AI agents, independent review cycles, iterative quality enhancement, continuity checking, and KDP-ready export.
The pipeline:
- Takes your idea (even something as vague as "something with time travel and the ocean")
- Generates 10 distinct storylines for you to choose from
- Asks if you want a standalone novel or a multi-book series
- Builds a complete world (codex, characters, magic/technology system)
- Creates a chapter-by-chapter outline with detailed beat sheets
- Writes each chapter using a proven five-sense immersion methodology
- Sends each chapter to two independent AI reviewers who have zero knowledge of the planning documents
- Based on reviewer ratings, either approves the chapter, enhances it surgically, or rewrites it
- Checks the full manuscript for continuity errors (character names, timeline, world rules)
- Formats the manuscript as a Kindle-ready EPUB and a KDP Print-ready paperback PDF
- Generates Amazon metadata (description, keywords, categories)
You can run the entire pipeline with one command, or pause at human gates to review and approve each step.
When the pipeline completes, it creates an artifact directory with this structure:
artifacts/nc-20260318-143022-my-novel/
βββ pipeline_state.json # Full pipeline state (for resume)
βββ parsed_concept.json # Your idea, parsed into structured elements
βββ storylines.md # All 10 generated storylines
βββ selected_storyline.md # The one you picked
βββ series_arc.md # Multi-book arc (if series)
βββ book_outline.md # Chapter-by-chapter outline
βββ beat_sheets.md # Detailed scene beats per chapter
βββ world/
β βββ world_codex.md # Geography, history, cultures, religion
β βββ character_profiles.md # All major characters with depth
β βββ magic_system.md # Or technology_system.md
βββ chapters/
β βββ chapter_01_scene_plan.md # Scene plan for chapter 1
β βββ chapter_01_draft.md # First draft
β βββ chapter_01_enhanced.md # After sensory enhancement pass
β βββ chapter_01_voice_checked.md
β βββ chapter_01_polished.md # Ready for review
β βββ chapter_01_Phase_1.md # After enhancement loop
β βββ chapter_01_APPROVED.md # Final approved version
β βββ ... (same for each chapter)
βββ reviews/
β βββ chapter_01_review_1.md # Literary critic review
β βββ chapter_01_review_2.md # Beta reader review
β βββ chapter_01_review_analysis.md
β βββ chapter_01_decision.md # PROCEED / REFINE / REWRITE
β βββ chapter_01_convergence.md # Quality convergence report
β βββ chapter_01_continuity_report.md
β βββ ... (same for each chapter)
βββ deliverables/
β βββ manuscript_complete.md # Full novel in Markdown
β βββ Your_Title.epub # Kindle-ready EPUB
β βββ Your_Title_interior.pdf # KDP Print-ready paperback interior
β βββ metadata.json # Book metadata
β βββ book_description.html # Amazon product page description
β βββ keywords.txt # 7 KDP search keywords
β βββ README.md # Summary of deliverables with stats
βββ evolution/ # Self-learning lessons (future runs)
AutoNovelClaw's writing engine is built on a proven five-sense immersion methodology β a writing system refined across 100+ hours of real human-AI collaborative novel writing. Multiple novels across different genres have been produced and published using these techniques, with manuscripts independently rated 9.3/10 by AI reviewers. The specific techniques that achieved those ratings are built into this pipeline's Writer Agent.
Most AI-generated prose over-indexes on visual description and neglects the other senses. The Writer Agent targets a specific sensory distribution in every chapter:
Visual ββββββββββββββββββββ 40% (light, shadow, colour, movement)
Kinesthetic βββββββββββββ 25% (texture, temperature, pressure, weight)
Olfactory ββββββββββ 20% (the most neglected sense β and the most grounding)
Auditory βββββ 10% (sound, silence, rhythm, vibration)
Gustatory βββ 5% (taste as emotional anchor)
The sensory enhancement stage (Stage 13) specifically audits and boosts sensory density to meet these targets.
Action and emotional scenes build in six mandatory stages. The Writer Agent never jumps from calm to climax:
1. Initial sensation (first signal something is wrong)
2. Visual shift (the world changes)
3. Physical escalation (the body responds)
4. Full immersion (the character is consumed)
5. Breaking point (peak intensity)
6. Aftermath (shaking hands, residual effects, the silence after)
Every description is filtered through the POV character's expertise. A pilot sees thunderheads at 40,000 feet. A scientist sees electromagnetic anomalies. A diver reads current patterns. A blacksmith notices metal grain. Characters never observe things their background wouldn't notice.
The Writer Agent is explicitly instructed to avoid AI-typical phrasing: "It's worth noting," "Moreover," "Furthermore," "a tapestry of," "a symphony of," "palpable tension," and dozens of other patterns that make AI-generated prose feel generic. The voice consistency stage (Stage 14) audits for these and removes them.
Phase 0: Ideation Phase F: Critical Review
0. IDEA_INTAKE 17. INDEPENDENT_REVIEW β Reviewer 1
1. STORYLINE_GENERATION (Γ10) 18. REVIEW_ANALYSIS β Multi-critic debate
2. SELECTION_AND_SCOPE [gate] 19. ENHANCEMENT_DECISION β PROCEED/REFINE/REWRITE
3. SERIES_ARC_DESIGN
Phase A: World-Building Phase G: Enhancement Loop
4. CODEX_GENERATION 20. SURGICAL_ENHANCEMENT β Phase 1.X
5. CHARACTER_CREATION 21. RE_REVIEW β Reviewer 2
6. SYSTEM_DESIGN 22. QUALITY_CONVERGENCE β Target β₯ 9.0/10
7. WORLD_VALIDATION [gate]
Phase B: Story Architecture Phase H: Manuscript Assembly
8. BOOK_OUTLINE 23. CHAPTER_APPROVAL [gate]
9. CHAPTER_BEAT_SHEETS 24. MANUSCRIPT_COMPILE
10. OUTLINE_REVIEW [gate] 25. CONTINUITY_VERIFY β Sentinel
26. STYLE_CONSISTENCY
Phase C: Chapter Writing
11. SCENE_PLANNING Phase I: Publishing Pipeline
12. CHAPTER_DRAFT β Writer 27. EPUB_GENERATION β KDP Kindle
13. SENSORY_ENHANCEMENT 28. PAPERBACK_FORMATTING β KDP Print
29. PUBLISHING_PACKAGE β Final export
Phase D: Style Verification
14. VOICE_CONSISTENCY
Phase E: Continuity Gate
15. CHAPTER_CONTINUITY β Sentinel
16. PRE_REVIEW_POLISH
Gate stages (2, 7, 10, 23) pause and ask for human approval. Use --auto-approve to skip all gates and run fully autonomously.
The chapter loop (Phases CβG) repeats for every chapter. Each chapter goes through: write β sensory enhance β voice check β continuity check β polish β review β decide β (enhance/rewrite if needed) β approve.
Decision logic after review:
- Rating β₯ 9.0/10 β PROCEED (chapter approved)
- Rating 7.5β8.9/10 β REFINE (surgical enhancement, then re-review, max 3 loops)
- Rating < 7.5/10 β REWRITE (full chapter rewrite, max 2 attempts)
- All loops exhausted β HUMAN ESCALATION (pipeline pauses for manual intervention)
The key innovation: the writer never reviews its own work. Each agent has a different system prompt, a different temperature, and deliberately restricted context access.
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β ORCHESTRATOR β
β (pipeline/runner.py β drives all stages) β
ββββββ¬βββββββββββ¬βββββββββββ¬βββββββββββ¬ββββββββββββ
β β β β
ββββββΌβββββ ββββΌβββββββ βββΌβββββββββ ββΌβββββββββββ
β WRITER β βREVIEWER β βREVIEWER β β EDITOR β
β (0.85) β β #1(0.3) β β #2(0.3) β β (0.1) β
β β β β β β β β
β Sees: β β Sees: β β Sees: β β Sees: β
β β
Codex β β β Codex β β β Codex β β β
Final β
β β
Chars β β β Chars β β β Chars β β text β
β β
Beats β β β Beats β β β Beats β β β
KDP β
β β
Prior β β β Prior β β β Prior β β specs β
β chaps β β reviews β β reviews β β β
β β
Style β β β Style β β β Style β β β
β guide β β guide β β guide β β β
βββββββββββ βββββββββββ ββββββββββββ βββββββββββββ
Temp 0.85 Temp 0.3 Temp 0.3 Temp 0.1
(creative) (analytic) (analytic) (precise)
- Writer Agent β Master novelist with the full five-sense immersion methodology (25 stage prompts + 9 reusable blocks in
prompts.py), world codex, character profiles, beat sheets, and rolling chapter summaries for continuity. Temperature 0.85 for creativity. - Reviewer #1 β Harsh literary critic. Receives ONLY the chapter text and the genre classification. Rates on a /10 scale, identifies 3β5 strengths, 3β5 weaknesses, and 3β5 concrete improvement suggestions. Temperature 0.3 for analytical precision.
- Reviewer #2 β Genre-savvy beta reader. Receives ONLY the enhanced chapter text (after Phase 1.X). Has zero knowledge of Reviewer #1's feedback. Evaluates engagement, drag points, confusion points, and memorability. Temperature 0.3.
- Editor Agent β KDP publishing specialist. Handles EPUB generation, paperback PDF formatting, metadata, and Amazon description. Temperature 0.1 for rule-following precision.
- Python 3.11 or newer (tested on 3.11 and 3.12)
- Operating System: Linux or macOS. Windows works for the pipeline itself but the
sentinel.shwatchdog script requires bash (use WSL on Windows, or skip the sentinel β the pipeline works fine without it). - API Key: Anthropic (recommended) or any OpenAI-compatible API provider.
- Disk space: ~50β200 MB per novel run (manuscripts, reviews, deliverables).
- Internet connection: Required for LLM API calls during the run.
# Clone the repository
git clone https://github.com/YOUR_USERNAME/AutoNovelClaw.git
cd AutoNovelClaw
# Create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows
# Install AutoNovelClaw and all dependencies
pip install -e .
# Verify the installation
novelclaw --version
# β novelclaw, version 0.1.0AutoNovelClaw reads the API key from an environment variable (default: ANTHROPIC_API_KEY).
# Anthropic (recommended)
export ANTHROPIC_API_KEY="sk-ant-api03-..."
# Or add to your shell profile for persistence:
echo 'export ANTHROPIC_API_KEY="sk-ant-api03-..."' >> ~/.bashrc
source ~/.bashrcIf you use OpenAI or another provider, see Using Other LLM Providers below.
The simplest way. The pipeline asks for your idea, generates storylines, and guides you through each decision.
novelclaw runThis will:
- Ask for your story idea
- Generate 10 storylines and present them
- Ask you to pick one
- Ask if standalone or series
- Build the world and pause for your approval
- Create the outline and pause for your approval
- Write each chapter, review it, and pause for your approval
- Generate the final EPUB and paperback PDF
Skip all human gates. The pipeline runs start-to-finish without stopping.
novelclaw run --topic "A pilot discovers ancient pyramids underwater" --auto-approveIn auto-approve mode:
- Storyline #1 is automatically selected
- The novel is treated as standalone (not a series)
- World, outline, and chapters are auto-approved
- The pipeline runs until deliverables are produced or it fails
For full control over every setting:
# Create a config file from the example
novelclaw init
# β Creates config.novelclaw.yaml in the current directory
# Or copy manually:
cp configs/config.novelclaw.example.yaml config.novelclaw.yaml
# Edit it β at minimum, set your author name
# The API key is read from the environment variable by default
# Run with your config
novelclaw run --config config.novelclaw.yaml --topic "Your idea"novelclaw run -c config.novelclaw.yaml -t "Your idea" --auto-approveSee detailed logs of every stage execution:
novelclaw run --topic "Your idea" --auto-approve --verbosenovelclaw status --run-dir artifacts/nc-20260318-143022-my-novel/Shows: start time, current stage, chapters completed, total stages, and the last 5 decisions made by the pipeline.
If the pipeline is interrupted (Ctrl+C, crash, rate limit), simply run the same command again. The pipeline reads pipeline_state.json from the artifact directory and resumes from the last completed stage.
# Same command as before β it picks up where it left off
novelclaw run --topic "Your idea" --auto-approveNote on resuming: The pipeline creates a timestamped artifact directory (e.g.,
nc-20260318-143022-my-novel). On re-run, a NEW directory is created. To resume an existing run, the pipeline would need to find the previous directory. Currently, resume works within the same process β if rate-limited, the retry logic handles it automatically. For cross-session resume, manually point to the existing directory by settingruntime.output_dirin your config to the existing artifact path.
from autonovelclaw.config import load_config, NovelClawConfig
from autonovelclaw.pipeline import PipelineRunner
# Option A: Load from YAML
config = load_config("config.novelclaw.yaml")
# Option B: Create programmatically with defaults
config = NovelClawConfig()
config.novel.author = "Jane Author"
config.novel.genre.primary = "epic_fantasy"
config.review.min_rating_proceed = 8.5 # Lower the quality bar
# Run the pipeline
runner = PipelineRunner(config, auto_approve=True, topic="Your idea here")
deliverables_path = runner.run()
print(f"Novel at: {deliverables_path}")
# β Novel at: artifacts/nc-20260318-.../deliverablesTo test the pipeline without committing to a full novel:
# In config.novelclaw.yaml β reduce everything
novel:
target:
chapter_count_min: 2
chapter_count_max: 2
words_per_chapter_min: 2000
words_per_chapter_max: 3000
review:
min_rating_proceed: 8.0 # Lower bar = fewer enhancement loops
max_enhancement_loops: 1novelclaw run -c config.novelclaw.yaml -t "Quick test story" --auto-approveThis runs the full pipeline with 2 short chapters β enough to verify everything works and estimate costs for a full run.
The sentinel monitors a running pipeline for stalled stages, empty chapters, and disk space:
chmod +x sentinel.sh
./sentinel.sh artifacts/nc-20260318-143022-my-novel/ &
# Check sentinel logs:
tail -f artifacts/nc-20260318-143022-my-novel/sentinel.logThe sentinel is optional. The pipeline works without it.
llm:
provider: "openai-compatible"
base_url: "https://api.openai.com/v1"
api_key_env: "OPENAI_API_KEY"
models:
writer: "gpt-4o"
reviewer_1: "gpt-4o"
reviewer_2: "gpt-4o-mini" # Cheaper model for second reviewer
editor: "gpt-4o-mini" # Formatting doesn't need frontier model
ideation: "gpt-4o"export OPENAI_API_KEY="sk-..."
novelclaw run --topic "Your idea"llm:
provider: "openai-compatible"
base_url: "http://localhost:11434/v1" # Ollama example
api_key_env: "OLLAMA_API_KEY"
models:
writer: "llama3.1:70b"
reviewer_1: "llama3.1:70b"
reviewer_2: "llama3.1:8b"
editor: "llama3.1:8b"
ideation: "llama3.1:70b"Note: Writing quality depends heavily on model capability. Smaller models (< 30B parameters) will produce noticeably weaker prose. The immersion prompts were developed with Claude Sonnet and work best with frontier-class models.
If you already have a world codex, character profiles, or outlines from previous work, pre-populate the knowledge base before running:
# Create the KB directories
mkdir -p novel_kb/world_codex novel_kb/characters novel_kb/approved_chapters
# Place your files (Markdown format)
cp my_world_codex.md novel_kb/world_codex/codex.md
cp my_hero_profile.md novel_kb/characters/hero.md
cp my_villain_profile.md novel_kb/characters/villain.mdThe Writer Agent loads context from the knowledge base at novel_kb/ (configurable via knowledge_base.root). Pre-populated files are used as context for world-building, character creation, and chapter writing. The pipeline may still run its generation stages, but the Writer Agent will see your existing materials when composing chapters.
All settings live in config.novelclaw.yaml. Create one with novelclaw init or copy from configs/config.novelclaw.example.yaml. Every field has a sensible default β you only need to set what you want to change.
Click to expand full settings table
| Setting | Default | Description |
|---|---|---|
mode |
semi-auto |
full-auto (only gates) / semi-auto (gates + prompts) / supervised (pause every stage) |
ideation.storyline_count |
10 |
How many storylines to generate (1β10) |
novel.author |
"" |
Your name β appears on title page and copyright |
novel.genre.primary |
"" |
Genre for overlay. Options: epic_fantasy, techno_thriller, sci_fi, dark_fantasy, horror, romance, literary_fiction, mystery. Leave blank for auto-detect. |
novel.scope |
standalone |
standalone or series |
novel.target.word_count_min |
55000 |
Minimum total word count |
novel.target.word_count_max |
85000 |
Maximum total word count |
novel.target.chapter_count_min |
8 |
Minimum chapters |
novel.target.chapter_count_max |
12 |
Maximum chapters |
novel.target.words_per_chapter_min |
5500 |
Minimum words per chapter |
novel.target.words_per_chapter_max |
8800 |
Maximum words per chapter |
writing.sensory_targets.visual |
0.40 |
Visual sensory ratio target |
writing.sensory_targets.kinesthetic |
0.25 |
Kinesthetic ratio target |
writing.sensory_targets.olfactory |
0.20 |
Olfactory ratio target |
writing.sensory_targets.auditory |
0.10 |
Auditory ratio target |
writing.sensory_targets.gustatory |
0.05 |
Gustatory ratio target |
writing.pov |
third-person-limited |
Narrative perspective |
writing.tense |
past |
Narrative tense |
review.min_rating_proceed |
9.0 |
Minimum composite rating to approve a chapter |
review.min_rating_refine |
7.5 |
Minimum rating before rewrite is triggered |
review.max_enhancement_loops |
3 |
Max Phase 1.X iterations per chapter |
review.max_rewrite_attempts |
2 |
Max full rewrites per chapter |
review.critic_weight |
0.6 |
Weight for Reviewer #1 in composite score |
review.reader_weight |
0.4 |
Weight for Reviewer #2 in composite score |
review.diminishing_returns_threshold |
0.2 |
Stop enhancing if improvement < this |
publishing.paperback.trim_size |
6x9 |
Options: 5x8, 5.25x8, 5.5x8.5, 6x9 |
publishing.paperback.paper_color |
cream |
white or cream |
publishing.paperback.font |
Palatino |
Interior body font |
publishing.paperback.font_size |
11 |
Body text size in points |
llm.provider |
anthropic |
anthropic or openai-compatible |
llm.base_url |
https://api.anthropic.com/v1 |
API endpoint |
llm.api_key_env |
ANTHROPIC_API_KEY |
Environment variable name for the key |
llm.temperature.writer |
0.85 |
Higher = more creative |
llm.temperature.reviewer |
0.3 |
Lower = more analytical |
llm.temperature.editor |
0.1 |
Lowest = most precise |
llm.temperature.ideation |
0.95 |
Highest = maximum divergence |
llm.max_tokens |
8192 |
Max tokens per LLM response |
The core writing engine is genre-agnostic. Genre overlays in prompts.py adjust sensory emphasis and pacing:
| Genre | Key Overlay | Sensory Boost | Pacing Profile |
|---|---|---|---|
| Epic Fantasy | World's wound, mythic beats, cultural idioms | Olfactory +5%, Gustatory +3% | Epic (longer reflection) |
| Techno-Thriller | Technical expertise, procedural detail, ticking clocks | Kinesthetic +5%, Auditory +3% | Propulsive (shorter scenes) |
| Sci-Fi | Technology shapes society, alien perspectives, scale | Visual +5%, Kinesthetic +3% | Discovery rhythms |
| Dark Fantasy | Beauty corrupted, cosmic indifference, body horror | Olfactory +8%, Auditory +5% | Slow dread build |
| Horror | The ordinary becoming wrong, withholding, isolation | Auditory +10%, Olfactory +8% | Slow suffocation |
| Romance | Physical awareness, proximity tension, slow-burn | Kinesthetic +10%, Olfactory +5% | Push-pull |
| Literary Fiction | Interior life, metaphor as structure, silence | Gustatory +5%, Kinesthetic +3% | Contemplative |
| Mystery | Clues in description, every character a suspect | Visual +5%, Olfactory +3% | Accelerating |
pip install -e ".[dev]"
pytest tests/ -v
# β 65 passed in ~1sThe test suite validates: configuration defaults and YAML loading, sensory target ranges, review threshold ordering, API key resolution, knowledge base CRUD, all agent prompt content (sensory model, escalation ladder, anti-AI phrasing, genre overlays, reviewer criteria, debate critics), pipeline state persistence, and token utilities.
The Writer Agent's prompts are in autonovelclaw/prompts.py with 25 stage prompts, 9 reusable blocks, and 8 genre overlays. All prompts can be overridden via YAML (copy prompts.default.yaml). To customise:
- Sensory targets: Change percentages in
config.novelclaw.yamlunderwriting.sensory_targets - Anti-clichΓ© list: Edit the
anti_ai_voiceblock inprompts.py, or the blacklist inquality.py - Genre techniques: Edit or add entries in
_GENRE_OVERLAY_PROMPTSinprompts.py - Chapter metrics: Modify word count, dialogue ratio, and beat frequency in the
chapter_metricsblock - Reviewer harshness: Edit the
independent_reviewstage prompt to change evaluation weights - Add a new genre: Add a new key to
_GENRE_OVERLAY_PROMPTSwith your overlay text
AutoNovelClaw includes CLAUDE.md (for Claude Code CLI) and .claude/skills/novelclaw/SKILL.md (for OpenClaw skill discovery).
1οΈβ£ Share the GitHub repo URL with OpenClaw
2οΈβ£ OpenClaw reads NOVELCLAW_AGENTS.md β understands the pipeline
3οΈβ£ Say: "Write a novel about [your idea]"
4οΈβ£ OpenClaw clones, installs, configures, runs, and returns the deliverables
Also works with Claude Code (reads NOVELCLAW_CLAUDE.md) and any AI coding agent that can read Markdown context files.
| Problem | Solution |
|---|---|
ValueError: No API key |
Set the env var: export ANTHROPIC_API_KEY="sk-ant-..." or add api_key: "..." in config under llm: |
| Rate limiting (429 errors) | Built-in retry (3 attempts, 2/5/15s backoff). If persistent, reduce llm.max_tokens or use a higher-tier API plan. Pipeline is resumable. |
| Chapters too short | Increase novel.target.words_per_chapter_min and ensure llm.max_tokens β₯ 8192 |
| "ebooklib not installed" | Run pip install ebooklib (should auto-install but some environments need it manual) |
| "reportlab not installed" | Run pip install reportlab |
| Pipeline stalls at gate | In semi-auto mode, type approve or reject in the terminal. Use --auto-approve to skip. |
sentinel.sh fails on Windows |
The sentinel is bash-only. Skip it on Windows (pipeline works without it) or use WSL. |
| Enhancement loops never converge | Lower review.min_rating_proceed (e.g., 8.5) or reduce review.max_enhancement_loops |
AutoNovelClaw/
βββ autonovelclaw/ # Main package (~12,000 lines of Python)
β βββ __init__.py
β βββ cli.py # CLI: run, status, init, doctor
β βββ config.py # Pydantic configuration with validation
β βββ prompts.py # PromptManager: 25 stage prompts, 9 blocks, 8 genres, YAML overrides
β βββ knowledge_base.py # File-backed KB for cross-chapter persistence
β βββ evolution.py # Self-learning: JSONL store, time-decay, per-stage overlays
β βββ health.py # Pre-flight doctor (11 checks with fix suggestions)
β βββ quality.py # AI clichΓ© detection, sensory analysis, quality scoring
β βββ pipeline/ # State machine + orchestration
β β βββ stages.py # 30-stage IntEnum, transitions, gates, rollback
β β βββ contracts.py # I/O contracts per stage (inputs, outputs, DoD, error codes)
β β βββ runner.py # Checkpoint/resume, chapter-loop orchestration
β β βββ executor.py # All 30 stage implementations
β βββ llm/ # Multi-provider LLM clients
β β βββ client.py # Abstract base with retry, token tracking
β β βββ anthropic.py # Native Anthropic Messages API
β β βββ openai_compat.py # OpenAI-compatible (GPT, Ollama, Together, Groq)
β βββ continuity/ # Cross-chapter consistency
β β βββ tracker.py # Entity database (characters, locations, objects)
β β βββ timeline.py # Timeline validator + foreshadowing tracker
β β βββ verify.py # Full-manuscript verification
β βββ chapter/ # Chapter generation support
β β βββ context.py # Context window budgeting + smart excerpt selection
β β βββ sensory_auditor.py # Paragraph-level sensory analysis with gap targeting
β β βββ validator.py # Structure validation (hooks, breaks, dialogue ratio)
β βββ reviewers/ # Review processing
β β βββ parser.py # Structured extraction from reviewer output
β β βββ planner.py # Enhancement planner + convergence tracker
β βββ publishing/ # KDP-ready output
β β βββ epub_builder.py # EPUB 3.0 with CSS, navigation, cover
β β βββ pdf_builder.py # KDP Print interior (trim sizes, gutters, typography)
β β βββ validator.py # KDP content guidelines validation
β βββ data/
β β βββ genre_conventions.yaml # 8 genres, clichΓ© blacklist, KDP specs
β βββ utils/ # Token estimation, chunking, word count
βββ tests/ # pytest suite
βββ configs/ # Example YAML config
βββ docs/ # Integration guide
βββ .claude/skills/novelclaw/ # Claude Code / OpenClaw skill
βββ CLAUDE.md # Claude Code project instructions
βββ prompts.default.yaml # User prompt override template
βββ sentinel.sh # Background watchdog
βββ pyproject.toml
βββ LICENSE (MIT)
βββ .gitignore
-
Be specific with your idea. "A story about a pilot" works, but "A disgraced Navy pilot discovers ancient pyramids underwater in the Bermuda Triangle" gives the ideation engine much better raw material.
-
Start with a short test run. Set
chapter_count_max: 2andwords_per_chapter_max: 3000to test the pipeline cheaply before a full novel. -
Use semi-auto mode first. Review the world codex and outline before writing starts. Catching issues early saves API tokens and prevents wasted chapters.
-
Lower
min_rating_proceedto save money. 8.5 instead of 9.0 means fewer enhancement loops per chapter. The quality difference is marginal but the cost savings are significant. -
Use frontier models for the writer, cheaper models for the editor. The writer needs maximum capability. The editor just formats β a smaller model works fine.
-
Review the deliverables before uploading to KDP. The EPUB and PDF are structurally correct but may need manual polish (cover placement, final proofread, ISBN insertion). This is an alpha release, not a replacement for a human final pass.
Inspired by:
- π¬ AutoResearchClaw β The 23-stage autonomous research pipeline whose architecture was adapted for novel writing
- π The five-sense immersion writing methodology β refined across 100+ hours of collaborative novel writing, with multiple novels published across genres including epic fantasy and techno-thriller
- π¦ OpenClaw β AI agent platform integration
MIT β see LICENSE for details.