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,231 +0,0 @@
1
- # OOXML SpreadsheetML Cheat Sheet
2
-
3
- Quick reference for XML manipulation of xlsx files.
4
-
5
- ---
6
-
7
- ## Package Structure
8
-
9
- ```
10
- my_file.xlsx (ZIP archive)
11
- ├── [Content_Types].xml ← declares MIME types for all files
12
- ├── _rels/
13
- │ └── .rels ← root relationship: points to xl/workbook.xml
14
- └── xl/
15
- ├── workbook.xml ← sheet list, calc settings
16
- ├── styles.xml ← ALL style definitions
17
- ├── sharedStrings.xml ← ALL text strings (referenced by index)
18
- ├── _rels/
19
- │ └── workbook.xml.rels ← maps r:id → worksheet/styles/sharedStrings files
20
- ├── worksheets/
21
- │ ├── sheet1.xml ← Sheet 1 data
22
- │ ├── sheet2.xml ← Sheet 2 data
23
- │ └── ...
24
- ├── charts/ ← chart XML (if any)
25
- ├── pivotTables/ ← pivot table XML (if any)
26
- └── theme/
27
- └── theme1.xml ← color/font theme
28
- ```
29
-
30
- ---
31
-
32
- ## Cell Reference Format
33
-
34
- ```
35
- A1 → column A (1), row 1
36
- B5 → column B (2), row 5
37
- AA1 → column 27, row 1
38
- ```
39
-
40
- Column letter ↔ number conversion:
41
- ```python
42
- def col_letter(n): # 1-based → letter
43
- r = ""
44
- while n > 0:
45
- n, rem = divmod(n - 1, 26)
46
- r = chr(65 + rem) + r
47
- return r
48
-
49
- def col_number(s): # letter → 1-based
50
- n = 0
51
- for c in s.upper():
52
- n = n * 26 + (ord(c) - 64)
53
- return n
54
- ```
55
-
56
- ---
57
-
58
- ## Cell XML Reference
59
-
60
- ### Data Types
61
-
62
- | Type | `t` attr | XML Example | Value |
63
- |------|---------|-------------|-------|
64
- | Number | omit | `<c r="B2"><v>1000</v></c>` | 1000 |
65
- | String (shared) | `s` | `<c r="A1" t="s"><v>0</v></c>` | sharedStrings[0] |
66
- | String (inline) | `inlineStr` | `<c r="A1" t="inlineStr"><is><t>Hi</t></is></c>` | "Hi" |
67
- | Boolean | `b` | `<c r="D1" t="b"><v>1</v></c>` | TRUE |
68
- | Error | `e` | `<c r="E1" t="e"><v>#REF!</v></c>` | #REF! |
69
- | Formula | omit | `<c r="B4"><f>SUM(B2:B3)</f><v></v></c>` | computed |
70
-
71
- ### Formula Types
72
-
73
- ```xml
74
- <!-- Basic formula (no leading = in XML!) -->
75
- <c r="B4"><f>SUM(B2:B3)</f><v></v></c>
76
-
77
- <!-- Cross-sheet -->
78
- <c r="C1"><f>Assumptions!B5</f><v></v></c>
79
- <c r="C1"><f>'Sheet With Spaces'!B5</f><v></v></c>
80
-
81
- <!-- Shared formula: D2:D100 all use B*C with relative row offset -->
82
- <c r="D2"><f t="shared" ref="D2:D100" si="0">B2*C2</f><v></v></c>
83
- <c r="D3"><f t="shared" si="0"/><v></v></c>
84
-
85
- <!-- Array formula -->
86
- <c r="E1"><f t="array" ref="E1:E5">SORT(A1:A5)</f><v></v></c>
87
- ```
88
-
89
- ---
90
-
91
- ## styles.xml Reference
92
-
93
- ### Indirect Reference Chain
94
-
95
- ```
96
- Cell s="3"
97
-
98
- cellXfs[3] → fontId="2", fillId="0", borderId="0", numFmtId="165"
99
- ↓ ↓ ↓ ↓ ↓
100
- fonts[2] fills[0] borders[0] numFmts: id=165
101
- blue color no fill no border "0.0%"
102
- ```
103
-
104
- ### Adding a New Style (step-by-step)
105
-
106
- 1. In `<numFmts>`: add `<numFmt numFmtId="168" formatCode="0.00%"/>`, update `count`
107
- 2. In `<fonts>`: add font entry, note its index
108
- 3. In `<cellXfs>`: append `<xf numFmtId="168" fontId="N" .../>`, update `count`
109
- 4. New style index = old `cellXfs count` value (before incrementing)
110
- 5. Apply to cells: `<c r="B5" s="NEW_INDEX">...</c>`
111
-
112
- ### Color Format
113
-
114
- `AARRGGBB` — Alpha (always `00` for opaque) + Red + Green + Blue
115
-
116
- ```
117
- 000000FF → Blue
118
- 00000000 → Black
119
- 00008000 → Green (dark)
120
- 00FF0000 → Red
121
- 00FFFF00 → Yellow (for fills)
122
- 00FFFFFF → White
123
- ```
124
-
125
- ### Built-in numFmtIds (no declaration needed)
126
-
127
- | ID | Format | Display |
128
- |----|--------|---------|
129
- | 0 | General | as-is |
130
- | 1 | 0 | 2024 (use for years!) |
131
- | 2 | 0.00 | 1000.00 |
132
- | 3 | #,##0 | 1,000 |
133
- | 4 | #,##0.00 | 1,000.00 |
134
- | 9 | 0% | 15% |
135
- | 10 | 0.00% | 15.25% |
136
- | 14 | m/d/yyyy | 3/21/2026 |
137
-
138
- ---
139
-
140
- ## sharedStrings.xml Reference
141
-
142
- ```xml
143
- <sst count="3" uniqueCount="3">
144
- <si><t>Revenue</t></si> <!-- index 0 -->
145
- <si><t>Cost</t></si> <!-- index 1 -->
146
- <si><t>Margin</t></si> <!-- index 2 -->
147
- </sst>
148
- ```
149
-
150
- Text with leading/trailing spaces:
151
- ```xml
152
- <si><t xml:space="preserve"> indented </t></si>
153
- ```
154
-
155
- Special characters:
156
- ```xml
157
- <si><t>R&amp;D Expenses</t></si> <!-- & must be &amp; -->
158
- ```
159
-
160
- ---
161
-
162
- ## workbook.xml / .rels Sync
163
-
164
- Every `<sheet>` in workbook.xml needs a matching `<Relationship>` in workbook.xml.rels:
165
-
166
- ```xml
167
- <!-- workbook.xml -->
168
- <!-- NOTE: rId numbering depends on what rIds are already in workbook.xml.rels.
169
- The minimal template reserves rId1=sheet1, rId2=styles, rId3=sharedStrings.
170
- When ADDING sheets to the template, start from rId4 to avoid conflicts.
171
- The rId3 here is just a generic illustration — use the next available rId. -->
172
- <sheet name="Summary" sheetId="3" r:id="rId3"/>
173
-
174
- <!-- workbook.xml.rels -->
175
- <Relationship Id="rId3"
176
- Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
177
- Target="worksheets/sheet3.xml"/>
178
- ```
179
-
180
- And a matching `<Override>` in `[Content_Types].xml`:
181
- ```xml
182
- <Override PartName="/xl/worksheets/sheet3.xml"
183
- ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>
184
- ```
185
-
186
- ---
187
-
188
- ## Column / Row Dimensions
189
-
190
- ```xml
191
- <!-- Before <sheetData> -->
192
- <cols>
193
- <col min="1" max="1" width="28" customWidth="1"/> <!-- A: 28 chars -->
194
- <col min="2" max="6" width="14" customWidth="1"/> <!-- B-F: 14 chars -->
195
- </cols>
196
-
197
- <!-- Row height on individual rows -->
198
- <row r="1" ht="20" customHeight="1">
199
- ...
200
- </row>
201
- ```
202
-
203
- ---
204
-
205
- ## Freeze Panes
206
-
207
- Inside `<sheetView>`:
208
- ```xml
209
- <!-- Freeze row 1 (header row stays visible) -->
210
- <pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/>
211
-
212
- <!-- Freeze column A -->
213
- <pane xSplit="1" topLeftCell="B1" activePane="topRight" state="frozen"/>
214
-
215
- <!-- Freeze both row 1 and column A -->
216
- <pane xSplit="1" ySplit="1" topLeftCell="B2" activePane="bottomRight" state="frozen"/>
217
- ```
218
-
219
- ---
220
-
221
- ## 7 Excel Error Types (All Must Be Absent at Delivery)
222
-
223
- | Error | Meaning | Detect in XML |
224
- |-------|---------|---------------|
225
- | `#REF!` | Invalid cell reference | `<c t="e"><v>#REF!</v></c>` |
226
- | `#DIV/0!` | Divide by zero | `<c t="e"><v>#DIV/0!</v></c>` |
227
- | `#VALUE!` | Wrong data type | `<c t="e"><v>#VALUE!</v></c>` |
228
- | `#NAME?` | Unknown function/name | `<c t="e"><v>#NAME?</v></c>` |
229
- | `#NULL!` | Empty intersection | `<c t="e"><v>#NULL!</v></c>` |
230
- | `#NUM!` | Number out of range | `<c t="e"><v>#NUM!</v></c>` |
231
- | `#N/A` | Value not found | `<c t="e"><v>#N/A</v></c>` |
@@ -1,97 +0,0 @@
1
- # Data Reading & Analysis Guide
2
-
3
- > Reference for the READ path. Use `xlsx_reader.py` for structure discovery and data quality auditing,
4
- > then pandas for custom analysis. **Never modify the source file.**
5
-
6
- ---
7
-
8
- ## When to Use This Path
9
-
10
- The user asks to read, analyze, view, summarize, extract, or answer questions about an Excel/CSV file's contents,
11
- without requiring file modification. If modification is needed, hand off to `edit.md`.
12
-
13
- ---
14
-
15
- ## Workflow
16
-
17
- ### Step 1 — Structure Discovery
18
-
19
- Run `xlsx_reader.py` first. It handles format detection, encoding fallback, structure exploration, and data quality audit:
20
-
21
- ```bash
22
- python3 SKILL_DIR/scripts/xlsx_reader.py input.xlsx # full report
23
- python3 SKILL_DIR/scripts/xlsx_reader.py input.xlsx --sheet Sales # single sheet
24
- python3 SKILL_DIR/scripts/xlsx_reader.py input.xlsx --quality # quality audit only
25
- python3 SKILL_DIR/scripts/xlsx_reader.py input.xlsx --json # machine-readable
26
- ```
27
-
28
- Supported formats: `.xlsx`, `.xlsm`, `.csv`, `.tsv`. The script tries multiple encodings for CSV (utf-8-sig, gbk, utf-8, latin-1).
29
-
30
- ### Step 2 — Custom Analysis with pandas
31
-
32
- Load data and perform the analysis the user requests:
33
-
34
- ```python
35
- import pandas as pd
36
- df = pd.read_excel("input.xlsx", sheet_name=None) # dict of all sheets
37
- # For CSV: pd.read_csv("input.csv")
38
- ```
39
-
40
- **Header handling** (when the default `header=0` doesn't work):
41
-
42
- | Situation | Code |
43
- |-----------|------|
44
- | Header on row 3 | `pd.read_excel(path, header=2)` |
45
- | Multi-level merged header | `pd.read_excel(path, header=[0, 1])` |
46
- | No header | `pd.read_excel(path, header=None)` |
47
-
48
- **Analysis quick reference:**
49
-
50
- | Scenario | Pattern |
51
- |----------|---------|
52
- | Descriptive stats | `df.describe()` or `df['Col'].agg(['sum', 'mean', 'min', 'max'])` |
53
- | Group aggregation | `df.groupby('Region')['Revenue'].agg(Total='sum', Avg='mean')` |
54
- | Top N | `df.groupby('Region')['Revenue'].sum().sort_values(ascending=False).head(5)` |
55
- | Pivot table | `df.pivot_table(values='Revenue', index='Region', columns='Quarter', aggfunc='sum', margins=True)` |
56
- | Time series | `df.set_index(pd.to_datetime(df['Date'])).resample('ME')['Revenue'].sum()` |
57
- | Cross-sheet merge | `pd.merge(sales, customers, on='CustomerID', how='left', validate='m:1')` |
58
- | Stack sheets | `pd.concat([df.assign(Source=name) for name, df in sheets.items()], ignore_index=True)` |
59
- | Large files (>50MB) | `pd.read_excel(path, usecols=['Date', 'Revenue'])` or `pd.read_csv(path, chunksize=10000)` |
60
-
61
- ### Step 3 — Output
62
-
63
- If the user specifies an output file path, write results to it (highest priority). Format the report as:
64
-
65
- ```
66
- ## Analysis Report: {filename}
67
- ### File Overview — format, sheets, row counts
68
- ### Data Quality — nulls, duplicates, mixed types (or "no issues")
69
- ### Key Findings — direct answer to the user's question
70
- ### Additional Notes — formula NaN, encoding issues, caveats
71
- ```
72
-
73
- **Numeric display**: monetary `1,234,567.89`, percentage `12.3%`, multiples `8.5x`, counts as integers.
74
-
75
- ---
76
-
77
- ## Common Pitfalls
78
-
79
- | Pitfall | Cause | Fix |
80
- |---------|-------|-----|
81
- | Formula cells read as NaN | `<v>` cache empty in freshly generated files | Inform user; suggest opening in Excel and re-saving; or use `libreoffice_recalc.py` |
82
- | CSV encoding errors | Chinese Windows exports use GBK | `xlsx_reader.py` auto-tries multiple encodings; manually specify if all fail |
83
- | Mixed types in column | Column has both numbers and text (e.g., "N/A") | `pd.to_numeric(df['Col'], errors='coerce')` — report unconvertible rows |
84
- | Year shows as 2,024 | Thousands separator format applied to year | `df['Year'].astype(int).astype(str)` |
85
- | Multi-level headers | Two-row header merged | `pd.read_excel(path, header=[0, 1])`, then flatten with `' - '.join()` |
86
- | Row number mismatch | pandas 0-indexed vs Excel 1-indexed | `excel_row = pandas_index + 2` (+1 for 1-index, +1 for header) |
87
-
88
- **Critical**: Never open with `data_only=True` then `save()` — this permanently destroys all formulas.
89
-
90
- ---
91
-
92
- ## Prohibitions
93
-
94
- - Never modify the source file (no `save()`, no XML edits)
95
- - Never report formula NaN as "data is zero" — explain it's a formula cache issue
96
- - Never report pandas indices as Excel row numbers
97
- - Never make speculative conclusions unsupported by the data