Codex Schema And Character Souls
Scritorio’s Codex should support two kinds of author knowledge at the same time:- product-defined fields that make common book entities structured, searchable, and useful to AI
- author-defined fields that let each book invent the metadata its world, argument, genre, or process actually needs
soul.md-style voice file. This lets the author chat with a character for inspiration, grounding, contradiction checks, emotional exploration, and dialogue discovery without confusing that conversation with finished manuscript prose or approved canon.
OpenClaw Inspiration
OpenClaw describesSOUL.md as the place where an agent’s voice lives and says it is injected into normal sessions, giving it real weight in behavior. Its current docs recommend using it for tone, opinions, brevity, humor, boundaries, and bluntness, while avoiding life-story dumps, changelogs, security-policy walls, or vague vibes with no behavioral effect. It also distinguishes SOUL.md from operating rules: use the soul for voice, stance, and style; use other instruction files for operational behavior.
Scritorio should adapt that idea for characters. A character soul is not a general-purpose autonomous agent identity. It is a constrained authoring instrument that shapes how a fictional person speaks, notices, avoids, lies, jokes, resists, and responds under pressure.
Character Soul
Every character may have a character soul. Major characters should be encouraged to have one. The character soul should answer:- what does this character sound like from the inside
- what values do they act from before they explain themselves
- what do they notice first in a room, person, or threat
- what do they avoid saying directly
- what do they overstate, understate, joke about, or refuse to joke about
- how do they respond when afraid, ashamed, attracted, angry, relieved, or cornered
- how do they speak differently to different people
- what do they know, not know, misunderstand, or refuse to admit
- what boundaries should the AI respect when simulating them
- a complete biography
- a replacement for the character dossier
- a canon dump
- a changelog
- a generic personality horoscope
- a permission slip for the AI to invent facts and silently add them to canon
Suggested File Shape
For new projects, Scritorio should prefer a folder shape for major Codex entities:- if a character has
soul.md, use it as the dedicated character soul - if a character has a
## Soulor## Voicesection inside the dossier, offer to extract it later - if a legacy flat character file exists, do not force conversion
- if the author wants one-file simplicity, keep it available
Character Chat
Character chat is a separate mode from Editorial Board critique. The author can open a character and choose to chat with them. The AI response should be shaped by:- Scritorio safety and authorship rules
- the selected character’s
soul.md - the character dossier and approved canon
- selected manuscript context, if the author includes it
- selected relationship or scene context, if relevant
- interviewing a character about a choice
- testing a scene beat from inside the character’s point of view
- asking what the character is hiding or avoiding
- exploring how the character would react to another character
- generating dialogue options that preserve voice
- checking whether a proposed action feels psychologically true
- surfacing contradictions between the soul, dossier, and manuscript
Time-Aware Character Chat
Character chat should always be anchored to a story moment. The v1 desktop entry point is the character dossier because the author’s intent usually starts as “let me talk to Adrian.” From there, Scritorio asks whether the chat should use the current dossier state or manuscript prose through a selected chapter or scene. For “chat with Adrian through chapter 5,” Scritorio resolves:- the selected character dossier
- the selected character soul, when one exists
- the canonical manuscript order
- bounded manuscript prose through chapter 5
Manuscript Context Files
Scritorio should separate author-owned source files from rebuildable metadata. Author-owned source files:story.yml is the canonical order file. It should identify the intended manuscript order without relying on mutable chapter numbers:
state/chapters/, state/characters/, generated state/README.md, and generated timeline/events.yml. It does not remove manuscript, codex, notes, assets, exports, or .scritorio metadata.
Canon Boundaries
Character chat can inspire canon, but it cannot silently create canon. Outputs should be treated as:in-character: what the simulated character says or impliesout-of-character: notes about why the answer may matter to the authorcanon proposal: a structured suggestion that the author can accept, edit, or reject
Prompt Formation
For character chat, Scritorio should form the prompt in layers:- the character dossier supplies stable identity, starting age, appearance, role, relationships, and canon fields
- the soul supplies voice, interiority, rhythm, default reactions, wounds, wants, and conversational posture
- manuscript prose supplies what has happened through the selected boundary
- canon tools can still retrieve additional location, organization, concept, or character files during the chat
Product-Defined Fields
Scritorio should provide product-defined fields for each major Codex type. These fields make the app useful out of the box, support reliable search and filtering, and give AI features predictable anchors. All Codex entries should share common fields:| Field | Purpose |
|---|---|
id | Stable semantic id. |
type | Canonical Codex type. |
name | Primary display name. |
aliases | Alternate names, spellings, titles, or search handles. |
short_description | Compact summary for lists, search, and AI context. |
categories | Author-facing grouping. |
tags | Lightweight labels. |
global | Whether the entry applies across a series or project scope. |
ai_context | Concise AI-facing guidance. |
do_not_contradict | Hard facts or rules the AI should preserve. |
Character Fields
Characters should include:pov_allowedrolepronounsageorbirth_datehome_locationcurrent_locationaffiliationsrelationshipsappearancevoicemotivationconflictarcsecretsflawsskillshabitsbackgroundcontinuity_notessoul_path
soul_path field points to the dedicated soul file when one exists.
Location Fields
Locations should include:parent_locationlocation_typescalegeographypopulationculturebuilt_formsensory_detailsrules_or_constraintsservicestransitassociated_charactersassociated_organizationsstory_anchorscontinuity_notes
Organization Fields
Organizations should include:organization_typepurposebeliefsstructureleadershipmembersalliesopponentscontrolled_locationsresourcesruleshistorypublic_reputationprivate_truthstory_anchorscontinuity_notes
Item Fields
Items should include:item_typeownercreatorcurrent_locationfirst_appearancelast_seenphysical_descriptionmaterialsfunctionsignificancehistoryrules_or_behaviorstatestate_changesassociated_charactersassociated_locationsassociated_organizationscontinuity_notes
Concept Fields
Concepts should include:concept_typesummaryruleslimitationsexceptionshistorycultural_meaninglegal_statusscientific_basisrelated_charactersrelated_locationsrelated_organizationsrelated_itemsrelated_eventscontinuity_notes
Event Fields
Events should include:datetimecalendarsequencebookactchapterscenesource_pathslocationparticipantsorganizationsitemsconceptssummarycauseconsequencesreader_knowsknown_by_characterscharacter_state_changesrevealed_inspoiler_levelcontinuity_notes
Style Fields
Style entries should include:scopeseverityruleexamplesanti_examplesapplies_torationalerelated_entries
Author-Defined Fields
Authors need custom fields because each book invents its own taxonomy. A hard-science novel may need fields such as:orbital_periodterraforming_statuscommunications_lagtech_constraints
magic_schooloath_boundcurse_rulesprophecy_links
source_confidencejurisdictioncase_study_regionevidence_type
- name
- label
- applies-to Codex types
- value type: text, long text, number, boolean, date, list, relation, enum, URL, citation, asset
- allowed values for enum fields
- default value
- whether the field is visible in compact lists
- whether the field is included in AI context by default
- whether the field is treated as a hard continuity constraint
Persona-Created Entries
Personas should be able to propose Codex changes in two directions:- update an existing entry when the author asks to revise character, location, organization, item, concept, event, or style canon
- create a new entry when the author names something important that does not yet exist in the Codex
- Codex type
- proposed name
- safe project-relative path
- product-defined fields
- author-defined custom fields, when relevant
- proposed Markdown body
- warnings about possible duplicates or ambiguity
- optional
soul.mdcontent for character entries
- Codex type
- resolved target entry
- target section or field
- original excerpt when available
- proposed replacement or insertion
- warnings when the target is ambiguous
Field Governance
Product-defined fields and author-defined fields should behave differently:- product-defined fields are stable app concepts
- author-defined fields are project concepts
- custom fields should never overwrite product-defined fields with the same name without explicit confirmation
- renaming a custom field should offer to migrate existing entries
- deleting a custom field should not silently delete values from Markdown
- AI should be able to read custom fields only when the author allows them into context
AI Context Use
AI features should understand the difference between:- compact list fields used for discovery
- dossier prose used for richer context
- soul files used for voice simulation
- hard constraints used for continuity protection
- custom fields that may or may not be relevant to a task
soul.md is the primary voice source. For continuity review, do_not_contradict, timeline, and dossier facts are stronger than the soul. For drafting suggestions, style rules and character soul can work together, but the output should remain a suggestion until the author accepts it.