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,691 +0,0 @@
1
- # Build New xlsx from Scratch
2
-
3
- Create new, production-quality xlsx files using the XML approach. NEVER use openpyxl
4
- for writing. NEVER hardcode Python-computed values — every derived number must be a
5
- live Excel formula.
6
-
7
- ---
8
-
9
- ## When to Use This Path
10
-
11
- Use this document when the user wants:
12
- - A brand-new Excel file that does not yet exist
13
- - A generated report, financial model, or data table
14
- - Any "create / build / generate / make" request
15
-
16
- If the user provides an existing file to modify, switch to `edit.md` instead.
17
-
18
- ---
19
-
20
- ## The Non-Negotiable Rules
21
-
22
- Before touching any file, internalize these four rules:
23
-
24
- 1. **Formula-First**: Every calculated value (`SUM`, growth rate, ratio, subtotal, etc.)
25
- MUST be written as `<f>SUM(B2:B9)</f>`, not as a hardcoded `<v>5000</v>`. Hardcoded
26
- numbers go stale when source data changes. Only raw inputs and assumption parameters
27
- may be hardcoded values.
28
-
29
- 2. **No openpyxl for writing**: The entire file is built by editing XML directly. Python
30
- is only allowed for reading/analysis (`pandas.read_excel()`) and for running helper
31
- scripts (`xlsx_pack.py`, `formula_check.py`).
32
-
33
- 3. **Style encodes meaning**: Blue font = user input/assumption. Black font = formula
34
- result. Green font = cross-sheet reference. See `format.md` for the full color system
35
- and style index table.
36
-
37
- 4. **Validate before delivery**: Run `formula_check.py` and fix all errors before
38
- handing the file to the user.
39
-
40
- ---
41
-
42
- ## Complete Creation Workflow
43
-
44
- ### Step 1 — Plan Before Writing
45
-
46
- Define the full structure on paper before touching any XML:
47
-
48
- - **Sheets**: names, order, purpose (e.g., Assumptions / Model / Summary)
49
- - **Layout per sheet**: which rows are headers, inputs, formulas, totals
50
- - **String inventory**: collect all text labels you will need in sharedStrings
51
- - **Style choices**: what number format each column needs (currency, %, integer, year)
52
- - **Cross-sheet links**: which sheets pull data from other sheets
53
-
54
- This planning step prevents the costly cycle of adding strings to sharedStrings
55
- mid-way and recomputing all indices.
56
-
57
- ---
58
-
59
- ### Step 2 — Copy Minimal Template
60
-
61
- ```bash
62
- cp -r SKILL_DIR/templates/minimal_xlsx/ /tmp/xlsx_work/
63
- ```
64
-
65
- The template gives you a complete, valid 7-file xlsx skeleton:
66
-
67
- ```
68
- /tmp/xlsx_work/
69
- ├── [Content_Types].xml ← MIME type registry
70
- ├── _rels/
71
- │ └── .rels ← root relationship (points to workbook.xml)
72
- └── xl/
73
- ├── workbook.xml ← sheet list and calc settings
74
- ├── styles.xml ← 13 pre-built financial style slots
75
- ├── sharedStrings.xml ← text string table (starts empty)
76
- ├── _rels/
77
- │ └── workbook.xml.rels ← maps rId → file paths
78
- └── worksheets/
79
- └── sheet1.xml ← one empty sheet
80
- ```
81
-
82
- After copying, rename sheets and add content. Do not create files from scratch —
83
- always start from the template.
84
-
85
- ---
86
-
87
- ### Step 3 — Configure Sheet Structure
88
-
89
- #### Single-Sheet Workbook
90
-
91
- The template already has one sheet named "Sheet1". Just change the `name` attribute
92
- in `xl/workbook.xml`:
93
-
94
- ```xml
95
- <sheets>
96
- <sheet name="Revenue Model" sheetId="1" r:id="rId1"/>
97
- </sheets>
98
- ```
99
-
100
- No other files need to change for a single-sheet workbook.
101
-
102
- #### Multi-Sheet Workbook
103
-
104
- Four files must be kept in sync. Work through them in this order:
105
-
106
- **IMPORTANT — rId collision rule**: In the template's `workbook.xml.rels`, the IDs
107
- `rId1`, `rId2`, and `rId3` are already taken:
108
- - `rId1` → `worksheets/sheet1.xml`
109
- - `rId2` → `styles.xml`
110
- - `rId3` → `sharedStrings.xml`
111
-
112
- New worksheet entries MUST start at `rId4` and count upward.
113
-
114
- **File 1 of 4 — `xl/workbook.xml`** (sheet list):
115
-
116
- ```xml
117
- <sheets>
118
- <sheet name="Assumptions" sheetId="1" r:id="rId1"/>
119
- <sheet name="Model" sheetId="2" r:id="rId4"/>
120
- <sheet name="Summary" sheetId="3" r:id="rId5"/>
121
- </sheets>
122
- ```
123
-
124
- Special characters in sheet names:
125
- - `&` → `&amp;` in XML: `<sheet name="P&amp;L" .../>`
126
- - Max 31 characters
127
- - Forbidden: `/ \ ? * [ ] :`
128
- - Sheet names with spaces need single quotes in formula references: `'Q1 Data'!B5`
129
-
130
- **File 2 of 4 — `xl/_rels/workbook.xml.rels`** (ID → file mapping):
131
-
132
- ```xml
133
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
134
- <Relationship Id="rId1"
135
- Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
136
- Target="worksheets/sheet1.xml"/>
137
- <Relationship Id="rId2"
138
- Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"
139
- Target="styles.xml"/>
140
- <Relationship Id="rId3"
141
- Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings"
142
- Target="sharedStrings.xml"/>
143
- <Relationship Id="rId4"
144
- Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
145
- Target="worksheets/sheet2.xml"/>
146
- <Relationship Id="rId5"
147
- Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
148
- Target="worksheets/sheet3.xml"/>
149
- </Relationships>
150
- ```
151
-
152
- **File 3 of 4 — `[Content_Types].xml`** (MIME type declarations):
153
-
154
- ```xml
155
- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
156
- <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
157
- <Default Extension="xml" ContentType="application/xml"/>
158
- <Override PartName="/xl/workbook.xml"
159
- ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>
160
- <Override PartName="/xl/worksheets/sheet1.xml"
161
- ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>
162
- <Override PartName="/xl/worksheets/sheet2.xml"
163
- ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>
164
- <Override PartName="/xl/worksheets/sheet3.xml"
165
- ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>
166
- <Override PartName="/xl/styles.xml"
167
- ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>
168
- <Override PartName="/xl/sharedStrings.xml"
169
- ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>
170
- </Types>
171
- ```
172
-
173
- **File 4 of 4 — Create new worksheet XML files**
174
-
175
- Copy `sheet1.xml` to `sheet2.xml` and `sheet3.xml`, then clear the `<sheetData>` content:
176
-
177
- ```xml
178
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
179
- <worksheet
180
- xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
181
- xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
182
- <sheetViews>
183
- <sheetView workbookViewId="0"/>
184
- </sheetViews>
185
- <sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"
186
- xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"/>
187
- <sheetData>
188
- <!-- Data rows go here -->
189
- </sheetData>
190
- <pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/>
191
- </worksheet>
192
- ```
193
-
194
- **Sync checklist** — every time you add a sheet, verify all four are consistent:
195
-
196
- | Check | What to verify |
197
- |-------|---------------|
198
- | `workbook.xml` | New `<sheet name="..." sheetId="N" r:id="rIdX"/>` exists |
199
- | `workbook.xml.rels` | New `<Relationship Id="rIdX" ... Target="worksheets/sheetN.xml"/>` exists |
200
- | `[Content_Types].xml` | New `<Override PartName="/xl/worksheets/sheetN.xml" .../>` exists |
201
- | Filesystem | `xl/worksheets/sheetN.xml` file actually exists |
202
-
203
- ---
204
-
205
- ### Step 4 — Populate sharedStrings
206
-
207
- All text values (headers, row labels, category names, any string the user will read)
208
- must be stored in `xl/sharedStrings.xml`. Cells reference them by 0-based index.
209
-
210
- **Recommended workflow**: collect ALL text you need first, write the complete table once,
211
- then fill in indices while writing worksheet XML. This avoids re-counting indices mid-way.
212
-
213
- ```xml
214
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
215
- <sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
216
- count="10" uniqueCount="10">
217
- <si><t>Item</t></si> <!-- index 0 -->
218
- <si><t>FY2023A</t></si> <!-- index 1 -->
219
- <si><t>FY2024E</t></si> <!-- index 2 -->
220
- <si><t>FY2025E</t></si> <!-- index 3 -->
221
- <si><t>YoY Growth</t></si> <!-- index 4 -->
222
- <si><t>Revenue</t></si> <!-- index 5 -->
223
- <si><t>Cost of Goods Sold</t></si> <!-- index 6 -->
224
- <si><t>Gross Profit</t></si> <!-- index 7 -->
225
- <si><t>EBITDA</t></si> <!-- index 8 -->
226
- <si><t>Net Income</t></si> <!-- index 9 -->
227
- </sst>
228
- ```
229
-
230
- **Attribute rules**:
231
- - `uniqueCount` = number of `<si>` elements (unique strings in the table)
232
- - `count` = total number of cell references to strings across the entire workbook
233
- (if "Revenue" appears in 3 sheets, count is `uniqueCount + 2`)
234
- - For new files where each string appears once, `count == uniqueCount`
235
- - Both attributes MUST be accurate — wrong values trigger warnings in some Excel versions
236
-
237
- **Special character escaping**:
238
-
239
- ```xml
240
- <si><t>R&amp;D Expenses</t></si> <!-- & must be &amp; -->
241
- <si><t>Revenue &lt; Target</t></si> <!-- < must be &lt; -->
242
- <si><t xml:space="preserve"> (note) </t></si> <!-- preserve leading/trailing spaces -->
243
- ```
244
-
245
- **Helper script**: use `shared_strings_builder.py` to generate the complete
246
- `sharedStrings.xml` from a plain list of strings:
247
-
248
- ```bash
249
- python3 SKILL_DIR/scripts/shared_strings_builder.py \
250
- "Item" "FY2024" "FY2025" "Revenue" "Gross Profit" \
251
- > /tmp/xlsx_work/xl/sharedStrings.xml
252
- ```
253
-
254
- Or interactively from a file listing one string per line:
255
-
256
- ```bash
257
- python3 SKILL_DIR/scripts/shared_strings_builder.py --file strings.txt \
258
- > /tmp/xlsx_work/xl/sharedStrings.xml
259
- ```
260
-
261
- ---
262
-
263
- ### Step 5 — Write Worksheet Data
264
-
265
- Edit each `xl/worksheets/sheetN.xml`. Replace the empty `<sheetData>` with rows
266
- and cells.
267
-
268
- #### Cell XML Anatomy
269
-
270
- ```
271
- <c r="B5" t="s" s="4">
272
- ↑ ↑ ↑
273
- address type style index (from cellXfs in styles.xml)
274
-
275
- <v>3</v>
276
-
277
- value (for t="s": sharedStrings index; for numbers: the number itself)
278
- ```
279
-
280
- #### Data Type Reference
281
-
282
- | Data | `t` attr | XML Example | Notes |
283
- |------|---------|-------------|-------|
284
- | Shared string (text) | `s` | `<c r="A1" t="s" s="4"><v>0</v></c>` | `<v>` = sharedStrings index |
285
- | Number | omit | `<c r="B2" s="5"><v>1000000</v></c>` | default type, `t` omitted |
286
- | Percentage (as decimal) | omit | `<c r="C2" s="7"><v>0.125</v></c>` | 12.5% stored as 0.125 |
287
- | Boolean | `b` | `<c r="D1" t="b"><v>1</v></c>` | 1=TRUE, 0=FALSE |
288
- | Formula | omit | `<c r="B4" s="2"><f>SUM(B2:B3)</f><v></v></c>` | `<v>` left empty |
289
- | Cross-sheet formula | omit | `<c r="C1" s="3"><f>Assumptions!B2</f><v></v></c>` | use s=3 (green) |
290
-
291
- #### A Full Sheet Data Example
292
-
293
- ```xml
294
- <cols>
295
- <col min="1" max="1" width="26" customWidth="1"/> <!-- A: label column -->
296
- <col min="2" max="5" width="14" customWidth="1"/> <!-- B-E: data columns -->
297
- </cols>
298
- <sheetData>
299
-
300
- <!-- Row 1: headers (style 4 = bold header) -->
301
- <row r="1" ht="18" customHeight="1">
302
- <c r="A1" t="s" s="4"><v>0</v></c> <!-- "Item" -->
303
- <c r="B1" t="s" s="4"><v>1</v></c> <!-- "FY2023A" -->
304
- <c r="C1" t="s" s="4"><v>2</v></c> <!-- "FY2024E" -->
305
- <c r="D1" t="s" s="4"><v>3</v></c> <!-- "FY2025E" -->
306
- <c r="E1" t="s" s="4"><v>4</v></c> <!-- "YoY Growth" -->
307
- </row>
308
-
309
- <!-- Row 2: Revenue — actual value (input) + formula (computed) -->
310
- <row r="2">
311
- <c r="A2" t="s" s="1"><v>5</v></c> <!-- "Revenue", blue input label -->
312
- <c r="B2" s="5"><v>85000000</v></c> <!-- FY2023A actual: $85M, currency input -->
313
- <c r="C2" s="6"><f>B2*(1+Assumptions!C3)</f><v></v></c> <!-- formula, currency -->
314
- <c r="D2" s="6"><f>C2*(1+Assumptions!D3)</f><v></v></c>
315
- <c r="E2" s="8"><f>D2/C2-1</f><v></v></c> <!-- YoY growth, percentage formula -->
316
- </row>
317
-
318
- <!-- Row 3: Gross Profit -->
319
- <row r="3">
320
- <c r="A3" t="s" s="2"><v>7</v></c> <!-- "Gross Profit", black formula label -->
321
- <c r="B3" s="6"><f>B2*Assumptions!B4</f><v></v></c>
322
- <c r="C3" s="6"><f>C2*Assumptions!C4</f><v></v></c>
323
- <c r="D3" s="6"><f>D2*Assumptions!D4</f><v></v></c>
324
- <c r="E3" s="8"><f>D3/C3-1</f><v></v></c>
325
- </row>
326
-
327
- <!-- Row 5: SUM total row -->
328
- <row r="5">
329
- <c r="A5" t="s" s="4"><v>8</v></c> <!-- "EBITDA" -->
330
- <c r="B5" s="6"><f>SUM(B2:B4)</f><v></v></c>
331
- <c r="C5" s="6"><f>SUM(C2:C4)</f><v></v></c>
332
- <c r="D5" s="6"><f>SUM(D2:D4)</f><v></v></c>
333
- <c r="E5" s="8"><f>D5/C5-1</f><v></v></c>
334
- </row>
335
-
336
- </sheetData>
337
- ```
338
-
339
- #### Column Width and Freeze Pane
340
-
341
- Column widths go **before** `<sheetData>`, freeze pane goes inside `<sheetView>`:
342
-
343
- ```xml
344
- <!-- Inside <sheetViews><sheetView ...> — freeze the header row -->
345
- <pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/>
346
-
347
- <!-- Before <sheetData> — set column widths -->
348
- <cols>
349
- <col min="1" max="1" width="28" customWidth="1"/>
350
- <col min="2" max="8" width="14" customWidth="1"/>
351
- </cols>
352
- ```
353
-
354
- ---
355
-
356
- ### Step 6 — Apply Styles
357
-
358
- The template's `xl/styles.xml` has 13 pre-built semantic style slots (indices 0–12).
359
- **Read `format.md` for the complete style index table, color system, and how to add new styles.**
360
-
361
- Quick reference for the most common slots:
362
-
363
- | `s` | Role | Example |
364
- |-----|------|---------|
365
- | 4 | Header (bold) | Column/row titles |
366
- | 5 / 6 | Currency input (blue) / formula (black) | `$#,##0` |
367
- | 7 / 8 | Percentage input / formula | `0.0%` |
368
- | 11 | Year (no comma) | 2024 not 2,024 |
369
-
370
- Design principle: Blue = human sets this. Black = Excel computes this. Green = cross-sheet.
371
-
372
- If you need a style not in the 13 pre-built slots, follow the append-only procedure in `format.md` section 3.2.
373
-
374
- ---
375
-
376
- ### Step 7 — Formula Cookbook
377
-
378
- #### XML Formula Syntax Reminder
379
-
380
- Formulas in XML have **no leading `=`**:
381
-
382
- ```xml
383
- <!-- Excel UI: =SUM(B2:B9) → XML: -->
384
- <c r="B10" s="6"><f>SUM(B2:B9)</f><v></v></c>
385
- ```
386
-
387
- #### Basic Aggregations
388
-
389
- ```xml
390
- <c r="B10" s="6"><f>SUM(B2:B9)</f><v></v></c>
391
- <c r="B11" s="6"><f>AVERAGE(B2:B9)</f><v></v></c>
392
- <c r="B12" s="10"><f>COUNT(B2:B9)</f><v></v></c>
393
- <c r="B13" s="10"><f>COUNTA(A2:A100)</f><v></v></c>
394
- <c r="B14" s="6"><f>MAX(B2:B9)</f><v></v></c>
395
- <c r="B15" s="6"><f>MIN(B2:B9)</f><v></v></c>
396
- ```
397
-
398
- #### Financial Calculations
399
-
400
- ```xml
401
- <!-- YoY growth rate: current / prior - 1 -->
402
- <c r="E5" s="8"><f>D5/C5-1</f><v></v></c>
403
-
404
- <!-- Gross profit: revenue × gross margin -->
405
- <c r="B6" s="6"><f>B4*B3</f><v></v></c>
406
-
407
- <!-- EBITDA margin: EBITDA / Revenue -->
408
- <c r="B9" s="8"><f>B8/B4</f><v></v></c>
409
-
410
- <!-- Suppress #DIV/0! when denominator may be zero -->
411
- <c r="E5" s="8"><f>IF(C5=0,0,D5/C5-1)</f><v></v></c>
412
-
413
- <!-- NPV and IRR (cash flows in B2:B7, discount rate in B1) -->
414
- <c r="C1" s="6"><f>NPV(B1,B3:B7)+B2</f><v></v></c>
415
- <c r="C2" s="8"><f>IRR(B2:B7)</f><v></v></c>
416
- ```
417
-
418
- #### Cross-Sheet References
419
-
420
- ```xml
421
- <!-- No spaces in name: no quotes needed -->
422
- <c r="B3" s="3"><f>Assumptions!B5</f><v></v></c>
423
-
424
- <!-- Space in sheet name: single quotes required -->
425
- <c r="B3" s="3"><f>'Q1 Data'!B5</f><v></v></c>
426
-
427
- <!-- Ampersand in sheet name (XML-escaped in workbook.xml, but in formula: literal &) -->
428
- <c r="B3" s="3"><f>'R&amp;D'!B5</f><v></v></c>
429
-
430
- <!-- Cross-sheet range: SUM of a range in another sheet -->
431
- <c r="B10" s="6"><f>SUM(Data!C2:C1000)</f><v></v></c>
432
-
433
- <!-- 3D reference: sum same cell across multiple sheets -->
434
- <c r="B5" s="6"><f>SUM(Jan:Dec!B5)</f><v></v></c>
435
- ```
436
-
437
- Cross-sheet formula cells should use `s="3"` (green) to signal the data origin.
438
-
439
- #### Shared Formulas (Same Pattern Repeated Down a Column)
440
-
441
- When many consecutive cells share the same formula structure with only the row number
442
- changing, use shared formulas to keep the XML compact:
443
-
444
- ```xml
445
- <!-- D2: defines the shared group (si="0", ref="D2:D11") -->
446
- <c r="D2" s="8"><f t="shared" ref="D2:D11" si="0">C2/B2-1</f><v></v></c>
447
-
448
- <!-- D3 through D11: reference the same group, no formula text needed -->
449
- <c r="D3" s="8"><f t="shared" si="0"/><v></v></c>
450
- <c r="D4" s="8"><f t="shared" si="0"/><v></v></c>
451
- <c r="D5" s="8"><f t="shared" si="0"/><v></v></c>
452
- <c r="D6" s="8"><f t="shared" si="0"/><v></v></c>
453
- <c r="D7" s="8"><f t="shared" si="0"/><v></v></c>
454
- <c r="D8" s="8"><f t="shared" si="0"/><v></v></c>
455
- <c r="D9" s="8"><f t="shared" si="0"/><v></v></c>
456
- <c r="D10" s="8"><f t="shared" si="0"/><v></v></c>
457
- <c r="D11" s="8"><f t="shared" si="0"/><v></v></c>
458
- ```
459
-
460
- Excel adjusts relative references automatically (D3 computes `C3/B3-1`, etc.).
461
- If you have multiple shared formula groups, assign sequential `si` values (0, 1, 2, …).
462
-
463
- #### Absolute References
464
-
465
- ```xml
466
- <!-- $B$2 locks to that cell when the formula is copied -->
467
- <c r="C5" s="8"><f>B5/$B$2</f><v></v></c>
468
- ```
469
-
470
- The `$` character needs no XML escaping — write it literally.
471
-
472
- #### Lookup Formulas
473
-
474
- ```xml
475
- <!-- VLOOKUP: exact match (last arg 0) -->
476
- <c r="C5" s="6"><f>VLOOKUP(A5,Assumptions!A:C,2,0)</f><v></v></c>
477
-
478
- <!-- INDEX/MATCH: more flexible -->
479
- <c r="C5" s="6"><f>INDEX(B:B,MATCH(A5,A:A,0))</f><v></v></c>
480
-
481
- <!-- XLOOKUP (Excel 2019+) -->
482
- <c r="C5" s="6"><f>XLOOKUP(A5,A:A,B:B)</f><v></v></c>
483
- ```
484
-
485
- ---
486
-
487
- ### Step 8 — Pack and Validate
488
-
489
- **Pack**:
490
-
491
- ```bash
492
- python3 SKILL_DIR/scripts/xlsx_pack.py /tmp/xlsx_work/ /path/to/output.xlsx
493
- ```
494
-
495
- `xlsx_pack.py` will:
496
- 1. Check that `[Content_Types].xml` exists at the root
497
- 2. Parse every `.xml` and `.rels` file for well-formedness — abort if any fail
498
- 3. Create the ZIP archive with correct compression
499
-
500
- **Validate**:
501
-
502
- ```bash
503
- python3 SKILL_DIR/scripts/formula_check.py /path/to/output.xlsx
504
- ```
505
-
506
- `formula_check.py` will:
507
- 1. Scan every cell for `<c t="e">` entries (cached error values) — all 7 error types
508
- 2. Extract sheet name references from every `<f>` formula
509
- 3. Verify each referenced sheet exists in `workbook.xml`
510
-
511
- Fix every reported error before delivery. Exit code 0 = safe to deliver.
512
-
513
- ---
514
-
515
- ## Pre-Delivery Checklist
516
-
517
- Run through this list before handing the file to the user:
518
-
519
- - [ ] `formula_check.py` reports 0 errors
520
- - [ ] Every calculated cell has `<f>` — not just `<v>` with a number
521
- - [ ] `sharedStrings.xml` `count` and `uniqueCount` match actual `<si>` count
522
- - [ ] Every cell `s` attribute value is in range `0` to `cellXfs count - 1`
523
- - [ ] Every sheet in `workbook.xml` has a matching entry in `workbook.xml.rels`
524
- - [ ] Every `worksheets/sheetN.xml` file has a matching `<Override>` in `[Content_Types].xml`
525
- - [ ] Year columns use `s="11"` (format `0`, no thousands separator)
526
- - [ ] Cross-sheet reference formulas use `s="3"` (green font)
527
- - [ ] Assumption inputs use `s="1"` or `s="5"` or `s="7"` (blue font)
528
-
529
- ---
530
-
531
- ## Common Mistakes and Fixes
532
-
533
- | Mistake | Symptom | Fix |
534
- |---------|---------|-----|
535
- | Formula has leading `=` | Cell shows `=SUM(...)` as text | Remove `=` from `<f>` content |
536
- | sharedStrings `count` not updated | Excel warning or blank cells | Count `<si>` elements, update both `count` and `uniqueCount` |
537
- | Style index out of range | File corruption / Excel repair | Ensure `s` < `cellXfs count`; append new `<xf>` if needed |
538
- | New sheet rId conflicts with styles/sharedStrings rId | Sheet missing or styles lost | New sheets use rId4, rId5, … (rId1-3 are reserved in template) |
539
- | Sheet name has `&` unescaped in XML | XML parse error | Use `&amp;` in `workbook.xml` name attribute |
540
- | Cross-sheet ref to sheet with space, no quotes | `#REF!` error | Wrap sheet name in single quotes: `'Sheet Name'!B5` |
541
- | Cross-sheet ref to non-existent sheet | `#REF!` error | Check `workbook.xml` sheet list vs formula |
542
- | Number stored as text (`t="s"`) | Left-aligned, can't sum | Remove `t` attribute from number cells |
543
- | Year displayed as `2,024` | Readability issue | Use `s="11"` (numFmtId=1, format `0`) |
544
- | Hardcoded Python result instead of formula | "Dead table" — won't update | Replace `<v>N</v>` with `<f>formula</f><v></v>` |
545
-
546
- ---
547
-
548
- ## Column Letter Reference
549
-
550
- | Col # | Letter | Col # | Letter | Col # | Letter |
551
- |-------|--------|-------|--------|-------|--------|
552
- | 1 | A | 26 | Z | 27 | AA |
553
- | 28 | AB | 52 | AZ | 53 | BA |
554
- | 54 | BB | 78 | BZ | 79 | CA |
555
-
556
- Python conversion (use when building formulas programmatically):
557
-
558
- ```python
559
- def col_letter(n: int) -> str:
560
- """Convert 1-based column number to Excel letter (A, B, ..., Z, AA, AB, ...)."""
561
- result = ""
562
- while n > 0:
563
- n, rem = divmod(n - 1, 26)
564
- result = chr(65 + rem) + result
565
- return result
566
-
567
- def col_number(s: str) -> int:
568
- """Convert Excel column letter to 1-based number."""
569
- n = 0
570
- for c in s.upper():
571
- n = n * 26 + (ord(c) - 64)
572
- return n
573
- ```
574
-
575
- ---
576
-
577
- ## Typical Scenario Walkthroughs
578
-
579
- ### Scenario A — Three-Year Financial Model (Single Sheet)
580
-
581
- Layout: rows 1-12 = Assumptions (blue inputs) / rows 14-30 = Model (black formulas).
582
-
583
- ```xml
584
- <!-- sharedStrings.xml (excerpt) -->
585
- <sst count="8" uniqueCount="8">
586
- <si><t>Metric</t></si> <!-- 0 -->
587
- <si><t>FY2023A</t></si> <!-- 1 -->
588
- <si><t>FY2024E</t></si> <!-- 2 -->
589
- <si><t>FY2025E</t></si> <!-- 3 -->
590
- <si><t>Revenue Growth</t></si> <!-- 4 -->
591
- <si><t>Gross Margin</t></si> <!-- 5 -->
592
- <si><t>Revenue</t></si> <!-- 6 -->
593
- <si><t>Gross Profit</t></si> <!-- 7 -->
594
- </sst>
595
-
596
- <!-- sheet1.xml (excerpt) -->
597
- <sheetData>
598
- <!-- Header -->
599
- <row r="1">
600
- <c r="A1" t="s" s="4"><v>0</v></c>
601
- <c r="B1" t="s" s="4"><v>1</v></c>
602
- <c r="C1" t="s" s="4"><v>2</v></c>
603
- <c r="D1" t="s" s="4"><v>3</v></c>
604
- </row>
605
- <!-- Assumptions (rows 2-3) -->
606
- <row r="2">
607
- <c r="A2" t="s" s="1"><v>4</v></c> <!-- "Revenue Growth", blue -->
608
- <c r="B2" s="7"><v>0</v></c> <!-- FY2023A: n/a, 0% placeholder -->
609
- <c r="C2" s="7"><v>0.12</v></c> <!-- FY2024E: 12.0% input -->
610
- <c r="D2" s="7"><v>0.15</v></c> <!-- FY2025E: 15.0% input -->
611
- </row>
612
- <row r="3">
613
- <c r="A3" t="s" s="1"><v>5</v></c> <!-- "Gross Margin", blue -->
614
- <c r="B3" s="7"><v>0.45</v></c>
615
- <c r="C3" s="7"><v>0.46</v></c>
616
- <c r="D3" s="7"><v>0.47</v></c>
617
- </row>
618
- <!-- Model (rows 14-15) -->
619
- <row r="14">
620
- <c r="A14" t="s" s="2"><v>6</v></c> <!-- "Revenue", black -->
621
- <c r="B14" s="5"><v>85000000</v></c> <!-- actual, currency input -->
622
- <c r="C14" s="6"><f>B14*(1+C2)</f><v></v></c>
623
- <c r="D14" s="6"><f>C14*(1+D2)</f><v></v></c>
624
- </row>
625
- <row r="15">
626
- <c r="A15" t="s" s="2"><v>7</v></c> <!-- "Gross Profit", black -->
627
- <c r="B15" s="6"><f>B14*B3</f><v></v></c>
628
- <c r="C15" s="6"><f>C14*C3</f><v></v></c>
629
- <c r="D15" s="6"><f>D14*D3</f><v></v></c>
630
- </row>
631
- </sheetData>
632
- ```
633
-
634
- ### Scenario B — Data + Summary (Two Sheets)
635
-
636
- The `Summary` sheet pulls from `Data` using cross-sheet formulas (green, `s="3"`):
637
-
638
- ```xml
639
- <!-- Summary/sheet2.xml sheetData excerpt -->
640
- <sheetData>
641
- <row r="1">
642
- <c r="A1" t="s" s="4"><v>0</v></c> <!-- "Metric" -->
643
- <c r="B1" t="s" s="4"><v>1</v></c> <!-- "Value" -->
644
- </row>
645
- <row r="2">
646
- <c r="A2" t="s" s="0"><v>2</v></c> <!-- "Total Revenue" -->
647
- <c r="B2" s="3"><f>SUM(Data!C2:C10000)</f><v></v></c>
648
- </row>
649
- <row r="3">
650
- <c r="A3" t="s" s="0"><v>3</v></c> <!-- "Deal Count" -->
651
- <c r="B3" s="3"><f>COUNTA(Data!A2:A10000)</f><v></v></c>
652
- </row>
653
- <row r="4">
654
- <c r="A4" t="s" s="0"><v>4</v></c> <!-- "Avg Deal Size" -->
655
- <c r="B4" s="3"><f>IF(B3=0,0,B2/B3)</f><v></v></c>
656
- </row>
657
- </sheetData>
658
- ```
659
-
660
- ### Scenario C — Multi-Department Consolidation
661
-
662
- `Consolidated` sheet sums the same cells from multiple department sheets:
663
-
664
- ```xml
665
- <!-- Consolidated/sheet4.xml — summing across Dept_Eng and Dept_Mkt -->
666
- <sheetData>
667
- <row r="5">
668
- <c r="A5" t="s" s="2"><v>0</v></c>
669
- <!-- No spaces in sheet names → no quotes needed -->
670
- <c r="B5" s="3"><f>Dept_Engineering!B5+Dept_Marketing!B5</f><v></v></c>
671
- </row>
672
- <row r="6">
673
- <c r="A6" t="s" s="2"><v>1</v></c>
674
- <c r="B6" s="3"><f>SUM(Dept_Engineering!B6,Dept_Marketing!B6)</f><v></v></c>
675
- </row>
676
- </sheetData>
677
- ```
678
-
679
- ---
680
-
681
- ## What You Must NOT Do
682
-
683
- - Do NOT use openpyxl or any Python library to write the final xlsx file
684
- - Do NOT hardcode any calculated value — use `<f>` formulas for every derived number
685
- - Do NOT deliver without running `formula_check.py` first
686
- - Do NOT set a cell's `s` attribute to a value >= `cellXfs count`
687
- - Do NOT modify an existing `<xf>` entry in `styles.xml` — only append new ones
688
- - Do NOT add a new sheet without updating all four sync points (workbook.xml,
689
- workbook.xml.rels, [Content_Types].xml, actual .xml file)
690
- - Do NOT assign new worksheet rIds that overlap with rId1, rId2, or rId3 (reserved
691
- for sheet1, styles, sharedStrings in the template)