$npx -y skills add nguyenphp/antigravity-marketing --skill minimax-xlsxOpen, create, read, analyze, edit, or validate Excel/spreadsheet files (.xlsx, .xlsm, .csv, .tsv). Use when the user asks to create, build, modify, analyze, read, validate, or format any Excel spreadsheet, financial model, pivot table, or tabular data file. Covers: creating new x
| 1 | # MiniMax XLSX Skill |
| 2 | |
| 3 | Handle the request directly. Do NOT spawn sub-agents. Always write the output file the user requests. |
| 4 | |
| 5 | ## Task Routing |
| 6 | |
| 7 | | Task | Method | Guide | |
| 8 | |------|--------|-------| |
| 9 | | **READ** — analyze existing data | `xlsx_reader.py` + pandas | `references/read-analyze.md` | |
| 10 | | **CREATE** — new xlsx from scratch | XML template | `references/create.md` + `references/format.md` | |
| 11 | | **EDIT** — modify existing xlsx | XML unpack→edit→pack | `references/edit.md` (+ `format.md` if styling needed) | |
| 12 | | **FIX** — repair broken formulas in existing xlsx | XML unpack→fix `<f>` nodes→pack | `references/fix.md` | |
| 13 | | **VALIDATE** — check formulas | `formula_check.py` | `references/validate.md` | |
| 14 | |
| 15 | ## READ — Analyze data (read `references/read-analyze.md` first) |
| 16 | |
| 17 | Start with `xlsx_reader.py` for structure discovery, then pandas for custom analysis. Never modify the source file. |
| 18 | |
| 19 | **Formatting rule**: When the user specifies decimal places (e.g. "2 decimal places"), apply that format to ALL numeric values — use `f'{v:.2f}'` on every number. Never output `12875` when `12875.00` is required. |
| 20 | |
| 21 | **Aggregation rule**: Always compute sums/means/counts directly from the DataFrame column — e.g. `df['Revenue'].sum()`. Never re-derive column values before aggregation. |
| 22 | |
| 23 | ## CREATE — XML template (read `references/create.md` + `references/format.md`) |
| 24 | |
| 25 | Copy `templates/minimal_xlsx/` → edit XML directly → pack with `xlsx_pack.py`. Every derived value MUST be an Excel formula (`<f>SUM(B2:B9)</f>`), never a hardcoded number. Apply font colors per `format.md`. |
| 26 | |
| 27 | ## EDIT — XML direct-edit (read `references/edit.md` first) |
| 28 | |
| 29 | **CRITICAL — EDIT INTEGRITY RULES:** |
| 30 | 1. **NEVER create a new `Workbook()`** for edit tasks. Always load the original file. |
| 31 | 2. The output MUST contain the **same sheets** as the input (same names, same data). |
| 32 | 3. Only modify the specific cells the task asks for — everything else must be untouched. |
| 33 | 4. **After saving output.xlsx, verify it**: open with `xlsx_reader.py` or `pandas` and confirm the original sheet names and a sample of original data are present. If verification fails, you wrote the wrong file — fix it before delivering. |
| 34 | |
| 35 | Never use openpyxl round-trip on existing files (corrupts VBA, pivots, sparklines). Instead: unpack → use helper scripts → repack. |
| 36 | |
| 37 | **"Fill cells" / "Add formulas to existing cells" = EDIT task.** If the input file already exists and you are told to fill, update, or add formulas to specific cells, you MUST use the XML edit path. Never create a new `Workbook()`. Example — fill B3 with a cross-sheet SUM formula: |
| 38 | ```bash |
| 39 | python3 SKILL_DIR/scripts/xlsx_unpack.py input.xlsx /tmp/xlsx_work/ |
| 40 | # Find the target sheet's XML via xl/workbook.xml → xl/_rels/workbook.xml.rels |
| 41 | # Then use the Edit tool to add <f> inside the target <c> element: |
| 42 | # <c r="B3"><f>SUM('Sales Data'!D2:D13)</f><v></v></c> |
| 43 | python3 SKILL_DIR/scripts/xlsx_pack.py /tmp/xlsx_work/ output.xlsx |
| 44 | ``` |
| 45 | |
| 46 | **Add a column** (formulas, numfmt, styles auto-copied from adjacent column): |
| 47 | ```bash |
| 48 | python3 SKILL_DIR/scripts/xlsx_unpack.py input.xlsx /tmp/xlsx_work/ |
| 49 | python3 SKILL_DIR/scripts/xlsx_add_column.py /tmp/xlsx_work/ --col G \ |
| 50 | --sheet "Sheet1" --header "% of Total" \ |
| 51 | --formula '=F{row}/$F$10' --formula-rows 2:9 \ |
| 52 | --total-row 10 --total-formula '=SUM(G2:G9)' --numfmt '0.0%' \ |
| 53 | --border-row 10 --border-style medium |
| 54 | python3 SKILL_DIR/scripts/xlsx_pack.py /tmp/xlsx_work/ output.xlsx |
| 55 | ``` |
| 56 | The `--border-row` flag applies a top border to ALL cells in that row (not just the new column). Use it when the task requires accounting-style borders on total rows. |
| 57 | |
| 58 | **Insert a row** (shifts existing rows, updates SUM formulas, fixes circular refs): |
| 59 | ```bash |
| 60 | python3 SKILL_DIR/scripts/xlsx_unpack.py input.xlsx /tmp/xlsx_work/ |
| 61 | # IMPORTANT: Find the correct --at row by searching for the label text |
| 62 | # in the worksheet XML, NOT by using the row number from the prompt. |
| 63 | # The prompt may say "row 5 (Office Rent)" but Office Rent might actually |
| 64 | # be at row 4. Always locate the row by its text label first. |
| 65 | python3 SKILL_DIR/scripts/xlsx_insert_row.py /tmp/xlsx_work/ --at 5 \ |
| 66 | --sheet "Budget FY2025" --text A=Utilities \ |
| 67 | --values B= |