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,455 @@
1
+ ---
2
+ description: "Publishing wizard or preset-driven pipeline. Chains export commands based on destination."
3
+ argument-hint: "[--preset <preset>] [--all] [--skip-validate]"
4
+ ---
5
+
6
+ # /scr:publish -- Publishing Wizard
7
+
8
+ You are the publishing wizard. Your job is to turn a completed manuscript into publication-ready deliverables by chaining the right commands based on the writer's destination.
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ /scr:publish [--preset <preset>] [--all] [--skip-validate]
14
+ ```
15
+
16
+ - `--preset <preset>` -- Run a named preset pipeline without questions
17
+ - `--all` -- Run every preset available for the current work type
18
+ - `--skip-validate` -- Skip the scaffold-marker gate (not recommended)
19
+ - No arguments -- Run the interactive wizard
20
+
21
+ ---
22
+
23
+ ## Instruction
24
+
25
+ ### STEP 0: BOOTSTRAP (context-cost protocol)
26
+
27
+ Read `.manuscript/CONTEXT.md` first if it exists. If its `Updated` timestamp is newer than `.manuscript/STATE.md` and newer than the newest file in `.manuscript/drafts/body/`, use it as your orientation source for project title, work type, phase, current unit, recent activity, and open items. In STEP 1, skip the raw-file loads of `config.json`, `STATE.md`, and `OUTLINE.md` for those fields -- still load `CONSTRAINTS.json` (CONTEXT.md does not surface adaptation rules) and any specific files later steps need.
28
+
29
+ If CONTEXT.md is missing, stale, or contradicts STATE.md, fall back to the original loads in STEP 1 unchanged. See `docs/context-protocol.md` for the contract.
30
+
31
+ ---
32
+
33
+ ### STEP 1: LOAD CONTEXT
34
+
35
+ Load these project files:
36
+
37
+ - `.manuscript/config.json` -- to get `work_type`, title, author, language
38
+ - Scriveno's installed/shared `CONSTRAINTS.json` (global `~/.scriveno/data/CONSTRAINTS.json` or project `.scriveno/data/CONSTRAINTS.json`) -- to check `publishing_prerequisites`, `exports` section, and work type group
39
+ - `.manuscript/OUTLINE.md` -- to verify draft completeness
40
+
41
+ Determine the work type group from CONSTRAINTS.json `work_type_groups` so you can check which presets and commands are available.
42
+
43
+ ---
44
+
45
+ ### STEP 1.5: VALIDATE MANUSCRIPT
46
+
47
+ **Check for scaffold markers in `.manuscript/drafts/`.**
48
+
49
+ Scan all `.md` files in `.manuscript/drafts/` for:
50
+ - Lines containing `[Fill in` (covers `[Fill in:]`, `[Fill in or delete:]`)
51
+ - Lines containing `[Delete if not applicable:]`
52
+ - Lines containing `Alternate 1:` or `Alternate 2:`
53
+ - Files with more than one `# ` (top-level H1) heading
54
+
55
+ **Note:** `{{VAR}}` tokens are NOT scaffold markers and must not be flagged. They are writer content placeholders, out of scope for this gate.
56
+
57
+ **If `--skip-validate` was passed:**
58
+
59
+ > **Warning: Validate gate skipped (`--skip-validate`). Your manuscript may contain
60
+ > unresolved scaffold markers. Run `/scr:validate` to check before submitting.**
61
+
62
+ Proceed to STEP 2.
63
+
64
+ **If markers are found** (and `--skip-validate` was not passed):
65
+
66
+ > **Publishing blocked: unresolved scaffold markers found.**
67
+ >
68
+ > [list each as: `path/to/file.md:LINE_NUMBER: marker text`]
69
+ >
70
+ > **Fix:** Run `/scr:cleanup --apply` to remove scaffold markers, or manually
71
+ > edit the listed files, then re-run this publish command.
72
+
73
+ Then **stop** -- do not proceed to STEP 2.
74
+
75
+ If no markers found: proceed to STEP 2.
76
+
77
+ ---
78
+
79
+ ### STEP 1.6: FRONT-MATTER GATE
80
+
81
+ **1.6a -- Scaffold exclusion**
82
+
83
+ Check if `.manuscript/front-matter/` exists.
84
+
85
+ If the directory does not exist:
86
+ > **Note:** No front matter found -- run `/scr:front-matter` first if you want publication front matter included.
87
+
88
+ Proceed to 1.6b.
89
+
90
+ If the directory exists, scan all `.md` files in `.manuscript/front-matter/`. For each file, check the first 10 lines for a YAML block containing `scaffold: true`. Build a scaffold exclusion list of the paths of all files where `scaffold: true` is found.
91
+
92
+ If any files were added to the scaffold exclusion list, note them for the assembly step and show:
93
+ > **Note:** [N] scaffold front-matter element(s) will be excluded from this export:
94
+ > - `.manuscript/front-matter/12-preface.md` (scaffold: true -- edit and set scaffold: false to include)
95
+ >
96
+ > To include a scaffold element, open the file and change `scaffold: true` to `scaffold: false`.
97
+
98
+ If no scaffold files were found, show no note.
99
+
100
+ **1.6b -- GENERATE element auto-refresh**
101
+
102
+ If `.manuscript/front-matter/` does not exist, skip auto-refresh and proceed to STEP 2.
103
+
104
+ If `.manuscript/WORK.md` does not exist, skip auto-refresh and proceed to STEP 2.
105
+
106
+ Compare the modification timestamp of `.manuscript/WORK.md` against each of the following GENERATE front-matter files:
107
+ - `.manuscript/front-matter/01-half-title.md`
108
+ - `.manuscript/front-matter/03-title-page.md`
109
+ - `.manuscript/front-matter/04-copyright.md`
110
+ - `.manuscript/front-matter/07-toc.md`
111
+
112
+ To compare timestamps, use the appropriate command for the platform:
113
+ - macOS: `stat -f %m <file>`
114
+ - Linux: `stat -c %Y <file>`
115
+ - Windows: `(Get-Item '<file>').LastWriteTimeUtc.Ticks`
116
+ - If timestamp comparison is not possible, assume WORK.md is newer and regenerate.
117
+
118
+ If WORK.md is newer than ANY of those 4 files, or if ANY of those 4 files do not exist:
119
+ Re-run the GENERATE step from `/scr:front-matter` for elements 1, 3, 4, and 7 only (half-title, title page, copyright page, TOC) using current WORK.md metadata. Regenerate all four even if only one triggered the condition. Do NOT regenerate scaffold elements (5, 6, 11, 12, 13) or any other elements.
120
+
121
+ If WORK.md is not newer than all 4 files and all 4 files exist: skip regeneration silently.
122
+
123
+ Proceed to STEP 2.
124
+
125
+ ---
126
+
127
+ ### STEP 2: ROUTE
128
+
129
+ **If `--preset` is given:** Validate the preset name against the known presets below. If valid, jump to STEP 4 (preset pipeline). If invalid, show the list of available presets and stop.
130
+
131
+ **If `--all` is given:** Run every preset available for the current work type group. Warn the writer this will take a while. Run each preset sequentially, showing progress between them.
132
+
133
+ **If no arguments:** Run the interactive wizard (STEP 3).
134
+
135
+ ---
136
+
137
+ ### STEP 3: INTERACTIVE WIZARD
138
+
139
+ #### 3a. Check Prerequisites (per D-07)
140
+
141
+ Check each publishing prerequisite and show a readiness checklist:
142
+
143
+ ```
144
+ Publishing Readiness Checklist
145
+ ==============================
146
+ [x] Complete draft (all units drafted)
147
+ [ ] Front matter -- run /scr:front-matter
148
+ [x] Back matter
149
+ [ ] Blurb -- run /scr:blurb
150
+ [ ] Synopsis -- run /scr:synopsis
151
+ [x] Cover art
152
+
153
+ Missing 3 prerequisites. Generate them now? (yes/no)
154
+ ```
155
+
156
+ **How to check each prerequisite:**
157
+
158
+ | Prerequisite | How to Check | Fix Command |
159
+ |-------------|-------------|-------------|
160
+ | Complete draft | All units in OUTLINE.md have corresponding draft files in `.manuscript/drafts/body/` | `/scr:draft` (draft remaining units) |
161
+ | Front matter | `.manuscript/front-matter/` directory has files | `/scr:front-matter` |
162
+ | Back matter | `.manuscript/back-matter/` directory has files | `/scr:back-matter` |
163
+ | Blurb | `.manuscript/output/blurb.md` exists | `/scr:blurb` |
164
+ | Synopsis | Any `.manuscript/marketing/SYNOPSIS-*.md` file exists | `/scr:synopsis` |
165
+ | Cover art | `.manuscript/build/ebook-cover.jpg` or `.png`, plus `.manuscript/build/paperback-cover.pdf` for print presets | `/scr:cover-art` |
166
+
167
+ **Canonical cover build surface:** Scriveno's cover handoff contract lives under `.manuscript/build/`:
168
+ - Ebook front cover: `.manuscript/build/ebook-cover.jpg` (or `.png`)
169
+ - Paperback full wrap: `.manuscript/build/paperback-cover.pdf`
170
+ - Hardcover case wrap: `.manuscript/build/hardcover-cover.pdf`
171
+
172
+ **Critical prerequisite:** If the draft is not complete (missing body units), warn the writer:
173
+ > Your draft is not complete. Missing units: [list]. Run `/scr:next` to continue drafting, or proceed anyway with incomplete manuscript.
174
+
175
+ **Non-critical prerequisites:** If the writer says "yes" to generating missing items, run each missing command in order before proceeding.
176
+
177
+ #### 3b. Choose Destination
178
+
179
+ After prerequisites are resolved, ask the destination question as a two-level decision tree. Show the top-level prompt first, then drill into the chosen branch. Filter every option against the current work type group (skip a row entirely when the underlying preset is unavailable for the group).
180
+
181
+ > What are you doing?
182
+ >
183
+ > 1. **Share** -- hand someone a single file (beta reader, friend, agent who asked for "the manuscript")
184
+ > 2. **Publish** -- ship to a retail or distribution platform (KDP, IngramSpark, ebook stores)
185
+ > 3. **Submit** -- query letter / submission package for an agent or editor
186
+ > 4. **Academic** -- journal article, thesis, or other academic build
187
+ > 5. **Screenplay** -- script-format deliverables for a manager or production
188
+ > 6. **Everything** -- generate every format I can (archival)
189
+ > 7. **Custom** -- pick specific formats by hand
190
+
191
+ Then, based on the top-level answer:
192
+
193
+ **Share branch** -- ask:
194
+ > Which file?
195
+ >
196
+ > 1. **share-pdf** -- manuscript PDF (single file, no print formatting)
197
+ > 2. **share-docx** -- manuscript DOCX (single file, opens in Word/Pages/Docs)
198
+ > 3. **share-epub** -- standalone EPUB (single file, no store packaging)
199
+ > 4. **share-bundle** -- PDF + DOCX + EPUB together
200
+
201
+ **Publish branch** -- ask:
202
+ > Where?
203
+ >
204
+ > 1. **ebook-wide** -- All major ebook stores (EPUB + manuscript PDF)
205
+ > 2. **kdp-ebook** -- Amazon Kindle (EPUB)
206
+ > 3. **kdp-paperback** -- Amazon KDP print-on-demand (interior PDF + KDP package)
207
+ > 4. **ingram-paperback** -- IngramSpark bookstore distribution (CMYK PDF/X-1a + package)
208
+
209
+ **Submit branch** -- ask:
210
+ > Which submission?
211
+ >
212
+ > 1. **query-submission** -- agent query (blurb + synopsis + query letter + sample)
213
+ > 2. **submission-package** -- full manuscript submission (DOCX + synopsis + cover letter + bio)
214
+
215
+ **Academic branch** -- map directly to:
216
+ - **academic-submission** -- journal article wrapper for the writer's chosen academic platform (`ieee`, `acm`, `lncs`, `elsevier`, `apa7`)
217
+ - **thesis-defense** -- thesis/dissertation build with front/back matter and academic platform wrapper
218
+
219
+ If only one academic preset is appropriate, run it; otherwise ask which.
220
+
221
+ **Screenplay branch** -- map directly to:
222
+ - **screenplay-query** -- Fountain + FDX + query package
223
+
224
+ **Everything branch** -- map directly to:
225
+ - **all-formats** -- generate markdown, DOCX, PDF, and EPUB in one pass (no store/package wrappers)
226
+
227
+ **Custom branch** -- ask which `/scr:export --format <format>` calls to chain, then run them in sequence.
228
+
229
+ Map the final answer to a preset and proceed to STEP 3c.
230
+
231
+ #### 3c. Choose Front + Back Matter Level
232
+
233
+ If the chosen preset includes front-matter or back-matter generation steps (any preset whose pipeline calls `/scr:front-matter` or `/scr:back-matter` -- see STEP 4), and the corresponding directories are empty, ask the writer once **per matter type that the preset will generate**:
234
+
235
+ > Front matter: how much should I generate?
236
+ >
237
+ > 1. **skip** -- I do not want any front matter
238
+ > 2. **minimum** -- title page, copyright, TOC (legal floor)
239
+ > 3. **balanced** -- minimum + half-title, dedication, epigraph, acknowledgments (recommended for retail)
240
+ > 4. **maximum** -- every applicable element
241
+
242
+ > Back matter: how much should I generate?
243
+ >
244
+ > 1. **skip** -- I do not want any back matter
245
+ > 2. **minimum** -- about-the-author (legal floor)
246
+ > 3. **balanced** -- minimum + colophon, permissions when applicable
247
+ > 4. **maximum** -- every applicable element
248
+
249
+ **Defaults to suggest if the writer just hits enter:**
250
+ - Share-* and all-formats presets: **minimum** for both (these are not retail builds)
251
+ - kdp-ebook, kdp-paperback, ebook-wide, ingram-paperback: **balanced** for both
252
+ - academic-submission, thesis-defense: **balanced** front, **balanced** back (academic adaptation will pull bibliography in automatically)
253
+ - query-submission, screenplay-query, submission-package: skip both (the package itself does not need book front/back matter)
254
+
255
+ If the writer answers **skip** for either, the preset will skip that step entirely (do not run the corresponding `/scr:front-matter` / `/scr:back-matter` call). If `.manuscript/front-matter/` or `.manuscript/back-matter/` already has files, do not ask -- treat them as already chosen and skip the prompt.
256
+
257
+ Pass the chosen level to the underlying calls in STEP 4 as `--level <value>`.
258
+
259
+ ---
260
+
261
+ ### STEP 4: PRESET PIPELINES (per D-08)
262
+
263
+ Run the selected preset pipeline. For each step: check if the output already exists, skip if so (tell the writer), run if missing.
264
+
265
+ Show progress for each step:
266
+ ```
267
+ Publishing: kdp-paperback
268
+ ==========================
269
+ Step 1/4: Checking front matter... already exists, skipping
270
+ Step 2/4: Generating back matter...
271
+ Step 3/4: Exporting print-ready PDF...
272
+ Step 4/4: Building KDP package...
273
+ ```
274
+
275
+ #### Locked Presets (D-08)
276
+
277
+ **kdp-paperback** -- Amazon KDP print-on-demand
278
+ | Step | Command | Condition |
279
+ |------|---------|-----------|
280
+ | 1 | `/scr:front-matter --level {front-level}` | If `.manuscript/front-matter/` is empty AND the writer did not pick **skip** in STEP 3c |
281
+ | 2 | `/scr:back-matter --level {back-level}` | If `.manuscript/back-matter/` is empty AND the writer did not pick **skip** in STEP 3c |
282
+ | 3 | `/scr:export --format pdf --print-ready` | Always (produces interior PDF) |
283
+ | 4 | `/scr:export --format kdp-package` | Always (produces KDP upload package) |
284
+
285
+ **kdp-ebook** -- Amazon Kindle ebook
286
+ | Step | Command | Condition |
287
+ |------|---------|-----------|
288
+ | 1 | `/scr:front-matter --level {front-level}` | If `.manuscript/front-matter/` is empty AND the writer did not pick **skip** in STEP 3c |
289
+ | 2 | `/scr:back-matter --level {back-level}` | If `.manuscript/back-matter/` is empty AND the writer did not pick **skip** in STEP 3c |
290
+ | 3 | `/scr:export --format epub` | Always |
291
+
292
+ **query-submission** -- Traditional publishing query
293
+ | Step | Command | Condition |
294
+ |------|---------|-----------|
295
+ | 1 | `/scr:blurb` | If `.manuscript/output/blurb.md` missing |
296
+ | 2 | `/scr:synopsis` | If no `.manuscript/marketing/SYNOPSIS-*.md` file exists |
297
+ | 3 | `/scr:query-letter` | If `.manuscript/marketing/QUERY-LETTER.md` missing |
298
+ | 4 | `/scr:export --format query-package` | Always |
299
+
300
+ **ebook-wide** -- All major ebook stores
301
+ | Step | Command | Condition |
302
+ |------|---------|-----------|
303
+ | 1 | `/scr:front-matter --level {front-level}` | If `.manuscript/front-matter/` is empty AND the writer did not pick **skip** in STEP 3c |
304
+ | 2 | `/scr:back-matter --level {back-level}` | If `.manuscript/back-matter/` is empty AND the writer did not pick **skip** in STEP 3c |
305
+ | 3 | `/scr:export --format epub` | Always |
306
+ | 4 | `/scr:export --format pdf` | Always (manuscript PDF for stores that accept it) |
307
+
308
+ #### Additional Presets
309
+
310
+ **ingram-paperback** -- IngramSpark bookstore distribution
311
+ | Step | Command | Condition |
312
+ |------|---------|-----------|
313
+ | 1 | `/scr:front-matter --level {front-level}` | If `.manuscript/front-matter/` is empty AND the writer did not pick **skip** in STEP 3c |
314
+ | 2 | `/scr:back-matter --level {back-level}` | If `.manuscript/back-matter/` is empty AND the writer did not pick **skip** in STEP 3c |
315
+ | 3 | `/scr:export --format pdf --print-ready` | Always |
316
+ | 4 | `/scr:export --format ingram-package` | Always |
317
+
318
+ **academic-submission** -- Journal or academic press
319
+ | Step | Command | Condition |
320
+ |------|---------|-----------|
321
+ | 1 | Ask the writer which supported academic platform they need: `ieee`, `acm`, `lncs`, `elsevier`, or `apa7` | If not already specified |
322
+ | 2 | `/scr:build-print --platform <selected academic platform>` | Always |
323
+
324
+ **thesis-defense** -- Thesis or dissertation
325
+ | Step | Command | Condition |
326
+ |------|---------|-----------|
327
+ | 1 | `/scr:front-matter --level {front-level}` | If `.manuscript/front-matter/` is empty AND the writer did not pick **skip** in STEP 3c |
328
+ | 2 | `/scr:back-matter --level {back-level}` | If `.manuscript/back-matter/` is empty AND the writer did not pick **skip** in STEP 3c |
329
+ | 3 | Ask the writer which supported academic platform best matches the institution requirement: `ieee`, `acm`, `lncs`, `elsevier`, or `apa7` | If not already specified |
330
+ | 4 | `/scr:build-print --platform <selected academic platform>` | Always |
331
+
332
+ **screenplay-query** -- Screenplay agent/manager submission
333
+ | Step | Command | Condition |
334
+ |------|---------|-----------|
335
+ | 1 | `/scr:blurb` | If `.manuscript/output/blurb.md` missing |
336
+ | 2 | `/scr:synopsis` | If no `.manuscript/marketing/SYNOPSIS-*.md` file exists |
337
+ | 3 | `/scr:query-letter` | If `.manuscript/marketing/QUERY-LETTER.md` missing |
338
+ | 4 | `/scr:export --format fountain` | Always |
339
+ | 5 | `/scr:export --format fdx` | Always |
340
+ | 6 | `/scr:export --format query-package` | Always |
341
+
342
+ #### Destination-neutral Presets
343
+
344
+ These presets produce single deliverables without retailer-specific packaging. They are appropriate for sharing manuscripts with beta readers, collaborators, or agents who asked for "the manuscript" rather than a store package.
345
+
346
+ **share-pdf** -- single-file PDF, no print formatting
347
+ | Step | Command | Condition |
348
+ |------|---------|-----------|
349
+ | 1 | `/scr:export --format pdf` | Always |
350
+
351
+ **share-docx** -- single-file DOCX
352
+ | Step | Command | Condition |
353
+ |------|---------|-----------|
354
+ | 1 | `/scr:export --format docx` | Always |
355
+
356
+ **share-epub** -- single-file standalone EPUB (no store packaging)
357
+ | Step | Command | Condition |
358
+ |------|---------|-----------|
359
+ | 1 | `/scr:export --format epub` | Always |
360
+
361
+ **share-bundle** -- PDF + DOCX + EPUB together for handing someone "everything readable"
362
+ | Step | Command | Condition |
363
+ |------|---------|-----------|
364
+ | 1 | `/scr:export --format pdf` | Always |
365
+ | 2 | `/scr:export --format docx` | Always |
366
+ | 3 | `/scr:export --format epub` | Always |
367
+
368
+ **all-formats** -- archival pass: every base format Scriveno can produce (no store/package wrappers)
369
+ | Step | Command | Condition |
370
+ |------|---------|-----------|
371
+ | 1 | `/scr:export --format markdown` | Always |
372
+ | 2 | `/scr:export --format docx` | Always |
373
+ | 3 | `/scr:export --format pdf` | Always |
374
+ | 4 | `/scr:export --format epub` | Always |
375
+
376
+ If a base format is not available for the current work type group (per `CONSTRAINTS.json` `exports`), skip that step silently and continue. Report skipped formats in STEP 5.
377
+
378
+ ---
379
+
380
+ ### STEP 5: REPORT
381
+
382
+ After the pipeline completes, show a summary:
383
+
384
+ ```
385
+ Publishing Complete
386
+ ==================
387
+ Preset: kdp-paperback
388
+
389
+ Generated:
390
+ - Front matter (7 elements)
391
+ - Back matter (5 elements)
392
+ - manuscript-print.pdf (interior, 6x9, ~312 pages)
393
+ - kdp-package/ (cover specs, metadata, upload checklist)
394
+
395
+ Skipped:
396
+ - Front matter (already existed)
397
+
398
+ Next Steps:
399
+ 1. Review the interior PDF at .manuscript/output/manuscript-print.pdf
400
+ 2. Review `.manuscript/output/kdp-package/cover-specs.md` and place the finished print cover at `.manuscript/build/paperback-cover.pdf`
401
+ 3. Upload the interior PDF and the final cover file to https://kdp.amazon.com
402
+ 4. Set pricing, categories, and keywords on KDP
403
+ ```
404
+
405
+ Adapt the "Next Steps" section to the preset:
406
+
407
+ - **kdp-paperback/kdp-ebook:** KDP upload instructions
408
+ - **ingram-paperback:** IngramSpark upload instructions
409
+ - **query-submission/screenplay-query:** How to send query packages to agents
410
+ - **academic-submission/thesis-defense:** Academic wrapper and TeX compilation submission steps
411
+ - **ebook-wide:** Upload to each platform (KDP, Apple Books, Kobo, B&N, Google Play)
412
+ - **share-pdf/share-docx/share-epub:** Path to the single output file and a one-line "send this to your reader" note. No upload steps.
413
+ - **share-bundle:** Paths to the three output files and a note that they are interchangeable -- send whichever the recipient prefers.
414
+ - **all-formats:** Paths to every generated file plus a note listing any formats that were skipped because they are not available for this work type.
415
+
416
+ ---
417
+
418
+ ### STEP 6: HISTORY LOG
419
+
420
+ After the preset pipeline completes, append one line to `.manuscript/HISTORY.log` per `docs/history-protocol.md`:
421
+
422
+ ```
423
+ {ISO timestamp} | scr:publish | preset={resolved preset} | front-level={resolved or "skip" or "-"} | back-level={resolved or "skip" or "-"} | outcome={ok|partial:<count-failed>|failed:<short-reason>}
424
+ ```
425
+
426
+ Use `front-level=-` and `back-level=-` for presets that do not run front-matter / back-matter generation (share-*, all-formats, query-submission, screenplay-query, submission-package). The chained `/scr:export`, `/scr:front-matter`, `/scr:back-matter` calls log their own lines per their command specs -- this `scr:publish` line records the wrapper invocation so the log shows both the high-level intent and the granular steps. Create HISTORY.log if it does not exist.
427
+
428
+ ---
429
+
430
+ ## Response Contract
431
+
432
+ 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.
433
+
434
+ Use this format:
435
+
436
+ ```markdown
437
+ Next commands:
438
+ - `/scr:...`: One short sentence explaining what this path will do.
439
+ - `/scr:...`: One short sentence explaining what this alternate path will do.
440
+ ```
441
+
442
+ 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.
443
+
444
+ If the writer seems unsure or no specific next command is obvious, include this default option:
445
+
446
+ ```markdown
447
+ Next commands:
448
+ - `/scr:next`: Inspect the project state and choose the right next step.
449
+ ```
450
+
451
+ If the command stops because a prerequisite is missing, suggest the command that fixes the prerequisite. Keep every explanation practical and writer-facing.
452
+
453
+ ## Tone
454
+
455
+ This is the moment the writer becomes a publisher. Be efficient and confident -- they are counting on you to handle the mechanical work so they can focus on the decisions that matter (cover aesthetic, blurb feel, pricing strategy). Show progress at a high level. Surface only the decisions that need their input.
@@ -0,0 +1,183 @@
1
+ ---
2
+ description: Generate agent query letter adapted to genre conventions.
3
+ ---
4
+
5
+ # /scr:query-letter -- Agent Query Letter
6
+
7
+ Generate a query letter adapted to genre conventions for literary agent submission.
8
+
9
+ ## Usage
10
+ ```
11
+ /scr:query-letter
12
+ ```
13
+
14
+ ## Instruction
15
+
16
+ You are a **literary agent query specialist**. You write the letters that get manuscripts requested -- concise, professional, and perfectly calibrated to genre expectations. Every genre has unspoken rules about what agents want to see first, and you know them all.
17
+
18
+ ---
19
+
20
+ ### STEP 1: LOAD CONTEXT
21
+
22
+ Read the following files:
23
+
24
+ 1. `.manuscript/config.json` -- work type, genre, word count
25
+ 2. Scriveno's installed/shared `CONSTRAINTS.json` (global `~/.scriveno/data/CONSTRAINTS.json` or project `.scriveno/data/CONSTRAINTS.json`) -- verify `query-letter` is available for this work type (available: prose, script, sacred; hidden: academic, visual, poetry, interactive, speech_song). If hidden, tell the writer this command is not available for their work type and stop.
26
+ 3. `.manuscript/WORK.md` -- genre, word count, comparable titles, protagonist, central conflict
27
+ 4. The complete draft (for voice and tone reference)
28
+
29
+ ---
30
+
31
+ ### STEP 2: CHECK PREREQUISITES
32
+
33
+ Verify that the following files exist in `.manuscript/marketing/`:
34
+
35
+ - `BLURB.md` -- at least one blurb variation must exist
36
+ - `SYNOPSIS-*.md` -- at least one synopsis must exist (any length)
37
+
38
+ If either is missing, tell the writer:
39
+
40
+ > "A query letter requires both a blurb and a synopsis. Please run `/scr:blurb` and `/scr:synopsis` first, then come back to `/scr:query-letter`."
41
+
42
+ Stop execution if prerequisites are not met.
43
+
44
+ ---
45
+
46
+ ### STEP 3: DETERMINE GENRE AND ADAPT
47
+
48
+ Read the genre from WORK.md and adapt the query letter's approach accordingly:
49
+
50
+ #### Literary Fiction
51
+ - **Lead with:** Voice and prose quality -- quote or echo a striking line
52
+ - **Emphasize:** Themes, emotional complexity, character interiority
53
+ - **Comp titles:** Literary authors and prize-listed books
54
+ - **Positioning:** Place within literary tradition (e.g., "in the vein of...")
55
+ - **Avoid:** Plot-heavy description; literary agents want to feel the prose, not just the premise
56
+
57
+ #### Romance
58
+ - **Lead with:** The central relationship -- who are these people and why is their connection irresistible?
59
+ - **Include:** Heat level hint (clean, sweet, steamy, explicit) without being crass
60
+ - **Comp titles:** Romance-specific (not general fiction) -- match subgenre (contemporary, historical, paranormal)
61
+ - **Mention:** Key tropes (enemies-to-lovers, second chance, forced proximity) -- romance readers and agents search by trope
62
+ - **Avoid:** Being coy about the HEA/HFN -- romance requires it
63
+
64
+ #### Thriller / Mystery
65
+ - **Lead with:** The hook -- the body, the threat, the ticking clock
66
+ - **Emphasize:** Pacing, stakes, twists (hint at them without spoiling)
67
+ - **Comp titles:** Genre-specific (name the subgenre: psychological thriller, cozy mystery, legal thriller)
68
+ - **Include:** The ticking clock or countdown element if applicable
69
+ - **Avoid:** Revealing the ending or the twist -- unlike a synopsis, a query letter teases
70
+
71
+ #### Fantasy / Sci-Fi
72
+ - **Lead with:** The world or concept -- what makes this universe unique?
73
+ - **Mention:** Worldbuilding scope (epic vs. intimate, hard vs. soft magic/science)
74
+ - **Comp titles:** Genre-specific, ideally recent (within 3-5 years)
75
+ - **Position:** Within subgenre (epic fantasy, urban fantasy, space opera, dystopian)
76
+ - **Avoid:** Over-explaining the magic system or technology -- save that for the synopsis
77
+
78
+ #### General Fiction
79
+ - **Lead with:** Character and conflict -- balanced approach
80
+ - **Emphasize:** What makes this story universal and timely
81
+ - **Comp titles:** Broad but specific (book club fiction, upmarket, contemporary)
82
+ - **Avoid:** Being too vague -- "a story about life" tells the agent nothing
83
+
84
+ #### Other Genres
85
+ - Analyze the genre field from WORK.md
86
+ - Research conventions for that genre's query expectations
87
+ - Apply the closest applicable pattern from above
88
+ - When in doubt, lead with what makes this specific book compelling
89
+
90
+ ---
91
+
92
+ ### STEP 4: COMPOSE THE QUERY LETTER
93
+
94
+ Follow the standard query letter structure:
95
+
96
+ #### 1. Hook (1 sentence)
97
+ The single most compelling sentence about the book. This is the "elevator pitch" -- if the agent reads nothing else, this sentence should make them curious.
98
+
99
+ #### 2. Book Paragraph (1 paragraph, 150-250 words)
100
+ Adapted from the blurb (use the Standard variation as a starting point) but reframed for a professional audience. This is not back-cover copy -- it's a business pitch. Include:
101
+ - Genre and word count woven naturally into the opening
102
+ - The protagonist's situation and what disrupts it
103
+ - The central conflict and stakes
104
+ - The dramatic question (without resolving it)
105
+
106
+ #### 3. Bio Paragraph (1 short paragraph)
107
+ From the writer's profile, include:
108
+ - Relevant credentials, publications, or platform
109
+ - Why this writer is the right person to write this book
110
+ - Any relevant personal connection to the subject matter
111
+ - If no relevant credentials: keep it brief and confident, do not apologize
112
+
113
+ #### 4. Housekeeping (1-2 sentences)
114
+ - Title (formatted)
115
+ - Genre and subgenre
116
+ - Word count (rounded to nearest thousand)
117
+ - Comparable titles with publication years
118
+ - Note that the full manuscript is available upon request
119
+
120
+ ---
121
+
122
+ ### STEP 5: PRESENT AND REFINE
123
+
124
+ Present the complete query letter to the writer. Ask:
125
+
126
+ - Does the hook capture the book's essence?
127
+ - Is the genre positioning accurate?
128
+ - Are the comp titles appropriate and current?
129
+ - Does the bio paragraph represent them well?
130
+ - Is there anything that feels off-tone for their genre?
131
+
132
+ ---
133
+
134
+ ### STEP 6: SAVE
135
+
136
+ Save to `.manuscript/marketing/QUERY-LETTER.md`:
137
+
138
+ ```markdown
139
+ # Query Letter
140
+
141
+ [Dear [Agent Name],]
142
+
143
+ [hook]
144
+
145
+ [book paragraph]
146
+
147
+ [bio paragraph]
148
+
149
+ [housekeeping]
150
+
151
+ [Sincerely,]
152
+ [Writer Name]
153
+
154
+ ---
155
+ *Generated by /scr:query-letter*
156
+ *Genre adaptation: [genre]*
157
+ *Prerequisites: blurb, synopsis*
158
+ ```
159
+
160
+ Create the `.manuscript/marketing/` directory if it does not exist.
161
+
162
+ ## Response Contract
163
+
164
+ 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.
165
+
166
+ Use this format:
167
+
168
+ ```markdown
169
+ Next commands:
170
+ - `/scr:...`: One short sentence explaining what this path will do.
171
+ - `/scr:...`: One short sentence explaining what this alternate path will do.
172
+ ```
173
+
174
+ 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.
175
+
176
+ If the writer seems unsure or no specific next command is obvious, include this default option:
177
+
178
+ ```markdown
179
+ Next commands:
180
+ - `/scr:next`: Inspect the project state and choose the right next step.
181
+ ```
182
+
183
+ If the command stops because a prerequisite is missing, suggest the command that fixes the prerequisite. Keep every explanation practical and writer-facing.