@litfamily/litgravity 0.1.1 → 0.1.3

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 (251) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +19 -3
  3. package/README_ko-KR.md +19 -3
  4. package/TRADEMARK.md +12 -0
  5. package/package.json +3 -2
  6. package/plugin/hooks/lib/lanes.mjs +65 -0
  7. package/plugin/hooks/lib/liveness.mjs +81 -0
  8. package/plugin/hooks/lib/motion.mjs +34 -5
  9. package/plugin/hooks/lib/reentry.mjs +7 -0
  10. package/plugin/hooks/lib/rewind/brief.mjs +364 -0
  11. package/plugin/hooks/lib/rewind/collect.mjs +359 -0
  12. package/plugin/hooks/lib/rewind/gauge.mjs +55 -0
  13. package/plugin/hooks/lib/rewind/next-step.mjs +77 -0
  14. package/plugin/hooks/lib/rewind/redact.mjs +60 -0
  15. package/plugin/hooks/lib/rewind/transcripts.mjs +214 -0
  16. package/plugin/hooks/lib/routes.mjs +79 -5
  17. package/plugin/hooks/lib/workflow-stack.mjs +213 -0
  18. package/plugin/hooks/post-tool-use.mjs +39 -1
  19. package/plugin/hooks/pre-invocation.mjs +93 -2
  20. package/plugin/hooks/session-start.mjs +26 -3
  21. package/plugin/hooks/stop.mjs +55 -6
  22. package/plugin/hud/looks.mjs +29 -0
  23. package/plugin/hud/render.mjs +277 -12
  24. package/plugin/plugin.json +1 -1
  25. package/plugin/skills/frontend-ui-ux/SKILL.md +12 -1
  26. package/plugin/skills/frontend-ui-ux/kit/components.css +417 -0
  27. package/plugin/skills/frontend-ui-ux/kit/fonts.json +22 -0
  28. package/plugin/skills/frontend-ui-ux/kit/layouts/landing.html +164 -0
  29. package/plugin/skills/frontend-ui-ux/kit/layouts/settings.html +114 -0
  30. package/plugin/skills/frontend-ui-ux/kit/layouts/workspace.html +115 -0
  31. package/plugin/skills/frontend-ui-ux/kit/styles/computational-brutalism.json +227 -0
  32. package/plugin/skills/frontend-ui-ux/kit/styles/field-notes.json +205 -0
  33. package/plugin/skills/frontend-ui-ux/kit/styles/graphite.json +200 -0
  34. package/plugin/skills/frontend-ui-ux/kit/styles/meadow.json +199 -0
  35. package/plugin/skills/frontend-ui-ux/kit/styles/neo-brutalism.json +222 -0
  36. package/plugin/skills/frontend-ui-ux/kit/ui.js +226 -0
  37. package/plugin/skills/frontend-ui-ux/references/house-styles.md +234 -0
  38. package/plugin/skills/frontend-ui-ux/scripts/design-lock.mjs +400 -0
  39. package/plugin/skills/frontend-ui-ux/scripts/interface-probe-lock.mjs +196 -0
  40. package/plugin/skills/frontend-ui-ux/scripts/interface-probe-page.mjs +30 -9
  41. package/plugin/skills/frontend-ui-ux/scripts/interface-probe-rules.mjs +20 -8
  42. package/plugin/skills/frontend-ui-ux/scripts/interface-probe.mjs +42 -9
  43. package/plugin/skills/frontend-ui-ux/scripts/pixel-art.mjs +60 -0
  44. package/plugin/skills/lit-adhd/SKILL.md +160 -0
  45. package/plugin/skills/lit-adhd/references/card-examples.md +107 -0
  46. package/plugin/skills/lit-adhd/references/status-taxonomy.md +34 -0
  47. package/plugin/skills/lit-adhd/scripts/rewind.mjs +5 -0
  48. package/plugin/skills/lit-diagram-drawer/SKILL.md +5 -3
  49. package/plugin/skills/lit-diagram-drawer/references/drawing-rules.md +1 -1
  50. package/plugin/skills/lit-diagram-drawer/references/style-guide.md +21 -12
  51. package/plugin/skills/lit-diagram-drawer/references/type-architecture.md +3 -3
  52. package/plugin/skills/lit-diagram-drawer/references/type-dependency.md +1 -1
  53. package/plugin/skills/lit-diagram-drawer/references/type-tree.md +3 -3
  54. package/plugin/skills/lit-diagram-drawer/references/type-wardley.md +1 -1
  55. package/plugin/skills/lit-diagram-drawer/scripts/diagram-craft-rules.mjs +1 -2
  56. package/plugin/skills/lit-diagram-drawer/scripts/visual-quality.mjs +1 -2
  57. package/plugin/skills/lit-docx/SKILL.md +3 -3
  58. package/plugin/skills/lit-handoff/SKILL.md +1 -0
  59. package/plugin/skills/lit-hijack/SKILL.md +263 -0
  60. package/plugin/skills/lit-hijack/references/capture-and-provenance.md +100 -0
  61. package/plugin/skills/lit-hijack/references/clean-room-build.md +75 -0
  62. package/plugin/skills/lit-hijack/references/distil-and-licence.md +67 -0
  63. package/plugin/skills/lit-hijack/references/gap-and-port-design.md +100 -0
  64. package/plugin/skills/lit-hijack/references/parity-and-report.md +85 -0
  65. package/plugin/skills/lit-hijack/scripts/hijack.mjs +953 -0
  66. package/plugin/skills/lit-plan/SKILL.md +3 -2
  67. package/plugin/skills/lit-plan/references/plan-contract.md +12 -1
  68. package/plugin/skills/lit-plan/scripts/check-plan.mjs +39 -3
  69. package/plugin/skills/lit-plan/templates/plan.md +3 -0
  70. package/plugin/skills/lit-pptx/SKILL.md +8 -8
  71. package/plugin/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Bold.ttf +0 -0
  72. package/plugin/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Regular.ttf +0 -0
  73. package/plugin/skills/lit-pptx/fonts/jetbrains-mono/OFL.txt +93 -0
  74. package/plugin/skills/lit-pptx/fonts/provenance.json +32 -1
  75. package/plugin/skills/lit-pptx/references/agents/analyst.md +34 -56
  76. package/plugin/skills/lit-pptx/references/agents/antithesis.md +49 -67
  77. package/plugin/skills/lit-pptx/references/agents/architect.md +38 -51
  78. package/plugin/skills/lit-pptx/references/agents/critic.md +25 -41
  79. package/plugin/skills/lit-pptx/references/agents/synthesizer.md +37 -46
  80. package/plugin/skills/lit-pptx/references/agents/thesis.md +29 -49
  81. package/plugin/skills/lit-pptx/references/anti-slop-checklist.md +119 -145
  82. package/plugin/skills/lit-pptx/references/authoring-guide.md +187 -278
  83. package/plugin/skills/lit-pptx/references/consensus-protocol.md +99 -97
  84. package/plugin/skills/lit-pptx/references/data-display-cookbook.md +36 -137
  85. package/plugin/skills/lit-pptx/references/density-and-fill.md +147 -216
  86. package/plugin/skills/lit-pptx/references/design-system-azure.md +56 -85
  87. package/plugin/skills/lit-pptx/references/direction-step.md +134 -176
  88. package/plugin/skills/lit-pptx/references/examples/01-pitch-signal-ko.md +114 -115
  89. package/plugin/skills/lit-pptx/references/examples/02-pitch-studio-ko.md +66 -66
  90. package/plugin/skills/lit-pptx/references/examples/03-business-review-ledger-ko.md +63 -63
  91. package/plugin/skills/lit-pptx/references/examples/04-business-review-night-en.md +96 -96
  92. package/plugin/skills/lit-pptx/references/examples/05-research-talk-paper-en.md +81 -81
  93. package/plugin/skills/lit-pptx/references/examples/06-lecture-chalk-ko.md +103 -103
  94. package/plugin/skills/lit-pptx/references/examples/07-data-review-night-en.md +100 -98
  95. package/plugin/skills/lit-pptx/references/examples/08-image-led-atlas-ko.md +76 -76
  96. package/plugin/skills/lit-pptx/references/examples/09-briefing-gazette-ko.md +96 -96
  97. package/plugin/skills/lit-pptx/references/examples/10-status-update-ledger-ko.md +80 -80
  98. package/plugin/skills/lit-pptx/references/examples/11-portfolio-studio-en.md +72 -72
  99. package/plugin/skills/lit-pptx/references/examples/12-research-tutorial-chalk-en.md +95 -95
  100. package/plugin/skills/lit-pptx/references/examples/13-engineering-review-computational-brutalism-ko.md +173 -0
  101. package/plugin/skills/lit-pptx/references/examples/14-launch-pitch-neo-brutalism-ko.md +154 -0
  102. package/plugin/skills/lit-pptx/references/examples/15-design-lecture-bauhaus-ko.md +139 -0
  103. package/plugin/skills/lit-pptx/references/examples/16-community-programme-riso-ko.md +158 -0
  104. package/plugin/skills/lit-pptx/references/examples/17-public-data-briefing-newsroom-ko.md +179 -0
  105. package/plugin/skills/lit-pptx/references/interview-protocol.md +83 -102
  106. package/plugin/skills/lit-pptx/references/layout-families.md +161 -265
  107. package/plugin/skills/lit-pptx/references/stages/autopilot.md +30 -70
  108. package/plugin/skills/lit-pptx/references/stages/interview.md +36 -68
  109. package/plugin/skills/lit-pptx/references/stages/plan.md +26 -67
  110. package/plugin/skills/lit-pptx/references/title-treatments.md +93 -145
  111. package/plugin/skills/lit-pptx/references/tonalities/atlas.md +95 -108
  112. package/plugin/skills/lit-pptx/references/tonalities/bauhaus.md +140 -0
  113. package/plugin/skills/lit-pptx/references/tonalities/chalk.md +107 -122
  114. package/plugin/skills/lit-pptx/references/tonalities/computational-brutalism.md +150 -0
  115. package/plugin/skills/lit-pptx/references/tonalities/gazette.md +87 -111
  116. package/plugin/skills/lit-pptx/references/tonalities/ledger.md +96 -125
  117. package/plugin/skills/lit-pptx/references/tonalities/neo-brutalism.md +161 -0
  118. package/plugin/skills/lit-pptx/references/tonalities/newsroom.md +144 -0
  119. package/plugin/skills/lit-pptx/references/tonalities/night.md +104 -131
  120. package/plugin/skills/lit-pptx/references/tonalities/paper.md +114 -130
  121. package/plugin/skills/lit-pptx/references/tonalities/riso.md +137 -0
  122. package/plugin/skills/lit-pptx/references/tonalities/signal.md +96 -103
  123. package/plugin/skills/lit-pptx/references/tonalities/studio.md +81 -112
  124. package/plugin/skills/lit-pptx/scripts/compile-deck.js +4 -6
  125. package/plugin/skills/lit-pptx/scripts/craft_extras.py +135 -91
  126. package/plugin/skills/lit-pptx/scripts/deck_craft.py +1 -1
  127. package/plugin/skills/lit-pptx/scripts/embed_fonts.py +13 -1
  128. package/plugin/skills/lit-pptx/scripts/layout_inventory.py +1 -1
  129. package/plugin/skills/lit-pptx/scripts/learn_template.py +1 -1
  130. package/plugin/skills/lit-pptx/scripts/lib/grid-resolver.js +101 -110
  131. package/plugin/skills/lit-pptx/scripts/lib/layout-resolver.js +9 -15
  132. package/plugin/skills/lit-pptx/scripts/lib/render-pack.js +370 -563
  133. package/plugin/skills/lit-pptx/scripts/lib/slide-grid.js +104 -0
  134. package/plugin/skills/lit-pptx/scripts/lib/template-registry.js +57 -6
  135. package/plugin/skills/lit-pptx/scripts/qa_deck.py +6 -6
  136. package/plugin/skills/lit-pptx/scripts/render_pages.py +31 -0
  137. package/plugin/skills/lit-pptx/scripts/validate_pptx.py +1 -1
  138. package/plugin/skills/lit-pptx/specs/markdown-slide-spec-v1.md +167 -191
  139. package/plugin/skills/lit-pptx/specs/markdown-slide-spec-v2.md +117 -166
  140. package/plugin/skills/lit-pptx/specs/template-enrollment-contract.md +307 -330
  141. package/plugin/skills/lit-pptx/templates/tonalities/atlas/pack.yaml +1 -1
  142. package/plugin/skills/lit-pptx/templates/tonalities/bauhaus/pack.yaml +98 -0
  143. package/plugin/skills/lit-pptx/templates/tonalities/chalk/pack.yaml +1 -1
  144. package/plugin/skills/lit-pptx/templates/tonalities/computational-brutalism/pack.yaml +99 -0
  145. package/plugin/skills/lit-pptx/templates/tonalities/gazette/pack.yaml +1 -1
  146. package/plugin/skills/lit-pptx/templates/tonalities/ledger/pack.yaml +1 -1
  147. package/plugin/skills/lit-pptx/templates/tonalities/neo-brutalism/pack.yaml +107 -0
  148. package/plugin/skills/lit-pptx/templates/tonalities/newsroom/pack.yaml +99 -0
  149. package/plugin/skills/lit-pptx/templates/tonalities/night/pack.yaml +1 -1
  150. package/plugin/skills/lit-pptx/templates/tonalities/paper/pack.yaml +1 -1
  151. package/plugin/skills/lit-pptx/templates/tonalities/riso/pack.yaml +99 -0
  152. package/plugin/skills/lit-pptx/templates/tonalities/signal/pack.yaml +2 -2
  153. package/plugin/skills/lit-pptx/templates/tonalities/studio/pack.yaml +1 -1
  154. package/plugin/skills/lit-schematic/SKILL.md +114 -0
  155. package/plugin/skills/lit-schematic/examples/iso-heat-exchanger/build.mjs +38 -0
  156. package/plugin/skills/lit-schematic/examples/iso-heat-exchanger/scene.mjs +133 -0
  157. package/plugin/skills/lit-schematic/examples/journal-adsorption-rig/build.mjs +87 -0
  158. package/plugin/skills/lit-schematic/examples/pid-dosing-skid/build.mjs +85 -0
  159. package/plugin/skills/lit-schematic/references/cutaway-outputs.md +70 -0
  160. package/plugin/skills/lit-schematic/references/isometric-craft.md +101 -0
  161. package/plugin/skills/lit-schematic/references/journal-figures.md +72 -0
  162. package/plugin/skills/lit-schematic/references/kit-api.md +134 -0
  163. package/plugin/skills/lit-schematic/references/pfd-and-layout.md +53 -0
  164. package/plugin/skills/lit-schematic/references/pid-drafting.md +103 -0
  165. package/plugin/skills/lit-schematic/references/pid-symbols.md +163 -0
  166. package/plugin/skills/lit-schematic/references/verification.md +100 -0
  167. package/plugin/skills/lit-schematic/scripts/doctor.mjs +57 -0
  168. package/plugin/skills/lit-schematic/scripts/lib/figure.mjs +81 -0
  169. package/plugin/skills/lit-schematic/scripts/lib/fonts.mjs +27 -0
  170. package/plugin/skills/lit-schematic/scripts/lib/geom.mjs +113 -0
  171. package/plugin/skills/lit-schematic/scripts/lib/interactive.mjs +292 -0
  172. package/plugin/skills/lit-schematic/scripts/lib/isa.mjs +115 -0
  173. package/plugin/skills/lit-schematic/scripts/lib/iso.mjs +719 -0
  174. package/plugin/skills/lit-schematic/scripts/lib/legend-sheet.mjs +162 -0
  175. package/plugin/skills/lit-schematic/scripts/lib/pid.mjs +937 -0
  176. package/plugin/skills/lit-schematic/scripts/lib/png.mjs +132 -0
  177. package/plugin/skills/lit-schematic/scripts/lib/qa-core.mjs +658 -0
  178. package/plugin/skills/lit-schematic/scripts/lib/route.mjs +218 -0
  179. package/plugin/skills/lit-schematic/scripts/lib/sheet.mjs +890 -0
  180. package/plugin/skills/lit-schematic/scripts/lib/svg.mjs +82 -0
  181. package/plugin/skills/lit-schematic/scripts/lib/theme.mjs +115 -0
  182. package/plugin/skills/lit-schematic/scripts/motion.mjs +129 -0
  183. package/plugin/skills/lit-schematic/scripts/qa.mjs +92 -0
  184. package/plugin/skills/lit-schematic/scripts/render.mjs +233 -0
  185. package/plugin/skills/lit-schematic/scripts/scaffold.mjs +60 -0
  186. package/plugin/skills/lit-scientific-visualization/SKILL.md +17 -6
  187. package/plugin/skills/lit-typographic-motion/SKILL.md +58 -48
  188. package/plugin/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +13 -2
  189. package/plugin/skills/lit-typographic-motion/engine/blender/runner.py +218 -0
  190. package/plugin/skills/lit-typographic-motion/engine/core/presets.mjs +1 -1
  191. package/plugin/skills/lit-typographic-motion/engine/node/analysis.mjs +65 -1
  192. package/plugin/skills/lit-typographic-motion/engine/node/assets.mjs +298 -0
  193. package/plugin/skills/lit-typographic-motion/engine/node/blender.mjs +143 -0
  194. package/plugin/skills/lit-typographic-motion/engine/node/board.mjs +136 -0
  195. package/plugin/skills/lit-typographic-motion/engine/node/brief.mjs +7 -1
  196. package/plugin/skills/lit-typographic-motion/engine/node/chrome.mjs +9 -12
  197. package/plugin/skills/lit-typographic-motion/engine/node/cover-assets.mjs +5 -3
  198. package/plugin/skills/lit-typographic-motion/engine/node/cover-capture.mjs +7 -6
  199. package/plugin/skills/lit-typographic-motion/engine/node/cover-treatment.mjs +37 -4
  200. package/plugin/skills/lit-typographic-motion/engine/node/cover.mjs +19 -8
  201. package/plugin/skills/lit-typographic-motion/engine/node/done.mjs +45 -6
  202. package/plugin/skills/lit-typographic-motion/engine/node/frame-worker.mjs +7 -5
  203. package/plugin/skills/lit-typographic-motion/engine/node/gallery.mjs +121 -0
  204. package/plugin/skills/lit-typographic-motion/engine/node/host.mjs +34 -0
  205. package/plugin/skills/lit-typographic-motion/engine/node/house.mjs +44 -0
  206. package/plugin/skills/lit-typographic-motion/engine/node/look.mjs +34 -20
  207. package/plugin/skills/lit-typographic-motion/engine/node/pipeline.mjs +19 -9
  208. package/plugin/skills/lit-typographic-motion/engine/node/scaffold.mjs +210 -0
  209. package/plugin/skills/lit-typographic-motion/engine/node/score.mjs +639 -0
  210. package/plugin/skills/lit-typographic-motion/engine/node/sound-cli.mjs +21 -4
  211. package/plugin/skills/lit-typographic-motion/engine/node/sound.mjs +127 -29
  212. package/plugin/skills/lit-typographic-motion/engine/node/stage-capture.mjs +7 -6
  213. package/plugin/skills/lit-typographic-motion/engine/node/stage-gate.mjs +59 -5
  214. package/plugin/skills/lit-typographic-motion/engine/node/stage-qa.mjs +141 -9
  215. package/plugin/skills/lit-typographic-motion/engine/node/stage-serve.mjs +28 -5
  216. package/plugin/skills/lit-typographic-motion/engine/node/stage.mjs +82 -14
  217. package/plugin/skills/lit-typographic-motion/engine/node/styles.mjs +213 -0
  218. package/plugin/skills/lit-typographic-motion/engine/node/treatment.mjs +311 -10
  219. package/plugin/skills/lit-typographic-motion/engine/stage/cover-init.js +14 -2
  220. package/plugin/skills/lit-typographic-motion/engine/stage/init.js +11 -1
  221. package/plugin/skills/lit-typographic-motion/engine/stage/qa.js +6 -1
  222. package/plugin/skills/lit-typographic-motion/engine/stage/stage-kit.js +83 -0
  223. package/plugin/skills/lit-typographic-motion/engine/vendor/three/LICENSE +21 -0
  224. package/plugin/skills/lit-typographic-motion/engine/vendor/three/addons/environments/RoomEnvironment.js +144 -0
  225. package/plugin/skills/lit-typographic-motion/engine/vendor/three/addons/geometries/RoundedBoxGeometry.js +155 -0
  226. package/plugin/skills/lit-typographic-motion/engine/vendor/three/three.module.js +54571 -0
  227. package/plugin/skills/lit-typographic-motion/recipes/hero-3d/expected.json +69 -0
  228. package/plugin/skills/lit-typographic-motion/recipes/hero-3d/index.html +139 -0
  229. package/plugin/skills/lit-typographic-motion/recipes/orbit-loop/expected.json +6 -4
  230. package/plugin/skills/lit-typographic-motion/recipes/painted-light/expected.json +4 -2
  231. package/plugin/skills/lit-typographic-motion/recipes/weight-tide/expected.json +7 -5
  232. package/plugin/skills/lit-typographic-motion/references/cover.md +394 -443
  233. package/plugin/skills/lit-typographic-motion/references/craft-loop.md +57 -87
  234. package/plugin/skills/lit-typographic-motion/references/depth.md +122 -0
  235. package/plugin/skills/lit-typographic-motion/references/look.md +94 -129
  236. package/plugin/skills/lit-typographic-motion/references/runtime.md +58 -91
  237. package/plugin/skills/lit-typographic-motion/references/sound.md +130 -99
  238. package/plugin/skills/lit-typographic-motion/references/stage.md +190 -215
  239. package/plugin/skills/lit-typographic-motion/references/studio.md +245 -0
  240. package/plugin/skills/lit-typographic-motion/references/style-bibles.md +108 -97
  241. package/plugin/skills/lit-typographic-motion/references/treatment.md +191 -143
  242. package/plugin/skills/lit-typographic-motion/scripts/motion-doctor.mjs +17 -5
  243. package/plugin/skills/lit-typographic-motion/scripts/motion.mjs +47 -7
  244. package/plugin/skills/lit-typographic-motion/styles/paper.json +41 -0
  245. package/plugin/skills/lit-typographic-motion/styles/swiss-signal.json +41 -0
  246. package/plugin/skills/lit-typographic-motion/styles/terminalcore.json +42 -0
  247. package/plugin/skills/lit-typographic-motion/styles/tidal.json +41 -0
  248. package/plugin/skills/litresearch/SKILL.md +1 -0
  249. package/plugin/skills/readme-studio/SKILL.md +2 -0
  250. package/plugin/skills/review-work/SKILL.md +1 -1
  251. package/plugin/skills/start-work/SKILL.md +2 -2
