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,564 @@
1
+ ---
2
+ description: Manage revision tracks -- create, switch, compare, merge, and propose changes for review.
3
+ argument-hint: "<create|list|switch|compare|merge|propose> [name] [options]"
4
+ ---
5
+
6
+ # /scr:track -- Revision Track Management
7
+
8
+ Revision tracks let writers explore alternate versions of their manuscript without risking the canon. Each track is a named workspace -- "Second draft attempt", "Editor's suggestions", "Experimental ending" -- that can be compared, merged back into canon, or proposed for review.
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ /scr:track create <name>
14
+ /scr:track list
15
+ /scr:track switch <name>
16
+ /scr:track compare [track-a] [track-b]
17
+ /scr:track merge <name>
18
+ /scr:track propose <name>
19
+ ```
20
+
21
+ ## Prerequisites
22
+
23
+ 1. **Check for `.manuscript/` directory.** If missing: "No manuscript found. Start with `/scr:new-work`."
24
+ 2. **Check for `.git/` directory.** If missing, silently run `git init` (writer mode) or inform and init (developer mode), following the same pattern as `/scr:save`.
25
+ 3. **Read `.manuscript/config.json`** for `developer_mode` and `work_type`.
26
+ 4. **Parse the subcommand** from the first argument. If none provided or unrecognized, show the usage table above and a brief description of each subcommand.
27
+
28
+ ## tracks.json Format
29
+
30
+ Track metadata lives in `.manuscript/tracks.json`. Create this file on first `track create` if it does not exist.
31
+
32
+ ```json
33
+ {
34
+ "canon_branch": "trunk",
35
+ "tracks": [
36
+ {
37
+ "label": "Editor's suggestions",
38
+ "branch": "track/editors-suggestions",
39
+ "created": "2026-04-07T10:30:00Z",
40
+ "author": "writer",
41
+ "status": "active",
42
+ "merged_at": null,
43
+ "proposed_at": null
44
+ }
45
+ ]
46
+ }
47
+ ```
48
+
49
+ **Label-to-branch mapping (D-01):** Writer-friendly labels are stored as-is. The git branch name is derived by slugifying the label: lowercase, replace spaces with hyphens, strip special characters (keep alphanumeric and hyphens only), prefix with `track/`. Example: "Second Draft Attempt" becomes `track/second-draft-attempt`.
50
+
51
+ **Canon branch metadata:** `canon_branch` stores the real branch name of the canon manuscript. This may be `main`, `master`, `trunk`, or any other branch name the writer uses.
52
+
53
+ ## Canon Branch Resolution
54
+
55
+ Any subcommand that needs the canon manuscript must resolve the canon branch in this order:
56
+
57
+ 1. If `.manuscript/tracks.json` has a top-level `canon_branch`, use it.
58
+ 2. Otherwise, read the current branch with `git branch --show-current`. If it exists and does not start with `track/`, treat that branch as canon and write it back to `tracks.json` as `canon_branch`.
59
+ 3. Otherwise, if the repo has a remote default branch (`git symbolic-ref refs/remotes/origin/HEAD`), use that short branch name.
60
+ 4. Otherwise, inspect the local branches. If there is exactly one non-`track/` local branch, use it as canon and write it back to `tracks.json` as `canon_branch`.
61
+ 5. Otherwise, fall back to `trunk` if it exists locally, then `main`, then `master`.
62
+ 6. If none of the above succeeds, stop and tell the writer: "I can't tell which branch is your canon manuscript. Switch to the branch that should be canon, then run `/scr:track create <name>` again."
63
+
64
+ ---
65
+
66
+ ## Subcommand: track create
67
+
68
+ **Purpose:** Create a new revision track with a writer-friendly name.
69
+
70
+ **What to do:**
71
+
72
+ 1. Take the `<name>` argument as the writer-friendly label (e.g., "Second draft attempt", "Editor's suggestions").
73
+ 2. Generate the slug identifier: lowercase, spaces to hyphens, strip special chars. Do not add the `track/` prefix yet; keep the raw slug available for collision handling and metadata.
74
+ 3. Check if a track with this label already exists in `tracks.json`. If so: "A revision track called '[name]' already exists. Use `/scr:track switch [name]` to work on it."
75
+ 4. Check for unsaved changes (`git status --porcelain .manuscript/`). If changes exist: "You have unsaved changes. Save them first with `/scr:save` before creating a new track."
76
+ 5. Resolve the canon branch using the Canon Branch Resolution rules above. On a first track in a fresh repo, this will usually be the current branch returned by `git branch --show-current`.
77
+ 6. Check whether `track/{slug}` already exists as a branch. If it does, append `-2`, `-3`, and so on to the slug identifier until you find an unused branch name, then use that resolved slug for all remaining steps in this flow.
78
+ 7. Run `git checkout -b track/{slug}` to create and switch to the new branch.
79
+ 8. If `.manuscript/tracks.json` does not exist, create it with an object containing `canon_branch` and an empty `tracks` array.
80
+ 9. Add the new track entry to `tracks.json`:
81
+ ```json
82
+ {
83
+ "canon_branch": "<resolved canon branch>",
84
+ "tracks": [
85
+ {
86
+ "label": "<name>",
87
+ "branch": "track/<slug>",
88
+ "created": "<ISO 8601 timestamp>",
89
+ "author": "writer",
90
+ "status": "active",
91
+ "merged_at": null,
92
+ "proposed_at": null
93
+ }
94
+ ]
95
+ }
96
+ ```
97
+ 10. Read `.manuscript/config.json`. If `collaboration.tracks_enabled` is `false` or missing, set it to `true`.
98
+ 11. Commit the track metadata and any config update together:
99
+ ```
100
+ git add .manuscript/tracks.json .manuscript/config.json
101
+ git commit -m "Created revision track: track/{slug}"
102
+ ```
103
+ Never interpolate the raw writer-provided label directly into a shell command. Use the sanitized slug or another shell-safe identifier in git commit messages.
104
+ 12. Confirm to the writer:
105
+
106
+ **Output:**
107
+ ```
108
+ Created revision track '<name>'. You're now working on it.
109
+
110
+ Everything you write and save here stays on this track until you switch back to the canon manuscript or another track.
111
+ ```
112
+
113
+ ---
114
+
115
+ ## Subcommand: track list
116
+
117
+ **Purpose:** Show all revision tracks with their status and last activity.
118
+
119
+ **What to do:**
120
+
121
+ 1. Read `.manuscript/tracks.json`. If missing or empty: "No revision tracks yet. Create one with `/scr:track create <name>`."
122
+ 2. Determine the current branch: `git branch --show-current`.
123
+ 3. Resolve the canon branch using the Canon Branch Resolution rules above.
124
+ 4. For each track in `tracks.json`:
125
+ - Determine if it is the currently active track (current branch matches `track.branch`).
126
+ - Get commit count ahead/behind canon: `git rev-list --left-right --count {canon_branch}...{branch} 2>/dev/null`.
127
+ - Get the date of the last checkpoint on the track: `git log -1 --format="%ai" {branch} -- .manuscript/ 2>/dev/null`.
128
+ 5. Always show "Canon manuscript" as the base track, marked as active if the current branch is the resolved `canon_branch`.
129
+
130
+ **Output format:**
131
+
132
+ ```
133
+ Your revision tracks:
134
+
135
+ * Canon manuscript (active)
136
+ The base manuscript. All accepted revisions live here.
137
+
138
+ Editor's suggestions
139
+ 3 checkpoints ahead of canon -- Last activity: Apr 6
140
+
141
+ Second draft attempt (merged Apr 5)
142
+ This track has been merged into canon.
143
+
144
+ Experimental ending
145
+ 1 checkpoint ahead, 2 behind canon -- Last activity: Apr 4
146
+ ```
147
+
148
+ - Mark the active track with `*` and "(active)".
149
+ - For merged tracks, show "(merged [date])" and skip ahead/behind counts.
150
+ - Use relative dates: "today", "yesterday", "Apr 6", "Mar 28".
151
+ - "Ahead" means the track has checkpoints not in canon. "Behind" means canon has checkpoints not in the track.
152
+
153
+ ---
154
+
155
+ ## Subcommand: track switch
156
+
157
+ **Purpose:** Switch between revision tracks or back to the canon manuscript.
158
+
159
+ **What to do:**
160
+
161
+ 1. Resolve the canon branch using the Canon Branch Resolution rules above.
162
+ 2. If `<name>` is "canon" or matches the resolved canon branch name: switch to the canon branch with `git checkout {canon_branch}`.
163
+ 3. Otherwise, look up `<name>` in `tracks.json` by matching the `label` field (case-insensitive).
164
+ 4. If not found: "No revision track called '[name]' found. Use `/scr:track list` to see available tracks."
165
+ 5. Check for unsaved changes (`git status --porcelain .manuscript/`). If changes exist: "You have unsaved changes. Save them first with `/scr:save` before switching tracks."
166
+ 6. Run `git checkout {branch}` using the branch name from the track entry.
167
+ 7. Confirm to the writer.
168
+
169
+ **Output:**
170
+ ```
171
+ Switched to revision track '<name>'.
172
+
173
+ Your work is now on this track. Any saves you make will stay here until you switch again.
174
+ ```
175
+
176
+ Or if switching to canon:
177
+ ```
178
+ Switched to the canon manuscript.
179
+
180
+ You're now working on the base version of your manuscript.
181
+ ```
182
+
183
+ ---
184
+
185
+ ## Subcommand: track compare
186
+
187
+ **Purpose:** Show a side-by-side comparison between two tracks (or a track and canon) in writer-friendly language.
188
+
189
+ **What to do:**
190
+
191
+ 1. **Determine what to compare:**
192
+ - No arguments: compare current track vs canon. If already on canon: "You're on the canon manuscript. Specify a track to compare: `/scr:track compare <name>`."
193
+ - One name: compare that track vs canon.
194
+ - Two names: compare track A vs track B.
195
+ 2. Resolve the canon branch using the Canon Branch Resolution rules above. "Canon" resolves to `{canon_branch}`.
196
+ 3. Run `git diff {branch-a}...{branch-b} -- .manuscript/` to get the differences.
197
+ 4. If no differences: "No differences found between '[track A]' and '[track B]'. The manuscripts are identical."
198
+
199
+ **Display format (reuses pattern from `/scr:compare`):**
200
+
201
+ Show passage-by-passage tracked changes in writer-friendly format:
202
+
203
+ ```
204
+ ## Tracked Changes: '<Track A>' vs '<Track B>'
205
+
206
+ ### Chapter 3 -- The Arrival
207
+
208
+ **In '<Track A>':**
209
+ > Marcus walked through the empty corridor, his footsteps echoing against the marble walls.
210
+
211
+ **In '<Track B>':**
212
+ > Marcus moved through the silent corridor, each footstep a small detonation against the marble.
213
+
214
+ ---
215
+
216
+ **New in '<Track A>':**
217
+ > The clockmaker paused, turning the gear over in her weathered hands. Something was different about this one.
218
+
219
+ ---
220
+
221
+ ### Summary
222
+
223
+ 4 passages changed, 2 passages added, 1 passage removed across 3 sections.
224
+ ```
225
+
226
+ **Formatting rules:**
227
+ - NEVER show raw diff markers (`+`, `-`, `@@`, line numbers, file paths, commit hashes).
228
+ - Use blockquotes (`>`) for prose passages.
229
+ - Group changes by unit (chapter/scene/section) with `###` headings.
230
+ - Label each version with "In '[track name]':" -- never "branch" or "HEAD".
231
+ - Show 1 sentence of unchanged context for readability.
232
+ - New passages use "**New in '[track name]':**".
233
+ - Removed passages use "**Removed from '[track name]':**".
234
+ - End with a summary line: "X passages changed, Y passages added, Z passages removed".
235
+
236
+ ---
237
+
238
+ ## Subcommand: track merge
239
+
240
+ **Purpose:** Merge a revision track into the canon manuscript, with writer-friendly continuity conflict resolution.
241
+
242
+ **What to do:**
243
+
244
+ 1. Resolve `<name>` to a branch via `tracks.json`. If not found: "No revision track called '[name]' found."
245
+ 2. Check if the track has any changes ahead of canon. If not: "Nothing to merge. '[name]' has no changes that differ from canon."
246
+ 3. Resolve the canon branch using the Canon Branch Resolution rules above.
247
+ 4. If not currently on canon, switch to canon first: `git checkout {canon_branch}`. Inform the writer: "Switching to the canon manuscript to accept the revisions."
248
+ 5. Attempt the merge without creating the final commit yet: `git merge {branch} --no-ff --no-commit`.
249
+ This must explicitly block fast-forward merges so `tracks.json` can be updated before the final merge checkpoint is created.
250
+
251
+ **If clean merge (no conflicts):**
252
+
253
+ ```
254
+ Revision track '<name>' merged into the canon manuscript. All changes accepted.
255
+
256
+ Tip: Run `/scr:continuity-check` to verify everything reads smoothly after merging.
257
+ ```
258
+
259
+ Update `tracks.json`: set the track's `status` to `"merged"` and `merged_at` to the current ISO timestamp, then create the final merge commit:
260
+
261
+ ```
262
+ git add .manuscript/
263
+ git commit -m "Merged revision track: track/{slug}"
264
+ ```
265
+
266
+ Never interpolate the raw writer-provided label directly into a shell command. Use the sanitized slug or another shell-safe identifier in git commit messages.
267
+
268
+ **If continuity conflicts arise (D-02):**
269
+
270
+ Walk through each conflicting passage one at a time. For each conflict, show both versions side by side and offer three resolution options:
271
+
272
+ ```
273
+ ## Continuity Conflict 1 of 3
274
+
275
+ ### Chapter 5 -- The Revelation
276
+
277
+ **Canon version:**
278
+ > The old woman smiled, her eyes crinkling at the corners. "I've been expecting you," she said, gesturing toward the empty chair.
279
+
280
+ **'<Track name>' version:**
281
+ > The old woman frowned, her lips pressed into a thin line. "You're late," she snapped, not moving from her seat.
282
+
283
+ How would you like to resolve this?
284
+
285
+ 1. **Keep mine** -- Use the canon version
286
+ 2. **Keep theirs** -- Use the version from '<track name>'
287
+ 3. **Keep both** -- Include both versions with a scene break between them
288
+ ```
289
+
290
+ After the writer chooses for each conflict:
291
+ - Apply the resolution by editing the conflicted file (remove conflict markers, keep the chosen content).
292
+ - For "Keep both": concatenate both versions separated by `---` (scene break / horizontal rule).
293
+ - Stage the resolved file: `git add <file>`.
294
+ - After all conflicts are resolved, update `tracks.json`: set `status` to `"merged"`, `merged_at` to current timestamp.
295
+ - Then stage the manuscript and metadata together and create the final merge commit:
296
+ `git add .manuscript/ && git commit -m "Merged revision track: track/{slug} (conflicts resolved)"`
297
+ - Never interpolate the raw writer-provided label directly into a shell command. Use the sanitized slug or another shell-safe identifier in git commit messages.
298
+
299
+ ```
300
+ All continuity conflicts resolved. Revision track '<name>' is now merged into canon.
301
+
302
+ Tip: Run `/scr:continuity-check` to verify everything reads smoothly after merging.
303
+ ```
304
+
305
+ **Language note:** Never say "merge conflict" -- always "continuity conflict". Never say "ours/theirs" in git terms -- use "canon version" and "[track name] version", or "Keep mine / Keep theirs" for the resolution options.
306
+
307
+ ---
308
+
309
+ ## Subcommand: track propose
310
+
311
+ **Purpose:** Create a revision proposal from a track for editor review (the writer-friendly equivalent of a pull request).
312
+
313
+ **What to do:**
314
+
315
+ 1. Resolve `<name>` to a branch via `tracks.json`. If not found: "No revision track called '[name]' found."
316
+ 2. Check if the track has any changes ahead of canon. If not: "Nothing to propose. '[name]' has no changes that differ from canon."
317
+ 3. Resolve the canon branch using the Canon Branch Resolution rules above, then generate a diff summary: `git diff {canon_branch}...{branch} -- .manuscript/`.
318
+ 4. Parse the diff to count: passages changed, passages added, passages removed, sections affected.
319
+ 5. Create the proposal directory if needed: `.manuscript/proposals/`.
320
+ 6. Generate `.manuscript/proposals/{track-slug}-proposal.md` with the following structure:
321
+
322
+ ```markdown
323
+ # Revision Proposal: <Track Label>
324
+
325
+ **Author:** <from tracks.json author field>
326
+ **Date:** <current date>
327
+ **Track:** <track label>
328
+
329
+ ## Summary of Changes
330
+
331
+ <Auto-generated from diff analysis>
332
+
333
+ - X passages changed across Y sections
334
+ - Z new passages added
335
+ - W passages removed
336
+
337
+ ## Detailed Changes
338
+
339
+ <Full diff formatted in the same writer-friendly style as track compare:
340
+ passage-by-passage with Before/After blocks, grouped by section>
341
+
342
+ ## Editor Notes
343
+
344
+ _Space for the editor to write feedback, approve, or request changes._
345
+
346
+ ---
347
+
348
+ _This proposal was generated from revision track '<name>'. To accept these changes, run `/scr:track merge <name>`. To see the full comparison, run `/scr:track compare <name>`._
349
+ ```
350
+
351
+ 7. Update `tracks.json`: set `proposed_at` to the current ISO timestamp.
352
+ 8. Commit the proposal file and metadata together:
353
+ ```
354
+ git add .manuscript/proposals/{track-slug}-proposal.md .manuscript/tracks.json
355
+ git commit -m "Created revision proposal: track/{track-slug}"
356
+ ```
357
+ Never interpolate the raw writer-provided label directly into a shell command. Use the sanitized slug or another shell-safe identifier in git commit messages.
358
+
359
+ **Output:**
360
+ ```
361
+ Revision proposal created for '<name>'.
362
+
363
+ The proposal is saved at .manuscript/proposals/<slug>-proposal.md
364
+ Share this file with your editor for review.
365
+
366
+ When your editor is ready to accept the changes, run `/scr:track merge <name>`.
367
+ ```
368
+
369
+ ---
370
+
371
+ ## Co-Writing Parallel Tracks
372
+
373
+ When multiple writers work on the same manuscript simultaneously -- one handling the A-plot, another the B-plot, or one taking dialogue while another handles description -- co-writing tracks provide continuity-aware merging to catch contradictions before they become problems.
374
+
375
+ ### Creating a Co-Writing Track
376
+
377
+ Use the `--co-writing` flag when creating a track intended for parallel work:
378
+
379
+ ```
380
+ /scr:track create "B-plot development" --co-writing
381
+ ```
382
+
383
+ This marks the track in `tracks.json` with `"type": "co-writing"` (default tracks have `"type": "revision"`):
384
+
385
+ ```json
386
+ {
387
+ "label": "B-plot development",
388
+ "branch": "track/b-plot-development",
389
+ "created": "2026-04-07T10:30:00Z",
390
+ "author": "writer-b",
391
+ "status": "active",
392
+ "type": "co-writing",
393
+ "merged_at": null,
394
+ "proposed_at": null
395
+ }
396
+ ```
397
+
398
+ Co-writing tracks behave identically to revision tracks for all subcommands except `merge`, where they trigger enhanced continuity checking.
399
+
400
+ ### Co-Writing Merge with Continuity Checking
401
+
402
+ When `track merge` detects that the merging track and canon have BOTH been modified (i.e., parallel work happened on both sides), the merge automatically includes continuity verification:
403
+
404
+ 1. **Pre-merge continuity scan.** Before finalizing the merge, run the equivalent of `/scr:continuity-check` on the combined content from both tracks. This checks for:
405
+
406
+ - **Character state conflicts:** A character alive in one track but dead or incapacitated in another. A character in Location A in one track but Location B at the same narrative time in another.
407
+ - **Timeline conflicts:** Events happening simultaneously in different locations involving the same character. Contradictory time references ("three days later" in one track conflicting with "the next morning" in another).
408
+ - **World-state conflicts:** World-building facts that contradict (a city destroyed in one track but intact in another, a magic system rule applied differently, a political situation described inconsistently).
409
+
410
+ 2. **Surface contradictions.** For each contradiction found, present both versions with context from each track:
411
+
412
+ ```
413
+ ## Continuity Contradiction 1 of 3
414
+
415
+ ### Character State Conflict: Marcus
416
+
417
+ **In canon (A-plot):**
418
+ > Marcus left the city at dawn, heading north toward the mountains.
419
+ > (Chapter 7, passage 3)
420
+
421
+ **In 'B-plot development':**
422
+ > Marcus met Elena at the harbor that same morning, agreeing to sail south.
423
+ > (Chapter 7, passage 5)
424
+
425
+ **Issue:** Marcus cannot be heading north and meeting someone at the harbor simultaneously.
426
+
427
+ How would you like to resolve this?
428
+
429
+ 1. **Pick canon** -- Keep the A-plot version (Marcus heads north)
430
+ 2. **Pick track** -- Keep the B-plot version (Marcus at the harbor)
431
+ 3. **Reconcile** -- Write a new version that resolves the contradiction
432
+ 4. **Flag for later** -- Merge as-is and mark for revision
433
+ ```
434
+
435
+ 3. **Writer resolves each contradiction.** For each:
436
+ - **Pick canon / Pick track:** Apply the chosen version, discard the other from the merged result.
437
+ - **Reconcile:** The writer provides a new passage that resolves the contradiction. Apply it.
438
+ - **Flag for later:** Include both versions with a visible marker in the manuscript: `<!-- CONTINUITY FLAG: [description] -->`. These can be found later with a search.
439
+
440
+ 4. **Log all resolutions** in `.manuscript/merge-log.json`:
441
+
442
+ ```json
443
+ {
444
+ "merge_date": "ISO 8601 timestamp",
445
+ "track": "B-plot development",
446
+ "track_type": "co-writing",
447
+ "contradictions_found": 3,
448
+ "resolutions": [
449
+ {
450
+ "type": "character_state",
451
+ "description": "Marcus location conflict in Chapter 7",
452
+ "canon_passage": "passage reference",
453
+ "track_passage": "passage reference",
454
+ "resolution": "pick_canon",
455
+ "reconciled_text": null
456
+ },
457
+ {
458
+ "type": "timeline",
459
+ "description": "Conflicting time references in Chapter 8",
460
+ "canon_passage": "passage reference",
461
+ "track_passage": "passage reference",
462
+ "resolution": "reconcile",
463
+ "reconciled_text": "The reconciled passage text"
464
+ },
465
+ {
466
+ "type": "world_state",
467
+ "description": "City status contradiction",
468
+ "canon_passage": "passage reference",
469
+ "track_passage": "passage reference",
470
+ "resolution": "flag_for_later",
471
+ "reconciled_text": null
472
+ }
473
+ ]
474
+ }
475
+ ```
476
+
477
+ 5. **Co-writing merge warning.** When merging a co-writing track, show a warning before proceeding:
478
+
479
+ ```
480
+ This is a co-writing track. Continuity checking will be thorough -- this may take a moment.
481
+
482
+ Scanning for character state, timeline, and world-state contradictions across both tracks...
483
+ ```
484
+
485
+ ### When Continuity Checking Triggers
486
+
487
+ Continuity checking during merge triggers automatically when:
488
+ - The track being merged has `"type": "co-writing"` in `tracks.json`, OR
489
+ - Both the track and canon have been modified since the track was created (detected via `git rev-list --left-right --count {canon_branch}...{branch}` showing changes on both sides)
490
+
491
+ For standard revision tracks where only the track has changes (canon is unmodified), the regular merge flow applies without continuity scanning.
492
+
493
+ ### Merge Log
494
+
495
+ The `.manuscript/merge-log.json` file accumulates entries from every co-writing merge. Each entry preserves both versions of contradictory passages, the resolution chosen, and any reconciled text. This provides a history of how parallel work was integrated and supports future continuity auditing.
496
+
497
+ ---
498
+
499
+ ## Writer-Friendly Language Guide
500
+
501
+ This command MUST use writer-friendly terminology throughout. Never expose git internals.
502
+
503
+ | Git Term | Writer Term |
504
+ |----------|------------|
505
+ | branch | revision track |
506
+ | canon branch | canon manuscript (or just "canon") |
507
+ | checkout | switch to |
508
+ | commit | checkpoint / save |
509
+ | merge | accept revisions / merge (the word "merge" is acceptable in creative context) |
510
+ | merge conflict | continuity conflict |
511
+ | pull request | revision proposal |
512
+ | diff | tracked changes |
513
+ | ahead/behind | checkpoints ahead/behind |
514
+ | ours/theirs | canon version / track version |
515
+ | HEAD | current position |
516
+ | tag | draft version |
517
+
518
+ ## Error Messages
519
+
520
+ All error messages use plain English:
521
+
522
+ - "You have unsaved changes. Save them first with `/scr:save` before switching tracks."
523
+ - "No revision track called '[name]' found. Use `/scr:track list` to see available tracks."
524
+ - "A revision track called '[name]' already exists. Use `/scr:track switch [name]` to work on it."
525
+ - "You're already on the canon manuscript. Specify a track to compare."
526
+ - "No revision tracks yet. Create one with `/scr:track create <name>`."
527
+ - "Nothing to merge. '[name]' has no changes that differ from canon."
528
+ - "Nothing to propose. '[name]' has no changes that differ from canon."
529
+
530
+ ## Edge Cases
531
+
532
+ - **No git repo:** Initialize silently in writer mode (same as `/scr:save`).
533
+ - **No tracks.json:** Create on first `track create`.
534
+ - **Branch deleted externally:** If a track's branch no longer exists in git, mark it as "(unavailable)" in the list and suggest removing it.
535
+ - **Canon branch name:** Resolve it from `tracks.json.canon_branch` first. For older projects without that field, fall back to the current non-track branch, the remote default branch, the single non-track local branch if there is only one, then `trunk`, `main`, or `master`.
536
+ - **Track name collision:** If the slugified branch name would collide with an existing branch, append a number: `track/editors-suggestions-2`.
537
+ - **Empty track:** If a track has no changes vs canon, `merge` and `propose` should inform the writer rather than creating empty merges/proposals.
538
+
539
+ ## Response Contract
540
+
541
+ Every writer-facing response must end with one to four next-command suggestions. Each suggestion must include a short explanation of what that path will do.
542
+
543
+ Use this format:
544
+
545
+ ```markdown
546
+ Next commands:
547
+ - `/scr:...`: One short sentence explaining what this path will do.
548
+ - `/scr:...`: One short sentence explaining what this alternate path will do.
549
+ ```
550
+
551
+ If exactly one path is clearly best, provide one suggestion. If two, three, or four useful paths exist, show them as alternatives. Do not force a linear path when the writer has a real choice.
552
+
553
+ If the writer seems unsure or no specific next command is obvious, include this default option:
554
+
555
+ ```markdown
556
+ Next commands:
557
+ - `/scr:next`: Inspect the project state and choose the right next step.
558
+ ```
559
+
560
+ If the command stops because a prerequisite is missing, suggest the command that fixes the prerequisite. Keep every explanation practical and writer-facing.
561
+
562
+ ## Tone
563
+
564
+ Supportive and clear. The writer should feel empowered to experiment freely with tracks, knowing they can always return to canon. Tracks are for creative exploration -- frame them that way, never as technical version control.