scriveno 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +222 -0
  3. package/agents/continuity-checker.md +85 -0
  4. package/agents/drafter.md +248 -0
  5. package/agents/plan-checker.md +209 -0
  6. package/agents/researcher.md +114 -0
  7. package/agents/translator.md +204 -0
  8. package/agents/voice-checker.md +154 -0
  9. package/bin/install.js +1620 -0
  10. package/commands/scr/add-note.md +51 -0
  11. package/commands/scr/add-unit.md +101 -0
  12. package/commands/scr/art-direction.md +225 -0
  13. package/commands/scr/autopilot-publish.md +210 -0
  14. package/commands/scr/autopilot-translate.md +237 -0
  15. package/commands/scr/autopilot.md +200 -0
  16. package/commands/scr/back-matter.md +630 -0
  17. package/commands/scr/back-translate.md +197 -0
  18. package/commands/scr/beta-reader.md +97 -0
  19. package/commands/scr/blurb.md +149 -0
  20. package/commands/scr/book-proposal.md +210 -0
  21. package/commands/scr/build-ebook.md +448 -0
  22. package/commands/scr/build-poetry-submission.md +202 -0
  23. package/commands/scr/build-print.md +598 -0
  24. package/commands/scr/build-smashwords.md +171 -0
  25. package/commands/scr/build-world.md +158 -0
  26. package/commands/scr/cast-list.md +104 -0
  27. package/commands/scr/chapter-header.md +158 -0
  28. package/commands/scr/character-arc.md +108 -0
  29. package/commands/scr/character-ref.md +160 -0
  30. package/commands/scr/character-sheet.md +143 -0
  31. package/commands/scr/character-touch.md +157 -0
  32. package/commands/scr/character-voice-sample.md +111 -0
  33. package/commands/scr/check-notes.md +50 -0
  34. package/commands/scr/cleanup.md +159 -0
  35. package/commands/scr/compare.md +112 -0
  36. package/commands/scr/complete-draft.md +49 -0
  37. package/commands/scr/continuity-check.md +129 -0
  38. package/commands/scr/copy-edit.md +118 -0
  39. package/commands/scr/cover-art.md +382 -0
  40. package/commands/scr/cultural-adaptation.md +177 -0
  41. package/commands/scr/demo.md +93 -0
  42. package/commands/scr/dialogue-audit.md +143 -0
  43. package/commands/scr/discuss.md +118 -0
  44. package/commands/scr/discussion-questions.md +129 -0
  45. package/commands/scr/do.md +68 -0
  46. package/commands/scr/draft.md +97 -0
  47. package/commands/scr/editor-review.md +466 -0
  48. package/commands/scr/export.md +942 -0
  49. package/commands/scr/fast.md +65 -0
  50. package/commands/scr/front-matter.md +696 -0
  51. package/commands/scr/health.md +113 -0
  52. package/commands/scr/help.md +121 -0
  53. package/commands/scr/history.md +92 -0
  54. package/commands/scr/illustrate-scene.md +211 -0
  55. package/commands/scr/import.md +95 -0
  56. package/commands/scr/insert-unit.md +108 -0
  57. package/commands/scr/line-edit.md +146 -0
  58. package/commands/scr/manager.md +77 -0
  59. package/commands/scr/manuscript-stats.md +139 -0
  60. package/commands/scr/map-illustration.md +213 -0
  61. package/commands/scr/map-manuscript.md +134 -0
  62. package/commands/scr/merge-units.md +136 -0
  63. package/commands/scr/multi-publish.md +344 -0
  64. package/commands/scr/new-character.md +167 -0
  65. package/commands/scr/new-revision.md +50 -0
  66. package/commands/scr/new-work.md +148 -0
  67. package/commands/scr/next.md +125 -0
  68. package/commands/scr/originality-check.md +170 -0
  69. package/commands/scr/outline.md +131 -0
  70. package/commands/scr/pacing-analysis.md +170 -0
  71. package/commands/scr/panel-layout.md +225 -0
  72. package/commands/scr/pause-work.md +88 -0
  73. package/commands/scr/plan.md +112 -0
  74. package/commands/scr/plant-seed.md +57 -0
  75. package/commands/scr/plot-graph.md +199 -0
  76. package/commands/scr/polish.md +141 -0
  77. package/commands/scr/profile-writer.md +154 -0
  78. package/commands/scr/progress.md +51 -0
  79. package/commands/scr/publish.md +455 -0
  80. package/commands/scr/query-letter.md +183 -0
  81. package/commands/scr/quick-write.md +82 -0
  82. package/commands/scr/relationship-map.md +129 -0
  83. package/commands/scr/remove-unit.md +120 -0
  84. package/commands/scr/reorder-units.md +126 -0
  85. package/commands/scr/resume-work.md +97 -0
  86. package/commands/scr/sacred/annotation-layer.md +105 -0
  87. package/commands/scr/sacred/chronology.md +121 -0
  88. package/commands/scr/sacred/concordance.md +88 -0
  89. package/commands/scr/sacred/cross-reference.md +97 -0
  90. package/commands/scr/sacred/doctrinal-check.md +129 -0
  91. package/commands/scr/sacred/genealogy.md +107 -0
  92. package/commands/scr/sacred/source-tracking.md +101 -0
  93. package/commands/scr/sacred/verse-numbering.md +103 -0
  94. package/commands/scr/sacred-numbering-format.md +103 -0
  95. package/commands/scr/save.md +109 -0
  96. package/commands/scr/scan.md +291 -0
  97. package/commands/scr/sensitivity-review.md +169 -0
  98. package/commands/scr/series-bible.md +127 -0
  99. package/commands/scr/session-report.md +80 -0
  100. package/commands/scr/settings.md +58 -0
  101. package/commands/scr/split-unit.md +123 -0
  102. package/commands/scr/spread-layout.md +187 -0
  103. package/commands/scr/storyboard.md +262 -0
  104. package/commands/scr/subject-touch.md +168 -0
  105. package/commands/scr/submit.md +50 -0
  106. package/commands/scr/subplot-map.md +147 -0
  107. package/commands/scr/sync.md +116 -0
  108. package/commands/scr/synopsis.md +137 -0
  109. package/commands/scr/theme-tracker.md +128 -0
  110. package/commands/scr/thread.md +83 -0
  111. package/commands/scr/timeline.md +141 -0
  112. package/commands/scr/track.md +564 -0
  113. package/commands/scr/translate.md +260 -0
  114. package/commands/scr/translation-glossary.md +298 -0
  115. package/commands/scr/translation-memory.md +310 -0
  116. package/commands/scr/troubleshoot.md +59 -0
  117. package/commands/scr/undo.md +106 -0
  118. package/commands/scr/validate.md +133 -0
  119. package/commands/scr/versions.md +94 -0
  120. package/commands/scr/voice-check.md +133 -0
  121. package/commands/scr/voice-test.md +68 -0
  122. package/data/CONSTRAINTS.json +1606 -0
  123. package/data/demo/.manuscript/BRIEF.md +37 -0
  124. package/data/demo/.manuscript/CHARACTERS.md +90 -0
  125. package/data/demo/.manuscript/OUTLINE.md +46 -0
  126. package/data/demo/.manuscript/PLOT-GRAPH.md +75 -0
  127. package/data/demo/.manuscript/STATE.md +44 -0
  128. package/data/demo/.manuscript/STYLE-GUIDE.md +119 -0
  129. package/data/demo/.manuscript/THEMES.md +51 -0
  130. package/data/demo/.manuscript/WORK.md +51 -0
  131. package/data/demo/.manuscript/config.json +59 -0
  132. package/data/demo/.manuscript/drafts/body/1-the-letter-DRAFT.md +51 -0
  133. package/data/demo/.manuscript/drafts/body/2-the-workshop-DRAFT.md +51 -0
  134. package/data/demo/.manuscript/drafts/body/3-the-pier-DRAFT.md +45 -0
  135. package/data/demo/.manuscript/drafts/body/4-the-clock-DRAFT.md +59 -0
  136. package/data/demo/.manuscript/plans/5-the-reunion-PLAN.md +52 -0
  137. package/data/demo/.manuscript/reviews/2-the-workshop-REVIEW.md +61 -0
  138. package/data/export-templates/scriveno-academic.latex +184 -0
  139. package/data/export-templates/scriveno-acm.latex +67 -0
  140. package/data/export-templates/scriveno-apa7.latex +83 -0
  141. package/data/export-templates/scriveno-book.typst +175 -0
  142. package/data/export-templates/scriveno-chapbook.typst +121 -0
  143. package/data/export-templates/scriveno-elsevier.latex +76 -0
  144. package/data/export-templates/scriveno-epub.css +386 -0
  145. package/data/export-templates/scriveno-fixed-layout-epub.css +76 -0
  146. package/data/export-templates/scriveno-fixed-layout.opf +23 -0
  147. package/data/export-templates/scriveno-ieee.latex +77 -0
  148. package/data/export-templates/scriveno-lncs.latex +79 -0
  149. package/data/export-templates/scriveno-picturebook.typst +113 -0
  150. package/data/export-templates/scriveno-poetry-submission-styles.md +45 -0
  151. package/data/export-templates/scriveno-poetry-submission.docx +0 -0
  152. package/data/export-templates/scriveno-smashwords-styles.md +45 -0
  153. package/data/export-templates/scriveno-smashwords.docx +0 -0
  154. package/data/export-templates/scriveno-stageplay.typst +129 -0
  155. package/data/proof/creative-context/README.md +79 -0
  156. package/data/proof/voice-dna/GUIDED-SAMPLE.md +19 -0
  157. package/data/proof/voice-dna/README.md +45 -0
  158. package/data/proof/voice-dna/STYLE-GUIDE-EXCERPT.md +43 -0
  159. package/data/proof/voice-dna/UNGUIDED-SAMPLE.md +11 -0
  160. package/data/proof/watchmaker-flow/README.md +78 -0
  161. package/docs/architecture.md +425 -0
  162. package/docs/command-reference.md +2384 -0
  163. package/docs/configuration.md +228 -0
  164. package/docs/context-protocol.md +81 -0
  165. package/docs/contributing.md +430 -0
  166. package/docs/creative-context.md +158 -0
  167. package/docs/development.md +152 -0
  168. package/docs/drafter-quality.md +127 -0
  169. package/docs/getting-started.md +198 -0
  170. package/docs/history-protocol.md +96 -0
  171. package/docs/proof-artifacts.md +56 -0
  172. package/docs/publishing.md +296 -0
  173. package/docs/release-notes.md +457 -0
  174. package/docs/runtime-support.md +77 -0
  175. package/docs/sacred-texts.md +296 -0
  176. package/docs/shipped-assets.md +129 -0
  177. package/docs/testing.md +156 -0
  178. package/docs/translation.md +343 -0
  179. package/docs/voice-dna.md +297 -0
  180. package/docs/work-types.md +339 -0
  181. package/lib/architectural-profiles.js +134 -0
  182. package/package.json +54 -0
  183. package/templates/BRIEF.md +51 -0
  184. package/templates/CHARACTERS.md +64 -0
  185. package/templates/CONTEXT.md +56 -0
  186. package/templates/OUTLINE.md +36 -0
  187. package/templates/RECORD.md +68 -0
  188. package/templates/STATE.md +50 -0
  189. package/templates/STYLE-GUIDE.md +121 -0
  190. package/templates/THEMES.md +36 -0
  191. package/templates/WORK.md +67 -0
  192. package/templates/WORLD.md +62 -0
  193. package/templates/WRITING-RULES.md +156 -0
  194. package/templates/academic/ARGUMENT-MAP.md +40 -0
  195. package/templates/academic/CONCEPTS.md +34 -0
  196. package/templates/academic/CONTEXT.md +29 -0
  197. package/templates/academic/PROPOSAL.md +37 -0
  198. package/templates/academic/QUESTIONS.md +24 -0
  199. package/templates/config.json +72 -0
  200. package/templates/pitfalls/comic.md +54 -0
  201. package/templates/pitfalls/commentary.md +62 -0
  202. package/templates/pitfalls/memoir.md +48 -0
  203. package/templates/pitfalls/novel.md +53 -0
  204. package/templates/pitfalls/poetry_collection.md +63 -0
  205. package/templates/pitfalls/research_paper.md +66 -0
  206. package/templates/pitfalls/runbook.md +64 -0
  207. package/templates/pitfalls/screenplay.md +54 -0
  208. package/templates/platforms/README.md +16 -0
  209. package/templates/platforms/apple/manifest.yaml +20 -0
  210. package/templates/platforms/bn/manifest.yaml +20 -0
  211. package/templates/platforms/d2d/manifest.yaml +20 -0
  212. package/templates/platforms/google/manifest.yaml +20 -0
  213. package/templates/platforms/ingram/manifest.yaml +44 -0
  214. package/templates/platforms/kdp/manifest.yaml +42 -0
  215. package/templates/platforms/kobo/manifest.yaml +20 -0
  216. package/templates/platforms/smashwords/manifest.yaml +26 -0
  217. package/templates/sacred/COSMOLOGY.md +88 -0
  218. package/templates/sacred/DOCTRINES.md +45 -0
  219. package/templates/sacred/FIGURES.md +69 -0
  220. package/templates/sacred/FRAMEWORK.md +98 -0
  221. package/templates/sacred/LINEAGES.md +52 -0
  222. package/templates/sacred/README.md +20 -0
  223. package/templates/sacred/THEOLOGICAL-ARC.md +69 -0
  224. package/templates/sacred/catholic/manifest.yaml +93 -0
  225. package/templates/sacred/islamic-hafs/manifest.yaml +134 -0
  226. package/templates/sacred/islamic-warsh/manifest.yaml +134 -0
  227. package/templates/sacred/jewish/manifest.yaml +56 -0
  228. package/templates/sacred/orthodox/manifest.yaml +98 -0
  229. package/templates/sacred/pali/manifest.yaml +20 -0
  230. package/templates/sacred/protestant/manifest.yaml +86 -0
  231. package/templates/sacred/sanskrit/manifest.yaml +20 -0
  232. package/templates/sacred/tewahedo/manifest.yaml +106 -0
  233. package/templates/sacred/tibetan/manifest.yaml +20 -0
  234. package/templates/technical/AUDIENCE.md +26 -0
  235. package/templates/technical/DEPENDENCIES.md +19 -0
  236. package/templates/technical/DOC-BRIEF.md +45 -0
  237. package/templates/technical/PROCEDURES.md +37 -0
  238. package/templates/technical/REFERENCES.md +36 -0
  239. package/templates/technical/SYSTEM.md +25 -0