@@ -1,79 +1,34 @@
1
- # Template enrollment contract
1
+ # Template Enrollment Contract
2
2
 
3
- Status: frozen for contract version 1. A change to a key, a default or a check below needs a version
4
- bump in the files that carry it.
3
+ > **Status:** Frozen for v1. Changes require a version bump.
4
+ > **Date:** 2026-04-19
5
5
 
6
- ## 1. Purpose and scope
6
+ ## Purpose
7
7
 
8
- An enrolled template is a folder of three YAML files that tells the compiler how to draw the five
9
- classic layouts (and any layout the template adds) on one canvas: where each region sits, which font
10
- role each region uses, which furniture belongs on which layout, and which blocks each layout accepts.
11
- Adding a template is a file operation, and the compiler discovers it by scanning folders. The
12
- compiler contains no template names.
8
+ Define the contract that an enrolled template must satisfy to participate in the Markdown → AST → rendered slide pipeline. Enrollment is a declarative, file-based process — no compiler code changes are required to add a new template.
13
9
 
14
- Two kinds of template follow this contract:
10
+ ## 1. Enrollment Package Structure
15
11
 
16
- | Kind | Origin | Typical home |
17
- |---|---|---|
18
- | Enrolled | Written by hand; the four bundled ones are `AZURE-PRO`, `AZURE-A2Z`, `BOILERPLATE-PRETENDARD`, `BOILERPLATE-A2Z` | `templates/enrolled/<NAME>/` inside the skill |
19
- | Learned | Produced from a user's own `.pptx` by `scripts/learn_template.py` | `.lit-pptx/templates/<NAME>/` in the user's working directory |
20
-
21
- Tonality packs (`templates/tonalities/<id>/pack.yaml`) are a separate mechanism with their own schema,
22
- checked by `validatePack` in `scripts/lib/template-registry.js`. A deck chooses one or the other: a
23
- `tonality:` line in the frontmatter (or `--tonality`) selects a pack, `--template <NAME>` selects an
24
- enrolled or learned template. When a deck names a tonality the template flag is ignored and the
25
- compile log says so.
26
-
27
- ## 2. Where templates are found
28
-
29
- `template-registry.js` searches these folders in order and takes the first folder that holds a
30
- `template.yaml` with the requested name:
31
-
32
- 1. each folder listed in `LIT_PPTX_TEMPLATE_DIRS` (separated by the platform path delimiter);
33
- 2. `.lit-pptx/templates` under the current working directory;
34
- 3. the skill's own `templates/enrolled`.
35
-
36
- The installed skill folder is read-only for users, so learned and custom templates live in folder 1
37
- or 2. A template name matches `^[A-Za-z0-9][A-Za-z0-9._-]*$`; any other string is rejected before the
38
- disk is touched. `node "$SKILL_ROOT/scripts/compile-deck.js" --list-templates` prints every name the
39
- search finds, and `--list-layouts <NAME>` prints each layout with its allowed blocks and its regions.
40
-
41
- ## 3. Package layout
12
+ An enrolled template lives in:
42
13
 
