dimcode-darwin-x64 0.1.0 → 0.1.2-beta.1

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 (148) hide show
  1. package/bin/dimcode +0 -0
  2. package/bin/runtime/sandbox/dim-sandbox-runner +0 -0
  3. package/bin/runtime/sandbox/manifest.json +15 -0
  4. package/bin/skills-assets/deep-investigate/SKILL.md +101 -0
  5. package/bin/skills-assets/deep-investigate/references/prompts.md +75 -0
  6. package/bin/skills-assets/deep-investigate/references/templates.md +73 -0
  7. package/bin/skills-assets/deep-investigate/references/thinking-tools.md +36 -0
  8. package/bin/skills-assets/docs-sprint/SKILL.md +73 -0
  9. package/bin/skills-assets/docs-sprint/agents/openai.yaml +4 -0
  10. package/bin/skills-assets/docs-sprint/references/contract-discipline.md +30 -0
  11. package/bin/skills-assets/docs-sprint/references/delivery-plan.md +162 -0
  12. package/bin/skills-assets/docs-sprint/references/documentation-system.md +109 -0
  13. package/bin/skills-assets/docs-sprint/references/ui-layout.md +73 -0
  14. package/bin/skills-assets/docs-sprint/references/worktree-guide.md +45 -0
  15. package/bin/skills-assets/docx/SKILL.md +273 -0
  16. package/bin/skills-assets/docx/assets/styles/academic_styles.xml +250 -0
  17. package/bin/skills-assets/docx/assets/styles/corporate_styles.xml +284 -0
  18. package/bin/skills-assets/docx/assets/styles/default_styles.xml +449 -0
  19. package/bin/skills-assets/docx/assets/xsd/aesthetic-rules.xsd +470 -0
  20. package/bin/skills-assets/docx/assets/xsd/business-rules.xsd +130 -0
  21. package/bin/skills-assets/docx/assets/xsd/common-types.xsd +159 -0
  22. package/bin/skills-assets/docx/assets/xsd/wml-subset.xsd +589 -0
  23. package/bin/skills-assets/docx/references/cjk_typography.md +357 -0
  24. package/bin/skills-assets/docx/references/cjk_university_template_guide.md +184 -0
  25. package/bin/skills-assets/docx/references/comments_guide.md +191 -0
  26. package/bin/skills-assets/docx/references/design_good_bad_examples.md +829 -0
  27. package/bin/skills-assets/docx/references/design_principles.md +819 -0
  28. package/bin/skills-assets/docx/references/openxml_element_order.md +308 -0
  29. package/bin/skills-assets/docx/references/openxml_encyclopedia_part1.md +4061 -0
  30. package/bin/skills-assets/docx/references/openxml_encyclopedia_part2.md +2820 -0
  31. package/bin/skills-assets/docx/references/openxml_encyclopedia_part3.md +3381 -0
  32. package/bin/skills-assets/docx/references/openxml_namespaces.md +82 -0
  33. package/bin/skills-assets/docx/references/openxml_units.md +72 -0
  34. package/bin/skills-assets/docx/references/scenario_a_create.md +284 -0
  35. package/bin/skills-assets/docx/references/scenario_b_edit_content.md +295 -0
  36. package/bin/skills-assets/docx/references/scenario_c_apply_template.md +456 -0
  37. package/bin/skills-assets/docx/references/track_changes_guide.md +200 -0
  38. package/bin/skills-assets/docx/references/troubleshooting.md +506 -0
  39. package/bin/skills-assets/docx/references/typography_guide.md +294 -0
  40. package/bin/skills-assets/docx/references/xsd_validation_guide.md +158 -0
  41. package/bin/skills-assets/docx/scripts/doc_to_docx.sh +40 -0
  42. package/bin/skills-assets/docx/scripts/docx_preview.sh +37 -0
  43. package/bin/skills-assets/docx/scripts/dotnet/Docx.Cli/Docx.Cli.csproj +19 -0
  44. package/bin/skills-assets/docx/scripts/dotnet/Docx.Cli/Program.cs +18 -0
  45. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/AnalyzeCommand.cs +147 -0
  46. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/ApplyTemplateCommand.cs +322 -0
  47. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/CreateCommand.cs +324 -0
  48. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/DiffCommand.cs +155 -0
  49. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/EditContentCommand.cs +487 -0
  50. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/FixOrderCommand.cs +108 -0
  51. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/MergeRunsCommand.cs +122 -0
  52. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/ValidateCommand.cs +107 -0
  53. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Docx.Core.csproj +15 -0
  54. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/CommentSynchronizer.cs +169 -0
  55. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/ElementOrder.cs +80 -0
  56. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/NamespaceConstants.cs +42 -0
  57. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/RunMerger.cs +81 -0
  58. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/StyleAnalyzer.cs +81 -0
  59. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/TrackChangesHelper.cs +99 -0
  60. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/UnitConverter.cs +23 -0
  61. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples.cs +1832 -0
  62. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch1.cs +910 -0
  63. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch2.cs +999 -0
  64. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch3.cs +1048 -0
  65. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch4.cs +1038 -0
  66. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/CharacterFormattingSamples.cs +1020 -0
  67. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/DocumentCreationSamples.cs +1121 -0
  68. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/FieldAndTocSamples.cs +624 -0
  69. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/FootnoteAndCommentSamples.cs +675 -0
  70. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/HeaderFooterSamples.cs +838 -0
  71. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ImageSamples.cs +917 -0
  72. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ListAndNumberingSamples.cs +826 -0
  73. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ParagraphFormattingSamples.cs +1199 -0
  74. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/StyleSystemSamples.cs +1487 -0
  75. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/TableSamples.cs +1163 -0
  76. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/TrackChangesSamples.cs +595 -0
  77. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/CjkHelper.cs +39 -0
  78. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/FontDefaults.cs +24 -0
  79. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/PageSizes.cs +20 -0
  80. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/BusinessRuleValidator.cs +224 -0
  81. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/GateCheckValidator.cs +148 -0
  82. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/ValidationResult.cs +23 -0
  83. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/XsdValidator.cs +69 -0
  84. package/bin/skills-assets/docx/scripts/dotnet/Docx.slnx +4 -0
  85. package/bin/skills-assets/docx/scripts/env_check.sh +196 -0
  86. package/bin/skills-assets/docx/scripts/setup.ps1 +274 -0
  87. package/bin/skills-assets/docx/scripts/setup.sh +504 -0
  88. package/bin/skills-assets/pdf/README.md +222 -0
  89. package/bin/skills-assets/pdf/SKILL.md +191 -0
  90. package/bin/skills-assets/pdf/design/design.md +381 -0
  91. package/bin/skills-assets/pdf/scripts/cover.py +1579 -0
  92. package/bin/skills-assets/pdf/scripts/fill_inspect.py +200 -0
  93. package/bin/skills-assets/pdf/scripts/fill_write.py +242 -0
  94. package/bin/skills-assets/pdf/scripts/make.sh +491 -0
  95. package/bin/skills-assets/pdf/scripts/merge.py +112 -0
  96. package/bin/skills-assets/pdf/scripts/palette.py +521 -0
  97. package/bin/skills-assets/pdf/scripts/reformat_parse.py +374 -0
  98. package/bin/skills-assets/pdf/scripts/render_body.py +1052 -0
  99. package/bin/skills-assets/pdf/scripts/render_cover.js +111 -0
  100. package/bin/skills-assets/pptx-generator/SKILL.md +248 -0
  101. package/bin/skills-assets/pptx-generator/references/design-system.md +392 -0
  102. package/bin/skills-assets/pptx-generator/references/editing.md +162 -0
  103. package/bin/skills-assets/pptx-generator/references/pitfalls.md +112 -0
  104. package/bin/skills-assets/pptx-generator/references/pptxgenjs.md +420 -0
  105. package/bin/skills-assets/pptx-generator/references/slide-types.md +413 -0
  106. package/bin/skills-assets/skill-creator/SKILL.md +368 -0
  107. package/bin/skills-assets/skill-creator/agents/openai.yaml +5 -0
  108. package/bin/skills-assets/skill-creator/assets/skill-creator-small.svg +3 -0
  109. package/bin/skills-assets/skill-creator/assets/skill-creator.png +0 -0
  110. package/bin/skills-assets/skill-creator/license.txt +202 -0
  111. package/bin/skills-assets/skill-creator/references/openai_yaml.md +49 -0
  112. package/bin/skills-assets/skill-creator/scripts/generate_openai_yaml.py +226 -0
  113. package/bin/skills-assets/skill-creator/scripts/init_skill.py +397 -0
  114. package/bin/skills-assets/skill-creator/scripts/quick_validate.py +101 -0
  115. package/bin/skills-assets/skill-installer/LICENSE.txt +202 -0
  116. package/bin/skills-assets/skill-installer/SKILL.md +58 -0
  117. package/bin/skills-assets/skill-installer/agents/openai.yaml +5 -0
  118. package/bin/skills-assets/skill-installer/assets/skill-installer-small.svg +3 -0
  119. package/bin/skills-assets/skill-installer/assets/skill-installer.png +0 -0
  120. package/bin/skills-assets/skill-installer/scripts/github_utils.py +21 -0
  121. package/bin/skills-assets/skill-installer/scripts/install-skill-from-github.py +308 -0
  122. package/bin/skills-assets/skill-installer/scripts/list-skills.py +107 -0
  123. package/bin/skills-assets/xlsx/SKILL.md +137 -0
  124. package/bin/skills-assets/xlsx/references/create.md +691 -0
  125. package/bin/skills-assets/xlsx/references/edit.md +684 -0
  126. package/bin/skills-assets/xlsx/references/fix.md +37 -0
  127. package/bin/skills-assets/xlsx/references/format.md +768 -0
  128. package/bin/skills-assets/xlsx/references/ooxml-cheatsheet.md +231 -0
  129. package/bin/skills-assets/xlsx/references/read-analyze.md +97 -0
  130. package/bin/skills-assets/xlsx/references/validate.md +772 -0
  131. package/bin/skills-assets/xlsx/scripts/formula_check.py +422 -0
  132. package/bin/skills-assets/xlsx/scripts/libreoffice_recalc.py +248 -0
  133. package/bin/skills-assets/xlsx/scripts/shared_strings_builder.py +163 -0
  134. package/bin/skills-assets/xlsx/scripts/style_audit.py +575 -0
  135. package/bin/skills-assets/xlsx/scripts/xlsx_add_column.py +395 -0
  136. package/bin/skills-assets/xlsx/scripts/xlsx_insert_row.py +274 -0
  137. package/bin/skills-assets/xlsx/scripts/xlsx_pack.py +87 -0
  138. package/bin/skills-assets/xlsx/scripts/xlsx_reader.py +362 -0
  139. package/bin/skills-assets/xlsx/scripts/xlsx_shift_rows.py +396 -0
  140. package/bin/skills-assets/xlsx/scripts/xlsx_unpack.py +130 -0
  141. package/bin/skills-assets/xlsx/templates/minimal_xlsx/[Content_Types].xml +9 -0
  142. package/bin/skills-assets/xlsx/templates/minimal_xlsx/_rels/.rels +6 -0
  143. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/_rels/workbook.xml.rels +19 -0
  144. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/sharedStrings.xml +33 -0
  145. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/styles.xml +160 -0
  146. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/workbook.xml +30 -0
  147. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/worksheets/sheet1.xml +70 -0
  148. package/package.json +1 -1
