dimcode-darwin-arm64 0.2.19 → 0.2.20

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 (109) hide show
  1. package/bin/dimcode +0 -0
  2. package/bin/skills-assets/chrome-control/SKILL.md +96 -0
  3. package/bin/skills-assets/dim-workflow/SKILL.md +78 -30
  4. package/bin/skills-assets/officecli/SKILL.md +423 -0
  5. package/package.json +1 -1
  6. package/bin/skills-assets/docx/SKILL.md +0 -273
  7. package/bin/skills-assets/docx/assets/styles/academic_styles.xml +0 -250
  8. package/bin/skills-assets/docx/assets/styles/corporate_styles.xml +0 -284
  9. package/bin/skills-assets/docx/assets/styles/default_styles.xml +0 -449
  10. package/bin/skills-assets/docx/assets/xsd/aesthetic-rules.xsd +0 -470
  11. package/bin/skills-assets/docx/assets/xsd/business-rules.xsd +0 -130
  12. package/bin/skills-assets/docx/assets/xsd/common-types.xsd +0 -159
  13. package/bin/skills-assets/docx/assets/xsd/wml-subset.xsd +0 -589
  14. package/bin/skills-assets/docx/references/cjk_typography.md +0 -357
  15. package/bin/skills-assets/docx/references/cjk_university_template_guide.md +0 -184
  16. package/bin/skills-assets/docx/references/comments_guide.md +0 -191
  17. package/bin/skills-assets/docx/references/design_good_bad_examples.md +0 -829
  18. package/bin/skills-assets/docx/references/design_principles.md +0 -819
  19. package/bin/skills-assets/docx/references/openxml_element_order.md +0 -308
  20. package/bin/skills-assets/docx/references/openxml_encyclopedia_part1.md +0 -4061
  21. package/bin/skills-assets/docx/references/openxml_encyclopedia_part2.md +0 -2820
  22. package/bin/skills-assets/docx/references/openxml_encyclopedia_part3.md +0 -3381
  23. package/bin/skills-assets/docx/references/openxml_namespaces.md +0 -82
  24. package/bin/skills-assets/docx/references/openxml_units.md +0 -72
  25. package/bin/skills-assets/docx/references/scenario_a_create.md +0 -284
  26. package/bin/skills-assets/docx/references/scenario_b_edit_content.md +0 -295
  27. package/bin/skills-assets/docx/references/scenario_c_apply_template.md +0 -456
  28. package/bin/skills-assets/docx/references/track_changes_guide.md +0 -200
  29. package/bin/skills-assets/docx/references/troubleshooting.md +0 -506
  30. package/bin/skills-assets/docx/references/typography_guide.md +0 -294
  31. package/bin/skills-assets/docx/references/xsd_validation_guide.md +0 -158
  32. package/bin/skills-assets/docx/scripts/doc_to_docx.sh +0 -40
  33. package/bin/skills-assets/docx/scripts/docx_preview.sh +0 -37
  34. package/bin/skills-assets/docx/scripts/dotnet/Docx.Cli/Docx.Cli.csproj +0 -19
  35. package/bin/skills-assets/docx/scripts/dotnet/Docx.Cli/Program.cs +0 -18
  36. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/AnalyzeCommand.cs +0 -147
  37. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/ApplyTemplateCommand.cs +0 -322
  38. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/CreateCommand.cs +0 -324
  39. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/DiffCommand.cs +0 -155
  40. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/EditContentCommand.cs +0 -487
  41. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/FixOrderCommand.cs +0 -108
  42. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/MergeRunsCommand.cs +0 -122
  43. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Commands/ValidateCommand.cs +0 -107
  44. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Docx.Core.csproj +0 -15
  45. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/CommentSynchronizer.cs +0 -169
  46. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/ElementOrder.cs +0 -80
  47. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/NamespaceConstants.cs +0 -42
  48. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/RunMerger.cs +0 -81
  49. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/StyleAnalyzer.cs +0 -81
  50. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/TrackChangesHelper.cs +0 -99
  51. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/OpenXml/UnitConverter.cs +0 -23
  52. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples.cs +0 -1832
  53. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch1.cs +0 -910
  54. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch2.cs +0 -999
  55. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch3.cs +0 -1048
  56. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/AestheticRecipeSamples_Batch4.cs +0 -1038
  57. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/CharacterFormattingSamples.cs +0 -1020
  58. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/DocumentCreationSamples.cs +0 -1121
  59. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/FieldAndTocSamples.cs +0 -624
  60. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/FootnoteAndCommentSamples.cs +0 -675
  61. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/HeaderFooterSamples.cs +0 -838
  62. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ImageSamples.cs +0 -917
  63. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ListAndNumberingSamples.cs +0 -826
  64. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/ParagraphFormattingSamples.cs +0 -1199
  65. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/StyleSystemSamples.cs +0 -1487
  66. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/TableSamples.cs +0 -1163
  67. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Samples/TrackChangesSamples.cs +0 -595
  68. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/CjkHelper.cs +0 -39
  69. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/FontDefaults.cs +0 -24
  70. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Typography/PageSizes.cs +0 -20
  71. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/BusinessRuleValidator.cs +0 -224
  72. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/GateCheckValidator.cs +0 -148
  73. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/ValidationResult.cs +0 -23
  74. package/bin/skills-assets/docx/scripts/dotnet/Docx.Core/Validation/XsdValidator.cs +0 -69
  75. package/bin/skills-assets/docx/scripts/dotnet/Docx.slnx +0 -4
  76. package/bin/skills-assets/docx/scripts/env_check.sh +0 -196
  77. package/bin/skills-assets/docx/scripts/setup.ps1 +0 -274
  78. package/bin/skills-assets/docx/scripts/setup.sh +0 -504
  79. package/bin/skills-assets/pptx-generator/SKILL.md +0 -248
  80. package/bin/skills-assets/pptx-generator/references/design-system.md +0 -392
  81. package/bin/skills-assets/pptx-generator/references/editing.md +0 -162
  82. package/bin/skills-assets/pptx-generator/references/pitfalls.md +0 -112
  83. package/bin/skills-assets/pptx-generator/references/pptxgenjs.md +0 -420
  84. package/bin/skills-assets/pptx-generator/references/slide-types.md +0 -413
  85. package/bin/skills-assets/xlsx/SKILL.md +0 -137
  86. package/bin/skills-assets/xlsx/references/create.md +0 -691
  87. package/bin/skills-assets/xlsx/references/edit.md +0 -684
  88. package/bin/skills-assets/xlsx/references/fix.md +0 -37
  89. package/bin/skills-assets/xlsx/references/format.md +0 -768
  90. package/bin/skills-assets/xlsx/references/ooxml-cheatsheet.md +0 -231
  91. package/bin/skills-assets/xlsx/references/read-analyze.md +0 -97
  92. package/bin/skills-assets/xlsx/references/validate.md +0 -772
  93. package/bin/skills-assets/xlsx/scripts/formula_check.py +0 -422
  94. package/bin/skills-assets/xlsx/scripts/libreoffice_recalc.py +0 -248
  95. package/bin/skills-assets/xlsx/scripts/shared_strings_builder.py +0 -163
  96. package/bin/skills-assets/xlsx/scripts/style_audit.py +0 -575
  97. package/bin/skills-assets/xlsx/scripts/xlsx_add_column.py +0 -395
  98. package/bin/skills-assets/xlsx/scripts/xlsx_insert_row.py +0 -274
  99. package/bin/skills-assets/xlsx/scripts/xlsx_pack.py +0 -87
  100. package/bin/skills-assets/xlsx/scripts/xlsx_reader.py +0 -362
  101. package/bin/skills-assets/xlsx/scripts/xlsx_shift_rows.py +0 -396
  102. package/bin/skills-assets/xlsx/scripts/xlsx_unpack.py +0 -130
  103. package/bin/skills-assets/xlsx/templates/minimal_xlsx/[Content_Types].xml +0 -9
  104. package/bin/skills-assets/xlsx/templates/minimal_xlsx/_rels/.rels +0 -6
  105. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/_rels/workbook.xml.rels +0 -19
  106. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/sharedStrings.xml +0 -33
  107. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/styles.xml +0 -160
  108. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/workbook.xml +0 -30
  109. package/bin/skills-assets/xlsx/templates/minimal_xlsx/xl/worksheets/sheet1.xml +0 -70