43
14
  ```
44
- <NAME>/
45
- ├── template.yaml identity, fonts, canvas, palette, global type rules
46
- ├── layout-mapping.yaml layouts -> regions, variants; decorations
47
- └── capabilities.yaml supported blocks, font roles, constraints
15
+ templates/enrolled/<TEMPLATE-NAME>/
16
+ ├── template.yaml # Identity and global properties
17
+ ├── layout-mapping.yaml # AST layout → template layout + regions
18
+ └── capabilities.yaml # Supported layouts, blocks, and constraints
48
19
  ```
49
20
 
50
- The loader reads exactly these three files. A missing one stops the compile with
51
- `Template "<NAME>" is missing <file>`. Decoration images are not part of the folder: an `image`
52
- decoration with `dir: azure` reads `assets/azure/<asset>` inside the skill, and one without `dir`
53
- reads `assets/media/<asset>`. A learned template carries no image decorations.
54
-
55
- ## 4. YAML subset
56
-
57
- The registry has its own small parser. Write plain block-style YAML:
21
+ ### 1.1 `template.yaml`
58
22
 
59
- - two-space indentation, `key: value` lines and `- item` lists;
60
- - scalars: quoted or bare strings, numbers, `true`, `false`, `null`;
61
- - flow lists of scalars such as `[title, body, image]` are read as lists;
62
- - a flow mapping such as `{ font: "Brand Sans", size: 24 }` is read as one string, so every mapping
63
- is written out in block style;
64
- - quote every hex colour (`"#1D4ED8"`) and every font name that contains a space;
65
- - a comment starts after whitespace and `#`; a `#` inside quotes stays;
66
- - keys match `[\w][\w.-]*`; anchors, multi-line strings and tabs are unsupported.
23
+ Declares template identity and global properties.
67
24
 