@@ -0,0 +1,111 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * render_cover.js — Render cover.html → cover.pdf via Playwright.
4
+ *
5
+ * Usage:
6
+ * node render_cover.js --input cover.html --out cover.pdf
7
+ * node render_cover.js --input cover.html --out cover.pdf --wait 1200
8
+ *
9
+ * Exit codes: 0 success, 1 bad args, 2 dependency missing, 3 render error
10
+ */
11
+
12
+ const path = require("path");
13
+ const fs = require("fs");
14
+
15
+ function usage() {
16
+ console.error("Usage: node render_cover.js --input <file.html> --out <file.pdf> [--wait <ms>]");
17
+ process.exit(1);
18
+ }
19
+
20
+ // ── Arg parsing ────────────────────────────────────────────────────────────────
21
+ const args = process.argv.slice(2);
22
+ let inputFile = null, outFile = null, waitMs = 800;
23
+
24
+ for (let i = 0; i < args.length; i++) {
25
+ if (args[i] === "--input" && args[i + 1]) { inputFile = args[++i]; }
26
+ else if (args[i] === "--out" && args[i + 1]) { outFile = args[++i]; }
27
+ else if (args[i] === "--wait" && args[i + 1]) { waitMs = parseInt(args[++i], 10); }
28
+ }
29
+
30
+ if (!inputFile || !outFile) usage();
31
+ if (!fs.existsSync(inputFile)) {
32
+ console.error(JSON.stringify({ status: "error", error: `File not found: ${inputFile}` }));
33
+ process.exit(1);
34
+ }
35
+
36
+ // ── Playwright loader (tolerates global npm installs) ─────────────────────────
37
+ function loadPlaywright() {
38
+ const { execSync } = require("child_process");
39
+ try { return require("playwright"); } catch (_) {}
40
+ try {
41
+ const root = execSync("npm root -g", { stdio: ["ignore","pipe","ignore"] }).toString().trim();
42
+ return require(path.join(root, "playwright"));
43
+ } catch (_) {}
44
+ console.error(JSON.stringify({
45
+ status: "error",
46
+ error: "playwright not found",
47
+ hint: "Run: npm install -g playwright && npx playwright install chromium"
48
+ }));
49
+ process.exit(2);
50
+ }
51
+
52
+ // ── Main ───────────────────────────────────────────────────────────────────────
53
+ (async () => {
54
+ const { chromium } = loadPlaywright();
55
+
56
+ let browser;
57
+ try {
58
+ browser = await chromium.launch();
59
+ } catch (e) {
60
+ // Chromium binary missing — try installing
61
+ const { spawnSync } = require("child_process");
62
+ const r = spawnSync("npx", ["playwright", "install", "chromium"], { stdio: "inherit", shell: true });
63
+ if (r.status !== 0) {
64
+ console.error(JSON.stringify({
65
+ status: "error",
66
+ error: "Chromium not installed and auto-install failed",
67
+ hint: "Run: npx playwright install chromium"
68
+ }));
69
+ process.exit(2);
70
+ }
71
+ browser = await chromium.launch();
72
+ }
73
+
74
+ try {
75
+ const page = await browser.newPage();
76
+ const fileUrl = "file://" + path.resolve(inputFile);
77
+ await page.goto(fileUrl);
78
+ await page.waitForTimeout(waitMs); // let CSS + any JS settle
79
+
80
+ await page.pdf({
81
+ path: outFile,
82
+ width: "794px",
83
+ height: "1123px",
84
+ printBackground: true,
85
+ });
86
+
87
+ await browser.close();
88
+
89
+ // Basic sanity: output file must exist and be > 5 KB
90
+ const stat = fs.statSync(outFile);
91
+ if (stat.size < 5000) {
92
+ console.error(JSON.stringify({
93
+ status: "error",
94
+ error: "Output PDF is suspiciously small — cover may be blank",
95
+ hint: "Check cover.html for render errors"
96
+ }));
97
+ process.exit(3);
98
+ }
99
+
100
+ console.log(JSON.stringify({
101
+ status: "ok",
102
+ out: outFile,
103
+ size_kb: Math.round(stat.size / 1024),
104
+ }));
105
+
106
+ } catch (e) {
107
+ if (browser) await browser.close().catch(() => {});
108
+ console.error(JSON.stringify({ status: "error", error: String(e) }));
109
+ process.exit(3);
110
+ }
111
+ })();
@@ -0,0 +1,248 @@
1
+ ---
2
+ name: pptx-generator
3
+ description: "Generate, edit, and read PowerPoint presentations. Create from scratch with PptxGenJS (cover, TOC, content, section divider, summary slides), edit existing PPTX via XML workflows, or extract text with markitdown. Triggers: PPT, PPTX, PowerPoint, presentation, slide, deck, slides."
4
+ metadata:
5
+ version: "1.0"
6
+ category: productivity
7
+ sources:
8
+ - https://gitbrent.github.io/PptxGenJS/
9
+ - https://github.com/microsoft/markitdown
10
+ ---
11
+
12
+ # PPTX Generator & Editor
13
+
14
+ ## Overview
15
+
16
+ This skill handles all PowerPoint tasks: reading/analyzing existing presentations, editing template-based decks via XML manipulation, and creating presentations from scratch using PptxGenJS. It includes a complete design system (color palettes, fonts, style recipes) and detailed guidance for every slide type.
17
+
18
+ ## Quick Reference
19
+
20
+ | Task | Approach |
21
+ |------|----------|
22
+ | Read/analyze content | `python -m markitdown presentation.pptx` |
23
+ | Edit or create from template | See [Editing Presentations](references/editing.md) |
24
+ | Create from scratch | See [Creating from Scratch](#creating-from-scratch-workflow) below |
25
+
26
+ | Item | Value |
27
+ |------|-------|
28
+ | **Dimensions** | 10" x 5.625" (LAYOUT_16x9) |
29
+ | **Colors** | 6-char hex without # (e.g., `"FF0000"`) |
30
+ | **English font** | Arial (default), or approved alternatives |
31
+ | **Chinese font** | Microsoft YaHei |
32
+ | **Page badge position** | x: 9.3", y: 5.1" |
33
+ | **Theme keys** | `primary`, `secondary`, `accent`, `light`, `bg` |
34
+ | **Shapes** | RECTANGLE, OVAL, LINE, ROUNDED_RECTANGLE |
35
+ | **Charts** | BAR, LINE, PIE, DOUGHNUT, SCATTER, BUBBLE, RADAR |
36
+
37
+ ## Reference Files
38
+
39
+ | File | Contents |
40
+ |------|----------|
41
+ | [slide-types.md](references/slide-types.md) | 5 slide page types (Cover, TOC, Section Divider, Content, Summary) + additional layout patterns |
42
+ | [design-system.md](references/design-system.md) | Color palettes, font reference, style recipes (Sharp/Soft/Rounded/Pill), typography & spacing |
43
+ | [editing.md](references/editing.md) | Template-based editing workflow, XML manipulation, formatting rules, common pitfalls |
44
+ | [pitfalls.md](references/pitfalls.md) | QA process, common mistakes, critical PptxGenJS pitfalls |
45
+ | [pptxgenjs.md](references/pptxgenjs.md) | Complete PptxGenJS API reference |
46
+
47
+ ---
48
+
49
+ ## Reading Content
50
+
51
+ ```bash
52
+ # Text extraction
53
+ python -m markitdown presentation.pptx
54
+ ```
55
+
56
+ ---
57
+
58
+ ## Creating from Scratch — Workflow
59
+
60
+ **Use when no template or reference presentation is available.**
61
+
62
+ ### Step 1: Research & Requirements
63
+
64
+ Search to understand user requirements — topic, audience, purpose, tone, content depth.
65
+
66
+ ### Step 2: Select Color Palette & Fonts
67
+
68
+ Use the [Color Palette Reference](references/design-system.md#color-palette-reference) to select a palette matching the topic and audience. Use the [Font Reference](references/design-system.md#font-reference) to choose a font pairing.
69
+
70
+ ### Step 3: Select Design Style
71
+
72
+ Use the [Style Recipes](references/design-system.md#style-recipes) to choose a visual style (Sharp, Soft, Rounded, or Pill) matching the presentation tone.
73
+
74
+ ### Step 4: Plan Slide Outline
75
+
76
+ Classify **every slide** as exactly one of the [5 page types](references/slide-types.md). Plan the content and layout for each slide. Ensure visual variety — do NOT repeat the same layout across slides.
77
+
78
+ ### Step 5: Generate Slide JS Files
79
+
80
+ Create one JS file per slide in `slides/` directory. Each file must export a synchronous `createSlide(pres, theme)` function. Follow the [Slide Output Format](#slide-output-format) and the type-specific guidance in [slide-types.md](references/slide-types.md). Generate up to 5 slides concurrently using subagents if available.
81
+
82
+ **Tell each subagent:**
83
+ 1. File naming: `slides/slide-01.js`, `slides/slide-02.js`, etc.
84
+ 2. Images go in: `slides/imgs/`
85
+ 3. Final PPTX goes in: `slides/output/`
86
+ 4. Dimensions: 10" x 5.625" (LAYOUT_16x9)
87
+ 5. Fonts: Chinese = Microsoft YaHei, English = Arial (or approved alternative)
88
+ 6. Colors: 6-char hex without # (e.g. `"FF0000"`)
89
+ 7. Must use the theme object contract (see [Theme Object Contract](#theme-object-contract))
90
+ 8. Must follow the [PptxGenJS API reference](references/pptxgenjs.md)
91
+
92
+ ### Step 6: Compile into Final PPTX
93
+
94
+ Create `slides/compile.js` to combine all slide modules:
95
+
96
+ ```javascript
97
+ // slides/compile.js
98
+ const pptxgen = require('pptxgenjs');
99
+ const pres = new pptxgen();
100
+ pres.layout = 'LAYOUT_16x9';
101
+
102
+ const theme = {
103
+ primary: "22223b", // dark color for backgrounds/text
104
+ secondary: "4a4e69", // secondary accent
105
+ accent: "9a8c98", // highlight color
106
+ light: "c9ada7", // light accent
107
+ bg: "f2e9e4" // background color
108
+ };
109
+
110
+ for (let i = 1; i <= 12; i++) { // adjust count as needed
111
+ const num = String(i).padStart(2, '0');
112
+ const slideModule = require(`./slide-${num}.js`);
113
+ slideModule.createSlide(pres, theme);
114
+ }
115
+
116
+ pres.writeFile({ fileName: './output/presentation.pptx' });
117
+ ```
118
+
119
+ Run with: `cd slides && node compile.js`
120
+
121
+ ### Step 7: QA (Required)
122
+
123
+ See [QA Process](references/pitfalls.md#qa-process).
124
+
125
+ ### Output Structure
126
+
127
+ ```
128
+ slides/
129
+ ├── slide-01.js # Slide modules
130
+ ├── slide-02.js
131
+ ├── ...
132
+ ├── imgs/ # Images used in slides
133
+ └── output/ # Final artifacts
134
+ └── presentation.pptx
135
+ ```
136
+
137
+ ---
138
+
139
+ ## Slide Output Format
140
+
141
+ Each slide is a **complete, runnable JS file**:
142
+
143
+ ```javascript
144
+ // slide-01.js
145
+ const pptxgen = require("pptxgenjs");
146
+
147
+ const slideConfig = {
148
+ type: 'cover',
149
+ index: 1,
150
+ title: 'Presentation Title'
151
+ };
152
+
153
+ // MUST be synchronous (not async)
154
+ function createSlide(pres, theme) {
155
+ const slide = pres.addSlide();
156
+ slide.background = { color: theme.bg };
157
+
158
+ slide.addText(slideConfig.title, {
159
+ x: 0.5, y: 2, w: 9, h: 1.2,
160
+ fontSize: 48, fontFace: "Arial",
161
+ color: theme.primary, bold: true, align: "center"
162
+ });
163
+
164
+ return slide;
165
+ }
166
+
167
+ // Standalone preview - use slide-specific filename
168
+ if (require.main === module) {
169
+ const pres = new pptxgen();
170
+ pres.layout = 'LAYOUT_16x9';
171
+ const theme = {
172
+ primary: "22223b",
173
+ secondary: "4a4e69",
174
+ accent: "9a8c98",
175
+ light: "c9ada7",
176
+ bg: "f2e9e4"
177
+ };
178
+ createSlide(pres, theme);
179
+ pres.writeFile({ fileName: "slide-01-preview.pptx" });
180
+ }
181
+
182
+ module.exports = { createSlide, slideConfig };
183
+ ```
184
+
185
+ ---
186
+
187
+ ## Theme Object Contract (MANDATORY)
188
+
189
+ The compile script passes a theme object with these **exact keys**:
190
+
191
+ | Key | Purpose | Example |
192
+ |-----|---------|---------|
193
+ | `theme.primary` | Darkest color, titles | `"22223b"` |
194
+ | `theme.secondary` | Dark accent, body text | `"4a4e69"` |
195
+ | `theme.accent` | Mid-tone accent | `"9a8c98"` |
196
+ | `theme.light` | Light accent | `"c9ada7"` |
197
+ | `theme.bg` | Background color | `"f2e9e4"` |
198
+
199
+ **NEVER use other key names** like `background`, `text`, `muted`, `darkest`, `lightest`.
200
+
201
+ ---
202
+
203
+ ## Page Number Badge (REQUIRED)
204
+
205
+ All slides **except Cover Page** MUST include a page number badge in the bottom-right corner.
206
+
207
+ - **Position**: x: 9.3", y: 5.1"
208
+ - Show current number only (e.g. `3` or `03`), NOT "3/12"
209
+ - Use palette colors, keep subtle
210
+
211
+ ### Circle Badge (Default)
212
+
213
+ ```javascript
214
+ slide.addShape(pres.shapes.OVAL, {
215
+ x: 9.3, y: 5.1, w: 0.4, h: 0.4,
216
+ fill: { color: theme.accent }
217
+ });
218
+ slide.addText("3", {
219
+ x: 9.3, y: 5.1, w: 0.4, h: 0.4,
220
+ fontSize: 12, fontFace: "Arial",
221
+ color: "FFFFFF", bold: true,
222
+ align: "center", valign: "middle"
223
+ });
224
+ ```
225
+
226
+ ### Pill Badge
227
+
228
+ ```javascript
229
+ slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
230
+ x: 9.1, y: 5.15, w: 0.6, h: 0.35,
231
+ fill: { color: theme.accent },
232
+ rectRadius: 0.15
233
+ });
234
+ slide.addText("03", {
235
+ x: 9.1, y: 5.15, w: 0.6, h: 0.35,
236
+ fontSize: 11, fontFace: "Arial",
237
+ color: "FFFFFF", bold: true,
238
+ align: "center", valign: "middle"
239
+ });
240
+ ```
241
+
242
+ ---
243
+
244
+ ## Dependencies
245
+
246
+ - `pip install "markitdown[pptx]"` — text extraction
247
+ - `npm install -g pptxgenjs` — creating from scratch
248
+ - `npm install -g react-icons react react-dom sharp` — icons (optional)