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,260 @@
1
+ ---
2
+ description: Translate manuscript to target language with glossary and translation memory support.
3
+ argument-hint: "<language> [--all] [--from <unit>] [--languages] [--add-language <lang>]"
4
+ ---
5
+
6
+ # /scr:translate -- Manuscript Translation
7
+
8
+ Translate the manuscript into a target language, one atomic unit at a time, using the translator agent with fresh context per unit. Loads glossary and translation memory into each unit's context for term consistency across the manuscript.
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ /scr:translate <language> # Translate to a specific language (e.g., fr, ja, ar)
14
+ /scr:translate --all # Translate to all configured target languages
15
+ /scr:translate --from <unit> # Resume translation from a specific unit
16
+ /scr:translate --languages # List configured target languages
17
+ /scr:translate --add-language <lang> # Add a target language to config
18
+ ```
19
+
20
+ ## Instruction
21
+
22
+ You are a **translation orchestrator**. Your job is to manage the per-unit translation pipeline, ensuring each unit is translated with full context (glossary, translation memory, style guide, character data) by invoking the translator agent in fresh context for every atomic unit.
23
+
24
+ ---
25
+
26
+ ### STEP 1: LOAD CONTEXT
27
+
28
+ Load the following project files:
29
+
30
+ - `.manuscript/config.json` -- to get `source_language`, `target_languages`, `name_handling`, `measurement_system` from the `translation` section
31
+ - Scriveno's installed/shared `CONSTRAINTS.json` (global `~/.scriveno/data/CONSTRAINTS.json` or project `.scriveno/data/CONSTRAINTS.json`) -- to check prerequisites
32
+
33
+ ---
34
+
35
+ ### STEP 2: HANDLE FLAGS
36
+
37
+ **If `--languages` flag:**
38
+
39
+ Read `.manuscript/config.json` and display the configured target languages:
40
+
41
+ > **Configured target languages:**
42
+ > - French (fr)
43
+ > - Japanese (ja)
44
+ >
45
+ > **Source language:** English (en)
46
+ >
47
+ > To add a language: `/scr:translate --add-language <lang>`
48
+
49
+ Then **stop**.
50
+
51
+ **If `--add-language <lang>` flag:**
52
+
53
+ 1. Read `.manuscript/config.json`
54
+ 2. Add the language code to the `translation.target_languages` array
55
+ 3. Write the updated config back
56
+ 4. Confirm:
57
+
58
+ > **Added target language:** [language name] ([code])
59
+ >
60
+ > Current target languages: [list all]
61
+ >
62
+ > **Next steps:**
63
+ > - Create a glossary: `/scr:translation-glossary [lang]`
64
+ > - Start translating: `/scr:translate [lang]`
65
+
66
+ Then **stop**.
67
+
68
+ ---
69
+
70
+ ### STEP 3: VALIDATE
71
+
72
+ **Validate target language:**
73
+
74
+ If a specific language was provided (not `--all`):
75
+ 1. Check if it is in the `translation.target_languages` array in config.json
76
+ 2. If not:
77
+
78
+ > **"[lang]" is not a configured target language.**
79
+ >
80
+ > Configured languages: [list]
81
+ >
82
+ > To add it: `/scr:translate --add-language [lang]`
83
+
84
+ Then **stop**.
85
+
86
+ **Check prerequisite: complete draft**
87
+
88
+ Check that drafts exist for all units in OUTLINE.md. Look for files in `.manuscript/drafts/body/` matching the units listed in `.manuscript/OUTLINE.md`.
89
+
90
+ If drafts are missing:
91
+
92
+ > **Translation requires a complete draft.** The following units have no draft:
93
+ > - [list missing units]
94
+ >
95
+ > Complete drafting first with `/scr:draft` or `/scr:autopilot`.
96
+
97
+ Then **stop**.
98
+
99
+ ---
100
+
101
+ ### STEP 4: PREPARE TRANSLATION ENVIRONMENT
102
+
103
+ 1. **Create directory structure** for the target language(s):
104
+
105
+ ```
106
+ .manuscript/translation/{lang}/
107
+ drafts/
108
+ front-matter/
109
+ back-matter/
110
+ metadata/
111
+ ```
112
+
113
+ 2. **Load glossary** (if it exists):
114
+
115
+ Read `.manuscript/translation/GLOSSARY-{lang}.md`. If it does not exist:
116
+
117
+ > **Glossary recommended.** No glossary found for [language]. A glossary ensures consistent translation of character names, place names, and key terms.
118
+ >
119
+ > Create one now: `/scr:translation-glossary [lang]`
120
+ >
121
+ > Continuing without glossary -- new terms will be flagged by the translator agent.
122
+
123
+ 3. **Load translation memory** (if it exists):
124
+
125
+ Read `.manuscript/translation/translation-memory.json`. If it does not exist, proceed without -- the translation memory will be built from completed translations.
126
+
127
+ 4. **Read OUTLINE.md** for the ordered list of units.
128
+
129
+ 5. **If `--from <unit>` flag:** Find the specified unit in OUTLINE.md and start from that position. Skip all units before it.
130
+
131
+ ---
132
+
133
+ ### STEP 5: TRANSLATE PER UNIT
134
+
135
+ **If `--all` flag:** Loop through each language in `target_languages`, running the full translation pipeline for each. Translate one language completely before starting the next.
136
+
137
+ For each unit in OUTLINE.md (or from `--from` position):
138
+
139
+ **5a. Gather context for this unit:**
140
+
141
+ 1. **Source text:** Read `.manuscript/drafts/body/{unit}-DRAFT.md` (or the appropriate draft path from OUTLINE.md)
142
+ 2. **STYLE-GUIDE.md:** Read `.manuscript/STYLE-GUIDE.md`
143
+ 3. **GLOSSARY-{lang}.md:** Read `.manuscript/translation/GLOSSARY-{lang}.md` (if it exists)
144
+ 4. **Translation memory excerpt:** From `translation-memory.json`, extract segments that match content in this unit (if TM exists). Look for source sentences that appear in this unit's text. Include the top 20 most relevant matches.
145
+ 5. **CHARACTERS.md excerpt:** Read `.manuscript/CHARACTERS.md` (or FIGURES.md for sacred works) and extract only the characters who appear in this unit's source text. Match character names against the source text to determine relevance.
146
+ 6. **Previous translated unit tail:** Read the last 200 words of the previously translated unit from `.manuscript/translation/{lang}/drafts/` (if any prior unit exists)
147
+ 7. **Target language config:** Language code, `name_handling`, `measurement_system` from config.json
148
+
149
+ **5b. Sacred mode detection:**
150
+
151
+ If `.manuscript/config.json` has a `work_type` whose group is `sacred` (check against `CONSTRAINTS.json` work_types), read the top-level sacred profile keys from config.json and construct a `sacred_mode` object to pass to the translator agent. For older projects only, if a value is absent at top level and present under a nested `sacred` object, use the nested value as a legacy fallback:
152
+
153
+ ```json
154
+ {
155
+ "sacred_mode": true,
156
+ "translation_philosophy": "[from top-level config.json translation_philosophy]",
157
+ "canonical_alignment": "[from top-level config.json canonical_alignment]",
158
+ "preserve_source_terms": "[from top-level config.json preserve_source_terms]",
159
+ "transliteration_style": "[from top-level config.json transliteration_style]",
160
+ "liturgical_preservation": "[from top-level config.json liturgical_preservation]"
161
+ }
162
+ ```
163
+
164
+ For sacred works, the translation philosophy from config.json determines how the translator approaches each passage. Use `/scr:settings` to change `translation_philosophy`.
165
+
166
+ If the work type group is not `sacred`, skip this step -- the translator operates in standard mode.
167
+
168
+ **5c. Invoke translator agent:**
169
+
170
+ Invoke the translator agent (`agents/translator.md`) with fresh context, providing all gathered files. For sacred works, include the `sacred_mode` object alongside the standard context. The agent translates the unit and writes to `.manuscript/translation/{lang}/drafts/{unit}-DRAFT.md`.
171
+
172
+ **Fresh context per unit is mandatory.** Each translator invocation is independent -- this prevents translation drift, glossary inconsistency, and register collapse across a long manuscript.
173
+
174
+ **5d. Post-unit processing:**
175
+
176
+ After each unit translation:
177
+
178
+ 1. **Check for new terms:** If the translator flagged new terms not in the glossary, collect them:
179
+
180
+ > **New terms flagged in [unit]:**
181
+ > - "[term]" -> "[suggested translation]" ([category])
182
+
183
+ 2. **Report progress:**
184
+
185
+ > Translated [unit]: [source_word_count] source words -> [target_word_count] target words ([ratio]x)
186
+
187
+ 3. **Update running totals:** Track total source words, total target words, units completed, new terms flagged.
188
+
189
+ ---
190
+
191
+ ### STEP 6: COMPLETION REPORT
192
+
193
+ After all units are translated, show a summary:
194
+
195
+ > **Translation complete: [language name]**
196
+ >
197
+ > **Units translated:** [count] / [total]
198
+ > **Source word count:** [total source words]
199
+ > **Target word count:** [total target words]
200
+ > **Expansion ratio:** [target/source]x
201
+ >
202
+ > **Glossary compliance:**
203
+ > - Terms from glossary used: [count]
204
+ > - New terms flagged: [count] (review with `/scr:translation-glossary [lang] --review`)
205
+ >
206
+ > **Translation memory:**
207
+ > - TM segments reused: [count]
208
+ > - New segments available: [count] (build TM with `/scr:translation-memory [lang] --build`)
209
+ >
210
+ > **Next steps:**
211
+ > - Review new terms: `/scr:translation-glossary [lang] --review`
212
+ > - Build translation memory: `/scr:translation-memory [lang] --build`
213
+ > - Cultural adaptation review: `/scr:cultural-adaptation [lang]`
214
+ > - Back-translate to verify: `/scr:back-translate [lang]`
215
+ > - Export translation: `/scr:export --format [format] --language [lang]`
216
+
217
+ ## Response Contract
218
+
219
+ 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.
220
+
221
+ Use this format:
222
+
223
+ ```markdown
224
+ Next commands:
225
+ - `/scr:...`: One short sentence explaining what this path will do.
226
+ - `/scr:...`: One short sentence explaining what this alternate path will do.
227
+ ```
228
+
229
+ 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.
230
+
231
+ If the writer seems unsure or no specific next command is obvious, include this default option:
232
+
233
+ ```markdown
234
+ Next commands:
235
+ - `/scr:next`: Inspect the project state and choose the right next step.
236
+ ```
237
+
238
+ If the command stops because a prerequisite is missing, suggest the command that fixes the prerequisite. Keep every explanation practical and writer-facing.
239
+
240
+ ## Tone
241
+
242
+ **Progress updates:** Concise, one line per unit.
243
+ - "Translated chapter 3, scene 2: 1,247 -> 1,389 words (1.11x)"
244
+ - "Skipping chapter 5 -- already translated"
245
+
246
+ **Warnings:** Actionable.
247
+ - "3 new terms not in glossary -- review after translation completes"
248
+
249
+ **Never show** (unless `developer_mode` is `true` in config.json):
250
+ - File paths
251
+ - Git terminology
252
+ - Technical jargon about agent context or invocation
253
+
254
+ ## Anti-patterns
255
+
256
+ - **NEVER** translate multiple units in a single agent context -- fresh context per unit is mandatory
257
+ - **NEVER** skip the glossary check -- term consistency is the translator's primary constraint
258
+ - **NEVER** translate without STYLE-GUIDE.md loaded -- voice must survive translation
259
+ - **NEVER** overwrite an existing translation without warning -- if `.manuscript/translation/{lang}/drafts/{unit}-DRAFT.md` already exists, ask before replacing
260
+ - **NEVER** ignore new terms flagged by the translator -- they must be reviewed and added to the glossary
@@ -0,0 +1,298 @@
1
+ ---
2
+ description: Create and manage bilingual term glossary for consistent translation.
3
+ argument-hint: "<language> [--add <term> --translation <value>] [--import] [--review] [--category <cat>]"
4
+ ---
5
+
6
+ # /scr:translation-glossary -- Glossary Management
7
+
8
+ Create and manage bilingual translation glossaries. Glossaries ensure consistent translation of character names, place names, invented terms, titles, recurring phrases, and cultural references across the manuscript.
9
+
10
+ Glossaries are stored as human-readable markdown tables in `.manuscript/translation/GLOSSARY-{lang}.md` -- version-controlled and easy to review.
11
+
12
+ ## Usage
13
+
14
+ ```
15
+ /scr:translation-glossary <language> # Create glossary (or show existing)
16
+ /scr:translation-glossary <language> --add <term> --translation <value> # Add a single entry
17
+ /scr:translation-glossary <language> --add <term> --translation <value> --category <cat> # Add with category
18
+ /scr:translation-glossary <language> --import # Bulk import terms
19
+ /scr:translation-glossary <language> --review # Review glossary and find missing terms
20
+ ```
21
+
22
+ ## Instruction
23
+
24
+ You are a **glossary manager**. Your job is to build and maintain bilingual term glossaries that the translator agent uses for consistent translation.
25
+
26
+ ---
27
+
28
+ ### STEP 1: LOAD CONTEXT
29
+
30
+ Load the following project files:
31
+
32
+ - `.manuscript/config.json` -- to get `target_languages`, `name_handling`, `measurement_system` from the `translation` section
33
+ - `.manuscript/CHARACTERS.md` (or `FIGURES.md` for sacred works) -- character names to include in glossary
34
+ - `.manuscript/WORLD.md` (if exists) -- place names and world-specific terms
35
+
36
+ If no language argument is provided:
37
+
38
+ > **Which language?**
39
+ >
40
+ > Configured target languages: [list from config.json]
41
+ >
42
+ > Specify a language: `/scr:translation-glossary <lang>`
43
+
44
+ Then **stop**.
45
+
46
+ Validate that the specified language is in the `target_languages` array. If not:
47
+
48
+ > **"[lang]" is not a configured target language.** Add it with `/scr:translate --add-language [lang]` first.
49
+
50
+ Then **stop**.
51
+
52
+ ---
53
+
54
+ ### STEP 2: ROUTE BY MODE
55
+
56
+ Determine the mode based on flags:
57
+
58
+ | Flags | Mode |
59
+ |-------|------|
60
+ | No flags | Create mode (if no glossary exists) or Display mode (if glossary exists) |
61
+ | `--add <term> --translation <value>` | Add mode |
62
+ | `--import` | Import mode |
63
+ | `--review` | Review mode |
64
+
65
+ ---
66
+
67
+ ### MODE: CREATE (no GLOSSARY-{lang}.md exists)
68
+
69
+ Scan the manuscript for translatable terms and build the initial glossary.
70
+
71
+ **Step 1: Scan for terms**
72
+
73
+ Read the following sources and extract terms that need consistent translation:
74
+
75
+ 1. **Character names** from CHARACTERS.md (or FIGURES.md for sacred works):
76
+ - Extract all character names, nicknames, titles
77
+ - Category: `character_name`
78
+
79
+ 2. **Place names** from WORLD.md (if it exists):
80
+ - Extract all location names, realm names, geographical features
81
+ - Category: `place_name`
82
+
83
+ 3. **Manuscript scan** -- Read through draft files in `.manuscript/drafts/body/` and identify:
84
+ - Invented terms and neologisms (words not in standard dictionaries)
85
+ - Category: `invented_term`
86
+ - Recurring titles and honorifics (e.g., "Lord," "Master," "Professor")
87
+ - Category: `title_honorific`
88
+ - Recurring phrases that appear 3+ times and carry specific meaning
89
+ - Category: `recurring_phrase`
90
+ - Cultural references specific to the work's setting
91
+ - Category: `cultural_reference`
92
+ - Brand names or proper nouns
93
+ - Category: `brand_name`
94
+
95
+ **Step 2: Generate translations based on name_handling config**
96
+
97
+ For each extracted term, provide a default translation:
98
+
99
+ - **name_handling = `keep_original`:** Character names default to original spelling. Add transliteration in Notes column if the target language uses a different script.
100
+ - **name_handling = `transliterate`:** Character names are transliterated into the target language's script/phonology.
101
+ - **name_handling = `localize`:** Character names are given culturally equivalent names in the target language (e.g., John -> Jean, William -> Guillaume).
102
+
103
+ For non-name terms (invented terms, phrases, cultural references): provide a contextually appropriate translation.
104
+
105
+ **Step 3: Write glossary**
106
+
107
+ Create the directory if needed:
108
+
109
+ ```
110
+ mkdir -p .manuscript/translation/
111
+ ```
112
+
113
+ Write the glossary as a markdown table to `.manuscript/translation/GLOSSARY-{lang}.md`:
114
+
115
+ ```markdown
116
+ # Translation Glossary: [Language Name]
117
+
118
+ **Source language:** [source_language from config]
119
+ **Target language:** [language name] ([code])
120
+ **Name handling:** [name_handling setting]
121
+ **Last updated:** [date]
122
+
123
+ ## Terms
124
+
125
+ | Source Term | Translation | Category | Notes |
126
+ |-------------|-------------|----------|-------|
127
+ | Marcus | Marcus | character_name | Original kept (keep_original) |
128
+ | The Wandering City | La Cite Errante | place_name | |
129
+ | chronoshifter | chronodecaleur | invented_term | Compound: chrono + shifter |
130
+ | "Break the seal" | "Briser le sceau" | recurring_phrase | Ritual context |
131
+ | Lord Commander | Seigneur Commandant | title_honorific | Military rank |
132
+
133
+ ## Categories
134
+
135
+ - **character_name** -- Character names, nicknames, aliases
136
+ - **place_name** -- Locations, realms, geographical features
137
+ - **invented_term** -- Made-up words, neologisms, world-specific vocabulary
138
+ - **title_honorific** -- Titles, ranks, forms of address
139
+ - **recurring_phrase** -- Phrases that appear multiple times with specific meaning
140
+ - **cultural_reference** -- Setting-specific cultural elements
141
+ - **brand_name** -- Proper nouns, organization names
142
+
143
+ ## Usage Notes
144
+
145
+ This glossary is loaded into the translator agent's context for every unit. Terms listed here MUST be used exactly as specified. To update a translation, edit this file directly or use `/scr:translation-glossary [lang] --add`.
146
+ ```
147
+
148
+ Report:
149
+
150
+ > **Glossary created for [language]:** `.manuscript/translation/GLOSSARY-[lang].md`
151
+ >
152
+ > **Terms catalogued:**
153
+ > - [count] character names
154
+ > - [count] place names
155
+ > - [count] invented terms
156
+ > - [count] titles/honorifics
157
+ > - [count] recurring phrases
158
+ > - [count] cultural references
159
+ >
160
+ > **Review the glossary** to verify translations before starting translation:
161
+ > `/scr:translation-glossary [lang] --review`
162
+
163
+ ---
164
+
165
+ ### MODE: DISPLAY (GLOSSARY-{lang}.md exists, no flags)
166
+
167
+ Read and display the existing glossary:
168
+
169
+ > **Translation Glossary: [Language]**
170
+ >
171
+ > [Display the markdown table]
172
+ >
173
+ > **[count] terms total**
174
+ >
175
+ > **Actions:**
176
+ > - Add a term: `/scr:translation-glossary [lang] --add <term> --translation <value>`
177
+ > - Review for missing terms: `/scr:translation-glossary [lang] --review`
178
+ > - Bulk import: `/scr:translation-glossary [lang] --import`
179
+
180
+ ---
181
+
182
+ ### MODE: ADD (`--add <term> --translation <value>`)
183
+
184
+ Add a single term to the existing glossary.
185
+
186
+ 1. Read the existing GLOSSARY-{lang}.md
187
+ 2. Check if the term already exists:
188
+ - If yes: Ask whether to update the existing translation or keep it
189
+ - If no: Add to the table
190
+ 3. Determine category:
191
+ - If `--category <cat>` flag provided: use that category
192
+ - If not: infer from context (check CHARACTERS.md for character names, WORLD.md for places, etc.)
193
+ 4. Append the new row to the glossary table
194
+ 5. Write the updated file
195
+
196
+ > **Added to glossary:** "[source term]" -> "[translation]" ([category])
197
+
198
+ ---
199
+
200
+ ### MODE: IMPORT (`--import`)
201
+
202
+ Bulk import terms from a list provided by the writer.
203
+
204
+ 1. Read the existing GLOSSARY-{lang}.md (or create one if it doesn't exist)
205
+ 2. Prompt the writer to provide terms in one of these formats:
206
+
207
+ > **Provide your terms in any of these formats:**
208
+ >
209
+ > **Simple list** (translations will be suggested):
210
+ > ```
211
+ > chronoshifter
212
+ > The Wandering City
213
+ > Lord Commander
214
+ > ```
215
+ >
216
+ > **Term + translation pairs:**
217
+ > ```
218
+ > chronoshifter | chronodecaleur
219
+ > The Wandering City | La Cite Errante
220
+ > Lord Commander | Seigneur Commandant
221
+ > ```
222
+ >
223
+ > **Full table rows:**
224
+ > ```
225
+ > chronoshifter | chronodecaleur | invented_term | Compound word
226
+ > ```
227
+
228
+ 3. For simple lists: generate suggested translations using the same name_handling rules as Create mode
229
+ 4. Show the proposed entries for writer approval
230
+ 5. On approval: append all entries to the glossary and write the updated file
231
+
232
+ > **Imported [count] terms to glossary.**
233
+
234
+ ---
235
+
236
+ ### MODE: REVIEW (`--review`)
237
+
238
+ Review the glossary for completeness and consistency.
239
+
240
+ 1. Read the existing GLOSSARY-{lang}.md
241
+ 2. Scan the manuscript for terms that SHOULD be in the glossary but are NOT:
242
+ - Character names from CHARACTERS.md not in glossary
243
+ - Place names from WORLD.md not in glossary
244
+ - Any terms flagged as "NEW TERM" in translated draft files
245
+ - Invented terms or proper nouns found in drafts but missing from glossary
246
+ 3. Check for potential inconsistencies:
247
+ - Same source term with different translations
248
+ - Similar terms that might confuse the translator (e.g., "Lord" vs "Lord Commander")
249
+
250
+ Report:
251
+
252
+ > **Glossary Review: [Language]**
253
+ >
254
+ > **Coverage:**
255
+ > - [count] terms in glossary
256
+ > - [count] character names covered / [total] in CHARACTERS.md
257
+ > - [count] place names covered / [total] in WORLD.md
258
+ >
259
+ > **Missing terms (found in manuscript but not in glossary):**
260
+ > - "[term]" -- appears [count] times in manuscript
261
+ > - "[term]" -- appears [count] times in manuscript
262
+ >
263
+ > **Potential inconsistencies:**
264
+ > - "[term]" has no translation yet
265
+ >
266
+ > **Actions:**
267
+ > - Add missing terms: `/scr:translation-glossary [lang] --add <term> --translation <value>`
268
+ > - Bulk add: `/scr:translation-glossary [lang] --import`
269
+
270
+ ## Anti-patterns
271
+
272
+ - **NEVER** create a glossary without checking CHARACTERS.md first -- character names are the highest priority for consistency
273
+ - **NEVER** auto-translate names when `name_handling` is `keep_original` -- names stay in original form
274
+ - **NEVER** overwrite an existing glossary without asking -- always append or update
275
+ - **NEVER** leave the glossary in an invalid markdown table format -- the translator agent parses it
276
+
277
+ ## Response Contract
278
+
279
+ 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.
280
+
281
+ Use this format:
282
+
283
+ ```markdown
284
+ Next commands:
285
+ - `/scr:...`: One short sentence explaining what this path will do.
286
+ - `/scr:...`: One short sentence explaining what this alternate path will do.
287
+ ```
288
+
289
+ 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.
290
+
291
+ If the writer seems unsure or no specific next command is obvious, include this default option:
292
+
293
+ ```markdown
294
+ Next commands:
295
+ - `/scr:next`: Inspect the project state and choose the right next step.
296
+ ```
297
+
298
+ If the command stops because a prerequisite is missing, suggest the command that fixes the prerequisite. Keep every explanation practical and writer-facing.