68
- Positions and sizes are inches, type sizes are points, `char_spacing` is points as pptxgenjs reads it.
69
-
70
- ## 5. `template.yaml`
25
+ Required fields:
71
26
 
72
27
  ```yaml
73
- name: LIBRARY-DEMO
74
- version: "1.0.0"
75
- label: "Municipal library (example)"
76
- description: "Example template for an invented municipal library"
28
+ name: MY-BRAND # Unique enrollment name (matches frontmatter)
29
+ version: "1.0.0" # Template contract version (semver)
30
+ label: "My Brand" # Human-readable label
31
+ description: "Example corporate template learned from a brand deck"
77
32
 
78
33
  fonts:
79
34
  title: "Brand Sans Bold"
@@ -81,254 +36,320 @@ fonts:
81
36
  light: "Brand Sans Light"
82
37
 
83
38
  dimensions:
84
- width: 10.833
85
- height: 7.5
86
- unit: inches
87
- format: "custom"
39
+ width: 10.833 # inches
40
+ height: 7.5 # inches (A4 landscape)
88
41
 
89
42
  palette:
90
- ink: "#1F2933"
91
- ink_muted: "#52606D"
43
+ ink: "#000000"
92
44
  paper: "#FFFFFF"
93
- line: "#CBD2D9"
94
- header_fill: "#E4E7EB"
95
- metric: "#0B5FA5"
96
-
97
- global_typography:
98
- char_spacing: -0.3
99
- bullet_font: "Brand Sans Medium"
100
- bullet_char: "•"
101
- bullet_color: "1F2933"
102
- section_accent: "1F2933"
103
- ```
104
-
105
- | Key | Use |
106
- |---|---|
107
- | `name` | Matches the folder name and the deck's `template:` line; the loader falls back to the folder name |
108
- | `version` | Contract version in semver; the loader falls back to `0.0.0` |
109
- | `label`, `description` | Shown in listings |
110
- | `fonts` | Title, body and light families; the font-swap logic reassigns them (see section 9) |
111
- | `dimensions` | Canvas in inches; `format` is `16:9`, `4:3` or `custom` |
112
- | `palette` | Free-form roles. The pack view reads `primary`, `primary_deep`, `ground`, `paper`, `tint`, `paper_warm`, `header_fill`, `ink`, `ink_muted`, `muted` and `line` when present, and falls back to neutral greys |
113
- | `global_typography` | Default character spacing, bullet font, bullet character and colours (colours without `#` here) |
114
- | `decoration_assets` | Informational map of image files; the render path reads the decoration elements instead |
115
- | `pack` | Optional legacy-pack block, below |
116
-
117
- The `pack` block opts a template into rich drawing:
118
-
119
- ```yaml
120
- pack:
121
- capabilities: [rich-blocks, recolor, font-swap, mesh-background]
122
- tokens:
123
- card:
124
- pad: 0.30
45
+ line: "#E7E6E6"
46
+ header_fill: "#E7E6E6"
47
+ metric: "#003087"
48
+ positive: "#00AD1D"
49
+ negative: "#C00000"
50
+ trust: "#002554"
125
51
  ```
