@nguyenphp/antigravity-marketing 1.0.18 → 1.0.19
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.
- package/README.md +186 -78
- package/package.json +4 -3
- package/templates/.agent/skills/marketing-report-expert/SKILL.md +70 -0
- package/templates/.agent/skills/minimax-docx/LICENSE +21 -0
- package/templates/.agent/skills/minimax-docx/SKILL.md +274 -0
- package/templates/.agent/skills/minimax-docx/assets/styles/academic_styles.xml +250 -0
- package/templates/.agent/skills/minimax-docx/assets/styles/corporate_styles.xml +284 -0
- package/templates/.agent/skills/minimax-docx/assets/styles/default_styles.xml +449 -0
- package/templates/.agent/skills/minimax-docx/assets/xsd/aesthetic-rules.xsd +470 -0
- package/templates/.agent/skills/minimax-docx/assets/xsd/business-rules.xsd +130 -0
- package/templates/.agent/skills/minimax-docx/assets/xsd/common-types.xsd +159 -0
- package/templates/.agent/skills/minimax-docx/assets/xsd/wml-subset.xsd +589 -0
- package/templates/.agent/skills/minimax-docx/references/cjk_typography.md +357 -0
- package/templates/.agent/skills/minimax-docx/references/cjk_university_template_guide.md +184 -0
- package/templates/.agent/skills/minimax-docx/references/comments_guide.md +191 -0
- package/templates/.agent/skills/minimax-docx/references/design_good_bad_examples.md +829 -0
- package/templates/.agent/skills/minimax-docx/references/design_principles.md +819 -0
- package/templates/.agent/skills/minimax-docx/references/openxml_element_order.md +308 -0
- package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part1.md +4061 -0
- package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part2.md +2820 -0
- package/templates/.agent/skills/minimax-docx/references/openxml_encyclopedia_part3.md +3381 -0
- package/templates/.agent/skills/minimax-docx/references/openxml_namespaces.md +82 -0
- package/templates/.agent/skills/minimax-docx/references/openxml_units.md +72 -0
- package/templates/.agent/skills/minimax-docx/references/scenario_a_create.md +284 -0
- package/templates/.agent/skills/minimax-docx/references/scenario_b_edit_content.md +295 -0
- package/templates/.agent/skills/minimax-docx/references/scenario_c_apply_template.md +456 -0
- package/templates/.agent/skills/minimax-docx/references/track_changes_guide.md +200 -0
- package/templates/.agent/skills/minimax-docx/references/troubleshooting.md +506 -0
- package/templates/.agent/skills/minimax-docx/references/typography_guide.md +294 -0
- package/templates/.agent/skills/minimax-docx/references/xsd_validation_guide.md +158 -0
- package/templates/.agent/skills/minimax-docx/scripts/doc_to_docx.sh +40 -0
- package/templates/.agent/skills/minimax-docx/scripts/docx_preview.sh +37 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Cli/MiniMaxAIDocx.Cli.csproj +19 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Cli/Program.cs +18 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/AnalyzeCommand.cs +147 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/ApplyTemplateCommand.cs +322 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/CreateCommand.cs +324 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/DiffCommand.cs +155 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/EditContentCommand.cs +487 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/FixOrderCommand.cs +108 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/MergeRunsCommand.cs +122 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Commands/ValidateCommand.cs +107 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/MiniMaxAIDocx.Core.csproj +15 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/CommentSynchronizer.cs +169 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/ElementOrder.cs +80 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/NamespaceConstants.cs +42 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/RunMerger.cs +81 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/StyleAnalyzer.cs +81 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/TrackChangesHelper.cs +99 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/OpenXml/UnitConverter.cs +23 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples.cs +1832 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch1.cs +910 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch2.cs +999 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch3.cs +1048 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/AestheticRecipeSamples_Batch4.cs +1038 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/CharacterFormattingSamples.cs +1020 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/DocumentCreationSamples.cs +1121 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/FieldAndTocSamples.cs +624 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/FootnoteAndCommentSamples.cs +675 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/HeaderFooterSamples.cs +838 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ImageSamples.cs +917 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ListAndNumberingSamples.cs +826 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/ParagraphFormattingSamples.cs +1199 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/StyleSystemSamples.cs +1487 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/TableSamples.cs +1163 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Samples/TrackChangesSamples.cs +595 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/CjkHelper.cs +39 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/FontDefaults.cs +24 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Typography/PageSizes.cs +20 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/BusinessRuleValidator.cs +224 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/GateCheckValidator.cs +148 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/ValidationResult.cs +23 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.Core/Validation/XsdValidator.cs +69 -0
- package/templates/.agent/skills/minimax-docx/scripts/dotnet/MiniMaxAIDocx.slnx +4 -0
- package/templates/.agent/skills/minimax-docx/scripts/env_check.sh +196 -0
- package/templates/.agent/skills/minimax-docx/scripts/setup.ps1 +274 -0
- package/templates/.agent/skills/minimax-docx/scripts/setup.sh +504 -0
- package/templates/.agent/skills/minimax-multimodal-toolkit/SKILL.md +359 -0
- package/templates/.agent/skills/minimax-pdf/README.md +222 -0
- package/templates/.agent/skills/minimax-pdf/SKILL.md +201 -0
- package/templates/.agent/skills/minimax-pdf/design/design.md +381 -0
- package/templates/.agent/skills/minimax-pdf/scripts/cover.py +1579 -0
- package/templates/.agent/skills/minimax-pdf/scripts/fill_inspect.py +200 -0
- package/templates/.agent/skills/minimax-pdf/scripts/fill_write.py +242 -0
- package/templates/.agent/skills/minimax-pdf/scripts/make.sh +491 -0
- package/templates/.agent/skills/minimax-pdf/scripts/merge.py +112 -0
- package/templates/.agent/skills/minimax-pdf/scripts/palette.py +559 -0
- package/templates/.agent/skills/minimax-pdf/scripts/reformat_parse.py +374 -0
- package/templates/.agent/skills/minimax-pdf/scripts/render_body.py +1055 -0
- package/templates/.agent/skills/minimax-pdf/scripts/render_cover.cjs +111 -0
- package/templates/.agent/skills/minimax-xlsx/SKILL.md +138 -0
- package/templates/.agent/skills/minimax-xlsx/references/create.md +691 -0
- package/templates/.agent/skills/minimax-xlsx/references/edit.md +684 -0
- package/templates/.agent/skills/minimax-xlsx/references/fix.md +37 -0
- package/templates/.agent/skills/minimax-xlsx/references/format.md +768 -0
- package/templates/.agent/skills/minimax-xlsx/references/ooxml-cheatsheet.md +231 -0
- package/templates/.agent/skills/minimax-xlsx/references/read-analyze.md +97 -0
- package/templates/.agent/skills/minimax-xlsx/references/validate.md +772 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/formula_check.py +422 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/libreoffice_recalc.py +248 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/shared_strings_builder.py +163 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/style_audit.py +575 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_add_column.py +395 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_insert_row.py +274 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_pack.py +87 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_reader.py +362 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_shift_rows.py +396 -0
- package/templates/.agent/skills/minimax-xlsx/scripts/xlsx_unpack.py +130 -0
- package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/[Content_Types].xml +9 -0
- package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/_rels/.rels +6 -0
- package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/_rels/workbook.xml.rels +19 -0
- package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/sharedStrings.xml +33 -0
- package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/styles.xml +160 -0
- package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/workbook.xml +30 -0
- package/templates/.agent/skills/minimax-xlsx/templates/minimal_xlsx/xl/worksheets/sheet1.xml +70 -0
- package/templates/.agent/skills/pptx-generator/SKILL.md +249 -0
- package/templates/.agent/skills/pptx-generator/references/design-system.md +392 -0
- package/templates/.agent/skills/pptx-generator/references/editing.md +162 -0
- package/templates/.agent/skills/pptx-generator/references/pitfalls.md +112 -0
- package/templates/.agent/skills/pptx-generator/references/pptxgenjs.md +420 -0
- package/templates/.agent/skills/pptx-generator/references/slide-types.md +413 -0
- package/templates/.agent/skills/tutorial-video-expert/SKILL.md +88 -0
- package/templates/.agent/skills/ui-ux-pro-max/SKILL.md +170 -585
- package/templates/.agent/skills/vision-analysis/SKILL.md +174 -0
- package/templates/.agent/workflows/analyze.md +3 -0
- package/templates/.agent/workflows/brand-report.md +44 -0
- package/templates/.agent/workflows/report.md +49 -0
|
@@ -0,0 +1,231 @@
|
|
|
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&D Expenses</t></si> <!-- & must be & -->
|
|
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>` |
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|