@@ -0,0 +1,423 @@
1
+ ---
2
+ name: officecli
3
+ description: Create, analyze, proofread, and modify Office documents (.docx, .xlsx, .pptx) using the officecli CLI tool. Use when the user wants to create, inspect, check formatting, find issues, add charts, or modify Office documents.
4
+ ---
5
+
6
+ # officecli
7
+
8
+ AI-friendly CLI for .docx, .xlsx, .pptx. Single binary, no dependencies, no Office installation needed.
9
+
10
+ ## Install
11
+
12
+ In DimCode Desktop the `officecli` binary is bundled and already on the agent
13
+ shell PATH — there is nothing to install. Verify availability before first use:
14
+
15
+ ```bash
16
+ officecli --version
17
+ ```
18
+
19
+ If the command is missing, tell the user to update DimCode Desktop to a build
20
+ that bundles OfficeCLI. Do NOT attempt to download or replace the bundled
21
+ binary yourself — DimCode owns its lifecycle and disables its self-update
22
+ mechanism at startup. (Outside DimCode, `curl -fsSL https://d.officecli.ai/install.sh | bash` still works.)
23
+
24
+ ---
25
+
26
+ ## Strategy
27
+
28
+ **L1 (read) → L2 (DOM edit) → L3 (raw XML)**. Always prefer higher layers. Add `--json` for structured output.
29
+
30
+ **Before doc work, check Specialized Skills** (bottom of this file). Fundraising decks, academic papers, financial models, dashboards, and Morph animations need their own skill loaded first — `load_skill` once, then proceed.
31
+
32
+ ---
33
+
34
+ ## Help System (IMPORTANT)
35
+
36
+ **When unsure about property names, value formats, or command syntax, ALWAYS run help instead of guessing.** One help query beats guess-fail-retry loops.
37
+
38
+ `officecli help` ≡ `officecli --help`, and `officecli <cmd> --help` ≡ `officecli help <cmd>` — same content.
39
+
40
+ ```bash
41
+ officecli help # All commands + global options + schema entry points
42
+ officecli help docx # List all docx elements
43
+ officecli help docx paragraph # Full schema: properties, aliases, examples, readbacks
44
+ officecli help docx set paragraph # Verb-filtered: only props usable with `set`
45
+ officecli help docx paragraph --json # Structured schema (machine-readable)
46
+ ```
47
+
48
+ Format aliases: `word`→`docx`, `excel`→`xlsx`, `ppt`/`powerpoint`→`pptx`. Verbs: `add`, `set`, `get`, `query`, `remove`. MCP exposes the same schema via `{"command":"help","format":"docx","type":"paragraph"}`.
49
+
50
+ ---
51
+
52
+ ## Performance: Resident Mode
53
+
54
+ **Every command auto-starts a resident on first access** (60s idle timeout) — file-lock conflicts are automatically avoided. Explicit `open`/`close` is still recommended for longer sessions (12min idle):
55
+ ```bash
56
+ officecli open report.docx # explicitly keep in memory
57
+ officecli set report.docx ... # no file I/O overhead
58
+ officecli close report.docx # save and release
59
+ ```
60
+
61
+ Opt out of auto-start: `OFFICECLI_NO_AUTO_RESIDENT=1`.
62
+
63
+ **Flush only at the non-officecli boundary.** officecli's own reads (`get`/`query`/`view`/`dump`) always see your latest edits, so you never need to save mid-workflow. Run `save` (keeps the resident) or `close` (flush + release) only **before a non-officecli program reads the file** — python-docx/openpyxl, Word, a renderer, delivery/upload.
64
+
65
+ ---
66
+
67
+ ## Quick Start
68
+
69
+ **PPT:**
70
+ ```bash
71
+ officecli create slides.pptx
72
+ officecli add slides.pptx / --type slide --prop title="Q4 Report" --prop background=1A1A2E
73
+ officecli add slides.pptx '/slide[1]' --type shape --prop text="Revenue grew 25%" --prop x=2cm --prop y=5cm --prop font=Arial --prop size=24 --prop color=FFFFFF
74
+ ```
75
+
76
+ **Word:**
77
+ ```bash
78
+ officecli create report.docx
79
+ officecli add report.docx /body --type paragraph --prop text="Executive Summary" --prop style=Heading1
80
+ officecli add report.docx /body --type paragraph --prop text="Revenue increased by 25% year-over-year."
81
+ ```
82
+
83
+ **Excel:**
84
+ ```bash
85
+ officecli create data.xlsx
86
+ officecli set data.xlsx /Sheet1/A1 --prop value="Name" --prop bold=true
87
+ officecli set data.xlsx /Sheet1/A2 --prop value="Alice"
88
+ ```
89
+
90
+ ---
91
+
92
+ ## L1: Create, Read & Inspect
93
+
94
+ ```bash
95
+ officecli create <file> # Create blank .docx/.xlsx/.pptx (type from extension)
96
+ officecli view <file> <mode> # outline | stats | issues | text | annotated | html
97
+ officecli get <file> <path> --depth N # Get a node and its children [--json]
98
+ officecli query <file> <selector> # CSS-like query
99
+ officecli validate <file> # Validate against OpenXML schema
100
+ ```
101
+
102
+ ### view modes
103
+
104
+ | Mode | Description | Useful flags |
105
+ |------|-------------|-------------|
106
+ | `outline` | Document structure | |
107
+ | `stats` | Statistics (pages, words, shapes) | |
108
+ | `issues` | Formatting/content/structure problems | `--type format\|content\|structure`, `--limit N` |
109
+ | `text` | Plain text extraction | `--start N --end N`, `--max-lines N` |
110
+ | `annotated` | Text with formatting annotations | |
111
+ | `html` | Static HTML snapshot — same renderer as `watch`, no server needed | `--browser`, `--page N` (docx), `--start N --end N` (pptx) |
112
+ | `screenshot` / `svg` / `pdf` / `forms` | PNG via headless browser / SVG (pptx slide) / PDF via exporter plugin / form-fields JSON via format-handler plugin | `-o`, `--screenshot-width/-height`, pptx `--grid N` |
113
+
114
+ Use `view html` for one-shot snapshots (CI artifacts, archival, diffing); use `watch` when you need live refresh or browser-side click-to-select.
115
+
116
+ ### get
117
+
118
+ Any XML path via element localName. Use `--depth N` to expand children. Add `--json` for structured output. Default text output is grep-friendly: `path (type) "text" key=val key=val ...`
119
+
120
+ ```bash
121
+ officecli get report.docx '/body/p[3]' --depth 2 --json
122
+ officecli get slides.pptx '/slide[1]' --depth 1 # list all shapes on slide 1
123
+ officecli get data.xlsx '/Sheet1/B2' --json
124
+ ```
125
+
126
+ ### Stable ID Addressing
127
+
128
+ Elements with stable IDs return `@attr=value` paths instead of positional indices. Prefer these in multi-step workflows — positional indices shift on insert/delete, stable IDs do not.
129
+
130
+ ```
131
+ /slide[1]/shape[@id=550950021] # PPT shape
132
+ /slide[1]/table[@id=1388430425]/tr[1]/tc[2] # PPT table
133
+ /body/p[@paraId=1A2B3C4D] # Word paragraph
134
+ /comments/comment[@commentId=1] # Word comment
135
+ ```
136
+
137
+ PPT also accepts `@name=` (e.g. `shape[@name=Title 1]`), with morph `!!` prefix awareness. Elements without stable IDs (slide, run, tr/tc, row) fall back to positional indices.
138
+
139
+ ### query
140
+
141
+ CSS-like selectors: `[attr=value]`, `[attr!=value]`, `[attr~=text]`, `[attr>=value]`, `[attr<=value]`, `:contains("text")`, `:empty`, `:has(formula)`, `:no-alt`. Boolean `and`/`or` supported across `query`/`set`/`remove`: `cell[value>5000 or value<100]`, `cell[(type=Number or type=Date) and value>0]`. Excel row-by-column-name: `Sheet1!row[Salary>5000]`. `set` accepts selectors and Excel-native paths (parity with `get`/`query`). Bare unscoped selectors rejected on `set`/`remove`.
142
+
143
+ ```bash
144
+ officecli query report.docx 'paragraph[style=Normal] > run[font!=Arial]'
145
+ officecli query slides.pptx 'shape[fill=FF0000]'
146
+ ```
147
+
148
+ ---
149
+
150
+ ## Watch & Interactive Selection
151
+
152
+ Live HTML preview that auto-refreshes on every file change. Browsers can click / shift-click / box-drag to select shapes; the CLI can read the current browser selection and act on it.
153
+
154
+ ```bash
155
+ officecli watch <file> [--port N] # Start preview server (default port 26315)
156
+ officecli unwatch <file> # Stop
157
+ officecli goto <file> <path> # Scroll watching browser(s) to element (docx: p / table / tr / tc)
158
+ ```
159
+
160
+ Open the printed `http://localhost:N` URL. Click to select; shift/cmd/ctrl+click to multi-select; drag from empty space to box-select. PPT/Word use blue outline; Excel uses native-style green selection (double-click cell to edit inline; drag a chart to reposition).
161
+
162
+ ### `get <file> selected` — read what the user clicked
163
+
164
+ ```bash
165
+ officecli get <file> selected [--json]
166
+ ```
167
+
168
+ Returns DocumentNodes for whatever is currently selected. Empty result if nothing selected. Exit code != 0 if no watch is running.
169
+
170
+ ```bash
171
+ # User clicks shapes in the browser, then asks "make these red"
172
+ PATHS=$(officecli get deck.pptx selected --json | jq -r '.data.Results[].path')
173
+ for p in $PATHS; do officecli set deck.pptx "$p" --prop fill=FF0000; done
174
+ ```
175
+
176
+ ### Key properties
177
+
178
+ - **Selection survives file edits.** Paths use stable `@id=` form.
179
+ - **All connected browsers share one selection.** Last-write-wins.
180
+ - **Same-file single-watch.** A given file can have only one watch process at a time.
181
+ - **Group shapes select as a whole.** Drilling into individual children of a group is not supported in v1.
182
+ - **Coverage:** `.pptx` shapes/pictures/tables/charts/connectors/groups; `.docx` top-level paragraphs and tables. Inherited layout/master decorations and Word nested elements (table cells, run-level) are not addressable. **`.xlsx` does not emit `data-path`** — `mark`/`selection` on xlsx always resolve `stale=true` (v2 candidate).
183
+
184
+ ### Marks — edit proposals waiting for review
185
+
186
+ Use `mark` when changes need human review BEFORE they hit the file. Marks live in the watch process only; a separate `set` pipeline applies accepted ones. For one-shot changes use `set` directly; for permanent file annotations use `add --type comment` (Word native).
187
+
188
+ ```bash
189
+ officecli mark <file> <path> [--prop find=... color=... note=... tofix=... regex=true] [--json]
190
+ officecli unmark <file> [--path <p> | --all] [--json]
191
+ officecli get-marks <file> [--json]
192
+ ```
193
+
194
+ Props: `find` (literal or regex when `regex=true`; raw form `find='r"[abc]"'`), `color` (hex / `rgb(...)` / 22 named whitelist), `note`, `tofix` (drives apply pipeline). **Path** must be `data-path` format from watch HTML — see subskills for full pipeline.
195
+
196
+ ---
197
+
198
+ ## L2: DOM Operations
199
+
200
+ ### set — modify properties
201
+
202
+ ```bash
203
+ officecli set <file> <path> --prop key=value [--prop ...]
204
+ ```
205
+
206
+ **Any XML attribute is settable** via element path (found via `get --depth N`) — even attributes not currently present. Without `find=`, `set` applies format to the entire element.
207
+
208
+ **Value formats:**
209
+
210
+ | Type | Format | Examples |
211
+ |------|--------|---------|
212
+ | Colors | Hex (with/without `#`), named, RGB, theme | `FF0000`, `#FF0000`, `red`, `rgb(255,0,0)`, `accent1`..`accent6` |
213
+ | Spacing | Unit-qualified | `12pt`, `0.5cm`, `1.5x`, `150%` |
214
+ | Dimensions | EMU or suffixed | `914400`, `2.54cm`, `1in`, `72pt`, `96px` |
215
+
216
+ **Dotted-attr aliases** — `font.<attr>` forms accepted on shape/run/paragraph/table/row/cell/section/styles, e.g. `--prop font.color=red --prop font.bold=true --prop font.size=14pt`. Run `officecli help <fmt> <element>` for the full list.
217
+
218
+ ### find — format or replace matched text
219
+
220
+ Use top-level `--find` / `--replace` on `set` (and `--find` on `query`). Legacy `--prop find=X` still works but emits a hint.
221
+
222
+ ```bash
223
+ # Format matched text (auto-splits runs)
224
+ officecli set doc.docx '/body/p[1]' --find weather --prop bold=true --prop color=red
225
+
226
+ # Regex matching (regex= still a prop flag)
227
+ officecli set doc.docx '/body/p[1]' --find '\d+%' --prop regex=true --prop color=red
228
+
229
+ # Replace text (use `/` for whole-document scope)
230
+ officecli set doc.docx / --find draft --replace final
231
+
232
+ # docx: tracked Find&Replace
233
+ officecli set doc.docx / --find draft --replace final --prop revision.author=Alice
234
+
235
+ # PPT — same syntax, different paths
236
+ officecli set slides.pptx / --find draft --replace final
237
+ ```
238
+
239
+ **Path controls search scope:** `/` = whole document, `/body/p[1]` or `/slide[N]/shape[M]` = specific element, `/header[1]` / `/footer[1]` = headers/footers.
240
+
241
+ **Notes:**
242
+ - Case-sensitive by default. Case-insensitive: `--prop 'find=(?i)error' --prop regex=true`
243
+ - Matches work across run boundaries
244
+ - No match = silent success. `--json` includes `"matched": N`
245
+ - **Excel:** only `find` + `replace` supported (no find + format props)
246
+
247
+ ### add — add elements or clone
248
+
249
+ ```bash
250
+ officecli add <file> <parent> --type <type> [--prop ...]
251
+ officecli add <file> <parent> --type <type> --after <path> [--prop ...] # insert after anchor
252
+ officecli add <file> <parent> --type <type> --before <path> [--prop ...] # insert before anchor
253
+ officecli add <file> <parent> --type <type> --index N [--prop ...] # 0-based position (legacy)
254
+ officecli add <file> <parent> --from <path> # clone existing element
255
+ ```
256
+
257
+ `--after`, `--before`, `--index` are mutually exclusive. No position flag = append to end.
258
+
259
+ **Element types (with aliases):**
260
+
261
+ | Format | Types |
262
+ |--------|-------|
263
+ | **pptx** | slide (incl. hidden), shape (font.latin/ea/cs, direction=rtl, underline.color, highlight=COLOR (Add/Set/Get/HTML preview), effective.X+effective.X.src; arrow alias for rightArrow; slideMaster/slideLayout typed add/set/remove), picture (SVG, brightness/contrast/glow/shadow, rotation, link, tooltip), chart (direction=rtl, pieOfPie, barOfPie, axisLine/gridline per-attr setters, animation+chartBuild=byCategory|bySeries, line dropLines/hiLowLines/upDownBars, anchor=x,y,w,h shorthand), table (cell direction=rtl, fill/background, built-in PowerPoint style catalogue, /col[C] get + swap/copyFrom, row/col Move/CopyFrom), row (tr), connector (from/to accept @name=, startshape/endshape SetByPath), group (link, tooltip, deep walk by get/query/add/remove), video/audio (loop, autoStart alias), equation, notes (direction=rtl, lang), comment (legacy + modern p188 threaded round-trip), animation (15 emphasis + 16 exit presets, multi-effect chains, motion-path presets, repeat/restart/autoReverse, chart animations), transition (12 p15 presets + morph/p14), paragraph (para), run, zoom, ole (preview=, full dump round-trip via add-part+raw-set), placeholder (phType=...), model3d (rotation=ax,ay,az; full dump round-trip), smartart (dump round-trip via add-part). |
264
+ | **docx** | paragraph (direction/font.latin/ea/cs, bold.cs/italic.cs/size.cs, lang.latin/ea/cs, wordWrap, framePr.\*, tabs shorthand), run (lang slots, direction, underline.color, position half-pts, **revision.type=ins\|del\|format\|moveFrom\|moveTo + revision.action=accept\|reject** with .author/.date — `/revision[@author=X]` selector for filtered accept/reject), table (direction=rtl, hMerge, **virtual column ops**: add/remove/move/copyfrom on /body/tbl[N]/col), row (tr), cell (td), image, header/footer (direction), section (pageNumFmt full enum, direction=rtl, rtlGutter, pgBorders=box), bookmark, comment, footnote, endnote, formfield, sdt, chart, equation, field (28 types), hyperlink, style (direction, indents, pbdr, lineSpacing on Add/Set), toc, watermark, break, ole, **num/abstractNum/lvl**, **tab**, **textbox/shape** (full Add+Get; geometry, fill, line, wrap, alt, anchor, **rotation, verticalText (eaVert/vert/vert270/wordArt\*), gradient, shadow, opacity**), embedded **OLE round-trip on dump→batch**. docDefaults.rtl, autoHyphenation, `get /` exposes locale + /comments /footnotes /endnotes. `create --minimal` for raw OOXML scaffolding. |
265
+ | **xlsx** | sheet (visible/hidden/veryHidden, print margins, printTitleRows/Cols, rightToLeft sheetView, cascade-aware rename), row (c{N}= cell-content shorthand; add accepts --from /Sheet/col[L]; formula-ref rewrite on insert), col (formula-ref rewrite, named-range follow on move), cell (type=richtext+runs, merge=range/sweep, direction=rtl, phonetic; **--shift left\|up on remove, shift=right\|down on add** — Excel UI dialog parity; formula auto-detect; OFFSET/INDIRECT in calc), chart (per-axis RTL/title, anchor=x,y,w,h, pareto), image (SVG), comment (direction=rtl), table (listobject), namedrange (definedname, volatile, `[@name=X]`; formula-body inlined at parse), pivottable (cache CoW + cross-pivot sharing, labelFilter, topN, fillDownLabels, calculatedField), sparkline, validation, autofilter, shape, textbox, CF (databar/colorscale/iconset/formulacf/cellIs/topN/aboveAverage), ole, csv. Query supports `merge`/`mergedrange`. Workbook: password. Shape selector enumerates leaves inside grpSp. |
266
+
267
+ ### Pivot tables (xlsx)
268
+
269
+ ```bash
270
+ officecli add data.xlsx /Sheet1 --type pivottable \
271
+ --prop source="Sheet1!A1:E100" --prop rows=Region,Category \
272
+ --prop cols=Year --prop values="Sales:sum,Qty:count" \
273
+ --prop grandTotals=rows --prop subtotals=off --prop sort=asc
274
+ ```
275
+
276
+ Key props: `rows`, `cols`, `values` (Field:func[:showDataAs]), `filters`, `source`, `position`, `layout` (compact/outline/tabular), `repeatLabels`, `blankRows`, `aggregate`, `showDataAs` (percent_of_total/row/col, running_total), `grandTotals`, `subtotals`, `sort`. Aggregators: sum, count, average, max, min, product, stdDev, stdDevp, var, varp, countNums. Date columns auto-group. Run `officecli help xlsx pivottable` for full schema.
277
+
278
+ ### Document-level properties (all formats)
279
+
280
+ ```bash
281
+ officecli set doc.docx / --prop docDefaults.font=Arial --prop docDefaults.fontSize=11pt
282
+ officecli set doc.docx / --prop protection=forms --prop evenAndOddHeaders=true
283
+ officecli set data.xlsx / --prop calc.mode=manual --prop calc.refMode=r1c1
284
+ officecli set slides.pptx / --prop defaultFont=Arial --prop show.loop=true --prop print.what=handouts
285
+ ```
286
+
287
+ Run `officecli help <format> /` for all document-level properties (docDefaults, docGrid, CJK spacing, calc, print, show, theme, extended).
288
+
289
+ ### Sort (xlsx)
290
+
291
+ ```bash
292
+ officecli set data.xlsx /Sheet1 --prop sort="C desc" --prop sortHeader=true
293
+ officecli set data.xlsx '/Sheet1/A1:D100' --prop sort="A asc" --prop sortHeader=true
294
+ ```
295
+
296
+ Format: `COL DIR[, COL DIR ...]`. Rejects ranges with merged cells or formulas. Sidecar metadata (hyperlinks, comments, conditional formatting, drawings) follows rows automatically.
297
+
298
+ ### Text-anchored insert (`--after find:X` / `--before find:X`)
299
+
300
+ Locate an insertion point by text match within a paragraph. Inline types (run, picture, hyperlink) insert within the paragraph; block types (table, paragraph) auto-split it. PPT only supports inline.
301
+
302
+ ```bash
303
+ # Word: inline run after matched text
304
+ officecli add doc.docx '/body/p[1]' --type run --after find:weather --prop text=" (sunny)"
305
+
306
+ # Word: block table after matched text (auto-splits paragraph)
307
+ officecli add doc.docx '/body/p[1]' --type table --after "find:First sentence." --prop rows=2 --prop cols=2
308
+ ```
309
+
310
+ ### Clone
311
+
312
+ `officecli add <file> / --from '/slide[1]'` — copies with all cross-part relationships.
313
+
314
+ ### move, swap, remove
315
+
316
+ ```bash
317
+ officecli move <file> <path> [--to <parent>] [--index N] [--after <path>] [--before <path>]
318
+ officecli swap <file> <path1> <path2>
319
+ officecli remove <file> '/body/p[4]'
320
+ ```
321
+
322
+ When using `--after` or `--before`, `--to` can be omitted — the target container is inferred from the anchor.
323
+
324
+ ### batch — multiple operations in one save cycle
325
+
326
+ Continues on error by default (returns exit 1 if any item fails). Use `--stop-on-error` to abort on the first failure. `--force` is the docx-protection bypass.
327
+
328
+ `officecli dump <file> [<path>]` emits a replayable batch JSON for round-trip — `.docx` (full coverage) and `.pptx` (text/tables/pictures/charts/notes/theme + OLE/3D/video/audio/SmartArt/morph/p15 transitions via raw-set passthrough). Path defaults to `/` (whole document); pass a subtree path (`/body`, `/body/p[N]`, `/body/tbl[N]`, `/theme`, `/settings`, `/numbering`, `/styles`) to scope the dump. `officecli refresh <file.docx>` recalculates TOC page numbers / PAGE / cross-references after replay (Word backend on Windows; headless-HTML fallback elsewhere). `officecli plugins list` extends support to `.doc`, `.hwpx`, `.pdf` export.
329
+
330
+ ```bash
331
+ echo '[
332
+ {"command":"set","path":"/Sheet1/A1","props":{"value":"Name","bold":"true"}},
333
+ {"command":"set","path":"/Sheet1/B1","props":{"value":"Score","bold":"true"}}
334
+ ]' | officecli batch data.xlsx --json
335
+
336
+ officecli batch data.xlsx --commands '[{"op":"set","path":"/Sheet1/A1","props":{"value":"Done"}}]' --json
337
+ officecli batch data.xlsx --input updates.json --force --json
338
+ ```
339
+
340
+ Supports: `add`, `set`, `get`, `query`, `remove`, `move`, `swap`, `view`, `raw`, `raw-set`, `validate`. Fields: `command` (or `op`), `path`, `parent`, `type`, `from`, `to`, `index`, `after`, `before`, `props`, `selector`, `mode`, `depth`, `part`, `xpath`, `action`, `xml`.
341
+
342
+ ---
343
+
344
+ ## L3: Raw XML
345
+
346
+ Use when L2 cannot express what you need. No xmlns declarations needed — prefixes auto-registered.
347
+
348
+ ```bash
349
+ officecli raw <file> <part> # view raw XML
350
+ officecli raw-set <file> <part> --xpath "..." --action replace --xml '<w:p>...</w:p>'
351
+ officecli add-part <file> <parent> # create new document part (returns rId)
352
+ ```
353
+
354
+ `raw-set` actions: `append`, `prepend`, `insertbefore`, `insertafter`, `replace`, `remove`, `setattr`. Run `officecli help <format> raw` for available parts.
355
+
356
+ ---
357
+
358
+ ## Common Pitfalls
359
+
360
+ | Pitfall | Correct Approach |
361
+ |---------|-----------------|
362
+ | `--name "foo"` | Use `--prop name="foo"` — all attributes go through `--prop` |
363
+ | Unquoted `[N]` paths in zsh/bash | Always quote: `'/slide[1]'` or `"/slide[1]"` (shell glob-expands brackets) |
364
+ | PPT `shape[1]` for content | `shape[1]` is typically the title placeholder. Use `shape[2]+` for content shapes |
365
+ | `/shape[myname]` | Name indexing not supported. Use numeric index or `@name=` (PPT only) |
366
+ | Guessing property names | Run `officecli help <format> <element>` to see exact names |
367
+ | Modifying an open file | Close the file in PowerPoint/WPS first |
368
+ | `\n` in shell strings | Use `\\n` for newlines in `--prop text="..."` |
369
+ | `$` in shell text | `--prop text="$15M"` strips `$15`. Use single quotes: `--prop text='$15M'`, or heredoc batch |
370
+
371
+ ---
372
+
373
+ ## Specialized Skills
374
+
375
+ `officecli load_skill <name>` — output is a SKILL.md, follow its rules.
376
+
377
+ **Loading rule**:
378
+ - Pick the most specific match in "When to use"; if none fits, load the format default (`word` / `pptx` / `excel`).
379
+ - Scenes already contain the format default's rules — load **one** skill per artifact, never stack.
380
+ - Loaded rules persist across turns; don't re-load each reply.
381
+ - Two distinct artifacts → two separate loads.
382
+
383
+ ### Word (.docx)
384
+
385
+ | Name | When to use |
386
+ |------|-------------|
387
+ | `word` | Reports, letters, memos, proposals, generic documents |
388
+ | `academic-paper` | Journal / conference / thesis: APA / Chicago / IEEE / MLA citations, equations, SEQ + PAGEREF cross-refs, multi-column journal layout, bibliography. NOT for business reports or letters (route those to `word`) |
389
+
390
+ ### PowerPoint (.pptx)
391
+
392
+ | Name | When to use |
393
+ |------|-------------|
394
+ | `pptx` | Generic decks: board reviews, sales decks, all-hands, product launches |
395
+ | `pitch-deck` | **Fundraising only** — seed / Series A-C / SAFE / convertible / strategic raise. NOT for sales / product / board decks (route those to `pptx`) |
396
+ | `morph-ppt` | Cinematic Morph-animated presentations. NOT for static decks (route those to `pptx`) |
397
+ | `morph-ppt-3d` | 3D Morph: GLB models, camera moves, depth. NOT for 2D-only Morph (route those to `morph-ppt`) |
398
+
399
+ ### Excel (.xlsx)
400
+
401
+ | Name | When to use |
402
+ |------|-------------|
403
+ | `excel` | Generic workbooks, formulas, pivots, trackers |
404
+ | `financial-model` | Financial models, scenarios, projections. NOT for general data analysis (route those to `excel`) |
405
+ | `data-dashboard` | CSV/tabular data → KPI / analytics / executive dashboards with charts and sparklines. NOT for raw data tracking (route those to `excel`) |
406
+
407
+ Example: a fundraising deck task → `officecli load_skill pitch-deck` → use the printed rules.
408
+
409
+ In DimCode you can also discover and enable the related Office capability from
410
+ the **Skills** panel — the bundled `officecli` base skill is the entry point,
411
+ and the specialized skills above remain available through `officecli load_skill`
412
+ on the bundled binary. If a specialized skill's guidance contradicts this base
413
+ skill, follow the specialized skill for the task it covers.
414
+
415
+ ---
416
+
417
+ ## Notes
418
+
419
+ - Paths are **1-based** (XPath convention): `'/body/p[3]'` = third paragraph
420
+ - `--index` is **0-based** (array convention): `--index 0` = first position
421
+ - **Excel exception**: for `add --type row` and `add --type col`, `--index N` is **1-based** (matches OOXML RowIndex / column letter index). `--index 5` inserts at row 5 / column 5.
422
+ - After modifications, verify with `validate` and/or `view issues`
423
+ - **When unsure**, run `officecli help <format> <element>` instead of guessing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dimcode-darwin-arm64",
3
- "version": "0.2.19",
3
+ "version": "0.2.20",
4
4
  "description": "dimcode binary for macOS ARM64 (Apple Silicon)",
5
5
  "os": [
6
6
  "darwin"