126
52
 
127
- `capabilities` is a list drawn from `rich-blocks` (cards, KPI tiles and styled tables instead of plain
128
- text regions), `recolor` (the `--accent <hex>` flag, or `accent:` in the frontmatter, derives a
129
- contrast-safe palette and regenerates the gradient circles), `font-swap` (`--font pretendard` or
130
- `--font a2z` reassigns the whole font system) and `mesh-background` (`--bg mesh` adds a generated
131
- gradient ground). An absent block means plain regions only, and each flag is ignored by a template
132
- that lacks its capability.
133
- `tokens` overrides one geometry group at a time: `card`, `kpi`, `bullet`, `secHeader`, `summary`,
134
- `toc`, `notice`. Both AZURE templates declare all four capabilities; the BOILERPLATE templates declare
135
- none.
53
+ ### 1.2 `layout-mapping.yaml`
136
54
 
137
- ## 6. `layout-mapping.yaml`
55
+ Maps each AST layout type to template-specific regions with exact positions.
138
56
 
139
57
  ```yaml
140
58
  layouts:
141
59
  cover:
142
- layout_source: none
143
60
  decorations: cover
144
- variants:
145
- rule:
146
- decorations: cover_rule
147
- regions:
148
- title:
149
- x: 0.84
150
- y: 2.60
151
- w: 8.8
152
- h: 1.6
153
- font_role: cover_title
154
61
  regions:
155
62
  title:
156
- x: 0.60
157
- y: 2.90
158
- w: 9.60
159
- h: 1.10
63
+ x: 0.518
64
+ y: 2.665
65
+ w: 8.743
66
+ h: 0.740
160
67
  font_role: cover_title
161
- valign: middle
162
- decorations:
163
- cover:
164
- elements: []
68
+ metadata:
69
+ x: 0.600
70
+ y: 3.898
71
+ w: 3.100
72
+ h: 1.227
73
+ font_role: cover_metadata
74
+
75
+ content:
76
+ decorations: body
77
+ regions:
78
+ title:
79
+ x: 0.394
80
+ y: 0.315
81
+ w: 8.110
82
+ h: 0.472
83
+ font_role: section_title
84
+ body:
85
+ x: 0.394
86
+ y: 1.044
87
+ w: 10.188
88
+ font_role: body_text
89
+
90
+ main:
91
+ decorations: body
92
+ regions:
93
+ title:
94
+ x: 0.394
95
+ y: 0.315
96
+ w: 8.110
97
+ h: 0.472
98
+ font_role: section_title
99
+ body:
100
+ x: 0.394
101
+ y: 1.044
102
+ w: 10.188
103
+ font_role: body_text
104
+ main_box:
105
+ x: 0.761
106
+ y: 5.691
107
+ w: 9.582
108
+ h: 0.757
109
+ border: { width: 2, color: "#000000", opacity: 0.99 }
110
+ font_role: body_text
111
+
112
+ summary:
113
+ decorations: body
114
+ regions:
115
+ title:
116
+ x: 0.394
117
+ y: 0.315
118
+ w: 8.110
119
+ h: 0.472
120
+ font_role: section_title
121
+ group_top:
122
+ x: 0.394
123
+ y: 1.044
124
+ w: 10.188
125
+ group_bottom:
126
+ x: 0.394
127
+ y: 3.863
128
+ w: 10.188
129
+
130
+ closing:
131
+ decorations: closing
132
+ regions:
133
+ title:
134
+ x: 0.745
135
+ y: 3.290
136
+ w: 9.344
137
+ h: 0.737
138
+ font_role: closing_title
139
+ align: center
165
140
  ```
166
141
 
167
- ### 6.1 Layouts and regions
168
-
169
- Each layout carries `layout_source: none`, a `decorations` key naming an entry of the top-level
170
- `decorations:` map, `regions`, and optionally `variants`. A region is a rectangle with `x`, `y`, `w`
171
- and usually `h`, plus these optional keys:
172
-
173
- | Key | Meaning |
174
- |---|---|
175
- | `font_role` | Entry of `font_roles` in `capabilities.yaml` used for the text |
176
- | `heading_role`, `sub_item_role` | Roles for a summary group's heading and its items |
177
- | `font_role_header`, `font_role_data` | Roles for a table region (default `table_header`, `table_data`) |
178
- | `align`, `valign` | Horizontal and vertical alignment; `valign` is `top`, `middle` or `bottom` |
179
- | `autofit` | `resize` grows the frame to the text, `shrink` shrinks the text; any other value leaves it fixed |
180
- | `border` | `width` and `color` of an outline, used by `main_box` |
181
-
182
- ### 6.2 Region names and the blocks they hold
183
-
184
- | Region | Block it holds |
185
- |---|---|
186
- | `title` | `title` |
187
- | `body` | `body` |
188
- | `table` (content, summary), `kpi_table` (main) | `kpi-table` and `table` |
189
- | `image` | `image` (several images share the region as a grid) |
190
- | `main_box` | `main-box` |
191
- | `key_message` | `key-message` |
192
- | `figure_caption`, `table_caption` | the caption blocks, numbered across the deck |
193
- | `group_top`, `group_bottom` | `summary-group`, by its position |
194
- | `metadata`, `subtitle`, `eyebrow`, `date_line` | cover text, filled from the frontmatter |
195
-
196
- On a cover, `date_line` joins `date` and `department` with two spaces, a bar and two spaces. Any other
197
- cover region whose name equals a frontmatter key (`subtitle`, `eyebrow`) is filled from that key. A
198
- slide's own `::: region name=<region>` line overrides the default mapping.
199
-
200
- ### 6.3 Decorations
201
-
202
- `decorations.<key>.elements` is a list drawn behind the regions, in order. Element types:
203
-
204
- | `type` | Keys |
205
- |---|---|
206
- | `image` | `asset`, optional `dir: azure`, `x`, `y`, `w`, `h`, `rotate` |
207
- | `rect`, `roundRect`, `pill` | `x`, `y`, `w`, `h`, `fill`, `line`, `line_width`, `alpha`, `radius`, optional `text` with `size`, `bold`, `text_color` |
208
- | `ellipse`, `ring` | `x`, `y`, `w`, `h`, `fill` or `line`, `line_width`, `alpha` |
209
- | `text` | `text`, `x`, `y`, `w`, `h`, `size`, `color`, `align`, `valign`, `bold` |
210
- | `line` | `x`, `y`, `w`, `color`, `width` |
211
- | `confidential_mark` | `x`, `y`, `w`, `h`; draws a bordered Korean confidentiality label, styled by the `confidential_mark` font role |
212
- | `disclaimer` | `x`, `y`, `w`, `h`, optional `text`; styled by the `disclaimer` font role |
213
-
214
- A `slide_number` element is accepted in the file and the renderer draws nothing for it. Keep a
215
- one-line `note:` on each element that explains why it exists; the loader ignores it.
216
-
217
- ## 7. `capabilities.yaml`
142
+ ### 1.3 `capabilities.yaml`
143
+
144
+ Declares which AST constructs the template supports.
218
145
 
