Version: 1.0.0
Status: Production Handoff Blueprint
Scope: End-to-end architecture, skill contracts, deployment, validation, and operations for the local AI book-building pipeline.
This document is the single source of truth for reproducing and operating the full pipeline you built: voice-first narrative capture, schema-first story structuring, pre-draft validation, continuity-safe drafting, refinement, human editing, and audio feedback loops. It is designed so a no-code/low-code operator can hand this spec to a capable coding agent (Codex/Claude Code class) and deploy the system on a local machine with predictable behavior.
- Execution over guessing: the system should execute structure, not improvise canon.
- Local artifact authority: the local filesystem is source of truth.
- Skill architecture over prompt hacking: behavior should be encoded in reusable skill logic.
- Gated progression: no draft generation without readiness validation.
- Human final authority: AI builds, human decides.
Voice Idea Capture
-> Book Brain Builder (BBB)
-> Dossier Evaluation Squad
-> Auto Book Builder
-> Claude Cowork Refinement
-> Raptor Write Surgical Edit
-> ElevenLabs Audio Review + Voice Notes
-> Final Human Edit
book-brain-builder: pre-production schema construction.dossier-evaluation-squad: readiness scoring + repair loop.auto-book-builder: continuity-safe manuscript generation engine.
- Codex desktop (or equivalent local file-capable coding agent).
- Optional Claude environment for second-pass refinement.
- Optional audio tools (ElevenLabs Reader) for auditory QA.
DOSSIER.mdVOICE_PROFILE.mdBBB_READINESS_REPORT.md<NOVEL_TITLE>_Build_Log.md<NOVEL_TITLE>_Continuity_Bible.md<NOVEL_TITLE>_Session_Memory.mdChapter_XX.mdACT_<ROMAN>_COMPLETE_README.md<NOVEL_TITLE>_Full_Manuscript.md
- OS: macOS (recommended) or Linux.
- Filesystem: local workspace write access.
- Terminal + shell available.
- LLM coding agent supports local file operations.
- Git
- Python 3.9+
- Node.js 18+ (only if adjacent tools in project require it)
- Optional:
- Pandoc (for DOCX publishing flows)
- FFmpeg/audio tooling (if custom audio processing is added)
- Do not store API keys in published docs.
- Use local environment variables or secure secret store.
- Recommended vars (adjust to provider stack):
OPENAI_API_KEY(if using OpenAI API features)ANTHROPIC_API_KEY(if using Claude API features)- Any provider-specific keys for audio/TTS tools
Recommended root shape:
<PROJECT_ROOT>/
DOSSIER.md
VOICE_PROFILE.md
BBB_READINESS_REPORT.md
templates/
DOSSIER_TEMPLATE.md
BUILD_LOG_TEMPLATE.md
CONTINUITY_BIBLE_TEMPLATE.md
SESSION_MEMORY_TEMPLATE.md
<NOVEL_TITLE>/
Chapter_01.md
...
<NOVEL_TITLE>_Build_Log.md
<NOVEL_TITLE>_Continuity_Bible.md
<NOVEL_TITLE>_Session_Memory.md
ACT_I_COMPLETE_README.md
ACT_II_COMPLETE_README.md
ACT_III_COMPLETE_README.md
<NOVEL_TITLE>_Full_Manuscript.md
Convert rough story intent into a complete Book Brain package.
- Brain dump, minimal seed, or partial dossier.
DOSSIER.mdVOICE_PROFILE.mdBBB_READINESS_REPORT.md
- Must not draft chapters/scenes.
- Must not create manuscript continuity artifacts.
- Must ask clarifying questions for missing critical fields.
- Must emit explicit handoff state (
READY/NOT_READY).
- Premise
- Genre + audience/tone
- Protagonist want/need/flaw
- Antagonistic force
- Stakes
- World constraints
- Core conflict
- Arc direction
- Beat spine
- Must-have/must-avoid
Evaluate pre-draft structural readiness through five personas.
- ATLAS: structure and causality.
- PSYCH: character logic.
- NOVA: world integrity.
- TEMPO: pacing architecture.
- NICHE: market/genre alignment.
- ATLAS
- PSYCH
- NOVA
- TEMPO
- NICHE
- CONSENSUS SUMMARY
- FOUNDATION VERDICT
- NEXT STEPS
- 1-4: STOP
- 5-6: CAUTION
- 7-8: SOLID
- 9-10: GREENLIGHT
Structure > Character > World > Pacing > Market
Any persona score <= 4 blocks drafting and launches targeted repair loop.
Transform validated dossier into continuity-safe chaptered manuscript.
DOSSIER.md- Template files:
templates/DOSSIER_TEMPLATE.mdtemplates/BUILD_LOG_TEMPLATE.mdtemplates/CONTINUITY_BIBLE_TEMPLATE.mdtemplates/SESSION_MEMORY_TEMPLATE.md
- Preflight validation.
- First-run initialization (if needed).
- Act/chapter planning.
- Chapter drafting.
- Continuity artifact updates.
- Act completion readme + full-manuscript assembly.
- No silent rewrites of approved chapters.
- No progression on missing critical inputs.
- Preserve user edits in existing plans/maps when extending.
- Resolve canon conflicts by prioritizing approved chapter text.
When conflicts exist:
- Approved chapter text
- Continuity Bible + Build Log
- DOSSIER intent
- Session Memory notes
Behavior:
- Preserve canon in chapters.
- Record ambiguity/conflict in Session Memory.
- Continue with explicit assumptions.
INGEST -> EXTRACT -> SCORE -> INTERVIEW_LOOP -> BUILD_ARTIFACTS -> HANDOFF
INGEST_DOSSIER -> PERSONA_EVAL -> CONSENSUS -> VERDICT -> (REPAIR_LOOP if needed)
PREFLIGHT -> INIT(if first run) -> PLAN -> DRAFT -> UPDATE_CONTINUITY -> COMPLETE
- Title/logline
- Genre/audience/tone
- Story promise/hook
- Theme/dilemma
- Protagonist + arc
- Antagonistic force
- Supporting cast
- World rules
- Stakes/escalation ladder
- Act/beat spine
- Set pieces
- Must-have/must-avoid
- Ending profile
- Voice descriptors
- POV/tense/distance
- Prose texture/rhythm
- Dialogue profile
- Emotional temperature
- Pacing profile
- Style boundaries
- Completeness score
- Critical gaps (resolved/unresolved)
- Assumptions
- Handoff state
- Next required question (if not ready)
- Chronological events
- Causal impacts
- Change ledger
- Open risks
- Character states
- Location states
- Object states
- Timeline
- Setups/payoffs
- Open threads
- Current drafting scope
- Active threads
- Emotional pacing snapshot
- Immediate next steps
- Assumptions taken
- Create project root folder.
- Place this spec and required templates in root.
- Add initial
DOSSIER.mdor run BBB to generate it. - Confirm skill files are available to the coding agent.
- Run
book-brain-builderto produce dossier/voice/readiness. - Run
dossier-evaluation-squaduntil score threshold is acceptable. - Run
auto-book-builderfor requested scope (chapter/act). - Run refinement pass in Claude environment.
- Perform surgical edit + audio loop.
- BBB:
- "Use BBB mode. Build DOSSIER.md + VOICE_PROFILE.md from this brain dump."
- Evaluation:
- "Run full Dossier Evaluation Squad and return consensus + fix priority."
- Drafting:
- "Run Auto Book Builder for Act I, chapters 1-4, continuity-safe."
Create three fixture scenarios:
fixture_minimal_seedfixture_partial_dossierfixture_continuation_with_existing_chapters
- BBB emits all 3 artifacts.
- Evaluation outputs all persona sections in exact order.
- Auto Book Builder:
- creates scaffold on first run,
- appends (does not overwrite) on continuation,
- updates continuity artifacts every batch.
- No blocked run proceeds silently.
- Every run returns explicit file update report.
- Continuity regression count = 0 across fixture sequence.
run_idstage(BBB/Eval/ABB)scope(chapter/act)inputs_detectedoutputs_writtenassumptionswarnings/blockers
MISSING_REQUIRED_FILEMISSING_CRITICAL_DOSSIER_FIELDSCANON_CONFLICTSCOPE_MISMATCHWRITE_FAILURE
- Never hide blocked states.
- Report exact missing paths/fields.
- Include actionable next command/instruction.
- If run fails mid-batch:
- Keep existing chapter files untouched.
- Mark failed scope in Session Memory.
- Resume from last fully completed chapter.
- Preserve chapter truth.
- Record discrepancy in Session Memory.
- Add repair ticket in Build Log.
- Keep timestamped backups of:
- Continuity Bible
- Session Memory
- Build Log
- On rollback, restore latest coherent trio together (not individually).
- Spec version: semantic versioning (
MAJOR.MINOR.PATCH). - Artifact schema versions stored in each artifact header.
- Migration rule:
- MAJOR changes require explicit migration script or mapping note.
- MINOR adds optional fields.
- PATCH fixes formatting/instructions only.
- Local files are authority; cloud tools are processors.
- Never commit plaintext keys.
- Keep model outputs reviewed before irreversible edits.
- Separate environments for:
- generation,
- refinement,
- publishing/export.
- Mandatory review checkpoints:
- post-BBB readiness,
- post-evaluation consensus,
- post-act draft,
- post-audio review.
- Human override can:
- freeze canon,
- re-open blocked stages,
- enforce rewrites for specific chapters only.
- Codex role: structural scaffolding and state integrity.
- Claude role: emotional depth/rhythm polishing.
- Raptor Write role: surgical line control.
- Audio loop role: cadence/clarity defect detection.
Constraint:
- Never allow downstream refinement to mutate continuity truth without logging change.
From your article, the “why” is codified as system constraints:
- Voice-first ingestion preserves narrative instinct.
- Architecture-first prevents drift.
- Validation-before-drafting is non-negotiable.
- Skill iteration beats prompt tinkering for quality scaling.
- Auditory review reveals defects visual reading misses.
A deployment is ready only when all are true:
- Environment contract satisfied.
- Templates present at required paths.
- BBB outputs generated and complete.
- Evaluation threshold passed or accepted with caution.
- Auto Book Builder dry run completed on fixture.
- Observability logs available with run IDs.
- Backup/rollback procedure tested once.
- Operator handoff notes written.
- Capture story by voice.
- Run BBB until
READY. - Run Evaluation Squad until no STOP verdict.
- Run Auto Book Builder for small scope first.
- Review continuity artifacts.
- Expand scope to full act.
- Refine, edit, audio-check, final edit.
- Risk: model drift in long runs
Mitigation: strict continuity updates + short scoped batches. - Risk: contradictory feedback from evaluators
Mitigation: consensus arbitration priority. - Risk: accidental overwrites
Mitigation: append/merge policy + backups. - Risk: style collapse in refinement
Mitigation: enforceVOICE_PROFILE.mdin all refinement prompts.
- Change owner: pipeline architect.
- Review cadence: per completed act.
- Mandatory regression check: before each major skill revision.
- Deprecation rule: do not remove fields without migration note.
For external operator enablement, provide:
- This master spec.
- Template files.
- Example fixture project.
- Expected outputs from one known-good run.
- Troubleshooting cheat sheet.
The pipeline succeeds when the model is constrained to execute explicit story architecture, and human judgment is preserved as the final quality gate. The objective is not “better prompts”; it is reliable creative systems engineering.