@litfamily/litcodex 1.0.6 → 1.0.8

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 (827) hide show
  1. package/README.md +361 -23
  2. package/dist/cli.js +42 -0
  3. package/dist/config-migration/config-paths.js +9 -2
  4. package/dist/install/doctor-render.js +1 -0
  5. package/dist/install/doctor.js +8 -0
  6. package/dist/install/execute.d.ts +2 -0
  7. package/dist/install/execute.js +8 -3
  8. package/dist/install/generated-skill-payload-hashes.d.ts +617 -21
  9. package/dist/install/generated-skill-payload-hashes.js +617 -21
  10. package/dist/install/index.js +13 -2
  11. package/dist/install/marketplace-payload.d.ts +1 -0
  12. package/dist/install/marketplace-payload.js +73 -2
  13. package/dist/install/motion-runtime.d.ts +36 -0
  14. package/dist/install/motion-runtime.js +82 -0
  15. package/dist/install/office-runtime.d.ts +20 -0
  16. package/dist/install/office-runtime.js +37 -0
  17. package/dist/install/skill-catalog.d.ts +1 -1
  18. package/dist/install/skill-catalog.js +26 -2
  19. package/dist/install/skill-resource-hashes.d.ts +1 -1
  20. package/dist/install/skill-resource-hashes.js +1 -1
  21. package/dist/install/types.d.ts +3 -0
  22. package/dist/postinstall.js +14 -2
  23. package/marketplace/plugins/litcodex/.codex-plugin/plugin.json +1 -1
  24. package/marketplace/plugins/litcodex/components/auto-update/package.json +1 -1
  25. package/marketplace/plugins/litcodex/components/comment-checker/package.json +1 -1
  26. package/marketplace/plugins/litcodex/components/git-bash/package.json +1 -1
  27. package/marketplace/plugins/litcodex/components/lit-loop/directive.md +90 -5
  28. package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-comprehend.md +13 -17
  29. package/marketplace/plugins/litcodex/components/lit-loop/directives/litwork.md +8 -0
  30. package/marketplace/plugins/litcodex/components/lit-loop/dist/codex-hook.js +8 -1
  31. package/marketplace/plugins/litcodex/components/lit-loop/dist/hook-cli.d.ts +8 -1
  32. package/marketplace/plugins/litcodex/components/lit-loop/dist/hook-cli.js +36 -4
  33. package/marketplace/plugins/litcodex/components/lit-loop/dist/jev-hint.d.ts +112 -0
  34. package/marketplace/plugins/litcodex/components/lit-loop/dist/jev-hint.js +522 -0
  35. package/marketplace/plugins/litcodex/components/lit-loop/dist/motion-route.d.ts +18 -0
  36. package/marketplace/plugins/litcodex/components/lit-loop/dist/motion-route.js +95 -0
  37. package/marketplace/plugins/litcodex/components/lit-loop/dist/skill-renames.d.ts +3 -1
  38. package/marketplace/plugins/litcodex/components/lit-loop/dist/skill-renames.js +10 -5
  39. package/marketplace/plugins/litcodex/components/lit-loop/package.json +1 -1
  40. package/marketplace/plugins/litcodex/components/lsp/package.json +1 -1
  41. package/marketplace/plugins/litcodex/components/rules/bundled-rules/lit-humanizer.md +12 -0
  42. package/marketplace/plugins/litcodex/components/rules/dist/cli.js +22 -10
  43. package/marketplace/plugins/litcodex/components/rules/dist/deliverable-hedge-guard.d.ts +23 -34
  44. package/marketplace/plugins/litcodex/components/rules/dist/deliverable-hedge-guard.js +420 -388
  45. package/marketplace/plugins/litcodex/components/rules/package.json +1 -1
  46. package/marketplace/plugins/litcodex/components/start-work-continuation/package.json +1 -1
  47. package/marketplace/plugins/litcodex/components/telemetry/package.json +1 -1
  48. package/marketplace/plugins/litcodex/components/wikify-knowledge/package.json +1 -1
  49. package/marketplace/plugins/litcodex/hooks/hooks.json +32 -21
  50. package/marketplace/plugins/litcodex/skills/autoconference/assets/report_template.md +1 -1
  51. package/marketplace/plugins/litcodex/skills/browser-drive/SKILL.md +4 -0
  52. package/marketplace/plugins/litcodex/skills/browser-drive/scripts/capability-probe.mjs +25 -2
  53. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/SKILL.md +14 -15
  54. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/THIRD-PARTY-NOTICE.txt +7 -0
  55. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/examples/readme-ab/README.md +13 -0
  56. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/adaptive-layout.md +12 -83
  57. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/brand-and-imagery.md +17 -65
  58. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/complete-contract.md +44 -13
  59. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/composition.md +14 -80
  60. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/craft-floor.md +103 -0
  61. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/creative-directions.md +13 -82
  62. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/evidence-review.md +14 -112
  63. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/implementation-platforms.md +16 -68
  64. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/inclusive-interface.md +12 -86
  65. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/interaction-motion.md +13 -82
  66. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/motion-guide.md +123 -0
  67. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/operating-lanes.md +12 -100
  68. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/performance-delivery.md +12 -78
  69. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/probe-and-review.md +41 -0
  70. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/product-direction.md +10 -88
  71. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/production-interview.md +10 -12
  72. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/redesign-playbook.md +12 -74
  73. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/slop-register.md +98 -0
  74. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/system-foundations.md +13 -100
  75. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/visual-language.md +11 -74
  76. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/visual-reconstruction.md +9 -78
  77. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/hover-probe.mjs +28 -0
  78. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/page-probe.mjs +423 -0
  79. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/probe.mjs +261 -0
  80. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/route-mode.mjs +19 -0
  81. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/rule-data.mjs +115 -0
  82. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/serve-static.mjs +24 -0
  83. package/marketplace/plugins/litcodex/skills/lit-comprehend/SKILL.md +45 -53
  84. package/marketplace/plugins/litcodex/skills/lit-comprehend/references/artifact-template.md +10 -44
  85. package/marketplace/plugins/litcodex/skills/lit-comprehend/scripts/verify-explainer.ts +0 -18
  86. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/NOTICE +33 -0
  87. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/SKILL.md +167 -0
  88. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/agents/openai.yaml +6 -0
  89. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-architecture-dark.html +1 -0
  90. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-architecture-full.html +1 -0
  91. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-architecture-light.html +1 -0
  92. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bar-dark.html +1 -0
  93. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bar-full.html +1 -0
  94. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bar-light.html +1 -0
  95. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-beeswarm-dark.html +1 -0
  96. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-beeswarm-full.html +1 -0
  97. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-beeswarm-light.html +1 -0
  98. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bubble-dark.html +1 -0
  99. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bubble-full.html +1 -0
  100. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bubble-light.html +1 -0
  101. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bump-dark.html +1 -0
  102. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bump-full.html +1 -0
  103. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-bump-light.html +1 -0
  104. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-data-flow-dark.html +1 -0
  105. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-data-flow-full.html +1 -0
  106. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-data-flow-light.html +1 -0
  107. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-datalake-dark.html +1 -0
  108. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-datalake-full.html +1 -0
  109. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-datalake-light.html +1 -0
  110. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-db-schema-dark.html +1 -0
  111. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-db-schema-full.html +1 -0
  112. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-db-schema-light.html +1 -0
  113. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dependency-dark.html +1 -0
  114. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dependency-full.html +1 -0
  115. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dependency-light.html +1 -0
  116. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-deployment-dark.html +1 -0
  117. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-deployment-full.html +1 -0
  118. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-deployment-light.html +1 -0
  119. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dp-integration-dark.html +1 -0
  120. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dp-integration-full.html +1 -0
  121. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dp-integration-light.html +1 -0
  122. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-dark.html +1 -0
  123. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-full.html +1 -0
  124. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-dp-security-matrix-light.html +1 -0
  125. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-er-dark.html +1 -0
  126. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-er-full.html +1 -0
  127. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-er-light.html +1 -0
  128. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-fishbone-dark.html +1 -0
  129. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-fishbone-full.html +1 -0
  130. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-fishbone-light.html +1 -0
  131. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-flowchart-dark.html +1 -0
  132. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-flowchart-full.html +1 -0
  133. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-flowchart-light.html +1 -0
  134. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-gantt-dark.html +1 -0
  135. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-gantt-full.html +1 -0
  136. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-gantt-light.html +1 -0
  137. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-heatmap-dark.html +1 -0
  138. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-heatmap-full.html +1 -0
  139. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-heatmap-light.html +1 -0
  140. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-high-level-dark.html +1 -0
  141. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-high-level-full.html +1 -0
  142. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-high-level-light.html +1 -0
  143. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-dark.html +1 -0
  144. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-full.html +1 -0
  145. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-high-level-vertical-light.html +1 -0
  146. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-drawio-dark.html +1 -0
  147. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-drawio-full.html +1 -0
  148. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-drawio-light.html +1 -0
  149. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-dark.html +1 -0
  150. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-full.html +1 -0
  151. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-excalidraw-light.html +1 -0
  152. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-dark.html +1 -0
  153. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-full.html +1 -0
  154. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-import-mermaid-light.html +1 -0
  155. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-it-state-dark.html +1 -0
  156. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-it-state-full.html +1 -0
  157. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-it-state-light.html +1 -0
  158. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-journey-dark.html +1 -0
  159. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-journey-full.html +1 -0
  160. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-journey-light.html +1 -0
  161. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-kanban-dark.html +1 -0
  162. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-kanban-full.html +1 -0
  163. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-kanban-light.html +1 -0
  164. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-layers-dark.html +1 -0
  165. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-layers-full.html +1 -0
  166. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-layers-light.html +1 -0
  167. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-line-dark.html +1 -0
  168. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-line-full.html +1 -0
  169. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-line-light.html +1 -0
  170. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-loop-dark.html +1 -0
  171. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-loop-full.html +1 -0
  172. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-loop-light.html +1 -0
  173. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-dark.html +1 -0
  174. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-full.html +1 -0
  175. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-loop-terminal-light.html +1 -0
  176. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-marimekko-dark.html +1 -0
  177. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-marimekko-full.html +1 -0
  178. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-marimekko-light.html +1 -0
  179. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-medallion-dark.html +1 -0
  180. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-medallion-full.html +1 -0
  181. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-medallion-light.html +1 -0
  182. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-nested-dark.html +1 -0
  183. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-nested-full.html +1 -0
  184. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-nested-light.html +1 -0
  185. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-org-chart-dark.html +1 -0
  186. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-org-chart-full.html +1 -0
  187. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-org-chart-light.html +1 -0
  188. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-dark.html +1 -0
  189. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-full.html +1 -0
  190. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-paved-road-animated-light.html +1 -0
  191. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-polar-dark.html +1 -0
  192. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-polar-full.html +1 -0
  193. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-polar-light.html +1 -0
  194. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-dark.html +1 -0
  195. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-full.html +1 -0
  196. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-policy-trace-animated-light.html +1 -0
  197. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-process-dark.html +1 -0
  198. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-process-full.html +1 -0
  199. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-process-light.html +1 -0
  200. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-pyramid-dark.html +1 -0
  201. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-pyramid-full.html +1 -0
  202. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-pyramid-light.html +1 -0
  203. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-dark.html +1 -0
  204. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-full.html +1 -0
  205. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-quadrant-consultant-light.html +1 -0
  206. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-quadrant-dark.html +1 -0
  207. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-quadrant-full.html +1 -0
  208. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-quadrant-light.html +1 -0
  209. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-queue-animated-dark.html +1 -0
  210. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-queue-animated-full.html +1 -0
  211. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-queue-animated-light.html +1 -0
  212. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-radar-dark.html +1 -0
  213. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-radar-full.html +1 -0
  214. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-radar-light.html +1 -0
  215. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-ridgeline-dark.html +1 -0
  216. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-ridgeline-full.html +1 -0
  217. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-ridgeline-light.html +1 -0
  218. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sankey-dark.html +1 -0
  219. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sankey-full.html +1 -0
  220. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sankey-light.html +1 -0
  221. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-scatter-dark.html +1 -0
  222. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-scatter-full.html +1 -0
  223. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-scatter-light.html +1 -0
  224. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sequence-dark.html +1 -0
  225. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sequence-full.html +1 -0
  226. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sequence-light.html +1 -0
  227. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-dark.html +1 -0
  228. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-full.html +1 -0
  229. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-sequence-oauth-light.html +1 -0
  230. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-slopegraph-dark.html +1 -0
  231. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-slopegraph-full.html +1 -0
  232. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-slopegraph-light.html +1 -0
  233. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-state-dark.html +1 -0
  234. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-state-full.html +1 -0
  235. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-dark.html +1 -0
  236. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-full.html +1 -0
  237. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-state-lifecycle-light.html +1 -0
  238. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-state-light.html +1 -0
  239. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-story-map-dark.html +1 -0
  240. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-story-map-full.html +1 -0
  241. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-story-map-light.html +1 -0
  242. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-streamgraph-dark.html +1 -0
  243. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-streamgraph-full.html +1 -0
  244. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-streamgraph-light.html +1 -0
  245. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-swimlane-dark.html +1 -0
  246. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-swimlane-full.html +1 -0
  247. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-swimlane-light.html +1 -0
  248. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-timeline-dark.html +1 -0
  249. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-timeline-full.html +1 -0
  250. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-timeline-light.html +1 -0
  251. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-dark.html +1 -0
  252. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-full.html +1 -0
  253. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-tree-block-decomposition-light.html +1 -0
  254. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-tree-dark.html +1 -0
  255. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-tree-full.html +1 -0
  256. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-tree-light.html +1 -0
  257. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-treemap-dark.html +1 -0
  258. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-treemap-full.html +1 -0
  259. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-treemap-light.html +1 -0
  260. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-uml-class-dark.html +1 -0
  261. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-uml-class-full.html +1 -0
  262. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-uml-class-light.html +1 -0
  263. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-venn-dark.html +1 -0
  264. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-venn-full.html +1 -0
  265. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-venn-light.html +1 -0
  266. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-wardley-dark.html +1 -0
  267. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-wardley-full.html +1 -0
  268. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-wardley-light.html +1 -0
  269. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-waterfall-dark.html +1 -0
  270. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-waterfall-full.html +1 -0
  271. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/examples/type-waterfall-light.html +1 -0
  272. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/fonts/OFL.txt +94 -0
  273. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/fonts/PretendardVariable.woff2 +0 -0
  274. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/fonts/provenance.json +22 -0
  275. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/icons.html +231 -0
  276. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/index.html +1 -0
  277. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/licenses/devicon-MIT.txt +20 -0
  278. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/licenses/diagram-design-MIT.txt +21 -0
  279. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/licenses/log-z-MIT.txt +21 -0
  280. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/licenses/simple-icons-CC0.md +30 -0
  281. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/assets/licenses/tabler-MIT.txt +21 -0
  282. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/01-service-architecture/after.html +1 -0
  283. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/01-service-architecture/brief.md +33 -0
  284. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/01-service-architecture/constructed-naive-foil.html +1 -0
  285. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/02-release-decision/after.html +1 -0
  286. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/02-release-decision/brief.md +18 -0
  287. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/02-release-decision/constructed-naive-foil.html +1 -0
  288. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/03-data-retention/after.html +1 -0
  289. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/03-data-retention/brief.md +19 -0
  290. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/03-data-retention/constructed-naive-foil.html +1 -0
  291. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/04-oauth-sequence/after.html +1 -0
  292. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/04-oauth-sequence/brief.md +17 -0
  293. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/04-oauth-sequence/constructed-naive-foil.html +1 -0
  294. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/05-review-lanes/after.html +1 -0
  295. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/05-review-lanes/brief.md +17 -0
  296. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/05-review-lanes/constructed-naive-foil.html +1 -0
  297. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/06-rollout-gates/after.html +1 -0
  298. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/06-rollout-gates/brief.md +17 -0
  299. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/06-rollout-gates/constructed-naive-foil.html +1 -0
  300. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/07-deployment-boundary/after.html +1 -0
  301. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/07-deployment-boundary/brief.md +19 -0
  302. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/07-deployment-boundary/constructed-naive-foil.html +1 -0
  303. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/08-policy-traces/after.html +1 -0
  304. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/08-policy-traces/brief.md +20 -0
  305. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/examples/08-policy-traces/constructed-naive-foil.html +1 -0
  306. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/accessibility.md +37 -0
  307. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/export.md +29 -0
  308. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/import-drawio.md +21 -0
  309. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/import-excalidraw.md +14 -0
  310. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/import-mermaid.md +18 -0
  311. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/import-schema.md +28 -0
  312. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/korean-typography.md +34 -0
  313. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/motion.md +29 -0
  314. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/office-pptx-docx.md +42 -0
  315. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/output-spec.md +48 -0
  316. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/primitive-annotation.md +12 -0
  317. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/primitive-icons.md +21 -0
  318. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/primitive-sketchy.md +11 -0
  319. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/primitive-terminal.md +11 -0
  320. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/profiles.md +24 -0
  321. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/semantic-patterns.md +27 -0
  322. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/style-guide.md +67 -0
  323. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-architecture.md +51 -0
  324. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-bar.md +51 -0
  325. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-beeswarm.md +49 -0
  326. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-bubble.md +49 -0
  327. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-bump.md +49 -0
  328. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-catalog.json +1433 -0
  329. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-data-flow.md +51 -0
  330. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-datalake.md +49 -0
  331. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-db-schema.md +49 -0
  332. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-dependency.md +49 -0
  333. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-deployment.md +49 -0
  334. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-dp-integration.md +49 -0
  335. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-dp-security-matrix.md +49 -0
  336. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-er.md +49 -0
  337. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-fishbone.md +49 -0
  338. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-flowchart.md +49 -0
  339. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-gantt.md +49 -0
  340. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-heatmap.md +53 -0
  341. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-high-level-vertical.md +53 -0
  342. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-high-level.md +53 -0
  343. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-import-drawio.md +53 -0
  344. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-import-excalidraw.md +53 -0
  345. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-import-mermaid.md +53 -0
  346. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-it-state.md +54 -0
  347. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-journey.md +54 -0
  348. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-kanban.md +54 -0
  349. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-layers.md +54 -0
  350. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-line.md +54 -0
  351. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-loop-terminal.md +53 -0
  352. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-loop.md +54 -0
  353. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-marimekko.md +54 -0
  354. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-medallion.md +54 -0
  355. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-nested.md +59 -0
  356. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-org-chart.md +58 -0
  357. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-paved-road-animated.md +72 -0
  358. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-polar.md +67 -0
  359. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-policy-trace-animated.md +69 -0
  360. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-process.md +58 -0
  361. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-pyramid.md +59 -0
  362. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-quadrant-consultant.md +60 -0
  363. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-quadrant.md +57 -0
  364. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-queue-animated.md +63 -0
  365. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-radar.md +57 -0
  366. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-ridgeline.md +63 -0
  367. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-sankey.md +68 -0
  368. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-scatter.md +60 -0
  369. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-sequence-oauth.md +66 -0
  370. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-sequence.md +63 -0
  371. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-slopegraph.md +65 -0
  372. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-state-lifecycle.md +53 -0
  373. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-state.md +59 -0
  374. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-story-map.md +52 -0
  375. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-streamgraph.md +53 -0
  376. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-swimlane.md +52 -0
  377. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-timeline.md +52 -0
  378. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-tree-block-decomposition.md +57 -0
  379. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-tree.md +54 -0
  380. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-treemap.md +54 -0
  381. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-uml-class.md +52 -0
  382. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-venn.md +51 -0
  383. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-wardley.md +52 -0
  384. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-waterfall.md +54 -0
  385. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/verifier-guide.md +59 -0
  386. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/block-registry.mjs +43 -0
  387. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/brief-contract.mjs +94 -0
  388. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/check-visible-text.mjs +15 -0
  389. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/diagram-craft-rules.mjs +14 -0
  390. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/diagram-metrics.mjs +219 -0
  391. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/doctor.mjs +28 -0
  392. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/drawio-model.mjs +162 -0
  393. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/drawio-source.mjs +147 -0
  394. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/drawio-xml.mjs +148 -0
  395. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/export.mjs +122 -0
  396. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/import-common.mjs +85 -0
  397. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/import-drawio.mjs +48 -0
  398. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/import-excalidraw.mjs +234 -0
  399. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/import-mermaid.mjs +104 -0
  400. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/mermaid-common.mjs +115 -0
  401. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/mermaid-er.mjs +70 -0
  402. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/mermaid-flowchart.mjs +178 -0
  403. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/mermaid-sequence.mjs +137 -0
  404. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/mermaid-state.mjs +80 -0
  405. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/office-safety.mjs +54 -0
  406. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/runtime-probes.mjs +11 -0
  407. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/verify-all.mjs +85 -0
  408. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/verify-brief.mjs +16 -0
  409. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/verify-diagram.mjs +27 -0
  410. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/verify-motion.mjs +12 -0
  411. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/verify-type.mjs +48 -0
  412. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/visual-quality-geometry.mjs +226 -0
  413. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/visual-quality.mjs +147 -0
  414. package/marketplace/plugins/litcodex/skills/lit-docx/LICENSE +21 -0
  415. package/marketplace/plugins/litcodex/skills/lit-docx/NOTICE +3 -0
  416. package/marketplace/plugins/litcodex/skills/lit-docx/SKILL.md +102 -0
  417. package/marketplace/plugins/litcodex/skills/lit-docx/agents/openai.yaml +14 -0
  418. package/marketplace/plugins/litcodex/skills/lit-docx/references/frontmatter_schema.md +42 -0
  419. package/marketplace/plugins/litcodex/skills/lit-docx/references/journal_style_spec.md +17 -0
  420. package/marketplace/plugins/litcodex/skills/lit-docx/references/markdown_quality_checklist.md +37 -0
  421. package/marketplace/plugins/litcodex/skills/lit-docx/references/slop_phrase_list.yaml +58 -0
  422. package/marketplace/plugins/litcodex/skills/lit-docx/references/slop_rules.md +35 -0
  423. package/marketplace/plugins/litcodex/skills/lit-docx/runtime/requirements.in +5 -0
  424. package/marketplace/plugins/litcodex/skills/lit-docx/runtime/requirements.lock +20 -0
  425. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/clean_markdown.py +95 -0
  426. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/convert_md_to_docx.py +1046 -0
  427. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/convert_md_to_pdf.py +281 -0
  428. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/convert_pdf.py +130 -0
  429. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/docx_craft.py +95 -0
  430. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/edit_docx.py +297 -0
  431. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/embed_images.py +78 -0
  432. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/generate_docx_templates.py +491 -0
  433. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/slop_lint.py +473 -0
  434. package/marketplace/plugins/litcodex/skills/lit-docx/scripts/visual_audit.py +41 -0
  435. package/marketplace/plugins/litcodex/skills/lit-docx/templates/docx/acs.docx +0 -0
  436. package/marketplace/plugins/litcodex/skills/lit-docx/templates/docx/elsevier.docx +0 -0
  437. package/marketplace/plugins/litcodex/skills/lit-docx/templates/docx/ieee.docx +0 -0
  438. package/marketplace/plugins/litcodex/skills/lit-docx/templates/docx/korean-generic.docx +0 -0
  439. package/marketplace/plugins/litcodex/skills/lit-docx/templates/docx/nature.docx +0 -0
  440. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/acs/README.md +5 -0
  441. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/acs/template.tex +37 -0
  442. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/elsevier/README.md +5 -0
  443. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/elsevier/template.tex +38 -0
  444. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/ieee/README.md +5 -0
  445. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/ieee/template.tex +37 -0
  446. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/korean-generic/README.md +5 -0
  447. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/korean-generic/template.tex +37 -0
  448. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/nature/README.md +5 -0
  449. package/marketplace/plugins/litcodex/skills/lit-docx/templates/latex/nature/template.tex +37 -0
  450. package/marketplace/plugins/litcodex/skills/lit-docx/templates/registry.yaml +1366 -0
  451. package/marketplace/plugins/litcodex/skills/lit-humanizer/NOTICE +160 -0
  452. package/marketplace/plugins/litcodex/skills/lit-humanizer/SKILL.md +146 -0
  453. package/marketplace/plugins/litcodex/skills/lit-humanizer/always-on-rule.md +9 -0
  454. package/marketplace/plugins/litcodex/skills/lit-humanizer/assets/always-on-rule.md +9 -0
  455. package/marketplace/plugins/litcodex/skills/lit-humanizer/assets/report-skeleton.md +25 -0
  456. package/marketplace/plugins/litcodex/skills/lit-humanizer/assets/slide-text-skeleton.md +28 -0
  457. package/marketplace/plugins/litcodex/skills/lit-humanizer/bench/prompts.md +73 -0
  458. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/accessibility-note/after.md +7 -0
  459. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/accessibility-note/before.md +7 -0
  460. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/api-reference/after.md +9 -0
  461. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/api-reference/before.md +15 -0
  462. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/changelog/after.md +5 -0
  463. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/changelog/before.md +12 -0
  464. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/code-comments/after.md +10 -0
  465. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/code-comments/before.md +19 -0
  466. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/commit/after.md +5 -0
  467. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/commit/before.md +7 -0
  468. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/data-release/after.md +7 -0
  469. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/data-release/before.md +9 -0
  470. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/english-essay/after.md +5 -0
  471. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/english-essay/before.md +5 -0
  472. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/incident-update/after.md +7 -0
  473. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/incident-update/before.md +7 -0
  474. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/ko-essay/after.md +7 -0
  475. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/ko-essay/before.md +9 -0
  476. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/ko-report/after.md +9 -0
  477. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/ko-report/before.md +13 -0
  478. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/ko-slide/after.md +19 -0
  479. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/ko-slide/before.md +21 -0
  480. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/meeting-brief/after.md +9 -0
  481. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/meeting-brief/before.md +11 -0
  482. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/policy-faq/after.md +9 -0
  483. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/policy-faq/before.md +9 -0
  484. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/pr/after.md +15 -0
  485. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/pr/before.md +17 -0
  486. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/project-update/after.md +7 -0
  487. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/project-update/before.md +9 -0
  488. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/readme/after.md +12 -0
  489. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/readme/before.md +14 -0
  490. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/report/after.md +13 -0
  491. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/report/before.md +11 -0
  492. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/research-abstract/after.md +5 -0
  493. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/research-abstract/before.md +5 -0
  494. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/slides/after.md +19 -0
  495. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/slides/before.md +19 -0
  496. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/troubleshooting/after.md +11 -0
  497. package/marketplace/plugins/litcodex/skills/lit-humanizer/examples/troubleshooting/before.md +11 -0
  498. package/marketplace/plugins/litcodex/skills/lit-humanizer/motion-guide.md +123 -0
  499. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/code-patterns.md +468 -0
  500. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/deliverable-channels.md +111 -0
  501. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/en-patterns-checklist.md +43 -0
  502. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/en-patterns-content.md +243 -0
  503. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/en-patterns-structure.md +375 -0
  504. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/en-patterns.md +57 -0
  505. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/ko-metrics.md +33 -0
  506. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/ko-patterns-a-d.md +659 -0
  507. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/ko-patterns-e-j.md +387 -0
  508. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/ko-patterns.md +31 -0
  509. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/prompt-injection-handling.md +7 -0
  510. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/rewrite-playbook.md +54 -0
  511. package/marketplace/plugins/litcodex/skills/lit-humanizer/references/taxonomy.md +153 -0
  512. package/marketplace/plugins/litcodex/skills/lit-humanizer/rules.json +884 -0
  513. package/marketplace/plugins/litcodex/skills/lit-humanizer/scripts/core.mjs +208 -0
  514. package/marketplace/plugins/litcodex/skills/lit-humanizer/scripts/detect.mjs +83 -0
  515. package/marketplace/plugins/litcodex/skills/lit-humanizer/scripts/extract_office_text.py +89 -0
  516. package/marketplace/plugins/litcodex/skills/lit-humanizer/scripts/ko-metrics.mjs +124 -0
  517. package/marketplace/plugins/litcodex/skills/lit-humanizer/scripts/test-fixtures.mjs +155 -0
  518. package/marketplace/plugins/litcodex/skills/lit-humanizer/scripts/test-ko-metrics.mjs +27 -0
  519. package/marketplace/plugins/litcodex/skills/lit-init/references/deep-repository-map.md +6 -10
  520. package/marketplace/plugins/litcodex/skills/lit-loop/SKILL.md +95 -12
  521. package/marketplace/plugins/litcodex/skills/lit-loop/agents/openai.yaml +3 -2
  522. package/marketplace/plugins/litcodex/skills/lit-loop/references/full-workflow.md +10 -3
  523. package/marketplace/plugins/litcodex/skills/lit-pptx/NOTICE +7 -0
  524. package/marketplace/plugins/litcodex/skills/lit-pptx/SKILL.md +102 -0
  525. package/marketplace/plugins/litcodex/skills/lit-pptx/agents/analyst.md +49 -0
  526. package/marketplace/plugins/litcodex/skills/lit-pptx/agents/antithesis.md +59 -0
  527. package/marketplace/plugins/litcodex/skills/lit-pptx/agents/architect.md +44 -0
  528. package/marketplace/plugins/litcodex/skills/lit-pptx/agents/critic.md +42 -0
  529. package/marketplace/plugins/litcodex/skills/lit-pptx/agents/openai.yaml +14 -0
  530. package/marketplace/plugins/litcodex/skills/lit-pptx/agents/synthesizer.md +47 -0
  531. package/marketplace/plugins/litcodex/skills/lit-pptx/agents/thesis.md +33 -0
  532. package/marketplace/plugins/litcodex/skills/lit-pptx/assets/azure/circle-lg.png +0 -0
  533. package/marketplace/plugins/litcodex/skills/lit-pptx/assets/azure/circle-md.png +0 -0
  534. package/marketplace/plugins/litcodex/skills/lit-pptx/assets/azure/circle-sm.png +0 -0
  535. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/a2z-font/A2Z-Black.otf +0 -0
  536. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/a2z-font/A2Z-Bold.otf +0 -0
  537. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/a2z-font/A2Z-Light.otf +0 -0
  538. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/a2z-font/A2Z-Medium.otf +0 -0
  539. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/a2z-font/A2Z-Regular.otf +0 -0
  540. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/a2z-font/OFL.txt +94 -0
  541. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/a2z-font/SOURCE.md +29 -0
  542. package/marketplace/plugins/litcodex/skills/lit-pptx/pretendard-font/LICENSE.txt +94 -0
  543. package/marketplace/plugins/litcodex/skills/lit-pptx/pretendard-font/public/static/PretendardGOV-Bold.otf +0 -0
  544. package/marketplace/plugins/litcodex/skills/lit-pptx/pretendard-font/public/static/PretendardGOV-Regular.otf +0 -0
  545. package/marketplace/plugins/litcodex/skills/lit-pptx/references/anti-slop-checklist.md +71 -0
  546. package/marketplace/plugins/litcodex/skills/lit-pptx/references/authoring-guide.md +141 -0
  547. package/marketplace/plugins/litcodex/skills/lit-pptx/references/consensus-protocol.md +125 -0
  548. package/marketplace/plugins/litcodex/skills/lit-pptx/references/data-display-cookbook.md +45 -0
  549. package/marketplace/plugins/litcodex/skills/lit-pptx/references/design-system-azure.md +58 -0
  550. package/marketplace/plugins/litcodex/skills/lit-pptx/references/interview-protocol.md +113 -0
  551. package/marketplace/plugins/litcodex/skills/lit-pptx/runtime/package-lock.json +747 -0
  552. package/marketplace/plugins/litcodex/skills/lit-pptx/runtime/package.json +13 -0
  553. package/marketplace/plugins/litcodex/skills/lit-pptx/runtime/requirements.in +2 -0
  554. package/marketplace/plugins/litcodex/skills/lit-pptx/runtime/requirements.lock +14 -0
  555. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/check_ooxml.py +40 -0
  556. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/compile-deck.js +399 -0
  557. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/craft_extras.py +246 -0
  558. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/embed_fonts.py +201 -0
  559. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/inventory.py +95 -0
  560. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/learn_template.py +433 -0
  561. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/derive-palette.js +176 -0
  562. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/directive-parser.js +244 -0
  563. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/font-map.js +79 -0
  564. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/gen-bg.js +85 -0
  565. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/gen-gradient-assets.js +36 -0
  566. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/layout-resolver.js +734 -0
  567. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/markdown-loader.js +136 -0
  568. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/render-adapter-html.js +358 -0
  569. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/render-adapter-pptx.js +1885 -0
  570. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/slide-ast.js +517 -0
  571. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/spec-validator.js +94 -0
  572. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/template-registry.js +355 -0
  573. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/office-run.mjs +137 -0
  574. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/package.json +1 -0
  575. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/qa_deck.py +795 -0
  576. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/validate_pptx.py +206 -0
  577. package/marketplace/plugins/litcodex/skills/lit-pptx/specs/markdown-slide-spec-v1.md +251 -0
  578. package/marketplace/plugins/litcodex/skills/lit-pptx/specs/markdown-slide-spec-v2.md +207 -0
  579. package/marketplace/plugins/litcodex/skills/lit-pptx/specs/slide-ast-v1.schema.json +229 -0
  580. package/marketplace/plugins/litcodex/skills/lit-pptx/specs/slide-ast-v2.schema.json +144 -0
  581. package/marketplace/plugins/litcodex/skills/lit-pptx/specs/template-enrollment-contract.md +379 -0
  582. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/bauhaus_light.css +4 -0
  583. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/boilerplate_professional.css +508 -0
  584. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-A2Z/capabilities.yaml +146 -0
  585. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-A2Z/layout-mapping.yaml +454 -0
  586. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-A2Z/template.yaml +37 -0
  587. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-PRO/capabilities.yaml +154 -0
  588. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-PRO/layout-mapping.yaml +464 -0
  589. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/AZURE-PRO/template.yaml +37 -0
  590. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/capabilities.yaml +179 -0
  591. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/layout-mapping.yaml +299 -0
  592. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/BOILERPLATE-A2Z/template.yaml +45 -0
  593. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/capabilities.yaml +181 -0
  594. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/layout-mapping.yaml +299 -0
  595. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/enrolled/BOILERPLATE-PRETENDARD/template.yaml +44 -0
  596. package/marketplace/plugins/litcodex/skills/lit-scientific-visualization/SKILL.md +2 -0
  597. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/SKILL.md +73 -0
  598. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/agents/openai.yaml +15 -0
  599. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/NOTICE +23 -0
  600. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +32 -0
  601. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/browser-app.js +735 -0
  602. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/completion.mjs +9 -0
  603. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/compose.mjs +255 -0
  604. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/constants.mjs +264 -0
  605. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/driver.mjs +169 -0
  606. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/encode.mjs +163 -0
  607. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/flash.mjs +251 -0
  608. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/fonts.mjs +169 -0
  609. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/gate.mjs +466 -0
  610. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/image.mjs +267 -0
  611. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/look.mjs +182 -0
  612. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/passes.mjs +181 -0
  613. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/presets.mjs +110 -0
  614. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/report.mjs +56 -0
  615. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/runtime.mjs +287 -0
  616. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/scenes.mjs +309 -0
  617. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/sound.mjs +463 -0
  618. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-gate.mjs +155 -0
  619. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-init.js +215 -0
  620. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-kit.js +515 -0
  621. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-qa.js +147 -0
  622. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-qa.mjs +243 -0
  623. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-render.mjs +335 -0
  624. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-worker.mjs +26 -0
  625. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage.mjs +311 -0
  626. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stroke.mjs +264 -0
  627. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/timeline.mjs +153 -0
  628. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/treatment.mjs +280 -0
  629. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/type.mjs +234 -0
  630. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/util.mjs +198 -0
  631. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-wt400.ttf +0 -0
  632. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-wt700.ttf +0 -0
  633. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w100-wt900.ttf +0 -0
  634. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-wt400.ttf +0 -0
  635. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-wt700.ttf +0 -0
  636. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w125-wt900.ttf +0 -0
  637. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-wt400.ttf +0 -0
  638. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-wt700.ttf +0 -0
  639. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/Archivo-w75-wt900.ttf +0 -0
  640. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/OFL.txt +93 -0
  641. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/archivo/SHA256SUMS +16 -0
  642. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/stroke/CREDITS +6 -0
  643. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/stroke/EMSAllure.svg +216 -0
  644. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/stroke/EMSFelix.svg +216 -0
  645. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/stroke/EMSOsmotron.svg +216 -0
  646. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/stroke/EMSReadability.svg +216 -0
  647. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/stroke/EMSTech.svg +217 -0
  648. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/stroke/OFL.txt +86 -0
  649. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/vt323/OFL.txt +93 -0
  650. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/fonts/vt323/VT323-Regular.ttf +0 -0
  651. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/quality-gate.md +137 -0
  652. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/runtime.md +68 -0
  653. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/scene-author.md +57 -0
  654. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/stage.md +175 -0
  655. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/style-bibles.md +103 -0
  656. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/treatment.md +119 -0
  657. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/type-and-timing.md +83 -0
  658. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/runtime/package-lock.json +59 -0
  659. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/runtime/package.json +1 -0
  660. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/runtime/requirements-audio.txt +1082 -0
  661. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/runtime/word-timing-models.json +11 -0
  662. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/scripts/beat-grid.py +50 -0
  663. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/scripts/render.mjs +807 -0
  664. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/scripts/runtime.mjs +43 -0
  665. package/marketplace/plugins/litcodex/skills/litresearch/SKILL.md +28 -41
  666. package/marketplace/plugins/litcodex/skills/litwork/SKILL.md +8 -0
  667. package/marketplace/plugins/litcodex/skills/litwork/references/delivery-playbook.md +6 -0
  668. package/node_modules/@litcodex/lit-loop/directive.md +90 -5
  669. package/node_modules/@litcodex/lit-loop/directives/lit-comprehend.md +13 -17
  670. package/node_modules/@litcodex/lit-loop/directives/litwork.md +8 -0
  671. package/node_modules/@litcodex/lit-loop/dist/codex-hook.js +8 -1
  672. package/node_modules/@litcodex/lit-loop/dist/hook-cli.d.ts +8 -1
  673. package/node_modules/@litcodex/lit-loop/dist/hook-cli.js +36 -4
  674. package/node_modules/@litcodex/lit-loop/dist/jev-hint.d.ts +112 -0
  675. package/node_modules/@litcodex/lit-loop/dist/jev-hint.js +522 -0
  676. package/node_modules/@litcodex/lit-loop/dist/motion-route.d.ts +18 -0
  677. package/node_modules/@litcodex/lit-loop/dist/motion-route.js +95 -0
  678. package/node_modules/@litcodex/lit-loop/dist/skill-renames.d.ts +3 -1
  679. package/node_modules/@litcodex/lit-loop/dist/skill-renames.js +10 -5
  680. package/node_modules/@litcodex/lit-loop/package.json +1 -1
  681. package/node_modules/@litcodex/lit-loop/skills/browser-drive/SKILL.md +4 -0
  682. package/node_modules/@litcodex/lit-loop/skills/browser-drive/scripts/capability-probe.mjs +25 -2
  683. package/node_modules/@litcodex/lit-loop/skills/lit-comprehend/SKILL.md +45 -53
  684. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/NOTICE +160 -0
  685. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/SKILL.md +146 -0
  686. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/always-on-rule.md +9 -0
  687. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/assets/always-on-rule.md +9 -0
  688. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/assets/report-skeleton.md +25 -0
  689. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/assets/slide-text-skeleton.md +28 -0
  690. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/bench/prompts.md +73 -0
  691. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/accessibility-note/after.md +7 -0
  692. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/accessibility-note/before.md +7 -0
  693. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/api-reference/after.md +9 -0
  694. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/api-reference/before.md +15 -0
  695. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/changelog/after.md +5 -0
  696. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/changelog/before.md +12 -0
  697. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/code-comments/after.md +10 -0
  698. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/code-comments/before.md +19 -0
  699. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/commit/after.md +5 -0
  700. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/commit/before.md +7 -0
  701. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/data-release/after.md +7 -0
  702. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/data-release/before.md +9 -0
  703. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/english-essay/after.md +5 -0
  704. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/english-essay/before.md +5 -0
  705. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/incident-update/after.md +7 -0
  706. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/incident-update/before.md +7 -0
  707. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/ko-essay/after.md +7 -0
  708. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/ko-essay/before.md +9 -0
  709. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/ko-report/after.md +9 -0
  710. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/ko-report/before.md +13 -0
  711. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/ko-slide/after.md +19 -0
  712. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/ko-slide/before.md +21 -0
  713. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/meeting-brief/after.md +9 -0
  714. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/meeting-brief/before.md +11 -0
  715. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/policy-faq/after.md +9 -0
  716. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/policy-faq/before.md +9 -0
  717. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/pr/after.md +15 -0
  718. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/pr/before.md +17 -0
  719. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/project-update/after.md +7 -0
  720. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/project-update/before.md +9 -0
  721. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/readme/after.md +12 -0
  722. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/readme/before.md +14 -0
  723. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/report/after.md +13 -0
  724. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/report/before.md +11 -0
  725. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/research-abstract/after.md +5 -0
  726. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/research-abstract/before.md +5 -0
  727. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/slides/after.md +19 -0
  728. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/slides/before.md +19 -0
  729. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/troubleshooting/after.md +11 -0
  730. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/examples/troubleshooting/before.md +11 -0
  731. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/motion-guide.md +123 -0
  732. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/code-patterns.md +468 -0
  733. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/deliverable-channels.md +111 -0
  734. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/en-patterns-checklist.md +43 -0
  735. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/en-patterns-content.md +243 -0
  736. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/en-patterns-structure.md +375 -0
  737. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/en-patterns.md +57 -0
  738. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/ko-metrics.md +33 -0
  739. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/ko-patterns-a-d.md +659 -0
  740. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/ko-patterns-e-j.md +387 -0
  741. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/ko-patterns.md +31 -0
  742. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/prompt-injection-handling.md +7 -0
  743. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/rewrite-playbook.md +54 -0
  744. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/references/taxonomy.md +153 -0
  745. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/rules.json +884 -0
  746. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/scripts/core.mjs +208 -0
  747. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/scripts/detect.mjs +83 -0
  748. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/scripts/extract_office_text.py +89 -0
  749. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/scripts/ko-metrics.mjs +124 -0
  750. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/scripts/test-fixtures.mjs +155 -0
  751. package/node_modules/@litcodex/lit-loop/skills/lit-humanizer/scripts/test-ko-metrics.mjs +27 -0
  752. package/node_modules/@litcodex/lit-loop/skills/lit-init/references/deep-repository-map.md +6 -10
  753. package/node_modules/@litcodex/lit-loop/skills/lit-loop/SKILL.md +95 -12
  754. package/node_modules/@litcodex/lit-loop/skills/lit-scientific-visualization/SKILL.md +2 -0
  755. package/node_modules/@litcodex/lit-loop/skills/litresearch/SKILL.md +28 -41
  756. package/node_modules/@litcodex/lit-loop/skills/litwork/SKILL.md +8 -0
  757. package/package.json +2 -2
  758. package/readme-assets/ab-simple/assets/s11-baseline-desktop.webp +0 -0
  759. package/readme-assets/ab-simple/assets/s11-baseline-phone.webp +0 -0
  760. package/readme-assets/ab-simple/assets/s11-lit-desktop.webp +0 -0
  761. package/readme-assets/ab-simple/assets/s11-lit-phone.webp +0 -0
  762. package/readme-assets/ab-simple/assets/s3-baseline-desktop.webp +0 -0
  763. package/readme-assets/ab-simple/assets/s3-baseline-phone.webp +0 -0
  764. package/readme-assets/ab-simple/assets/s3-lit-desktop.webp +0 -0
  765. package/readme-assets/ab-simple/assets/s3-lit-phone.webp +0 -0
  766. package/readme-assets/ab-simple/assets/s4-baseline-desktop.webp +0 -0
  767. package/readme-assets/ab-simple/assets/s4-baseline-phone.webp +0 -0
  768. package/readme-assets/ab-simple/assets/s4-lit-desktop.webp +0 -0
  769. package/readme-assets/ab-simple/assets/s4-lit-phone.webp +0 -0
  770. package/readme-assets/ab-simple/assets/s5-baseline-slides.webp +0 -0
  771. package/readme-assets/ab-simple/assets/s5-lit-slides.webp +0 -0
  772. package/readme-assets/ab-simple/assets/s7-lit-diagram.webp +0 -0
  773. package/readme-assets/ab-simple/assets/s8-baseline-slides.webp +0 -0
  774. package/readme-assets/ab-simple/assets/s8-lit-slides.webp +0 -0
  775. package/readme-assets/ab-simple/assets/s9-lit-pages.webp +0 -0
  776. package/readme-assets/badge-version.svg +1 -1
  777. package/readme-assets/cover-motion-still.webp +0 -0
  778. package/readme-assets/cover-motion.webp +0 -0
  779. package/readme-assets/skills/autoconference.webp +0 -0
  780. package/readme-assets/skills/automatic-checks.webp +0 -0
  781. package/readme-assets/skills/autoresearch.webp +0 -0
  782. package/readme-assets/skills/browser-drive.webp +0 -0
  783. package/readme-assets/skills/coding-session-audit.webp +0 -0
  784. package/readme-assets/skills/debugging.webp +0 -0
  785. package/readme-assets/skills/deep-interview.webp +0 -0
  786. package/readme-assets/skills/frontend-ui-ux.webp +0 -0
  787. package/readme-assets/skills/lit-burnoff-file.webp +0 -0
  788. package/readme-assets/skills/lit-burnoff.webp +0 -0
  789. package/readme-assets/skills/lit-code.webp +0 -0
  790. package/readme-assets/skills/lit-commit.webp +0 -0
  791. package/readme-assets/skills/lit-comprehend.webp +0 -0
  792. package/readme-assets/skills/lit-crucible.webp +0 -0
  793. package/readme-assets/skills/lit-diagram-drawer.webp +0 -0
  794. package/readme-assets/skills/lit-docx.webp +0 -0
  795. package/readme-assets/skills/lit-fetch.webp +0 -0
  796. package/readme-assets/skills/lit-handoff.webp +0 -0
  797. package/readme-assets/skills/lit-humanizer.webp +0 -0
  798. package/readme-assets/skills/lit-init.webp +0 -0
  799. package/readme-assets/skills/lit-loop.webp +0 -0
  800. package/readme-assets/skills/lit-plan.webp +0 -0
  801. package/readme-assets/skills/lit-pptx.webp +0 -0
  802. package/readme-assets/skills/lit-recap.webp +0 -0
  803. package/readme-assets/skills/lit-scientific-visualization.webp +0 -0
  804. package/readme-assets/skills/lit-team.webp +0 -0
  805. package/readme-assets/skills/lit-typographic-motion.webp +0 -0
  806. package/readme-assets/skills/litcodex-contribute-bug-fix.webp +0 -0
  807. package/readme-assets/skills/litcodex-doctor.webp +0 -0
  808. package/readme-assets/skills/litcodex-report-bug.webp +0 -0
  809. package/readme-assets/skills/litgoal.webp +0 -0
  810. package/readme-assets/skills/litresearch.webp +0 -0
  811. package/readme-assets/skills/litwork.webp +0 -0
  812. package/readme-assets/skills/lsp-setup.webp +0 -0
  813. package/readme-assets/skills/readme-studio.webp +0 -0
  814. package/readme-assets/skills/refactor.webp +0 -0
  815. package/readme-assets/skills/review-work.webp +0 -0
  816. package/readme-assets/skills/start-approved-plan.webp +0 -0
  817. package/readme-assets/skills/structural-search.webp +0 -0
  818. package/readme-assets/skills/visual-qa.webp +0 -0
  819. package/readme-assets/skills/wikify.webp +0 -0
  820. package/marketplace/plugins/litcodex/skills/lit-korean/SKILL.md +0 -206
  821. package/marketplace/plugins/litcodex/skills/lit-korean/references/prompt-injection-handling.md +0 -23
  822. package/marketplace/plugins/litcodex/skills/lit-korean/references/quick-rules.md +0 -38
  823. package/marketplace/plugins/litcodex/skills/lit-korean/references/safety-checklist.md +0 -38
  824. package/node_modules/@litcodex/lit-loop/skills/lit-korean/SKILL.md +0 -206
  825. package/node_modules/@litcodex/lit-loop/skills/lit-korean/references/prompt-injection-handling.md +0 -23
  826. package/node_modules/@litcodex/lit-loop/skills/lit-korean/references/quick-rules.md +0 -38
  827. package/node_modules/@litcodex/lit-loop/skills/lit-korean/references/safety-checklist.md +0 -38