219
146
  ```yaml
220
- supported_layouts: [cover, content, main, summary, closing]
147
+ supported_layouts:
148
+ - cover
149
+ - content
150
+ - main
151
+ - summary
152
+ - closing
153
+
221
154
  supported_blocks:
222
155
  cover: [title]
223
- content: [title, body, image, notes, kpi-table, figure-caption, table-caption]
156
+ content: [title, body, image, notes, kpi-table]
157
+ main: [title, body, main-box, image, kpi-table]
158
+ summary: [title, summary-group]
224
159
  closing: [title]
225
- supported_body_items: [bullet, numbered, section]
160
+
161
+ supported_body_items:
162
+ - bullet
163
+ - numbered
164
+ - section
165
+
226
166
  font_roles:
227
- body_text:
228
- font: "Brand Sans Medium"
229
- size: 12
230
- char_spacing: -0.3
231
- line_spacing: 1.3
232
- align: left
233
- bold: false
234
- color: "#1F2933"
235
- constraints:
236
- max_columns_per_table: 6
237
- no_bold_on_bold_fonts: false
238
- body_text_stays_black: false
167
+ cover_title: { font: "Brand Sans Bold", size: 33.45, char_spacing: -0.7, line_spacing: 1.0, align: left }
168
+ cover_metadata: { font: "Brand Sans Medium", size: 16.73, char_spacing: -0.7, line_spacing: 1.0, align: left }
169
+ section_title: { font: "Brand Sans Bold", size: 24, char_spacing: -0.7, line_spacing: 1.0, align: left }
170
+ body_text: { font: "Brand Sans Medium", size: 16, char_spacing: -0.7, line_spacing: 1.25, align: left }
171
+ section_header: { font: "Brand Sans Bold", size: 18, char_spacing: -0.7, line_spacing: 1.5, align: left }
172
+ numbered_item: { font: "Brand Sans Medium", size: 16, char_spacing: -0.7, align: left }
173
+ closing_title: { font: "Brand Sans Medium", size: 44, char_spacing: null, line_spacing: 0.9, align: center }
174
+ disclaimer: { font: "Brand Sans Light", size: 6, char_spacing: null, line_spacing: 1.0, align: left }
175
+
176
+ decoration_presets:
177
+ cover:
178
+ - { type: image, asset: image11.png, position: background_right }
179
+ - { type: image, asset: image12.png, position: top_left_logo }
180
+ - { type: confidential_mark }
181
+ - { type: disclaimer }
182
+ body:
183
+ - { type: line, color: "#00AE41", width: 1.5, y: 0.787 }
184
+ - { type: image, asset: image10.png, position: top_right_logo }
185
+ - { type: confidential_mark }
186
+ - { type: slide_number }
187
+ closing:
188
+ - { type: line, color: "#00823D", width: 6, y: 4.079, full_width: true }
189
+ - { type: image, asset: image9.png, position: top_right_logo }
239
190
  ```
240
191
 