@@ -0,0 +1,425 @@
1
+ # Scriveno Architecture
2
+
3
+ How Scriveno works under the hood -- for developers who want to understand the system before extending it.
4
+
5
+ ## Overview
6
+
7
+ Scriveno is a pure skill system. There is no compiled code, no runtime library, no framework. AI coding agents (Claude Code, Cursor, Gemini CLI, and others) read markdown command files and follow their instructions using their built-in tools (Read, Write, Bash).
8
+
9
+ The entire system is a collection of files:
10
+
11
+ - **Command files** tell the agent what to do when a writer invokes `/scr:draft` or `/scr:new-work`
12
+ - **Agent files** provide specialized instructions for tasks like drafting and voice-checking
13
+ - **CONSTRAINTS.json** is the central registry that controls which commands are available for which work types
14
+ - **Templates** provide starting content for new projects
15
+
16
+ Nothing compiles. Nothing bundles. Changes take effect immediately because the agent reads files at runtime.
17
+
18
+ ## Skill System Design
19
+
20
+ The skill system works like this:
21
+
22
+ 1. The writer types a slash command (e.g., `/scr:draft 3`)
23
+ 2. The AI agent reads `commands/scr/draft.md`
24
+ 3. The command file contains step-by-step instructions in plain markdown
25
+ 4. The agent follows those instructions, using its tools to read files, write drafts, and run checks
26
+
27
+ Each command file has YAML frontmatter (metadata) and a markdown body (instructions):
28
+
29
+ ```yaml
30
+ ---
31
+ description: Draft the planned unit. Invokes the drafter agent in fresh context.
32
+ argument-hint: "[unit number, optional]"
33
+ ---
34
+
35
+ # Draft {unit}
36
+
37
+ You are orchestrating the drafter agent to produce the actual prose...
38
+
39
+ ## What to do
40
+
41
+ 1. Find all plan files for the unit...
42
+ 2. For each atomic unit, invoke the drafter agent in fresh context...
43
+ 3. Save drafted output...
44
+ ```
45
+
46
+ The agent reads this file and executes it. No SDK, no API calls, no imports. The markdown IS the program.
47
+
48
+ ### Why markdown?
49
+
50
+ - **Portability.** Any AI agent that can read files can run Scriveno
51
+ - **No build step.** Contributors edit a `.md` file and the change is live
52
+ - **Inspectable.** The writer can read any command file to understand exactly what Scriveno will do
53
+ - **No dependencies.** No node_modules, no pip install, no version conflicts
54
+
55
+ ## CONSTRAINTS.json Schema
56
+
57
+ `data/CONSTRAINTS.json` is the central registry. Every command checks it at runtime to determine what is available, what adapts, and what is restricted. Here are the top-level sections.
58
+
59
+ ### work_type_groups
60
+
61
+ Groups related work types together. Commands use these groups for availability:
62
+
63
+ ```json
64
+ "work_type_groups": {
65
+ "prose": {
66
+ "label": "Prose",
67
+ "members": ["novel", "novella", "short_story", "flash_fiction",
68
+ "memoir", "creative_nonfiction", "biography", "essay",
69
+ "essay_collection"]
70
+ },
71
+ "sacred": {
72
+ "label": "Sacred & Historical",
73
+ "members": ["scripture_biblical", "scripture_quranic", "commentary",
74
+ "devotional", "liturgical", "historical_chronicle", ...]
75
+ }
76
+ }
77
+ ```
78
+
79
+ There are 9 groups: prose, script, academic, technical, visual, poetry, interactive, speech_song, and sacred. Together they contain 50 work types.
80
+
81
+ ### work_types
82
+
83
+ Individual work type definitions. Each entry specifies its structural hierarchy and which hierarchy level commands operate on:
84
+
85
+ ```json
86
+ "novel": {
87
+ "label": "Novel",
88
+ "group": "prose",
89
+ "hierarchy": { "top": "part", "mid": "chapter", "atomic": "scene" },
90
+ "command_unit": "chapter"
91
+ }
92
+ ```
93
+
94
+ - **`hierarchy`** -- Three structural levels. The `top` is the largest division (part, act, testament), `mid` is the middle (chapter, scene, section), and `atomic` is the smallest unit that gets drafted individually (scene, beat, verse).
95
+ - **`command_unit`** -- Determines how commands adapt their terminology. A novel's `/scr:draft` talks about drafting a chapter. A screenplay's `/scr:draft` talks about drafting an act.
96
+
97
+ Sacred work types can also specify defaults:
98
+
99
+ ```json
100
+ "scripture_quranic": {
101
+ "label": "Scripture (Quranic)",
102
+ "group": "sacred",
103
+ "hierarchy": { "top": null, "mid": "surah", "atomic": "ayah" },
104
+ "command_unit": "surah",
105
+ "config_defaults": {
106
+ "verse_numbering_system": "quranic_hafs",
107
+ "calendar_system": "hijri"
108
+ }
109
+ }
110
+ ```
111
+
112
+ ### commands
113
+
114
+ The command registry. Each entry maps a command name to its category, availability, and behavior:
115
+
116
+ ```json
117
+ "draft": {
118
+ "category": "core",
119
+ "available": ["all"],
120
+ "renames_by_unit": true,
121
+ "description": "Draft the planned unit"
122
+ },
123
+ "editor-review": {
124
+ "category": "core",
125
+ "available": ["all"],
126
+ "adapted": {
127
+ "academic": { "rename": "peer-review" },
128
+ "sacred": { "rename": "scholarly-review" }
129
+ },
130
+ "description": "Manual review of drafted unit"
131
+ }
132
+ ```
133
+
134
+ - **`available`** -- `["all"]` means universal. Otherwise, list specific group names like `["prose", "script"]`.
135
+ - **`renames_by_unit`** -- Legacy schema flag indicating that the command's terminology adapts based on the project's `command_unit`. The runnable command id remains the canonical base command.
136
+ - **`adapted`** -- Per-group overrides. The `editor-review` command becomes `peer-review` for academic works, `technical-review` for technical docs, and `scholarly-review` for sacred works.
137
+
138
+ ## File Structure
139
+
140
+ ```
141
+ scriveno/
142
+ commands/
143
+ scr/ Core command tree (100+ command files total, including sacred subcommands)
144
+ draft.md Core workflow: draft a unit
145
+ new-work.md Core workflow: start a new project
146
+ autopilot.md Autonomous pipeline orchestrator
147
+ help.md Navigation: show available commands
148
+ ...
149
+ sacred/ 8 sacred-exclusive subcommands
150
+ concordance.md
151
+ cross-reference.md
152
+ ...
153
+ agents/
154
+ drafter.md Drafts one atomic unit in the writer's voice
155
+ voice-checker.md Compares drafts against STYLE-GUIDE.md
156
+ continuity-checker.md Catches contradictions and timeline errors
157
+ plan-checker.md Validates unit plans before drafting
158
+ researcher.md Gathers research material
159
+ translator.md Translates content with voice preservation
160
+ data/
161
+ CONSTRAINTS.json Central constraint registry (the source of truth)
162
+ demo/ Pre-baked demo project (watchmaker story)
163
+ export-templates/ Output format templates
164
+ scriveno-book.typst Book interior PDF
165
+ scriveno-epub.css EPUB styling
166
+ scriveno-academic.latex Academic paper formatting
167
+ templates/
168
+ config.json Per-project configuration template
169
+ WORK.md Work overview template
170
+ OUTLINE.md Structural outline template
171
+ RECORD.md Established content store template
172
+ CHARACTERS.md Character profiles template
173
+ STYLE-GUIDE.md Voice DNA template
174
+ WRITING-RULES.md Universal AI-tell rulebook (1.6.0+)
175
+ THEMES.md Thematic threads template
176
+ STATE.md Progress tracking template
177
+ BRIEF.md Project brief template
178
+ WORLD.md World-building template
179
+ pitfalls/ Per-work-type pitfall packs (1.6.0+)
180
+ novel.md, memoir.md, screenplay.md, runbook.md,
181
+ research_paper.md, poetry_collection.md, comic.md,
182
+ commentary.md (drop-in extensible: contributors add
183
+ <work_type>.md and listPitfallPacks() picks it up)
184
+ technical/ Technical-writing template variants
185
+ DOC-BRIEF.md Replaces BRIEF.md for technical docs
186
+ AUDIENCE.md Reader and audience contract
187
+ DEPENDENCIES.md Systems, owners, and interface map
188
+ SYSTEM.md Replaces WORLD.md for technical docs
189
+ PROCEDURES.md Replaces PLOT-GRAPH.md for technical docs
190
+ REFERENCES.md Replaces THEMES.md for technical docs
191
+ sacred/ Sacred-specific templates
192
+ FIGURES.md Replaces CHARACTERS.md for sacred works
193
+ DOCTRINES.md Theological framework
194
+ COSMOLOGY.md World/cosmological structure
195
+ LINEAGES.md Genealogies and lineage tracking
196
+ FRAMEWORK.md Interpretive framework
197
+ THEOLOGICAL-ARC.md Replaces PLOT-GRAPH.md for sacred works
198
+ bin/
199
+ install.js Multi-platform installer (Node.js)
200
+ docs/
201
+ proof-artifacts.md Canonical proof layer and artifact index
202
+ getting-started.md Install to first draft in 10 minutes
203
+ command-reference.md Full command listing with usage
204
+ work-types.md 50 work types and how they adapt Scriveno
205
+ voice-dna.md Voice profile system guide
206
+ publishing.md Export formats and publishing pipelines
207
+ sacred-texts.md Sacred work types and voice registers
208
+ translation.md Translation pipeline guide
209
+ contributing.md How to extend Scriveno (commands, agents, etc.)
210
+ configuration.md Package, installer, constraints, and project config surfaces
211
+ development.md Contributor workflow for changing Scriveno itself
212
+ testing.md Test suite coverage and release-safety checks
213
+ shipped-assets.md Canonical shipped-template and trust-file inventory
214
+ runtime-support.md Canonical runtime matrix and Node baseline
215
+ release-notes.md Public package-release summaries
216
+ architecture.md This file
217
+ .manuscript/ Per-project working directory (created by commands)
218
+ ```
219
+
220
+ The `.manuscript/` directory is created when a writer runs `/scr:new-work`. It contains their project's context files (STYLE-GUIDE.md, OUTLINE.md, RECORD.md, CHARACTERS.md, etc.), plans, drafts, and state. It is not shipped with Scriveno -- it is generated per project.
221
+
222
+ ## Creative Context
223
+
224
+ Scriveno context files can include optional Creative Context metadata that helps commands route project memory without changing the historical file contract. See [Creative Context](creative-context.md) for the full pilot protocol.
225
+
226
+ The important rule is unchanged: `STYLE-GUIDE.md` is sovereign and loads first for any prose-producing task. Other metadata is advisory. Existing projects without frontmatter still work through the established filenames.
227
+
228
+ ## Agent Orchestration
229
+
230
+ Commands invoke agents to perform specialized work. Here is how the orchestration flows:
231
+
232
+ ```
233
+ Writer: /scr:draft 3
234
+ |
235
+ v
236
+ commands/scr/draft.md
237
+ (orchestration command)
238
+ |
239
+ | For each atomic unit (scene):
240
+ |
241
+ v
242
+ agents/drafter.md <-- fresh context per unit
243
+ receives: STYLE-GUIDE.md, 3-1-PLAN.md, CHARACTERS.md excerpt,
244
+ previous unit tail (200 words), THEMES.md excerpt
245
+ produces: .manuscript/drafts/body/3-1-DRAFT.md
246
+ |
247
+ v
248
+ agents/voice-checker.md <-- fresh context
249
+ receives: STYLE-GUIDE.md, .manuscript/drafts/body/3-1-DRAFT.md
250
+ produces: voice score + issues list
251
+ |
252
+ v
253
+ draft.md updates STATE.md, reports to writer
254
+ ```
255
+
256
+ The autopilot command (`/scr:autopilot`) chains multiple stages:
257
+
258
+ ```
259
+ /scr:autopilot
260
+ |
261
+ FOR each unit in OUTLINE.md:
262
+ |
263
+ +-> /scr:discuss N
264
+ +-> /scr:plan N
265
+ +-> /scr:draft N
266
+ | +-> drafter agent (per atomic unit)
267
+ | +-> voice-checker agent
268
+ +-> /scr:editor-review N
269
+ +-> /scr:submit N
270
+ |
271
+ Pause behavior depends on profile:
272
+ guided -> pause after every atomic unit
273
+ supervised -> pause at structural boundaries
274
+ full-auto -> pause only on errors
275
+ ```
276
+
277
+ Key points:
278
+
279
+ - Commands are orchestrators. They read instructions and coordinate work.
280
+ - Agents are workers. They receive specific files and produce specific output.
281
+ - Each agent invocation is independent. No shared state between invocations.
282
+ - STYLE-GUIDE.md is always the first file loaded into any agent that produces or evaluates prose.
283
+
284
+ ## Fresh Context per Unit
285
+
286
+ This is the core architectural pattern that makes Scriveno work. Every agent invocation starts with a clean context -- no prior conversation, no accumulated state, no cross-contamination.
287
+
288
+ ### Why fresh context?
289
+
290
+ **Voice drift.** When an AI accumulates context across multiple scenes, its writing style gradually shifts. By scene 10, it no longer sounds like the writer -- it sounds like an average of everything it has read. Fresh context forces the agent to re-read STYLE-GUIDE.md every time, resetting the voice profile.
291
+
292
+ **Context bloat.** A 100,000-word novel would overwhelm the agent's context window if loaded all at once. Fresh context means each unit works within comfortable limits.
293
+
294
+ **Focus.** The agent receives only what it needs for this one unit. No distractions from other chapters, no temptation to revise what came before, no interference from unrelated plot threads.
295
+
296
+ ### What the drafter receives
297
+
298
+ For each atomic unit (scene, subsection, passage, stanza), the drafter agent gets, loaded in this exact order so the prompt cache stays warm across invocations:
299
+
300
+ 1. **STYLE-GUIDE.md** -- Always first, sovereign. The voice DNA profile with 15+ dimensions: POV, tense, sentence architecture, vocabulary register, figurative density, dialogue style, pacing, and always/never/consider rules.
301
+ 2. **WRITING-RULES.md** (optional, 1.6.0+) -- Universal human-first and AI-tell rulebook. The canonical list covers human-first restraint, factual integrity, register awareness, artifact cleanup, hedging, throat-clearing, balanced-both-sides constructions, generic metaphors, symmetrical rhythm, moralizing closings, AI tics in dialogue, and show-don't-tell triggers. Loaded if present; falls back to inline rules in `agents/drafter.md` when absent.
302
+ 3. **Pitfall pack** (optional, 1.6.0+) -- Type-specific traps from `templates/pitfalls/<work_type>.md` (or `.manuscript/PITFALLS.md` for project-local overrides). Refines WRITING-RULES.md with traps unique to the work type: filter words for prose, unfilmable description for screenplays, missing-precondition checks for runbooks, anachronism for sacred commentary.
303
+ 4. **.manuscript/plans/{N}-{A}-PLAN.md** -- The specific plan for this unit: what happens, emotional arc, beats to hit, voice notes, continuity anchors. Legacy root-level plans are accepted only as older project input.
304
+ 5. **CHARACTERS.md or FIGURES.md** -- Full file by default, with voice anchors, speech patterns, persona notes, relationship-specific interactions, and current state. Filtering to relevant entries is opt-in through `draft.context_profile: minimal`.
305
+ 6. **Previous unit tail** -- The last 200 words of the preceding unit, for rhythm and tone continuity.
306
+ 7. **THEMES.md excerpt** -- Only the thematic threads this unit should advance.
307
+ 8. **WORK.md excerpt** -- Premise, tone, central question (for orientation, not copying).
308
+
309
+ Conflict resolution is top-down: STYLE-GUIDE.md beats WRITING-RULES.md beats the pitfall pack. The writer's voice stays sovereign; the rule layers are scaffolding intended to keep weaker models from drifting into generic AI prose while preserving factual integrity, register, and human texture. The `draft` block in `.manuscript/config.json` (`rigor`, `context_profile`, `pitfalls_enabled`) tunes the system. See [Drafter Quality](drafter-quality.md) for the full reference.
310
+
311
+ ### What the drafter does NOT receive
312
+
313
+ - The full manuscript -- trust the plan file
314
+ - Other units' drafts -- no cross-contamination
315
+ - Revision history -- each draft is fresh
316
+ - The writer's conversation -- the agent is a craft worker, not a chatbot
317
+
318
+ This constraint is what makes voice fidelity possible. The drafter writes one unit at a time, grounded in the voice profile, without drifting toward a generic AI voice.
319
+
320
+ ## Installer Architecture
321
+
322
+ The installer (`bin/install.js`) handles getting Scriveno's files into the right place for each AI agent runtime.
323
+
324
+ ### Platform detection
325
+
326
+ The installer detects which AI agents are available by checking for their configuration directories:
327
+
328
+ | Runtime | Detection | Type |
329
+ |---------|-----------|------|
330
+ | Claude Code | `~/.claude` exists | commands |
331
+ | Cursor | `~/.cursor` exists | commands |
332
+ | Gemini CLI | `~/.gemini` exists | commands |
333
+ | Codex | `~/.codex` exists | skills |
334
+ | OpenCode | `~/.config/opencode` exists | commands |
335
+ | GitHub Copilot | `~/.github` exists | commands |
336
+ | Windsurf | `~/.windsurf` exists | commands |
337
+ | Antigravity | `~/.gemini/antigravity` exists | commands |
338
+ | Manus Desktop | `~/.manus` or Manus.app exists | skills |
339
+ | Perplexity Desktop | `/Applications/Perplexity.app` or `~/Applications/Perplexity.app` exists | guided-mcp |
340
+ | Generic | Fallback (never auto-detected) | skills |
341
+
342
+ ### Three installation strategies
343
+
344
+ **Command-directory (type: `commands`).** Copies individual command markdown files into the agent's command directory (for Claude Code, `~/.claude/commands/scr-*.md`; for other slash-command runtimes, nested `scr/` directories are still used). Each file becomes a slash command. Also copies agent files to the agent directory. This is the native approach for agents that support file-based commands.
345
+
346
+ **Skill-file (type: `skills`).** Generates a single `SKILL.md` manifest file that lists all commands in a table. For platforms that do not support file-based command directories (like Manus), the SKILL.md acts as a command index that the agent reads to discover available commands. The agent then reads individual command files from the package directory.
347
+
348
+ Codex uses a skill-native variation of this strategy. The installer generates one `$scr-*` skill per Scriveno command under `.codex/skills/`, while also mirroring the underlying command markdown into `.codex/commands/scr/` so the generated skills can read the installed command files as their source of truth.
349
+
350
+ **Guided local-MCP (type: `guided-mcp`).** Writes setup assets and connector recipes for runtimes that expose a documented local-MCP surface instead of a writable slash-command directory. Perplexity Desktop currently fits this model: Scriveno writes a setup guide and filesystem-server command recipe under `.scriveno/perplexity/`, and the user adds that command inside Perplexity Desktop's Connectors UI.
351
+
352
+ ### Installation modes
353
+
354
+ The installer supports two scopes:
355
+
356
+ - **Global** -- Installs to the user's home directory (`~/.claude/commands/scr-*.md` for Claude Code). Commands available in all projects.
357
+ - **Project** -- Installs to the current project directory (`.claude/commands/scr-*.md` for Claude Code). Commands scoped to this project only.
358
+
359
+ The user chooses during installation. Guided local-MCP targets still write their setup assets globally or per-project, but the connector itself remains tied to the specific project paths the user allows.
360
+
361
+ ### Runtime credibility
362
+
363
+ Scriveno's installer compatibility floor is `Node.js >=20.0.0`. For new installs, prefer a currently supported LTS such as Node.js 24. The compatibility floor applies to `npx scriveno@latest`, `bin/install.js`, and the repo's JavaScript test suite, not to the markdown command system once files are installed.
364
+
365
+ This architecture doc is intentionally about mechanics: detection rules, install path shapes, `commands` versus `skills` versus `guided-mcp`, and global versus project scope. For the authoritative runtime matrix, support levels, and verification status, see [`docs/runtime-support.md`](runtime-support.md).
366
+
367
+ ## Voice DNA Pipeline
368
+
369
+ The Voice DNA system is what makes Scriveno's output sound like the writer, not like AI. Here is how STYLE-GUIDE.md flows through the system.
370
+
371
+ ### Creation
372
+
373
+ When the writer runs `/scr:new-work`, Scriveno asks if they have existing writing samples. If they do, `/scr:profile-writer` analyzes the samples across 15+ dimensions to build the voice profile:
374
+
375
+ - Point of view (close third, first person, omniscient, etc.)
376
+ - Tense (past, present, mixed)
377
+ - Sentence architecture (length distribution, variation patterns)
378
+ - Vocabulary register (formal, conversational, lyrical, sparse)
379
+ - Word origin preference (Anglo-Saxon vs Latinate)
380
+ - Figurative density (metaphor/simile frequency)
381
+ - Dialogue style (tagged, untagged, dialect handling)
382
+ - Pacing (scene-to-summary ratio, paragraph rhythm)
383
+ - Always/never/consider rules (specific writer preferences)
384
+
385
+ The result is saved to `.manuscript/STYLE-GUIDE.md`.
386
+
387
+ ### Loading
388
+
389
+ Every agent that produces or evaluates prose loads STYLE-GUIDE.md **first**, before any other file. This is a hard rule -- the voice profile must be the agent's primary frame of reference.
390
+
391
+ ### Enforcement
392
+
393
+ The voice-checker agent (`agents/voice-checker.md`) compares drafted prose against STYLE-GUIDE.md and produces:
394
+
395
+ - A voice consistency score
396
+ - Specific issues organized by category (structural voice, lexical voice, character voice, AI-slop indicators)
397
+ - Severity ratings (drift vs critical violation)
398
+
399
+ The voice-checker is invoked after every drafted unit. If drift exceeds the configured threshold (default: 0.3 in `config.json`), the writer is offered a re-draft.
400
+
401
+ ### Calibration
402
+
403
+ Writers can refine their voice profile over time with `/scr:voice-test` (test the profile against new samples) and `/scr:profile-writer` (re-analyze with additional samples). The profile is additive -- new samples refine the dimensions, they do not replace them.
404
+
405
+ ## Design Principles
406
+
407
+ ### Zero dependencies
408
+
409
+ Scriveno's `package.json` has no runtime dependencies. The installer is pure Node.js. Commands are markdown. This means no version conflicts, no supply-chain attacks, no broken builds. External tools (Pandoc, Typst) are optional prerequisites for export features -- the core writing workflow needs nothing beyond the AI agent itself.
410
+
411
+ ### Plan is canonical
412
+
413
+ The product plan is the source of truth. If a command file contradicts the plan, the command file is wrong. This ensures consistency across 112 commands and prevents drift as multiple contributors work on the system.
414
+
415
+ ### Backward compatibility
416
+
417
+ Existing commands must keep working as new features are added. The constraint system (CONSTRAINTS.json) makes this manageable -- new work types and commands are additive, and existing `available` arrays are not modified without explicit decision.
418
+
419
+ ### Progressive disclosure
420
+
421
+ Onboarding asks 3 questions max. Depth is optional and additive. The writer should be drafting within minutes, not configuring options. Advanced features (autopilot profiles, voice calibration, sacred voice registers) are discoverable but not mandatory.
422
+
423
+ ## Next Steps
424
+
425
+ To extend Scriveno, see the [contributor guide](contributing.md). For the full command listing, see the [command reference](command-reference.md).