@@ -0,0 +1,1046 @@
1
+ #!/usr/bin/env python3
2
+ """Convert Markdown to DOCX with proper styling.
3
+
4
+ Usage:
5
+ python convert_md_to_docx.py input.md output.docx [--template template.docx]
6
+ python convert_md_to_docx.py input.md output.docx --publisher elsevier
7
+
8
+ Features:
9
+ - Headings (H1-H6 → Word heading styles)
10
+ - Paragraphs with bold/italic/code formatting
11
+ - Bullet and numbered lists
12
+ - Tables
13
+ - Code blocks (monospace font)
14
+ - Images (if local)
15
+ - Links (as hyperlinks)
16
+ - [NEW in M1] --publisher NAME loads templates/registry.yaml and applies
17
+ journal design discipline: title block from YAML frontmatter, curly
18
+ quotes, en/em dashes, nbsp before units, ellipsis, heading auto-numbering,
19
+ booktabs tables, banned-font/style stripping, CJK font pairing.
20
+ """
21
+
22
+ from __future__ import annotations
23
+ import argparse
24
+ import re
25
+ import sys
26
+ from pathlib import Path
27
+ from typing import Any
28
+
29
+ try:
30
+ import markdown
31
+ from markdown.extensions.tables import TableExtension
32
+ from markdown.extensions.fenced_code import FencedCodeExtension
33
+ except ImportError:
34
+ print("Error: 'markdown' library not found. Install with: pip install markdown")
35
+ sys.exit(1)
36
+
37
+ try:
38
+ from docx import Document
39
+ from docx.shared import Pt, Inches, Cm, RGBColor
40
+ from docx.enum.text import WD_ALIGN_PARAGRAPH
41
+ from docx.enum.style import WD_STYLE_TYPE
42
+ from docx.oxml.ns import qn
43
+ from docx.oxml import OxmlElement
44
+ except ImportError:
45
+ print("Error: 'python-docx' library not found. Install with: pip install python-docx")
46
+ sys.exit(1)
47
+
48
+ try:
49
+ from bs4 import BeautifulSoup, NavigableString
50
+ except ImportError:
51
+ print("Error: 'beautifulsoup4' library not found. Install with: pip install beautifulsoup4")
52
+ sys.exit(1)
53
+
54
+
55
+ # ===========================================================================
56
+ # Legacy HTML→DOCX helpers (unchanged from pre-M1 — preserved byte-for-byte)
57
+ # ===========================================================================
58
+
59
+
60
+ def create_hyperlink(paragraph, url: str, text: str):
61
+ """Add a hyperlink to a paragraph."""
62
+ part = paragraph.part
63
+ r_id = part.relate_to(url, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", is_external=True)
64
+
65
+ hyperlink = OxmlElement('w:hyperlink')
66
+ hyperlink.set(qn('r:id'), r_id)
67
+
68
+ new_run = OxmlElement('w:r')
69
+ rPr = OxmlElement('w:rPr')
70
+
71
+ # Blue color and underline for hyperlink
72
+ color = OxmlElement('w:color')
73
+ color.set(qn('w:val'), '0000FF')
74
+ rPr.append(color)
75
+
76
+ underline = OxmlElement('w:u')
77
+ underline.set(qn('w:val'), 'single')
78
+ rPr.append(underline)
79
+
80
+ new_run.append(rPr)
81
+
82
+ text_elem = OxmlElement('w:t')
83
+ text_elem.text = text
84
+ new_run.append(text_elem)
85
+
86
+ hyperlink.append(new_run)
87
+ paragraph._p.append(hyperlink)
88
+
89
+
90
+ def process_inline_elements(paragraph, element, md_path: Path):
91
+ """Process inline elements like bold, italic, code, links within a paragraph."""
92
+ if isinstance(element, NavigableString):
93
+ text = str(element)
94
+ if text.strip():
95
+ paragraph.add_run(text)
96
+ elif text:
97
+ paragraph.add_run(text)
98
+ return
99
+
100
+ if element.name == 'strong' or element.name == 'b':
101
+ run = paragraph.add_run(element.get_text())
102
+ run.bold = True
103
+ elif element.name == 'em' or element.name == 'i':
104
+ run = paragraph.add_run(element.get_text())
105
+ run.italic = True
106
+ elif element.name == 'code':
107
+ run = paragraph.add_run(element.get_text())
108
+ run.font.name = 'Courier New'
109
+ run.font.size = Pt(10)
110
+ elif element.name == 'a':
111
+ href = element.get('href', '')
112
+ text = element.get_text()
113
+ if href:
114
+ create_hyperlink(paragraph, href, text)
115
+ else:
116
+ paragraph.add_run(text)
117
+ elif element.name == 'img':
118
+ src = element.get('src', '')
119
+ if src and not src.startswith(('http://', 'https://', 'data:')):
120
+ img_path = (md_path.parent / src).resolve()
121
+ if img_path.exists():
122
+ try:
123
+ paragraph.add_run().add_picture(str(img_path), width=Inches(4))
124
+ except Exception:
125
+ paragraph.add_run(f"[Image: {src}]")
126
+ else:
127
+ paragraph.add_run(f"[Image not found: {src}]")
128
+ else:
129
+ paragraph.add_run(f"[Image: {src}]")
130
+ elif element.name == 'br':
131
+ paragraph.add_run('\n')
132
+ else:
133
+ # Recursively process children
134
+ for child in element.children:
135
+ process_inline_elements(paragraph, child, md_path)
136
+
137
+
138
+ def add_paragraph_with_formatting(doc: Document, element, md_path: Path, style: str = None):
139
+ """Add a paragraph with inline formatting."""
140
+ para = doc.add_paragraph(style=style)
141
+ for child in element.children:
142
+ process_inline_elements(para, child, md_path)
143
+ return para
144
+
145
+
146
+ def process_list(doc: Document, element, md_path: Path, ordered: bool = False, level: int = 0):
147
+ """Process ordered or unordered lists."""
148
+ for i, li in enumerate(element.find_all('li', recursive=False)):
149
+ # Create paragraph with list style
150
+ para = doc.add_paragraph(style='List Number' if ordered else 'List Bullet')
151
+
152
+ # Set indentation for nested lists
153
+ if level > 0:
154
+ para.paragraph_format.left_indent = Inches(0.5 * level)
155
+
156
+ # Process direct text content
157
+ for child in li.children:
158
+ if isinstance(child, NavigableString):
159
+ text = str(child).strip()
160
+ if text:
161
+ para.add_run(text)
162
+ elif child.name in ('ul', 'ol'):
163
+ # Nested list
164
+ process_list(doc, child, md_path, ordered=(child.name == 'ol'), level=level + 1)
165
+ elif child.name == 'p':
166
+ # Process paragraph content inline
167
+ for subchild in child.children:
168
+ process_inline_elements(para, subchild, md_path)
169
+ else:
170
+ process_inline_elements(para, child, md_path)
171
+
172
+
173
+ def process_table(doc: Document, element, md_path: Path):
174
+ """Process HTML table and create DOCX table."""
175
+ rows = element.find_all('tr')
176
+ if not rows:
177
+ return
178
+
179
+ # Count columns from first row
180
+ first_row = rows[0]
181
+ cols = len(first_row.find_all(['th', 'td']))
182
+
183
+ if cols == 0:
184
+ return
185
+
186
+ table = doc.add_table(rows=len(rows), cols=cols)
187
+ table.style = 'Table Grid'
188
+ table.autofit = False
189
+
190
+ # Word otherwise divides every column equally and lets long prose collapse
191
+ # into narrow vertical strips. Size to the usable page, with a compact label
192
+ # column for the common two-column report table.
193
+ section = doc.sections[-1]
194
+ usable = int(section.page_width - section.left_margin - section.right_margin)
195
+ if cols == 2:
196
+ widths = [int(usable * 0.28), usable - int(usable * 0.28)]
197
+ else:
198
+ widths = [usable // cols] * cols
199
+ widths[-1] += usable - sum(widths)
200
+ for index, width in enumerate(widths):
201
+ table.columns[index].width = width
202
+ for row in table.rows:
203
+ row_properties = row._tr.get_or_add_trPr()
204
+ row_properties.append(OxmlElement('w:cantSplit'))
205
+ for index, cell in enumerate(row.cells):
206
+ cell.width = widths[index]
207
+ table.rows[0]._tr.get_or_add_trPr().append(OxmlElement('w:tblHeader'))
208
+
209
+ for row_idx, tr in enumerate(rows):
210
+ cells = tr.find_all(['th', 'td'])
211
+ for col_idx, cell in enumerate(cells):
212
+ if col_idx < cols:
213
+ table_cell = table.rows[row_idx].cells[col_idx]
214
+ # Clear default paragraph
215
+ table_cell.text = ''
216
+ para = table_cell.paragraphs[0]
217
+ for child in cell.children:
218
+ process_inline_elements(para, child, md_path)
219
+ para.paragraph_format.keep_together = True
220
+ if row_idx == 0:
221
+ para.paragraph_format.keep_with_next = True
222
+
223
+ # Bold for header cells
224
+ if cell.name == 'th':
225
+ for run in para.runs:
226
+ run.bold = True
227
+
228
+
229
+ def process_code_block(doc: Document, element):
230
+ """Process code block with monospace formatting."""
231
+ code = element.find('code')
232
+ text = code.get_text() if code else element.get_text()
233
+
234
+ para = doc.add_paragraph()
235
+ run = para.add_run(text)
236
+ run.font.name = 'Courier New'
237
+ run.font.size = Pt(9)
238
+
239
+ # Light gray background (via shading)
240
+ shading = OxmlElement('w:shd')
241
+ shading.set(qn('w:fill'), 'F0F0F0')
242
+ para._p.get_or_add_pPr().append(shading)
243
+
244
+
245
+ def html_to_docx(html: str, doc: Document, md_path: Path):
246
+ """Convert HTML to DOCX elements."""
247
+ soup = BeautifulSoup(html, 'html.parser')
248
+
249
+ for element in soup.children:
250
+ if isinstance(element, NavigableString):
251
+ text = str(element).strip()
252
+ if text:
253
+ doc.add_paragraph(text)
254
+ continue
255
+
256
+ if element.name in ('h1', 'h2', 'h3', 'h4', 'h5', 'h6'):
257
+ level = int(element.name[1])
258
+ heading = doc.add_heading(level=level)
259
+ for child in element.children:
260
+ process_inline_elements(heading, child, md_path)
261
+
262
+ elif element.name == 'p':
263
+ add_paragraph_with_formatting(doc, element, md_path)
264
+
265
+ elif element.name == 'ul':
266
+ process_list(doc, element, md_path, ordered=False)
267
+
268
+ elif element.name == 'ol':
269
+ process_list(doc, element, md_path, ordered=True)
270
+
271
+ elif element.name == 'table':
272
+ process_table(doc, element, md_path)
273
+
274
+ elif element.name == 'pre':
275
+ process_code_block(doc, element)
276
+
277
+ elif element.name == 'blockquote':
278
+ para = doc.add_paragraph(style='Quote')
279
+ for child in element.children:
280
+ if child.name == 'p':
281
+ for subchild in child.children:
282
+ process_inline_elements(para, subchild, md_path)
283
+ else:
284
+ process_inline_elements(para, child, md_path)
285
+
286
+ elif element.name == 'hr':
287
+ # Add a horizontal line
288
+ para = doc.add_paragraph()
289
+ para.add_run('─' * 50)
290
+ para.alignment = WD_ALIGN_PARAGRAPH.CENTER
291
+
292
+ elif element.name in ('div', 'section', 'article'):
293
+ # Recursively process container elements
294
+ html_to_docx(str(element), doc, md_path)
295
+
296
+
297
+ # ===========================================================================
298
+ # M1: Journal workflow — frontmatter, filters, design enforcement
299
+ # ===========================================================================
300
+
301
+
302
+ def _load_yaml():
303
+ try:
304
+ import yaml
305
+ return yaml
306
+ except ImportError:
307
+ print("Error: 'pyyaml' library required for --publisher. pip install pyyaml")
308
+ sys.exit(1)
309
+
310
+
311
+ def parse_frontmatter(md_text: str) -> tuple[dict, str]:
312
+ """Extract leading YAML frontmatter. Returns (frontmatter_dict, body)."""
313
+ if not md_text.startswith("---"):
314
+ return {}, md_text
315
+ # Find closing fence
316
+ lines = md_text.splitlines(keepends=True)
317
+ if len(lines) < 2:
318
+ return {}, md_text
319
+ end_idx = None
320
+ for i in range(1, len(lines)):
321
+ if lines[i].rstrip() == "---":
322
+ end_idx = i
323
+ break
324
+ if end_idx is None:
325
+ return {}, md_text
326
+ yaml_src = "".join(lines[1:end_idx])
327
+ body = "".join(lines[end_idx + 1:])
328
+ yaml = _load_yaml()
329
+ try:
330
+ data = yaml.safe_load(yaml_src) or {}
331
+ except Exception as exc:
332
+ print(f"Warning: could not parse YAML frontmatter: {exc}", file=sys.stderr)
333
+ return {}, md_text
334
+ if not isinstance(data, dict):
335
+ return {}, md_text
336
+ return data, body
337
+
338
+
339
+ def load_publisher(registry_path: Path, name: str) -> dict:
340
+ yaml = _load_yaml()
341
+ if not registry_path.exists():
342
+ raise SystemExit(f"Error: registry not found: {registry_path}")
343
+ with registry_path.open("r", encoding="utf-8") as fh:
344
+ data = yaml.safe_load(fh) or {}
345
+ pubs = data.get("publishers") or {}
346
+ if name not in pubs:
347
+ raise SystemExit(
348
+ f"Error: publisher {name!r} not in registry "
349
+ f"(known: {', '.join(sorted(pubs)) or 'none'})"
350
+ )
351
+ return pubs[name]
352
+
353
+
354
+ # ---------------------------------------------------------------------------
355
+ # Code-preserving filter helpers
356
+ # ---------------------------------------------------------------------------
357
+
358
+
359
+ _FENCE_RE = re.compile(r"(^```.*?^```)", re.MULTILINE | re.DOTALL)
360
+ _INLINE_CODE_RE = re.compile(r"(`[^`\n]+`)")
361
+
362
+
363
+ def _split_code_preserving(text: str) -> list[tuple[str, bool]]:
364
+ """Split text into (segment, is_code) tuples.
365
+
366
+ Fenced code blocks and inline backtick code are returned as is_code=True
367
+ and must never be touched by the micro-typography filters.
368
+ """
369
+ # First split on fenced code blocks
370
+ out: list[tuple[str, bool]] = []
371
+ pos = 0
372
+ for m in _FENCE_RE.finditer(text):
373
+ if m.start() > pos:
374
+ out.append((text[pos:m.start()], False))
375
+ out.append((m.group(0), True))
376
+ pos = m.end()
377
+ if pos < len(text):
378
+ out.append((text[pos:], False))
379
+ # Then split non-code segments on inline backtick code
380
+ refined: list[tuple[str, bool]] = []
381
+ for seg, is_code in out:
382
+ if is_code:
383
+ refined.append((seg, True))
384
+ continue
385
+ last = 0
386
+ for m in _INLINE_CODE_RE.finditer(seg):
387
+ if m.start() > last:
388
+ refined.append((seg[last:m.start()], False))
389
+ refined.append((m.group(0), True))
390
+ last = m.end()
391
+ if last < len(seg):
392
+ refined.append((seg[last:], False))
393
+ return refined
394
+
395
+
396
+ def _apply_to_noncode(text: str, fn) -> str:
397
+ parts = _split_code_preserving(text)
398
+ out = []
399
+ for seg, is_code in parts:
400
+ out.append(seg if is_code else fn(seg))
401
+ return "".join(out)
402
+
403
+
404
+ # ---------------------------------------------------------------------------
405
+ # Pre-MD micro-typography filters
406
+ # ---------------------------------------------------------------------------
407
+
408
+
409
+ _NUMRANGE_RE = re.compile(r"(\d)-(\d)")
410
+ _PAREN_DASH_RE = re.compile(r"(\w) - (\w)")
411
+
412
+
413
+ def fix_dashes(text: str, rules: dict | None = None) -> str:
414
+ """Numeric ranges → en-dash; parenthetical 'word - word' → em-dash.
415
+
416
+ rules is the design.micro_typography.dashes block (currently informational;
417
+ M1 hardcodes en-dash for numeric range and em-dash for parenthetical).
418
+ """
419
+ def _fn(seg: str) -> str:
420
+ seg = _NUMRANGE_RE.sub(lambda m: f"{m.group(1)}\u2013{m.group(2)}", seg)
421
+ seg = _PAREN_DASH_RE.sub(lambda m: f"{m.group(1)} \u2014 {m.group(2)}", seg)
422
+ return seg
423
+ return _apply_to_noncode(text, _fn)
424
+
425
+
426
+ def fix_quotes(text: str) -> str:
427
+ """ASCII "..." → "..."; '...' → '...' via left/right state machine."""
428
+ def _fn(seg: str) -> str:
429
+ out_chars = []
430
+ open_dq = True
431
+ open_sq = True
432
+ for ch in seg:
433
+ if ch == '"':
434
+ out_chars.append("\u201C" if open_dq else "\u201D")
435
+ open_dq = not open_dq
436
+ elif ch == "'":
437
+ # Keep apostrophe if surrounded by letters (e.g. "don't")
438
+ prev = out_chars[-1] if out_chars else ""
439
+ if prev.isalpha():
440
+ out_chars.append("\u2019")
441
+ else:
442
+ out_chars.append("\u2018" if open_sq else "\u2019")
443
+ open_sq = not open_sq
444
+ else:
445
+ out_chars.append(ch)
446
+ return "".join(out_chars)
447
+ return _apply_to_noncode(text, _fn)
448
+
449
+
450
+ _UNIT_GROUP = (
451
+ r"mg|g|kg|mL|L|\u03BCL|uL|nm|\u03BCm|um|mm|cm|m|km|K|\u00B0C|%|min|h|s|ms"
452
+ )
453
+ _UNIT_RE = re.compile(rf"(\d)(\s+)({_UNIT_GROUP})(?=\b|\W|$)")
454
+ _FIG_RE = re.compile(r"(Fig\.)\s(\d)")
455
+ _TABLE_RE = re.compile(r"(Table)\s(\d)")
456
+ _EQ_RE = re.compile(r"(Eq\.)\s(\d)")
457
+
458
+
459
+ def fix_unit_spacing(text: str) -> str:
460
+ """Insert U+00A0 between number and SI unit, and after Fig./Table/Eq."""
461
+ def _fn(seg: str) -> str:
462
+ seg = _UNIT_RE.sub(lambda m: f"{m.group(1)}\u00A0{m.group(3)}", seg)
463
+ seg = _FIG_RE.sub(lambda m: f"{m.group(1)}\u00A0{m.group(2)}", seg)
464
+ seg = _TABLE_RE.sub(lambda m: f"{m.group(1)}\u00A0{m.group(2)}", seg)
465
+ seg = _EQ_RE.sub(lambda m: f"{m.group(1)}\u00A0{m.group(2)}", seg)
466
+ return seg
467
+ return _apply_to_noncode(text, _fn)
468
+
469
+
470
+ def fix_ellipsis(text: str) -> str:
471
+ def _fn(seg: str) -> str:
472
+ return seg.replace("...", "\u2026")
473
+ return _apply_to_noncode(text, _fn)
474
+
475
+
476
+ def normalize_double_spaces(text: str) -> str:
477
+ def _fn(seg: str) -> str:
478
+ # Preserve leading indentation; collapse interior double spaces
479
+ lines = seg.split("\n")
480
+ cleaned = []
481
+ for line in lines:
482
+ stripped_left = line.lstrip(" ")
483
+ lead = line[: len(line) - len(stripped_left)]
484
+ cleaned.append(lead + re.sub(r" {2,}", " ", stripped_left))
485
+ return "\n".join(cleaned)
486
+ return _apply_to_noncode(text, _fn)
487
+
488
+
489
+ # ---------------------------------------------------------------------------
490
+ # Post-HTML (doc object) filters
491
+ # ---------------------------------------------------------------------------
492
+
493
+
494
+ def apply_heading_numbering(doc, design: dict) -> None:
495
+ def to_roman(value: int) -> str:
496
+ numerals = [
497
+ (1000, "M"), (900, "CM"), (500, "D"), (400, "CD"),
498
+ (100, "C"), (90, "XC"), (50, "L"), (40, "XL"),
499
+ (10, "X"), (9, "IX"), (5, "V"), (4, "IV"), (1, "I"),
500
+ ]
501
+ out: list[str] = []
502
+ remaining = value
503
+ for arabic, roman in numerals:
504
+ while remaining >= arabic:
505
+ out.append(roman)
506
+ remaining -= arabic
507
+ return "".join(out)
508
+
509
+ def prefix_for(level: int, counters: list[int]) -> str | None:
510
+ key = f"h{level}"
511
+ cfg = (design.get("heading_hierarchy") or {}).get(key) or {}
512
+ numbering = cfg.get("numbering")
513
+ if numbering is None:
514
+ return None
515
+ numbering = str(numbering).strip()
516
+ if level == 1 and numbering.upper() == "I.":
517
+ return f"{to_roman(counters[0])}. "
518
+ if level == 1:
519
+ return f"{counters[0]}. "
520
+ if level == 2:
521
+ return f"{counters[0]}.{counters[1]}. "
522
+ if level == 3:
523
+ return f"{counters[0]}.{counters[1]}.{counters[2]}. "
524
+ return None
525
+
526
+ counters = [0, 0, 0]
527
+ for para in doc.paragraphs:
528
+ style_name = para.style.name if para.style else ""
529
+ level = 0
530
+ if style_name == "Heading 1":
531
+ level = 1
532
+ counters[0] += 1
533
+ counters[1] = 0
534
+ counters[2] = 0
535
+ elif style_name == "Heading 2":
536
+ level = 2
537
+ counters[1] += 1
538
+ counters[2] = 0
539
+ elif style_name == "Heading 3":
540
+ level = 3
541
+ counters[2] += 1
542
+ else:
543
+ continue
544
+ prefix = prefix_for(level, counters)
545
+ if prefix is None:
546
+ continue
547
+ current = para.text or ""
548
+ # Skip if already numbered (e.g. "1 Introduction" from the source)
549
+ if re.match(r"^(?:\d+(?:\.\d+)*\.?|[IVXLCDM]+\.?)\s", current):
550
+ continue
551
+ if para.runs:
552
+ para.runs[0].text = prefix + para.runs[0].text
553
+ else:
554
+ para.add_run(prefix)
555
+
556
+
557
+ def _set_cell_borders_nil(tcPr):
558
+ tcBorders = tcPr.find(qn("w:tcBorders"))
559
+ if tcBorders is None:
560
+ tcBorders = OxmlElement("w:tcBorders")
561
+ tcPr.append(tcBorders)
562
+ for side in ("top", "left", "bottom", "right", "insideH", "insideV"):
563
+ el = tcBorders.find(qn(f"w:{side}"))
564
+ if el is None:
565
+ el = OxmlElement(f"w:{side}")
566
+ tcBorders.append(el)
567
+ el.set(qn("w:val"), "nil")
568
+ el.set(qn("w:sz"), "0")
569
+
570
+
571
+ def apply_table_style(doc, design: dict) -> None:
572
+ """Override python-docx 'Table Grid' with booktabs: only horizontal rules.
573
+
574
+ Rules: top rule (table top), header-bottom rule, bottom rule (table bottom).
575
+ All vertical rules (left/right/insideV) set to nil.
576
+ """
577
+ for table in doc.tables:
578
+ table.style = None # detach Table Grid
579
+ tbl = table._tbl
580
+ tblPr = tbl.find(qn("w:tblPr"))
581
+ if tblPr is None:
582
+ tblPr = OxmlElement("w:tblPr")
583
+ tbl.insert(0, tblPr)
584
+ # Remove any existing tblBorders and add our booktabs set
585
+ existing = tblPr.find(qn("w:tblBorders"))
586
+ if existing is not None:
587
+ tblPr.remove(existing)
588
+ tblBorders = OxmlElement("w:tblBorders")
589
+
590
+ def _add_border(name: str, val: str, sz: str):
591
+ el = OxmlElement(f"w:{name}")
592
+ el.set(qn("w:val"), val)
593
+ el.set(qn("w:sz"), sz)
594
+ el.set(qn("w:space"), "0")
595
+ el.set(qn("w:color"), "000000")
596
+ tblBorders.append(el)
597
+
598
+ _add_border("top", "single", "12") # ~1.5pt
599
+ _add_border("bottom", "single", "12") # ~1.5pt
600
+ _add_border("left", "nil", "0")
601
+ _add_border("right", "nil", "0")
602
+ _add_border("insideH", "single", "6") # ~0.75pt (header-bottom)
603
+ _add_border("insideV", "nil", "0") # explicit no verticals
604
+ tblPr.append(tblBorders)
605
+
606
+ # Bold header row + add bottom border only to header cells so the
607
+ # thicker rule sits under the header (and horizontal rules between
608
+ # body rows are suppressed)
609
+ if table.rows:
610
+ header_row = table.rows[0]
611
+ for cell in header_row.cells:
612
+ for p in cell.paragraphs:
613
+ for r in p.runs:
614
+ r.bold = True
615
+ # Remove insideH to prevent inner body rules; header-bottom comes
616
+ # from a per-cell bottom border on the first row.
617
+ insideH = tblBorders.find(qn("w:insideH"))
618
+ if insideH is not None:
619
+ insideH.set(qn("w:val"), "nil")
620
+ for cell in header_row.cells:
621
+ tcPr = cell._tc.get_or_add_tcPr()
622
+ tcBorders = tcPr.find(qn("w:tcBorders"))
623
+ if tcBorders is None:
624
+ tcBorders = OxmlElement("w:tcBorders")
625
+ tcPr.append(tcBorders)
626
+ existing_bottom = tcBorders.find(qn("w:bottom"))
627
+ if existing_bottom is None:
628
+ existing_bottom = OxmlElement("w:bottom")
629
+ tcBorders.append(existing_bottom)
630
+ existing_bottom.set(qn("w:val"), "single")
631
+ existing_bottom.set(qn("w:sz"), "6")
632
+ existing_bottom.set(qn("w:space"), "0")
633
+ existing_bottom.set(qn("w:color"), "000000")
634
+
635
+
636
+ def strip_banned(doc, design: dict) -> None:
637
+ """Remove any banned font/style from runs and paragraphs."""
638
+ banned = design.get("banned") or {}
639
+ banned_fonts = set(banned.get("fonts") or [])
640
+ banned_styles = set(banned.get("styles") or [])
641
+ body_font = None
642
+ # body font is enforced on Normal style already, but we override raw runs too
643
+ for para in doc.paragraphs:
644
+ if para.style and para.style.name in banned_styles:
645
+ try:
646
+ para.style = doc.styles["Normal"]
647
+ except KeyError:
648
+ pass
649
+ for run in para.runs:
650
+ if run.font.name and run.font.name in banned_fonts:
651
+ run.font.name = None # inherit from style
652
+ # Also walk table cells
653
+ for table in doc.tables:
654
+ for row in table.rows:
655
+ for cell in row.cells:
656
+ for para in cell.paragraphs:
657
+ if para.style and para.style.name in banned_styles:
658
+ try:
659
+ para.style = doc.styles["Normal"]
660
+ except KeyError:
661
+ pass
662
+ for run in para.runs:
663
+ if run.font.name and run.font.name in banned_fonts:
664
+ run.font.name = None
665
+
666
+
667
+ def _set_run_fonts(run, latin: str, cjk: str | None) -> None:
668
+ rpr = run._element.get_or_add_rPr()
669
+ rfonts = rpr.find(qn("w:rFonts"))
670
+ if rfonts is None:
671
+ rfonts = OxmlElement("w:rFonts")
672
+ rpr.append(rfonts)
673
+ rfonts.set(qn("w:ascii"), latin)
674
+ rfonts.set(qn("w:hAnsi"), latin)
675
+ rfonts.set(qn("w:cs"), latin)
676
+ if cjk:
677
+ rfonts.set(qn("w:eastAsia"), cjk)
678
+
679
+
680
+ def apply_cjk_font_pairing(doc, font_cfg: dict) -> None:
681
+ body = font_cfg.get("body") or {}
682
+ body_cjk = font_cfg.get("body_cjk") or {}
683
+ latin = body.get("family")
684
+ cjk = body_cjk.get("family")
685
+ if not latin:
686
+ return
687
+
688
+ def _walk(paragraphs):
689
+ for para in paragraphs:
690
+ for run in para.runs:
691
+ # Only fix runs that already have a font set to something
692
+ # other than the registry-banned default; leaving run.font.name
693
+ # as None lets the style do its job. We still force eastAsia.
694
+ current_name = run.font.name
695
+ if current_name and current_name != "Courier New":
696
+ _set_run_fonts(run, latin, cjk)
697
+ elif not current_name:
698
+ # set only eastAsia pair to avoid losing style inheritance
699
+ rpr = run._element.get_or_add_rPr()
700
+ rfonts = rpr.find(qn("w:rFonts"))
701
+ if rfonts is None:
702
+ rfonts = OxmlElement("w:rFonts")
703
+ rpr.append(rfonts)
704
+ if cjk:
705
+ rfonts.set(qn("w:eastAsia"), cjk)
706
+
707
+ _walk(doc.paragraphs)
708
+ for table in doc.tables:
709
+ for row in table.rows:
710
+ for cell in row.cells:
711
+ _walk(cell.paragraphs)
712
+
713
+
714
+ # ---------------------------------------------------------------------------
715
+ # Title block builder
716
+ # ---------------------------------------------------------------------------
717
+
718
+
719
+ def _insert_paragraph_before(doc, before_p, style=None):
720
+ """Insert a new paragraph before the given paragraph element."""
721
+ new_p = OxmlElement("w:p")
722
+ before_p._p.addprevious(new_p)
723
+ from docx.text.paragraph import Paragraph
724
+ para = Paragraph(new_p, before_p._parent)
725
+ if style is not None:
726
+ try:
727
+ para.style = doc.styles[style]
728
+ except KeyError:
729
+ pass
730
+ return para
731
+
732
+
733
+ def inject_title_block(doc, frontmatter: dict, design: dict) -> None:
734
+ """Prepend title/authors/affiliations/abstract/keywords to the doc.
735
+
736
+ Builds the block at the top of the document body via the underlying
737
+ XML so it appears before any html_to_docx output. Called BEFORE
738
+ html_to_docx in M1's control flow so paragraphs just append normally.
739
+ """
740
+ tb = design.get("title_block") or {}
741
+ title = frontmatter.get("title")
742
+ if not title:
743
+ return
744
+
745
+ def _p_center(size: int, bold=False, italic=False, space_after=4):
746
+ p = doc.add_paragraph()
747
+ p.alignment = WD_ALIGN_PARAGRAPH.CENTER
748
+ p.paragraph_format.first_line_indent = Cm(0)
749
+ p.paragraph_format.space_after = Pt(space_after)
750
+ return p
751
+
752
+ def _add_run(p, text: str, size: int, bold=False, italic=False, sup=False):
753
+ run = p.add_run(text)
754
+ run.font.size = Pt(size)
755
+ run.bold = bold
756
+ run.italic = italic
757
+ run.font.superscript = sup
758
+ return run
759
+
760
+ # Title
761
+ tp = _p_center(
762
+ tb.get("title", {}).get("size_pt", 18),
763
+ bold=True,
764
+ space_after=tb.get("title", {}).get("space_after_pt", 12),
765
+ )
766
+ _add_run(tp, str(title), tb.get("title", {}).get("size_pt", 18), bold=True)
767
+
768
+ # Authors
769
+ authors = frontmatter.get("authors") or []
770
+ if authors:
771
+ ap = _p_center(
772
+ tb.get("authors", {}).get("size_pt", 12),
773
+ space_after=tb.get("authors", {}).get("space_after_pt", 4),
774
+ )
775
+ sep = tb.get("author_separator", ", ")
776
+ corr_mark = tb.get("corresponding_marker", "*")
777
+ size = tb.get("authors", {}).get("size_pt", 12)
778
+ for i, author in enumerate(authors):
779
+ if not isinstance(author, dict):
780
+ continue
781
+ if i > 0:
782
+ _add_run(ap, sep, size)
783
+ name = str(author.get("name", "Author"))
784
+ _add_run(ap, name, size)
785
+ aff = author.get("affiliation")
786
+ if aff is not None:
787
+ if isinstance(aff, list):
788
+ aff_text = ",".join(str(a) for a in aff)
789
+ else:
790
+ aff_text = str(aff)
791
+ _add_run(ap, aff_text, size, sup=True)
792
+ if author.get("corresponding"):
793
+ _add_run(ap, corr_mark, size, sup=True)
794
+
795
+ # Affiliations
796
+ affs = frontmatter.get("affiliations")
797
+ if isinstance(affs, dict):
798
+ for key in sorted(affs.keys(), key=lambda k: str(k)):
799
+ fp = _p_center(
800
+ tb.get("affiliations", {}).get("size_pt", 10),
801
+ italic=True,
802
+ space_after=2,
803
+ )
804
+ _add_run(
805
+ fp,
806
+ f"{key} {affs[key]}",
807
+ tb.get("affiliations", {}).get("size_pt", 10),
808
+ italic=True,
809
+ )
810
+
811
+ # Corresponding email (if present, small italic line)
812
+ corr_email = frontmatter.get("corresponding_email")
813
+ if corr_email:
814
+ cp = _p_center(10, italic=True, space_after=8)
815
+ _add_run(cp, f"* Corresponding author: {corr_email}", 10, italic=True)
816
+
817
+ # Abstract
818
+ abstract = frontmatter.get("abstract")
819
+ if abstract:
820
+ lp = doc.add_paragraph()
821
+ lp.paragraph_format.first_line_indent = Cm(0)
822
+ lp.paragraph_format.space_after = Pt(4)
823
+ _add_run(
824
+ lp,
825
+ tb.get("abstract_label", "Abstract"),
826
+ tb.get("abstract_font_size_pt", 10),
827
+ bold=True,
828
+ )
829
+ body = doc.add_paragraph()
830
+ body.paragraph_format.first_line_indent = Cm(0)
831
+ body.paragraph_format.space_after = Pt(6)
832
+ _add_run(
833
+ body,
834
+ str(abstract),
835
+ tb.get("abstract_font_size_pt", 10),
836
+ )
837
+
838
+ # Keywords
839
+ keywords = frontmatter.get("keywords")
840
+ if keywords:
841
+ kp = doc.add_paragraph()
842
+ kp.paragraph_format.first_line_indent = Cm(0)
843
+ kp.paragraph_format.space_after = Pt(12)
844
+ _add_run(
845
+ kp,
846
+ tb.get("keywords_label", "Keywords") + ": ",
847
+ tb.get("abstract_font_size_pt", 10),
848
+ bold=True,
849
+ )
850
+ if isinstance(keywords, list):
851
+ sep = tb.get("keywords_separator", "; ")
852
+ text = sep.join(str(k) for k in keywords)
853
+ else:
854
+ text = str(keywords)
855
+ _add_run(kp, text, tb.get("abstract_font_size_pt", 10))
856
+
857
+
858
+ # ---------------------------------------------------------------------------
859
+ # Locale detection
860
+ # ---------------------------------------------------------------------------
861
+
862
+
863
+ _HANGUL_RE = re.compile(r"[\uac00-\ud7a3]")
864
+
865
+
866
+ def detect_locale(text: str) -> str:
867
+ total = len(text) or 1
868
+ hangul_count = len(_HANGUL_RE.findall(text))
869
+ ratio = hangul_count / total
870
+ if ratio > 0.05:
871
+ return "ko"
872
+ if ratio > 0.01:
873
+ return "mixed"
874
+ return "en"
875
+
876
+
877
+ # ===========================================================================
878
+ # Conversion entry point
879
+ # ===========================================================================
880
+
881
+
882
+ def convert_md_to_docx(
883
+ md_path: Path,
884
+ docx_path: Path,
885
+ template_path: Path = None,
886
+ publisher_name: str | None = None,
887
+ registry_path: Path | None = None,
888
+ locale: str = "auto",
889
+ ):
890
+ """Convert Markdown file to DOCX.
891
+
892
+ When publisher_name is None, behavior is byte-compatible with the pre-M1
893
+ script: read md, convert to HTML, html_to_docx, save. Regression-guarded.
894
+
895
+ When publisher_name is set, apply the full journal pipeline: registry
896
+ load, frontmatter parse, pre-MD filters, title-block injection, post-HTML
897
+ heading numbering, booktabs tables, banned stripping, CJK font pairing.
898
+ """
899
+ if publisher_name is None:
900
+ # --- Legacy code path (regression-critical: do not mutate) ---
901
+ md_text = md_path.read_text(encoding='utf-8')
902
+ md_converter = markdown.Markdown(extensions=[
903
+ 'tables',
904
+ 'fenced_code',
905
+ 'nl2br',
906
+ 'sane_lists',
907
+ ])
908
+ html = md_converter.convert(md_text)
909
+ if template_path and template_path.exists():
910
+ doc = Document(str(template_path))
911
+ else:
912
+ doc = Document()
913
+ html_to_docx(html, doc, md_path)
914
+ doc.save(str(docx_path))
915
+ print(f"Successfully converted {md_path} to {docx_path}")
916
+ return
917
+
918
+ # --- Journal workflow ---
919
+ script_dir = Path(__file__).resolve().parent
920
+ registry_path = registry_path or (script_dir.parent / "templates" / "registry.yaml")
921
+ publisher = load_publisher(Path(registry_path), publisher_name)
922
+ design = publisher["design"]
923
+ docx_font = publisher["docx"]["font"]
924
+
925
+ md_text = md_path.read_text(encoding="utf-8")
926
+ frontmatter, body = parse_frontmatter(md_text)
927
+ if not frontmatter.get("title"):
928
+ first_heading = re.match(r"^\s*#\s+([^\n]+)\n+", body)
929
+ if first_heading:
930
+ frontmatter["title"] = first_heading.group(1).strip()
931
+ body = body[first_heading.end():]
932
+
933
+ # Locale detection (informational in M1; Korean rules land in M6)
934
+ detected_locale = detect_locale(body) if locale == "auto" else locale
935
+
936
+ # Pre-MD micro-typography filters
937
+ dash_rules = design.get("micro_typography", {}).get("dashes")
938
+ body = fix_dashes(body, dash_rules)
939
+ body = fix_quotes(body)
940
+ body = fix_unit_spacing(body)
941
+ body = fix_ellipsis(body)
942
+ body = normalize_double_spaces(body)
943
+
944
+ # Load template if available
945
+ template_docx = script_dir.parent / "templates" / "docx" / f"{publisher_name}.docx"
946
+ if template_docx.exists():
947
+ doc = Document(str(template_docx))
948
+ # The template includes a self-describing sample title block and
949
+ # sample heading/body paragraph. Strip all existing body paragraphs
950
+ # and tables so the conversion output is the user's content only.
951
+ body_el = doc.element.body
952
+ sect_pr = body_el.find(qn("w:sectPr"))
953
+ for child in list(body_el):
954
+ if child is sect_pr:
955
+ continue
956
+ body_el.remove(child)
957
+ if sect_pr is None:
958
+ pass # keep original body even if no sectPr detected
959
+ elif template_path and template_path.exists():
960
+ doc = Document(str(template_path))
961
+ else:
962
+ doc = Document()
963
+
964
+ # Title block (built from frontmatter) before main content
965
+ if frontmatter.get("title"):
966
+ inject_title_block(doc, frontmatter, design)
967
+
968
+ # Main content
969
+ md_converter = markdown.Markdown(extensions=[
970
+ 'tables',
971
+ 'fenced_code',
972
+ 'nl2br',
973
+ 'sane_lists',
974
+ ])
975
+ html = md_converter.convert(body)
976
+ html_to_docx(html, doc, md_path)
977
+
978
+ # Post-HTML design enforcement
979
+ apply_heading_numbering(doc, design)
980
+ apply_table_style(doc, design)
981
+ strip_banned(doc, design)
982
+ apply_cjk_font_pairing(doc, docx_font)
983
+
984
+ doc.save(str(docx_path))
985
+ print(
986
+ f"Successfully converted {md_path} to {docx_path} "
987
+ f"[publisher={publisher_name}, locale={detected_locale}]"
988
+ )
989
+
990
+
991
+ def parse_args() -> argparse.Namespace:
992
+ parser = argparse.ArgumentParser(
993
+ description="Convert Markdown to DOCX with proper styling"
994
+ )
995
+ parser.add_argument("input", help="Input Markdown file")
996
+ parser.add_argument("output", help="Output DOCX file")
997
+ parser.add_argument(
998
+ "--template",
999
+ help="Optional DOCX template to use as base",
1000
+ default=None,
1001
+ )
1002
+ parser.add_argument(
1003
+ "--publisher",
1004
+ help="Journal publisher profile from templates/registry.yaml (e.g. elsevier)",
1005
+ default=None,
1006
+ )
1007
+ parser.add_argument(
1008
+ "--registry",
1009
+ help="Path to templates/registry.yaml (defaults to the one in this skill)",
1010
+ default=None,
1011
+ )
1012
+ parser.add_argument(
1013
+ "--locale",
1014
+ choices=("auto", "en", "ko", "mixed"),
1015
+ default="auto",
1016
+ help="Force locale; 'auto' detects via Hangul codepoint ratio",
1017
+ )
1018
+ args = parser.parse_args()
1019
+ if args.publisher and args.template:
1020
+ parser.error("--publisher and --template are mutually exclusive")
1021
+ return args
1022
+
1023
+
1024
+ def main() -> int:
1025
+ args = parse_args()
1026
+
1027
+ md_path = Path(args.input).expanduser().resolve()
1028
+ docx_path = Path(args.output).expanduser().resolve()
1029
+ template_path = Path(args.template).expanduser().resolve() if args.template else None
1030
+ registry_path = Path(args.registry).expanduser().resolve() if args.registry else None
1031
+
1032
+ if not md_path.exists():
1033
+ print(f"Error: Input file not found: {md_path}")
1034
+ return 1
1035
+
1036
+ convert_md_to_docx(
1037
+ md_path, docx_path, template_path,
1038
+ publisher_name=args.publisher,
1039
+ registry_path=registry_path,
1040
+ locale=args.locale,
1041
+ )
1042
+ return 0
1043
+
1044
+
1045
+ if __name__ == "__main__":
1046
+ raise SystemExit(main())