241
- - `supported_blocks` is enforced. The spec validator first applies the fixed block set of the five
242
- classic layouts (`block type "body" is not supported. Allowed: title, box, shape, columns` for a
243
- closing slide with a bullet list); the resolver then applies the template's list and stops with
244
- `Slide <n> (layout: <name>): block type "<type>" is not allowed. Allowed: ...` for a block the
245
- template left out. `notes` and the placement blocks (`box`, `shape`, `columns`) are allowed on every
246
- layout.
247
- - `supported_layouts`, `supported_body_items` and most `constraints` are declarative. They document
248
- the template for reviewers and listings, and the compiler leaves them unread. The one constraint the
249
- engine changes is `no_bold_on_bold_fonts`, which the font-swap sets to match the font system it
250
- applies.
251
- - `font_roles` entries accept `font`, `size`, `color`, `align`, `char_spacing`, `line_spacing`,
252
- `bold`, `space_after`, `bullet_type` (`bullet` or `number`), `bullet_char`, `bullet_font`,
253
- `number_type` (for example `arabicParenBoth`), `marL`, `indent`, `fill`, `border_color` and
254
- `border_width`. Role names are free. The renderer looks up `table_header`, `table_data`,
255
- `figure_caption`, `table_caption`, `disclaimer` and `confidential_mark` by name; every other role is
256
- reached through a region's `font_role` or a slide's `::: box role=<name>` (an unknown role stops the
257
- compile and lists the available ones).
258
- - Per-weight families (A2Z, "Brand Sans" style sets) set `bold: false` on every role and choose the
259
- weight by family name, with `no_bold_on_bold_fonts: true`. Single weighted families (Pretendard) use
260
- `bold: true` where the hierarchy needs it.
261
-
262
- ## 8. Compile-time checks
263
-
264
- For a deck that names a template the compiler verifies, in order:
265
-
266
- 1. The name resolves in the search path, else `Unknown template: "<NAME>" not found in <folders>`.
267
- 2. A `layout:` the template declares is used as written. A family name the template does not declare
268
- (`kpi-row`, `agenda`, `cover-figures`) is drawn on the layout that hosts its kind of slide: the
269
- cover, section or content layout. A name that resolves nowhere stops with
270
- `layout "<name>" not found in template mapping. Available: ..., free`, and a name that is neither
271
- a family nor a layout gets a message listing the families and the legacy layouts.
272
- 3. Every block belongs to the layout (section 7). When `supported_blocks` has no entry for the
273
- layout, the allowed blocks derive from the regions the layout declares.
274
- 4. A `variant:` slide key names a variant of that layout, else
275
- `layout "<name>" has no variant "<v>". Available: ...`.
276
- 5. A slide-level `title:` key is rejected on a template, since a title treatment needs a tonality.
277
-
278
- ## 9. Fonts
279
-
280
- Fonts named in the files must exist on the machine that opens the deck. `--embed-fonts` embeds the
281
- families the skill bundles (Pretendard, and the A2Z faces under `fonts/`); any other family is skipped
282
- with a warning, so a learned template's own fonts need a local install on the viewing machine. The
283
- font-swap capability reassigns every role by its weight class (bold, black, medium, regular, light),
284
- which it reads from the role name: titles, headers and `eyebrow` take bold, `kpi_value` takes black,
285
- `disclaimer` takes light and the rest take regular. Name new roles with those words when a swap should
286
- treat them correctly. On a tonality the same choice is `--faces a2z`.
287
-
288
- ## 10. Learning a template from a deck
192
+ ## 2. Enrollment Validation
193
+
194
+ When a deck targets an enrolled template, the compiler MUST verify:
195
+
196
+ 1. The template name exists in the enrollment directory.
197
+ 2. Each slide layout is listed in `supported_layouts`.
198
+ 3. Each block type is listed in `supported_blocks` for that layout.
199
+ 4. Each body item type is listed in `supported_body_items`.
200
+
201
+ Violation of any check produces an error naming the specific unsupported construct, the slide index, and the template name.
202
+
203
+ ## 3. Required Assets
204
+
205
+ Each enrolled template must provide or reference the following assets:
206
+
207
+ ### 3.1 Image assets
208
+
209
+ Decoration presets in `capabilities.yaml` reference image files. These must exist in an `assets/` directory discoverable by the render adapter.
210
+
211
+ | Asset role | Purpose | Required |
212
+ |------------|---------|----------|
213
+ | `top_left_logo` | Cover slide logo (large, light version) | yes |
214
+ | `top_right_logo` | Body/closing slide logo (small, dark version) | yes |
215
+ | `background_right` | Cover slide right-side decorative image | cover layouts only |
216
+ | `background_full` | Optional full-slide background | no |
217
+
218
+ Asset files are placed in `templates/enrolled/<TEMPLATE-NAME>/assets/` or a shared `assets/` directory.
219
+
220
+ ### 3.2 Font availability
221
+
222
+ All fonts declared in `template.yaml` and `capabilities.yaml` must be installed on the rendering machine. The enrollment contract does not bundle fonts — it assumes they are available system-wide.
223
+
224
+ For MY-BRAND, the required fonts are:
225
+ - `Brand Sans Bold` (1 space)
226
+ - `Brand Sans Medium` (2 spaces)
227
+ - `Brand Sans Light` (2 spaces)
228
+
229
+ ### 3.3 Fixture decks
230
+
231
+ At minimum, two fixture Markdown decks must exist for regression testing:
232
+
233
+ - `tests/fixtures/decks/<template-name>-basic.md` — 5-slide deck (cover, content, main, summary, closing)
234
+ - `tests/fixtures/decks/<template-name>-complex.md` — deck with tables, images, and all supported block types
235
+
236
+ ### 3.4 AST fixtures
237
+
238
+ Corresponding AST snapshot files must exist:
239
+
240
+ - `tests/fixtures/ast/<template-name>-basic.json`
241
+ - `tests/fixtures/ast/<template-name>-complex.json`
242
+
243
+ ## 4. Adding a New Template (MY-BRAND-N)
244
+
245
+ To enroll a new template:
246
+
247
+ 1. Create `templates/enrolled/MY-BRAND-N/` with all three YAML files.
248
+ 2. Place required image assets in the assets directory.
249
+ 3. Create fixture decks and AST snapshots (see §3.3–3.4).
250
+ 4. Create mapping tests: `tests/test_template_example_N_mapping.js`.
251
+ 5. Fill in all required fields from the YAML templates in §1.
252
+ 6. Verify the enrollment by running:
253
+
254
+ ```bash
255
+ node --test tests/test_template_example_N_mapping.js
256
+ python -m pytest tests/test_template_regression.py -v
257
+ ```
258
+
259
+ 7. No changes to compiler code are required — the template registry discovers enrolled templates by directory scan.
260
+
261
+ ## 5. Regression Gate
262
+
263
+ Before an enrolled template is considered production-ready, it must pass the regression gate:
264
+
265
+ ### 5.1 Gate checks
266
+
267
+ | Gate | Tool | Pass criteria |
268
+ |------|------|---------------|
269
+ | Compilation | `compile-deck.js` | Both fixture decks compile without error |
270
+ | Dimensions | python-pptx | Slide width/height within 5000 EMU of declared dimensions |
271
+ | Slide count | python-pptx | Matches expected count per fixture |
272
+ | Hygiene | `validate_pptx.py` | `pass: true` (no hard failures) |
273
+ | Inventory | `layout_inventory.py --issues-only` | No overflow, overlap, or formatting issues |
274
+ | Content | python-pptx | Every slide has text content |
275
+ | Score baseline | `evaluate_pptx.py` | Composite score within 2 points of established baseline |
276
+
277
+ ### 5.2 Baseline establishment
278
+
279
+ On first run, the regression harness records baseline scores to `tests/baselines/`. Subsequent runs compare against these baselines. A regression of more than 2 composite points triggers a failure.
280
+
281
+ To reset baselines (e.g., after intentional template changes):
289
282
 
290
283
  ```bash
291
- python3 "$SKILL_ROOT/scripts/learn_template.py" brand-deck.pptx --name LIBRARY-DEMO
284
+ rm tests/baselines/baseline_*.json
285
+ python -m pytest tests/test_template_regression.py -v
292
286
  ```
293
287
 
294
- The default output folder is `.lit-pptx/templates/<NAME>`. The script reads the source as untrusted
295
- input: it requires a `.pptx` with `ppt/presentation.xml`, caps the package at 5000 entries and 500 MB
296
- uncompressed, and rejects an entry with a compression ratio above 200. XML is parsed with
297
- `defusedxml`.
288
+ ### 5.3 Running the gate
298
289
 
299
- What it learns:
290
+ ```bash
291
+ # Full regression suite
292
+ python -m pytest tests/test_template_regression.py -v
300
293
 
301
- | Fact | Source in the deck |
302
- |---|---|
303
- | Canvas | `sldSz` of `presentation.xml`; format `16:9`, `4:3` or `custom` |
304
- | Palette | the theme colour scheme (`dk1`, `lt1`, `dk2`, `lt2`, `accent1` to `accent6`, `hlink`) |
305
- | Fonts | the theme's major and minor Latin and East Asian faces, preferring faces the slides use |
306
- | Regions | proportions of the canvas: side margin 6%, title at 6% of the height, body at 18% |
294
+ # Node.js mapping tests (per template)
295
+ node --test tests/test_template_example_1_mapping.js
296
+
297
+ # Full verification pipeline
298
+ node --test tests/test_compile_deck.js tests/test_template_example_1_mapping.js
299
+ python -m pytest tests/test_template_regression.py -v
300
+ python validate_pptx.py test_output.pptx
301
+ python3 "$SKILL_ROOT/scripts/layout_inventory.py" test_output.pptx --issues-only
302
+ ```
307
303
 
308
- It writes `layout_source: none` layouts for cover, content, main, summary and closing with empty
309
- decoration lists, so logos and background art stay with the original deck and are added to the
310
- template by hand.
304
+ ## 6. Enrollment Review Checklist
311
305
 
312
- ### Closed-set verification
306
+ Before approving enrollment, verify every item:
313
307
 
