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

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/package.json +1 -1
  3. package/bin/runtime/sandbox/dim-sandbox-runner +0 -0
  4. package/bin/runtime/sandbox/manifest.json +0 -15
  5. package/bin/skills-assets/deep-investigate/SKILL.md +0 -101
  6. package/bin/skills-assets/deep-investigate/references/prompts.md +0 -75
  7. package/bin/skills-assets/deep-investigate/references/templates.md +0 -73
  8. package/bin/skills-assets/deep-investigate/references/thinking-tools.md +0 -36
  9. package/bin/skills-assets/docs-sprint/SKILL.md +0 -73
  10. package/bin/skills-assets/docs-sprint/agents/openai.yaml +0 -4
  11. package/bin/skills-assets/docs-sprint/references/contract-discipline.md +0 -30
  12. package/bin/skills-assets/docs-sprint/references/delivery-plan.md +0 -162
  13. package/bin/skills-assets/docs-sprint/references/documentation-system.md +0 -109
  14. package/bin/skills-assets/docs-sprint/references/ui-layout.md +0 -73
  15. package/bin/skills-assets/docs-sprint/references/worktree-guide.md +0 -45
  16. package/bin/skills-assets/docx/SKILL.md +0 -273
  17. package/bin/skills-assets/docx/assets/styles/academic_styles.xml +0 -250
  18. package/bin/skills-assets/docx/assets/styles/corporate_styles.xml +0 -284
  19. package/bin/skills-assets/docx/assets/styles/default_styles.xml +0 -449
  20. package/bin/skills-assets/docx/assets/xsd/aesthetic-rules.xsd +0 -470
  21. package/bin/skills-assets/docx/assets/xsd/business-rules.xsd +0 -130
  22. package/bin/skills-assets/docx/assets/xsd/common-types.xsd +0 -159
  23. package/bin/skills-assets/docx/assets/xsd/wml-subset.xsd +0 -589
  24. package/bin/skills-assets/docx/references/cjk_typography.md +0 -357
  25. package/bin/skills-assets/docx/references/cjk_university_template_guide.md +0 -184
  26. package/bin/skills-assets/docx/references/comments_guide.md +0 -191
  27. package/bin/skills-assets/docx/references/design_good_bad_examples.md +0 -829
  28. package/bin/skills-assets/docx/references/design_principles.md +0 -819
  29. package/bin/skills-assets/docx/references/openxml_element_order.md +0 -308
  30. package/bin/skills-assets/docx/references/openxml_encyclopedia_part1.md +0 -4061
  31. package/bin/skills-assets/docx/references/openxml_encyclopedia_part2.md +0 -2820
  32. package/bin/skills-assets/docx/references/openxml_encyclopedia_part3.md +0 -3381
  33. package/bin/skills-assets/docx/references/openxml_namespaces.md +0 -82
  34. package/bin/skills-assets/docx/references/openxml_units.md +0 -72
  35. package/bin/skills-assets/docx/references/scenario_a_create.md +0 -284
  36. package/bin/skills-assets/docx/references/scenario_b_edit_content.md +0 -295
  37. package/bin/skills-assets/docx/references/scenario_c_apply_template.md +0 -456
  38. package/bin/skills-assets/docx/references/track_changes_guide.md +0 -200
  39. package/bin/skills-assets/docx/references/troubleshooting.md +0 -506
  40. package/bin/skills-assets/docx/references/typography_guide.md +0 -294
  41. package/bin/skills-assets/docx/references/xsd_validation_guide.md +0 -158
  42. package/bin/skills-assets/docx/scripts/doc_to_docx.sh +0 -40
  43. package/bin/skills-assets/docx/scripts/docx_preview.sh +0 -37
  44. package/bin/skills-assets/docx/scripts/dotnet/Docx.Cli/Docx.Cli.csproj +0 -19
  45. package/bin/skills-assets/docx/scripts/dotnet/Docx.Cli/Program.cs +0 -18
  46. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/AnalyzeCommand.cs +0 -147
  47. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/ApplyTemplateCommand.cs +0 -322
  48. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/CreateCommand.cs +0 -324
  49. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/DiffCommand.cs +0 -155
  50. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/EditContentCommand.cs +0 -487
  51. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/FixOrderCommand.cs +0 -108
  52. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/MergeRunsCommand.cs +0 -122
  53. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/ValidateCommand.cs +0 -107
  54. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Docx.Core.csproj +0 -15
  55. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/CommentSynchronizer.cs +0 -169
  56. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/ElementOrder.cs +0 -80
  57. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/NamespaceConstants.cs +0 -42
  58. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/RunMerger.cs +0 -81
  59. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/StyleAnalyzer.cs +0 -81
  60. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/TrackChangesHelper.cs +0 -99
  61. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/UnitConverter.cs +0 -23
  62. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples.cs +0 -1832
  63. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch1.cs +0 -910
  64. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch2.cs +0 -999
  65. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch3.cs +0 -1048
  66. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch4.cs +0 -1038
  67. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/CharacterFormattingSamples.cs +0 -1020
  68. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/DocumentCreationSamples.cs +0 -1121
  69. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/FieldAndTocSamples.cs +0 -624
  70. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/FootnoteAndCommentSamples.cs +0 -675
  71. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/HeaderFooterSamples.cs +0 -838
  72. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ImageSamples.cs +0 -917
  73. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ListAndNumberingSamples.cs +0 -826
  74. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ParagraphFormattingSamples.cs +0 -1199
  75. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/StyleSystemSamples.cs +0 -1487
  76. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/TableSamples.cs +0 -1163
  77. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/TrackChangesSamples.cs +0 -595
  78. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/CjkHelper.cs +0 -39
  79. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/FontDefaults.cs +0 -24
  80. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/PageSizes.cs +0 -20
  81. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/BusinessRuleValidator.cs +0 -224
  82. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/GateCheckValidator.cs +0 -148
  83. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/ValidationResult.cs +0 -23
  84. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/XsdValidator.cs +0 -69
  85. package/bin/skills-assets/docx/scripts/dotnet/Docx.slnx +0 -4
  86. package/bin/skills-assets/docx/scripts/env_check.sh +0 -196
  87. package/bin/skills-assets/docx/scripts/setup.ps1 +0 -274
  88. package/bin/skills-assets/docx/scripts/setup.sh +0 -504
  89. package/bin/skills-assets/pdf/README.md +0 -222
  90. package/bin/skills-assets/pdf/SKILL.md +0 -191
  91. package/bin/skills-assets/pdf/design/design.md +0 -381
  92. package/bin/skills-assets/pdf/scripts/cover.py +0 -1579
  93. package/bin/skills-assets/pdf/scripts/fill_inspect.py +0 -200
  94. package/bin/skills-assets/pdf/scripts/fill_write.py +0 -242
  95. package/bin/skills-assets/pdf/scripts/make.sh +0 -491
  96. package/bin/skills-assets/pdf/scripts/merge.py +0 -112
  97. package/bin/skills-assets/pdf/scripts/palette.py +0 -521
  98. package/bin/skills-assets/pdf/scripts/reformat_parse.py +0 -374
  99. package/bin/skills-assets/pdf/scripts/render_body.py +0 -1052
  100. package/bin/skills-assets/pdf/scripts/render_cover.js +0 -111
  101. package/bin/skills-assets/pptx-generator/SKILL.md +0 -248
  102. package/bin/skills-assets/pptx-generator/references/design-system.md +0 -392
  103. package/bin/skills-assets/pptx-generator/references/editing.md +0 -162
  104. package/bin/skills-assets/pptx-generator/references/pitfalls.md +0 -112
  105. package/bin/skills-assets/pptx-generator/references/pptxgenjs.md +0 -420
  106. package/bin/skills-assets/pptx-generator/references/slide-types.md +0 -413
  107. package/bin/skills-assets/skill-creator/SKILL.md +0 -368
  108. package/bin/skills-assets/skill-creator/agents/openai.yaml +0 -5
  109. package/bin/skills-assets/skill-creator/assets/skill-creator-small.svg +0 -3
  110. package/bin/skills-assets/skill-creator/assets/skill-creator.png +0 -0
  111. package/bin/skills-assets/skill-creator/license.txt +0 -202
  112. package/bin/skills-assets/skill-creator/references/openai_yaml.md +0 -49
  113. package/bin/skills-assets/skill-creator/scripts/generate_openai_yaml.py +0 -226
  114. package/bin/skills-assets/skill-creator/scripts/init_skill.py +0 -397
  115. package/bin/skills-assets/skill-creator/scripts/quick_validate.py +0 -101
  116. package/bin/skills-assets/skill-installer/LICENSE.txt +0 -202
  117. package/bin/skills-assets/skill-installer/SKILL.md +0 -58
  118. package/bin/skills-assets/skill-installer/agents/openai.yaml +0 -5
  119. package/bin/skills-assets/skill-installer/assets/skill-installer-small.svg +0 -3
  120. package/bin/skills-assets/skill-installer/assets/skill-installer.png +0 -0
  121. package/bin/skills-assets/skill-installer/scripts/github_utils.py +0 -21
  122. package/bin/skills-assets/skill-installer/scripts/install-skill-from-github.py +0 -308
  123. package/bin/skills-assets/skill-installer/scripts/list-skills.py +0 -107
  124. package/bin/skills-assets/xlsx/SKILL.md +0 -137
  125. package/bin/skills-assets/xlsx/references/create.md +0 -691
  126. package/bin/skills-assets/xlsx/references/edit.md +0 -684
  127. package/bin/skills-assets/xlsx/references/fix.md +0 -37
  128. package/bin/skills-assets/xlsx/references/format.md +0 -768
  129. package/bin/skills-assets/xlsx/references/ooxml-cheatsheet.md +0 -231
  130. package/bin/skills-assets/xlsx/references/read-analyze.md +0 -97
  131. package/bin/skills-assets/xlsx/references/validate.md +0 -772
  132. package/bin/skills-assets/xlsx/scripts/formula_check.py +0 -422
  133. package/bin/skills-assets/xlsx/scripts/libreoffice_recalc.py +0 -248
  134. package/bin/skills-assets/xlsx/scripts/shared_strings_builder.py +0 -163
  135. package/bin/skills-assets/xlsx/scripts/style_audit.py +0 -575
  136. package/bin/skills-assets/xlsx/scripts/xlsx_add_column.py +0 -395
  137. package/bin/skills-assets/xlsx/scripts/xlsx_insert_row.py +0 -274
  138. package/bin/skills-assets/xlsx/scripts/xlsx_pack.py +0 -87
  139. package/bin/skills-assets/xlsx/scripts/xlsx_reader.py +0 -362
  140. package/bin/skills-assets/xlsx/scripts/xlsx_shift_rows.py +0 -396
  141. package/bin/skills-assets/xlsx/scripts/xlsx_unpack.py +0 -130
  142. package/bin/skills-assets/xlsx/templates/minimal_xlsx/[Content_Types].xml +0 -9
  143. package/bin/skills-assets/xlsx/templates/minimal_xlsx/_rels/.rels +0 -6
  144. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/_rels/workbook.xml.rels +0 -19
  145. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/sharedStrings.xml +0 -33
  146. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/styles.xml +0 -160
  147. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/workbook.xml +0 -30
  148. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/worksheets/sheet1.xml +0 -70
@@ -1,111 +0,0 @@
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
- })();
@@ -1,248 +0,0 @@
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)