Build Novelcrafter

KINDAback to the verdict

0%0 of 16 items done

Saved on this device only. Tick prerequisites first, then work the phases in order · do not start one until the checks above it pass.

A novel-writing environment whose real problem is continuity across a hundred thousand words: a character's eye colour established in chapter three, a timeline that has to hold, and an assistant that must be given the relevant facts rather than allowed to invent them.

estimated effort multi-daythe files for this build are in the project pack

RuntimeTypeScript with a local application and SQLiteBibleEntities with typed attributes, each citing where it was establishedRetrievalRelevant bible entries and prior scenes selected per requestContinuityChecks comparing the manuscript against the bibleModelsLocal by default, hosted as an explicit per-project choice

Before step 1

Everything below is assumed from the first step. Tick each one when you actually have it, not when you plan to.

  1. installfree

    Why Runs the local application.

    Get it nodejs.org, or nvm install 22. open ↗

    Verify node --version prints v22 or higher

  2. installfree, needs memory

    Why An unpublished manuscript is the most private thing a novelist has, and the default should not be sending it to a service.

    Get it Any local runner with a model that handles long context and follows structured instructions. open ↗

    Verify A generation completes locally using supplied context

  3. have readyfree

    Why Editor performance, fact extraction and continuity checking all behave completely differently at novel length, and a short test project demonstrates none of the problems.

    Get it Your own draft, or a public domain novel imported as scenes and chapters.

    Verify Sixty thousand words are loaded as scenes with chapter structure

  4. have readyfree

    Why Continuity checking cannot be evaluated without knowing the right answer, and the interesting cases are the deliberate deviations fiction is full of.

    Get it From your manuscript, list twenty established facts and introduce one genuine contradiction and one intentional deviation.

    Verify Both the contradiction and the intentional deviation are identified by hand first

Data model

Create these before the first phase that stores anything. Changing a table later is the expensive kind of change.

- projects(id, title, model_policy, created_at)
- chapters(id, project_id, ordinal, title) and scenes(id, chapter_id, ordinal, body, word_count, updated_at)
- entities(id, project_id, kind, name, aliases_json) · kind is character, place, object or faction
- facts(id, entity_id, attribute, value, established_in_scene_id, confidence, superseded_by)
- timeline(id, project_id, scene_id, story_time, duration, ordering_note) · story order is not manuscript order
- continuity_flags(id, scene_id, fact_id, kind, detail, resolved_at) · kind is contradiction, unestablished or anachronism
- generations(id, scene_id, prompt, context_fact_ids_json, output, accepted) · what the assistant was told, kept
- A fact records the scene that established it, so when that scene is rewritten the fact is flagged rather than silently orphaned.

Environment variables

These go in a .env file the app reads at startup. The pack's .env.example is this table as a file · copy it, never commit the filled-in version.

VariableNeededExampleWhere the value comes from
DB_PATHrequired~/.local/share/novel/project.dbThe manuscript and the bible. Back this up above everything else.
DEFAULT_MODEL_POLICYrequiredlocalWhat a new project gets. Local, so sending a manuscript is a decision.
CONTEXT_BUDGET_TOKENSrequired8000How much context a generation may carry. Selection matters more than size.
SESSION_GAP_MINUTESrequired30The gap that ends a writing session and snapshots a version.
EXPORT_FORMATrequireddocxThe format editors expect. Chapters and scene breaks preserved.
HOSTED_API_KEYsecretoptionalsk-...Only for projects explicitly set to a hosted model. Absent means local only.

The build, in order

  1. A manuscript that survives a hundred thousand words

    Writing, reordering and searching stay fast at novel length.

    1. Whole-manuscript loading fails exactly when the stakes are highest.

      Files src/scenes.ts

    2. Generate a hundred thousand word fixture. Ten thousand proves nothing.

      Files tests/scale.test.ts

    3. Per keystroke fills the history and makes it useless.

      Files src/versions.ts

    done when · tick each as it passes
    watch out
    • Loading the whole manuscript into the editor works beautifully at twenty thousand words and becomes unusable at a hundred thousand, which is exactly when the writer has the most to lose. Load and save per scene, and test against a manuscript of realistic length from the start.
  2. A bible whose facts point at the text

    Every established fact knows which scene established it.

    1. A fact with no source cannot be rechecked when the text changes.

      Files src/facts.ts

    2. A hand-maintained bible diverges within a week.

      Files src/extract.ts

    3. Characters change. A later fact is not always a contradiction.

      Files src/facts.ts

    done when · tick each as it passes
    watch out
    • A bible maintained by hand diverges from the manuscript within a week, because writers change things while writing and updating a separate document is the first thing to go. Extract candidates from the text and have the writer confirm them, so the bible is derived from the manuscript rather than parallel to it.
  3. Telling the assistant what it needs to know

    A generation request carries the relevant facts and nothing irrelevant.

    1. Entities in this scene first, then timeline neighbours.

      Files src/retrieve.tssrc/retrieve.test.ts

    2. A bad selection should be visible rather than mysterious.

      Files src/context-view.ts

    3. So a wrong output can be traced to a missing fact.

      Files src/generations.ts

    done when · tick each as it passes
    watch out
    • Sending whatever fits, in bible order, fills the context with the protagonist's full history while omitting the one fact about the character actually in the scene. Select by relevance to the scene's entities and its position in the story, and show the writer what was selected so a bad selection is visible rather than mysterious.
  4. Catching contradictions before a reader does

    The manuscript is checked against the bible and against itself.

    1. The writer needs to see the two passages together.

      Files src/continuity.ts

    2. One is a possible mistake, the other is possibly just new.

      Files src/continuity.ts

    3. Fiction is full of intentional deviations. Re-flagging them ends the feature.

      Files src/flags.ts

    done when · tick each as it passes
    watch out
    • Flagging every deviation as an error makes the check unusable in fiction, where a character lying about their eye colour is a plot point rather than a mistake. Let a flag be dismissed as intentional, keep the dismissal, and never raise the same one again.
what this build does not replace
after v1, if you want it

Need the files? The project pack on the verdict page hands your agent the whole brief · more writing tools.