314
- Before writing any file the script asserts that every font in `font_roles` appears in the source
315
- (slide runs plus theme faces; `Arial` is allowed only when the source names no font) and that every
316
- palette value comes from the theme or from a neutral set (`#000000`, `#FFFFFF`, `#444444`, `#CCCCCC`,
317
- `#EEEEEE`). A violation prints `CLOSED-SET VERIFICATION FAILED` with one line per offender and exits
318
- 3. Exit 2 means the input was unusable. Four palette roles fall back to fixed colours when the theme
319
- lacks the source slot (`accent_red` from `accent2`, `accent_green` from `accent6`, `accent_amber`
320
- from `accent4`, `source_blue` from `hlink`); those fallbacks are outside the neutral set, so a theme
321
- without the slot fails closed. Fix it by adding the missing theme colour to the source deck.
308
+ ### 6.1 File completeness
309
+ - [ ] All three YAML files exist and are valid YAML.
310
+ - [ ] `template.yaml` has all required fields (name, version, label, fonts, dimensions, palette).
311
+ - [ ] `layout-mapping.yaml` has regions for every supported layout with numeric positions.
312
+ - [ ] `capabilities.yaml` lists supported layouts, blocks, body items, font roles, and decoration presets.
313
+ - [ ] Required image assets exist in the assets directory.
314
+ - [ ] Fixture decks and AST snapshots exist.
322
315
 
323
- ## 11. Variants and the open layout set
316
+ ### 6.2 Contract correctness
317
+ - [ ] `font_roles` match the actual template typography exactly.
318
+ - [ ] `decoration_presets` reference assets that exist.
319
+ - [ ] `supported_blocks` per layout are accurate and complete.
320
+ - [ ] `supported_body_items` covers all bullet/numbering styles used.
321
+ - [ ] Position values (x, y, w, h) are accurate to within 0.01 inches.
324
322
 
325
- A template may declare any layout name matching `^[a-z][a-z0-9-]*$`. With no `supported_blocks` entry,
326
- the allowed blocks come from the regions the layout declares, so adding a layout needs no table edit.
323
+ ### 6.3 Compiler independence
324
+ - [ ] No hardcoded values in compiler code reference this template.
325
+ - [ ] The template is discoverable by the registry via directory scan alone.
327
326
 
328
- `free` needs no declaration. It means a slide that uses no template region, so every template supports
329
- it; a template that declares its own `free` layout takes precedence.
327
+ ### 6.4 Regression gate
328
+ - [ ] Node.js mapping tests pass.
329
+ - [ ] Python regression tests pass (all 7 gates).
330
+ - [ ] Baseline scores are established and recorded.
331
+ - [ ] `validate_pptx.py` reports `pass: true` on compiled output.
330
332
 
331
- A variant lives under its layout and swaps the decoration set, optionally moving regions:
333
+ ## 7. Enrollment File Format Rules
334
+
335
+ - YAML files use 2-space indentation.
336
+ - Positions are in inches (convert from EMU: `inches = EMU / 914400`).
337
+ - Font sizes are in points.
338
+ - Color values are hex strings without `#` prefix where used in code, with `#` prefix in YAML.
339
+ - Asset filenames reference files in the `assets/` directory.
340
+
341
+ ## Variants and the open layout set (spec v2)
342
+
343
+ A template may declare any layout name matching `^[a-z][a-z0-9-]*$`. When it declares a
344
+ layout but publishes no `supported_blocks` entry for it, the allowed blocks are derived
345
+ from the regions that layout declares, so adding a layout does not mean editing a table
346
+ in the resolver.
347
+
348
+ `free` needs no declaration at all. It means "this slide uses no template region", so
349
+ every template supports it by construction; a template that declares its own `free`
350
+ layout still wins.
351
+
352
+ A **variant** is declared under the layout it belongs to:
332
353
 
333
354
  ```yaml
334
355
  layouts:
@@ -345,61 +366,17 @@ layouts:
345
366
  h: 2.6
346
367
  font_role: cover_title
347
368
  regions:
348
- title:
349
- x: 0.84
350
- y: 1.55
351
- w: 7.4
352
- h: 1.85
353
- font_role: cover_title
369
+ title: { ... }
354
370
  ```
355
371
 
356
- `decorations` names another entry of the top-level map; `regions` merges over the layout's own. Move
357
- a region whenever you move the thing it sits on: a date pill relocated without its `date_line`
358
- region leaves white text on a white ground, and the contrast check finds it only after a render.
359
- Both AZURE templates ship `split-navy` and `minimal` cover variants and a `rule` section variant.
360
-
361
- ## 12. Enrolling a template
362
-
363
- 1. Start from the closest bundled folder or from `learn_template.py` output, and copy it to
364
- `.lit-pptx/templates/<NAME>/` (or a folder on `LIT_PPTX_TEMPLATE_DIRS`).
365
- 2. Edit the three files to match the real typography and geometry, reading positions off the source
366
- deck (inches = EMU / 914400, accurate to 0.01).
367
- 3. Place image assets and point `dir` / `asset` at them.
368
- 4. Write two fixture decks: a 5-slide deck (cover, content, main, summary, closing) and a deck that
369
- uses a table, an image and every block the template supports.
370
- 5. Run the gate below on both. No compiler change is needed.
371
-
372
- ## 13. Verification gate
373
-
374
- | Gate | Tool | Pass condition |
375
- |---|---|---|
376
- | Discovery | `compile-deck.js --list-templates` and `--list-layouts <NAME>` | The name and every layout appear with the expected blocks |
377
- | Compilation | `compile-deck.js <fixture>.md --template <NAME> --pptx out.pptx` | Both fixtures compile |
378
- | Canvas | python-pptx | Slide width and height within 5000 EMU of `dimensions` |
379
- | Slide count | python-pptx | Matches the fixture |
380
- | Hygiene | `scripts/validate_pptx.py out.pptx` | `pass: true` |
381
- | Inventory | `scripts/layout_inventory.py out.pptx --issues-only` | No overflow, overlap or off-slide shape |
382
- | Honest gate | `scripts/qa_deck.py out.pptx` | Exit 0 |
383
- | Look | `scripts/render_pages.py out.pptx --out-dir renders --pages 5` | Pages open and show no clipped or empty region |
384
-
385
- ## 14. Review checklist
386
-
387
- File completeness:
388
- - [ ] Three YAML files parse and use the subset in section 4.
389
- - [ ] `template.yaml` carries name, version, label, fonts, dimensions and palette.
390
- - [ ] Every supported layout has numeric regions.
391
- - [ ] Referenced image assets exist.
392
- - [ ] Both fixture decks exist.
393
-
394
- Contract correctness:
395
- - [ ] `font_roles` match the real typography.
396
- - [ ] `supported_blocks` per layout is accurate and complete.
397
- - [ ] Region positions match the source within 0.01 in.
398
- - [ ] Per-weight families set `no_bold_on_bold_fonts: true` and `bold: false` on every role.
399
-
400
- Compiler independence:
401
- - [ ] The template appears in `--list-templates` from directory scanning alone.
402
- - [ ] No compiler file mentions the template's name.
403
-
404
- Gate:
405
- - [ ] Every row of section 13 passes on both fixtures.
372
+ `decorations` names another entry in the top-level `decorations:` map. `regions` is
373
+ merged over the layout's own, and exists because new furniture displaces content: a
374
+ split cover needs a narrower title than a full-bleed one, and shipping the two apart
375
+ guarantees they drift.
376
+
377
+ **Move the region whenever you move the thing it sits on.** A date pill relocated
378
+ without its `date_line` region leaves white text on a white ground — which the contrast
379
+ check will fail, but only after someone renders the deck.
380
+
381
+ Placement blocks (`box`, `shape`, `columns`) and `notes` are allowed in every layout and
382
+ need no capability entry, since they do not depend on a region existing.