[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77M86V7YZN87CJGY6RXK3XY":3,"skill-same:01M77M86V7YZN87CJGY6RXK3XY":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M77M86V7YZN87CJGY6RXK3XY","officecli",null,"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.","nomifun\u002Fnomifun-desktop","nomifun","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F291464596?v=4","01M77M4EP8WPNA5WEBYFWP5G9S","NomiFun","01M77M4EPYW9JXTWM3A9CRQTX4",336,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fnomifun\u002Fnomifun-desktop\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-skill-library\u002Fassets\u002Fbuiltin-skills\u002Fofficecli\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: officecli\ndescription: 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.\n---\n\n# officecli\n\nAI-friendly CLI for .docx, .xlsx, .pptx. Single binary, no dependencies, no Office installation needed.\n\n## Managed component setup\n\nUse NomiFun's approved **iOfficeAI\u002FOfficeCLI 1.0.156** through an already-authorized\n`workspace.process\u002Fstart` tool with `component=officecli`\nand literal `args`. The Host verifies the executable and sets its required\nenvironment. Follow [the shared runtime instructions](references\u002Fruntime.md) before\nrunning any example. Every `officecli` example means this component target;\ndo not copy executable paths from Skill resources or use an ambient PATH tool.\n\nStandalone use outside NomiFun uses the exact official scoped package\n`@officecli\u002Fofficecli@1.0.156`; the shared instructions cover verification.\n\n## Strategy\n\n**L1 (read) → L2 (DOM edit) → L3 (raw XML)**. Always prefer higher layers. Add `--json` for structured output.\n\n**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.\n\n---\n\n## Help System (IMPORTANT)\n\n**When unsure about property names, value formats, or command syntax, ALWAYS run help instead of guessing.** One help query beats guess-fail-retry loops.\n\n`officecli help` ≡ `officecli --help`, and `officecli \u003Ccmd> --help` ≡ `officecli help \u003Ccmd>` — same content.\n\n```bash\nofficecli help                                  # All commands + global options + schema entry points\nofficecli help docx                             # List all docx elements\nofficecli help docx paragraph                   # Full schema: properties, aliases, examples, readbacks\nofficecli help docx set paragraph               # Verb-filtered: only props usable with `set`\nofficecli help docx paragraph --json            # Structured schema (machine-readable)\n```\n\nFormat aliases: `word`→`docx`, `excel`→`xlsx`, `ppt`\u002F`powerpoint`→`pptx`. Verbs: `add`, `set`, `get`, `query`, `remove`. MCP exposes the same schema via `{\"command\":\"help\",\"format\":\"docx\",\"type\":\"paragraph\"}`.\n\n---\n\n## Performance: Resident Mode (standalone only)\n\nInside NomiFun, follow the Host resource's one-shot mode and\n`OFFICECLI_NO_AUTO_RESIDENT=1` on every supervised command. Do not use resident\n`open` \u002F `watch` sessions or depend on a later `close` to flush a product task.\nThe following resident workflow applies only to explicit standalone CLI use.\n\n**Every command auto-starts a resident on first access** (60s idle timeout) — file-lock conflicts are automatically avoided. Explicit `open`\u002F`close` is still recommended for longer sessions (12min idle):\n```bash\nofficecli open report.docx       # explicitly keep in memory\nofficecli set report.docx ...    # no file I\u002FO overhead\nofficecli close report.docx      # save and release\n```\n\nOpt out of auto-start: `OFFICECLI_NO_AUTO_RESIDENT=1`.\n\n---\n\n## Quick Start\n\n**PPT:**\n```bash\nofficecli create slides.pptx\nofficecli add slides.pptx \u002F --type slide --prop title=\"Q4 Report\" --prop background=1A1A2E\nofficecli add slides.pptx '\u002Fslide[1]' --type shape --prop text=\"Revenue grew 25%\" --prop x=2cm --prop y=5cm --prop font=Arial --prop size=24 --prop color=FFFFFF\n```\n\n**Word:**\n```bash\nofficecli create report.docx\nofficecli add report.docx \u002Fbody --type paragraph --prop text=\"Executive Summary\" --prop style=Heading1\nofficecli add report.docx \u002Fbody --type paragraph --prop text=\"Revenue increased by 25% year-over-year.\"\n```\n\n**Excel:**\n```bash\nofficecli create data.xlsx\nofficecli set data.xlsx \u002FSheet1\u002FA1 --prop value=\"Name\" --prop bold=true\nofficecli set data.xlsx \u002FSheet1\u002FA2 --prop value=\"Alice\"\n```\n\n---\n\n## L1: Create, Read & Inspect\n\n```bash\nofficecli create \u003Cfile>               # Create blank .docx\u002F.xlsx\u002F.pptx (type from extension)\nofficecli view \u003Cfile> \u003Cmode>          # outline | stats | issues | text | annotated | html\nofficecli get \u003Cfile> \u003Cpath> --depth N # Get a node and its children [--json]\nofficecli query \u003Cfile> \u003Cselector>     # CSS-like query\nofficecli validate \u003Cfile>             # Validate against OpenXML schema\n```\n\n### view modes\n\n| Mode | Description | Useful flags |\n|------|-------------|-------------|\n| `outline` | Document structure | |\n| `stats` | Statistics (pages, words, shapes) | |\n| `issues` | Formatting\u002Fcontent\u002Fstructure problems | `--type format\\|content\\|structure`, `--limit N` |\n| `text` | Plain text extraction | `--start N --end N`, `--max-lines N` |\n| `annotated` | Text with formatting annotations | |\n| `html` | Static HTML snapshot — same renderer as `watch`, no server needed | `--browser`, `--page N` (docx), `--start N --end N` (pptx) |\n\nUse `view html` for one-shot snapshots (CI artifacts, archival, diffing); use `watch` when you need live refresh or browser-side click-to-select.\n\n### get\n\nAny 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 ...`\n\n```bash\nofficecli get report.docx '\u002Fbody\u002Fp[3]' --depth 2 --json\nofficecli get slides.pptx '\u002Fslide[1]' --depth 1          # list all shapes on slide 1\nofficecli get data.xlsx '\u002FSheet1\u002FB2' --json\n```\n\n### Stable ID Addressing\n\nElements with stable IDs return `@attr=value` paths instead of positional indices. Prefer these in multi-step workflows — positional indices shift on insert\u002Fdelete, stable IDs do not.\n\n```\n\u002Fslide[1]\u002Fshape[@id=550950021]                    # PPT shape\n\u002Fslide[1]\u002Ftable[@id=1388430425]\u002Ftr[1]\u002Ftc[2]       # PPT table\n\u002Fbody\u002Fp[@paraId=1A2B3C4D]                         # Word paragraph\n\u002Fcomments\u002Fcomment[@commentId=1]                    # Word comment\n```\n\nPPT also accepts `@name=` (e.g. `shape[@name=Title 1]`), with morph `!!` prefix awareness. Elements without stable IDs (slide, run, tr\u002Ftc, row) fall back to positional indices.\n\n### query\n\nCSS-like selectors: `[attr=value]`, `[attr!=value]`, `[attr~=text]`, `[attr>=value]`, `[attr\u003C=value]`, `:contains(\"text\")`, `:empty`, `:has(formula)`, `:no-alt`.\n\n```bash\nofficecli query report.docx 'paragraph[style=Normal] > run[font!=Arial]'\nofficecli query slides.pptx 'shape[fill=FF0000]'\n```\n\n---\n\n## Watch & Interactive Selection\n\nThis is an explicit standalone CLI workflow. NomiFun attachment previews use\nmanaged static HTML artifacts and do not start this server.\n\nLive HTML preview that auto-refreshes on every file change. Browsers can click \u002F shift-click \u002F box-drag to select shapes; the CLI can read the current browser selection and act on it.\n\n```bash\nofficecli watch \u003Cfile> [--port N]      # Start preview server (default port 26315)\nofficecli unwatch \u003Cfile>               # Stop\nofficecli goto \u003Cfile> \u003Cpath>           # Scroll watching browser(s) to element (docx: p \u002F table \u002F tr \u002F tc)\n```\n\nOpen the printed `http:\u002F\u002Flocalhost:N` URL. Click to select; shift\u002Fcmd\u002Fctrl+click to multi-select; drag from empty space to box-select. PPT\u002FWord use blue outline; Excel uses native-style green selection (double-click cell to edit inline; drag a chart to reposition).\n\n### `get \u003Cfile> selected` — read what the user clicked\n\n```bash\nofficecli get \u003Cfile> selected [--json]\n```\n\nReturns DocumentNodes for whatever is currently selected. Empty result if nothing selected. Exit code != 0 if no watch is running.\n\n```bash\n# User clicks shapes in the browser, then asks \"make these red\"\nPATHS=$(officecli get deck.pptx selected --json | jq -r '.data.Results[].path')\nfor p in $PATHS; do officecli set deck.pptx \"$p\" --prop fill=FF0000; done\n```\n\n### Key properties\n\n- **Selection survives file edits.** Paths use stable `@id=` form.\n- **All connected browsers share one selection.** Last-write-wins.\n- **Same-file single-watch.** A given file can have only one watch process at a time.\n- **Group shapes select as a whole.** Drilling into individual children of a group is not supported in v1.\n- **Coverage:** `.pptx` shapes\u002Fpictures\u002Ftables\u002Fcharts\u002Fconnectors\u002Fgroups; `.docx` top-level paragraphs and tables. Inherited layout\u002Fmaster decorations and Word nested elements (table cells, run-level) are not addressable. **`.xlsx` does not emit `data-path`** — `mark`\u002F`selection` on xlsx always resolve `stale=true` (v2 candidate).\n\n### Marks — edit proposals waiting for review\n\nUse `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).\n\n```bash\nofficecli mark \u003Cfile> \u003Cpath> [--prop find=... color=... note=... tofix=... regex=true] [--json]\nofficecli unmark \u003Cfile> [--path \u003Cp> | --all] [--json]\nofficecli get-marks \u003Cfile> [--json]\n```\n\nProps: `find` (literal or regex when `regex=true`; raw form `find='r\"[abc]\"'`), `color` (hex \u002F `rgb(...)` \u002F 22 named whitelist), `note`, `tofix` (drives apply pipeline). **Path** must be `data-path` format from watch HTML — see subskills for full pipeline.\n\n---\n\n## L2: DOM Operations\n\n### set — modify properties\n\n```bash\nofficecli set \u003Cfile> \u003Cpath> --prop key=value [--prop ...]\n```\n\n**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.\n\n**Value formats:**\n\n| Type | Format | Examples |\n|------|--------|---------|\n| Colors | Hex (with\u002Fwithout `#`), named, RGB, theme | `FF0000`, `#FF0000`, `red`, `rgb(255,0,0)`, `accent1`..`accent6` |\n| Spacing | Unit-qualified | `12pt`, `0.5cm`, `1.5x`, `150%` |\n| Dimensions | EMU or suffixed | `914400`, `2.54cm`, `1in`, `72pt`, `96px` |\n\n**Dotted-attr aliases** — `font.\u003Cattr>` forms accepted on shape\u002Frun\u002Fparagraph\u002Ftable\u002Frow\u002Fcell\u002Fsection\u002Fstyles, e.g. `--prop font.color=red --prop font.bold=true --prop font.size=14pt`. Run `officecli help \u003Cfmt> \u003Celement>` for the full list.\n\n### find — format or replace matched text\n\nUse `find=` with `set` to target specific text for formatting or replacement. Format props are separate `--prop` flags — do NOT nest them.\n\n```bash\n# Format matched text (auto-splits runs)\nofficecli set doc.docx '\u002Fbody\u002Fp[1]' --prop find=weather --prop bold=true --prop color=red\n\n# Regex matching\nofficecli set doc.docx '\u002Fbody\u002Fp[1]' --prop 'find=\\d+%' --prop regex=true --prop color=red\n\n# Replace text (use `\u002F` for whole-document scope)\nofficecli set doc.docx \u002F --prop find=draft --prop replace=final\n\n# PPT — same syntax, different paths\nofficecli set slides.pptx \u002F --prop find=draft --prop replace=final\n```\n\n**Path controls search scope:** `\u002F` = whole document, `\u002Fbody\u002Fp[1]` or `\u002Fslide[N]\u002Fshape[M]` = specific element, `\u002Fheader[1]` \u002F `\u002Ffooter[1]` = headers\u002Ffooters.\n\n**Notes:**\n- Case-sensitive by default. Case-insensitive: `--prop 'find=(?i)error' --prop regex=true`\n- Matches work across run boundaries\n- No match = silent success. `--json` includes `\"matched\": N`\n- **Excel:** only `find` + `replace` supported (no find + format props)\n\n### add — add elements or clone\n\n```bash\nofficecli add \u003Cfile> \u003Cparent> --type \u003Ctype> [--prop ...]\nofficecli add \u003Cfile> \u003Cparent> --type \u003Ctype> --after \u003Cpath> [--prop ...]   # insert after anchor\nofficecli add \u003Cfile> \u003Cparent> --type \u003Ctype> --before \u003Cpath> [--prop ...]  # insert before anchor\nofficecli add \u003Cfile> \u003Cparent> --type \u003Ctype> --index N [--prop ...]        # 0-based position (legacy)\nofficecli add \u003Cfile> \u003Cparent> --from \u003Cpath>                               # clone existing element\n```\n\n`--after`, `--before`, `--index` are mutually exclusive. No position flag = append to end.\n\n**Element types (with aliases):**\n\n| Format | Types |\n|--------|-------|\n| **pptx** | slide (incl. hidden), shape (textbox — font.latin\u002Fea\u002Fcs, direction=rtl), picture (SVG, brightness\u002Fcontrast\u002Fglow\u002Fshadow), chart (direction=rtl), table (cell direction=rtl), row (tr), connector (connection\u002Fline), group, video (audio\u002Fmedia, trim), equation (formula\u002Fmath), notes (direction=rtl, lang), comment (RTL via U+200F bidi mark; full CRUD via \u002Fslide[N]\u002Fcomment[M]), paragraph (para), run, zoom (slidezoom), ole (oleobject\u002Fobject\u002Fembed), placeholder (phType=title\u002Fbody\u002Fsubtitle\u002Ffooter\u002F...). slideLayout\u002FslideMaster direction inheritance. |\n| **docx** | paragraph (para — direction\u002Ffont.latin\u002Fea\u002Fcs, bold.cs\u002Fitalic.cs\u002Fsize.cs for RTL\u002FCJK; lang.latin\u002Fea\u002Fcs BCP-47 tags on run; wordWrap toggle), run, table (direction=rtl → bidiVisual), row (tr), cell (td), image (picture\u002Fimg — SVG supported), header (direction), footer (direction), section (pageNumFmt full ECMA-376 enum incl. Hindi\u002FArabic\u002FThai\u002FCJK numerals; direction=rtl on Add\u002FSet; rtlGutter; pgBorders=box shorthand), bookmark, comment, footnote, endnote, formfield (text\u002Fcheckbox\u002Fdropdown), sdt (contentcontrol), chart, equation, field (28 types incl. mergefield\u002Fref\u002Fseq\u002Fstyleref\u002Fdocproperty\u002Fif), hyperlink, style (direction round-trip), toc, watermark, break (pagebreak\u002Fcolumnbreak), ole, **num \u002F abstractNum \u002F lvl** (numbering\u002Flist system), **tab** (paragraph or paragraph\u002Ftable style tab stops). docDefaults.rtl document-wide override; `get \u002F` exposes `locale`. Document protection: `set \u002F --prop protection=forms\\|readOnly\\|comments\\|trackedChanges\\|none` |\n| **xlsx** | sheet (visible\u002Fhidden\u002FveryHidden, print margins, printTitleRows\u002FCols, rightToLeft sheetView, cascade-aware rename), row, cell (type=richtext+runs, merge=range\u002Fsweep, direction=rtl, phonetic guide on add), chart (direction=rtl on per-axis txPr \u002F title; incl. pareto), image (picture — SVG), comment (direction=rtl), table (listobject), namedrange (definedname, volatile, `[@name=X]` selector), pivottable (pivot, calculatedField), sparkline, validation (datavalidation), autofilter, shape, textbox, databar\u002Fcolorscale\u002Ficonset\u002Fformulacf\u002FcellIs\u002FtopN\u002FaboveAverage (conditional formatting), ole, csv (tsv). Query supports `merge`\u002F`mergedrange` aliases for `mergeCell`. Workbook: password. `value=\"=SUM(...)\"` auto-detects as formula. Chart\u002Fpicture\u002Fshape\u002Fslicer accept `anchor=A1:E10`. |\n\n### Pivot tables (xlsx)\n\n```bash\nofficecli add data.xlsx \u002FSheet1 --type pivottable \\\n  --prop source=\"Sheet1!A1:E100\" --prop rows=Region,Category \\\n  --prop cols=Year --prop values=\"Sales:sum,Qty:count\" \\\n  --prop grandTotals=rows --prop subtotals=off --prop sort=asc\n```\n\nKey props: `rows`, `cols`, `values` (Field:func[:showDataAs]), `filters`, `source`, `position`, `layout` (compact\u002Foutline\u002Ftabular), `repeatLabels`, `blankRows`, `aggregate`, `showDataAs` (percent_of_total\u002Frow\u002Fcol, 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.\n\n### Document-level properties (all formats)\n\n```bash\nofficecli set doc.docx \u002F --prop docDefaults.font=Arial --prop docDefaults.fontSize=11pt\nofficecli set doc.docx \u002F --prop protection=forms --prop evenAndOddHeaders=true\nofficecli set data.xlsx \u002F --prop calc.mode=manual --prop calc.refMode=r1c1\nofficecli set slides.pptx \u002F --prop defaultFont=Arial --prop show.loop=true --prop print.what=handouts\n```\n\nRun `officecli help \u003Cformat> \u002F` for all document-level properties (docDefaults, docGrid, CJK spacing, calc, print, show, theme, extended).\n\n### Sort (xlsx)\n\n```bash\nofficecli set data.xlsx \u002FSheet1 --prop sort=\"C desc\" --prop sortHeader=true\nofficecli set data.xlsx '\u002FSheet1\u002FA1:D100' --prop sort=\"A asc\" --prop sortHeader=true\n```\n\nFormat: `COL DIR[, COL DIR ...]`. Rejects ranges with merged cells or formulas. Sidecar metadata (hyperlinks, comments, conditional formatting, drawings) follows rows automatically.\n\n### Text-anchored insert (`--after find:X` \u002F `--before find:X`)\n\nLocate 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.\n\n```bash\n# Word: inline run after matched text\nofficecli add doc.docx '\u002Fbody\u002Fp[1]' --type run --after find:weather --prop text=\" (sunny)\"\n\n# Word: block table after matched text (auto-splits paragraph)\nofficecli add doc.docx '\u002Fbody\u002Fp[1]' --type table --after \"find:First sentence.\" --prop rows=2 --prop cols=2\n```\n\n### Clone\n\n`officecli add \u003Cfile> \u002F --from '\u002Fslide[1]'` — copies with all cross-part relationships.\n\n### move, swap, remove\n\n```bash\nofficecli move \u003Cfile> \u003Cpath> [--to \u003Cparent>] [--index N] [--after \u003Cpath>] [--before \u003Cpath>]\nofficecli swap \u003Cfile> \u003Cpath1> \u003Cpath2>\nofficecli remove \u003Cfile> '\u002Fbody\u002Fp[4]'\n```\n\nWhen using `--after` or `--before`, `--to` can be omitted — the target container is inferred from the anchor.\n\n### batch — multiple operations in one save cycle\n\nContinues 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.\n\n`officecli dump \u003Cfile.docx> [\u003Cpath>]` emits a replayable batch JSON for round-trip. Path defaults to `\u002F` (whole document); pass a subtree path (`\u002Fbody`, `\u002Fbody\u002Fp[N]`, `\u002Fbody\u002Ftbl[N]`, `\u002Ftheme`, `\u002Fsettings`, `\u002Fnumbering`, `\u002Fstyles`) to scope the dump. `officecli refresh \u003Cfile.docx>` recalculates TOC page numbers \u002F PAGE \u002F cross-references after replay (Word backend on Windows; headless-HTML fallback elsewhere).\n\n```bash\necho '[\n  {\"command\":\"set\",\"path\":\"\u002FSheet1\u002FA1\",\"props\":{\"value\":\"Name\",\"bold\":\"true\"}},\n  {\"command\":\"set\",\"path\":\"\u002FSheet1\u002FB1\",\"props\":{\"value\":\"Score\",\"bold\":\"true\"}}\n]' | officecli batch data.xlsx --json\n\nofficecli batch data.xlsx --commands '[{\"op\":\"set\",\"path\":\"\u002FSheet1\u002FA1\",\"props\":{\"value\":\"Done\"}}]' --json\nofficecli batch data.xlsx --input updates.json --force --json\n```\n\nSupports: `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`.\n\n---\n\n## L3: Raw XML\n\nUse when L2 cannot express what you need. No xmlns declarations needed — prefixes auto-registered.\n\n```bash\nofficecli raw \u003Cfile> \u003Cpart>                          # view raw XML\nofficecli raw-set \u003Cfile> \u003Cpart> --xpath \"...\" --action replace --xml '\u003Cw:p>...\u003C\u002Fw:p>'\nofficecli add-part \u003Cfile> \u003Cparent>                   # create new document part (returns rId)\n```\n\n`raw-set` actions: `append`, `prepend`, `insertbefore`, `insertafter`, `replace`, `remove`, `setattr`. Run `officecli help \u003Cformat> raw` for available parts.\n\n---\n\n## Common Pitfalls\n\n| Pitfall | Correct Approach |\n|---------|-----------------|\n| `--name \"foo\"` | Use `--prop name=\"foo\"` — all attributes go through `--prop` |\n| Unquoted `[N]` paths in zsh\u002Fbash | Always quote: `'\u002Fslide[1]'` or `\"\u002Fslide[1]\"` (shell glob-expands brackets) |\n| PPT `shape[1]` for content | `shape[1]` is typically the title placeholder. Use `shape[2]+` for content shapes |\n| `\u002Fshape[myname]` | Name indexing not supported. Use numeric index or `@name=` (PPT only) |\n| Guessing property names | Run `officecli help \u003Cformat> \u003Celement>` to see exact names |\n| Modifying an open file | Close the file in PowerPoint\u002FWPS first |\n| `\\n` in shell strings | Use `\\\\n` for newlines in `--prop text=\"...\"` |\n| `$` in shell text | `--prop text=\"$15M\"` strips `$15`. Use single quotes: `--prop text='$15M'`, or heredoc batch |\n\n---\n\n## Specialized Skills\n\n`officecli load_skill \u003Cname>` — output is a SKILL.md, follow its rules.\n\n**Loading rule**:\n- Pick the most specific match in \"When to use\"; if none fits, load the format default (`word` \u002F `pptx` \u002F `excel`).\n- Scenes already contain the format default's rules — load **one** skill per artifact, never stack.\n- Loaded rules persist across turns; don't re-load each reply.\n- Two distinct artifacts → two separate loads.\n\n### Word (.docx)\n\n| Name | When to use |\n|------|-------------|\n| `word` | Reports, letters, memos, proposals, generic documents |\n| `academic-paper` | Journal \u002F conference \u002F thesis: APA \u002F Chicago \u002F IEEE \u002F MLA citations, equations, SEQ + PAGEREF cross-refs, multi-column journal layout, bibliography. NOT for business reports or letters (route those to `word`) |\n\n### PowerPoint (.pptx)\n\n| Name | When to use |\n|------|-------------|\n| `pptx` | Generic decks: board reviews, sales decks, all-hands, product launches |\n| `pitch-deck` | **Fundraising only** — seed \u002F Series A-C \u002F SAFE \u002F convertible \u002F strategic raise. NOT for sales \u002F product \u002F board decks (route those to `pptx`) |\n\n### Excel (.xlsx)\n\n| Name | When to use |\n|------|-------------|\n| `excel` | Generic workbooks, formulas, pivots, trackers |\n| `financial-model` | Financial models, scenarios, projections. NOT for general data analysis (route those to `excel`) |\n| `data-dashboard` | CSV\u002Ftabular data → KPI \u002F analytics \u002F executive dashboards with charts and sparklines. NOT for raw data tracking (route those to `excel`) |\n\nExample: a fundraising deck task → `officecli load_skill pitch-deck` → use the printed rules.\n\n---\n\n## Notes\n\n- Paths are **1-based** (XPath convention): `'\u002Fbody\u002Fp[3]'` = third paragraph\n- `--index` is **0-based** (array convention): `--index 0` = first position\n- **Excel exception**: for `add --type row` and `add --type col`, `--index N` is **1-based** (matches OOXML RowIndex \u002F column letter index). `--index 5` inserts at row 5 \u002F column 5.\n- After modifications, verify with `validate` and\u002For `view issues`\n- **When unsure**, run `officecli help \u003Cformat> \u003Celement>` instead of guessing\n","# officecli\n\nAI-friendly CLI for .docx, .xlsx, .pptx. Single binary, no dependencies, no Office installation needed.\n\n## Managed component setup\n\nUse NomiFun's approved **iOfficeAI\u002FOfficeCLI 1.0.156** through an already-authorized\n`workspace.process\u002Fstart` tool with `component=officecli`\nand literal `args`. The Host verifies the executable and sets its required\nenvironment. Follow [the shared runtime instructions](references\u002Fruntime.md) before\nrunning any example. Every `officecli` example means this component target;\ndo not copy executable paths from Skill resources or use an ambient PATH tool.\n\nStandalone use outside NomiFun uses the exact official scoped package\n`@officecli\u002Fofficecli@1.0.156`; the shared instructions cover verification.\n\n## Strategy\n\n**L1 (read) → L2 (DOM edit) → L3 (raw XML)**. Always prefer higher layers. Add `--json` for structured output.\n\n**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.\n\n---\n\n## Help System (IMPORTANT)\n\n**When unsure about property names, value formats, or command syntax, ALWAYS run help instead of guessing.** One help query beats guess-fail-retry loops.\n\n`officecli help` ≡ `officecli --help`, and `officecli \u003Ccmd> --help` ≡ `officecli help \u003Ccmd>` — same content.\n\n```bash\nofficecli help                                  # All commands + global options + schema entry points\nofficecli help docx                             # List all docx elements\nofficecli help docx paragraph                   # Full schema: properties, aliases, examples, readbacks\nofficecli help docx set paragraph               # Verb-filtered: only props usable with `set`\nofficecli help docx paragraph --json            # Structured schema (machine-readable)\n```\n\nFormat aliases: `word`→`docx`, `excel`→`xlsx`, `ppt`\u002F`powerpoint`→`pptx`. Verbs: `add`, `set`, `get`, `query`, `remove`. MCP exposes the same schema via `{\"command\":\"help\",\"format\":\"docx\",\"type\":\"paragraph\"}`.\n\n---\n\n## Performance: Resident Mode (standalone only)\n\nInside NomiFun, follow the Host resource's one-shot mode and\n`OFFICECLI_NO_AUTO_RESIDENT=1` on every supervised command. Do not use resident\n`open` \u002F `watch` sessions or depend on a later `close` to flush a product task.\nThe following resident workflow applies only to explicit standalone CLI use.\n\n**Every command auto-starts a resident on first access** (60s idle timeout) — file-lock conflicts are automatically avoided. Explicit `open`\u002F`close` is still recommended for longer sessions (12min idle):\n```bash\nofficecli open report.docx       # explicitly keep in memory\nofficecli set report.docx ...    # no file I\u002FO overhead\nofficecli close report.docx      # save and release\n```\n\nOpt out of auto-start: `OFFICECLI_NO_AUTO_RESIDENT=1`.\n\n---\n\n## Quick Start\n\n**PPT:**\n```bash\nofficecli create slides.pptx\nofficecli add slides.pptx \u002F --type slide --prop title=\"Q4 Report\" --prop background=1A1A2E\nofficecli add slides.pptx '\u002Fslide[1]' --type shape --prop text=\"Revenue grew 25%\" --prop x=2cm --prop y=5cm --prop font=Arial --prop size=24 --prop color=FFFFFF\n```\n\n**Word:**\n```bash\nofficecli create report.docx\nofficecli add report.docx \u002Fbody --type paragraph --prop text=\"Executive Summary\" --prop style=Heading1\nofficecli add report.docx \u002Fbody --type paragraph --prop text=\"Revenue increased by 25% year-over-year.\"\n```\n\n**Excel:**\n```bash\nofficecli create data.xlsx\nofficecli set data.xlsx \u002FSheet1\u002FA1 --prop value=\"Name\" --prop bold=true\nofficecli set data.xlsx \u002FSheet1\u002FA2 --prop value=\"Alice\"\n```\n\n---\n\n## L1: Create, Read & Inspect\n\n```bash\nofficecli create \u003Cfile>               # Create blank .docx\u002F.xlsx\u002F.pptx (type from extension)\nofficecli view \u003Cfile> \u003Cmode>          # outline | stats | issues | text | annotated | html\nofficecli get \u003Cfile> \u003Cpath> --depth N # Get a node and its children [--json]\nofficecli query \u003Cfile> \u003Cselector>     # CSS-like query\nofficecli validate \u003Cfile>             # Validate against OpenXML schema\n```\n\n### view modes\n\n| Mode | Description | Useful flags |\n|------|-------------|-------------|\n| `outline` | Document structure | |\n| `stats` | Statistics (pages, words, shapes) | |\n| `issues` | Formatting\u002Fcontent\u002Fstructure problems | `--type format\\|content\\|structure`, `--limit N` |\n| `text` | Plain text extraction | `--start N --end N`, `--max-lines N` |\n| `annotated` | Text with formatting annotations | |\n| `html` | Static HTML snapshot — same renderer as `watch`, no server needed | `--browser`, `--page N` (docx), `--start N --end N` (pptx) |\n\nUse `view html` for one-shot snapshots (CI artifacts, archival, diffing); use `watch` when you need live refresh or browser-side click-to-select.\n\n### get\n\nAny 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 ...`\n\n```bash\nofficecli get report.docx '\u002Fbody\u002Fp[3]' --depth 2 --json\nofficecli get slides.pptx '\u002Fslide[1]' --depth 1          # list all shapes on slide 1\nofficecli get data.xlsx '\u002FSheet1\u002FB2' --json\n```\n\n### Stable ID Addressing\n\nElements with stable IDs return `@attr=value` paths instead of positional indices. Prefer these in multi-step workflows — positional indices shift on insert\u002Fdelete, stable IDs do not.\n\n```\n\u002Fslide[1]\u002Fshape[@id=550950021]                    # PPT shape\n\u002Fslide[1]\u002Ftable[@id=1388430425]\u002Ftr[1]\u002Ftc[2]       # PPT table\n\u002Fbody\u002Fp[@paraId=1A2B3C4D]                         # Word paragraph\n\u002Fcomments\u002Fcomment[@commentId=1]                    # Word comment\n```\n\nPPT also accepts `@name=` (e.g. `shape[@name=Title 1]`), with morph `!!` prefix awareness. Elements without stable IDs (slide, run, tr\u002Ftc, row) fall back to positional indices.\n\n### query\n\nCSS-like selectors: `[attr=value]`, `[attr!=value]`, `[attr~=text]`, `[attr>=value]`, `[attr\u003C=value]`, `:contains(\"text\")`, `:empty`, `:has(formula)`, `:no-alt`.\n\n```bash\nofficecli query report.docx 'paragraph[style=Normal] > run[font!=Arial]'\nofficecli query slides.pptx 'shape[fill=FF0000]'\n```\n\n---\n\n## Watch & Interactive Selection\n\nThis is an explicit standalone CLI workflow. NomiFun attachment previews use\nmanaged static HTML artifacts and do not start this server.\n\nLive HTML preview that auto-refreshes on every file change. Browsers can click \u002F shift-click \u002F box-drag to select shapes; the CLI can read the current browser selection and act on it.\n\n```bash\nofficecli watch \u003Cfile> [--port N]      # Start preview server (default port 26315)\nofficecli unwatch \u003Cfile>               # Stop\nofficecli goto \u003Cfile> \u003Cpath>           # Scroll watching browser(s) to element (docx: p \u002F table \u002F tr \u002F tc)\n```\n\nOpen the printed `http:\u002F\u002Flocalhost:N` URL. Click to select; shift\u002Fcmd\u002Fctrl+click to multi-select; drag from empty space to box-select. PPT\u002FWord use blue outline; Excel uses native-style green selection (double-click cell to edit inline; drag a chart to reposition).\n\n### `get \u003Cfile> selected` — read what the user clicked\n\n```bash\nofficecli get \u003Cfile> selected [--json]\n```\n\nReturns DocumentNodes for whatever is currently selected. Empty result if nothing selected. Exit code != 0 if no watch is running.\n\n```bash\n# User clicks shapes in the browser, then asks \"make these red\"\nPATHS=$(officecli get deck.pptx selected --json | jq -r '.data.Results[].path')\nfor p in $PATHS; do officecli set deck.pptx \"$p\" --prop fill=FF0000; done\n```\n\n### Key properties\n\n- **Selection survives file edits.** Paths use stable `@id=` form.\n- **All connected browsers share one selection.** Last-write-wins.\n- **Same-file single-watch.** A given file can have only one watch process at a time.\n- **Group shapes select as a whole.** Drilling into individual children of a group is not supported in v1.\n- **Coverage:** `.pptx` shapes\u002Fpictures\u002Ftables\u002Fcharts\u002Fconnectors\u002Fgroups; `.docx` top-level paragraphs and tables. Inherited layout\u002Fmaster decorations and Word nested elements (table cells, run-level) are not addressable. **`.xlsx` does not emit `data-path`** — `mark`\u002F`selection` on xlsx always resolve `stale=true` (v2 candidate).\n\n### Marks — edit proposals waiting for review\n\nUse `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).\n\n```bash\nofficecli mark \u003Cfile> \u003Cpath> [--prop find=... color=... note=... tofix=... regex=true] [--json]\nofficecli unmark \u003Cfile> [--path \u003Cp> | --all] [--json]\nofficecli get-marks \u003Cfile> [--json]\n```\n\nProps: `find` (literal or regex when `regex=true`; raw form `find='r\"[abc]\"'`), `color` (hex \u002F `rgb(...)` \u002F 22 named whitelist), `note`, `tofix` (drives apply pipeline). **Path** must be `data-path` format from watch HTML — see subskills for full pipeline.\n\n---\n\n## L2: DOM Operations\n\n### set — modify properties\n\n```bash\nofficecli set \u003Cfile> \u003Cpath> --prop key=value [--prop ...]\n```\n\n**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.\n\n**Value formats:**\n\n| Type | Format | Examples |\n|------|--------|---------|\n| Colors | Hex (with\u002Fwithout `#`), named, RGB, theme | `FF0000`, `#FF0000`, `red`, `rgb(255,0,0)`, `accent1`..`accent6` |\n| Spacing | Unit-qualified | `12pt`, `0.5cm`, `1.5x`, `150%` |\n| Dimensions | EMU or suffixed | `914400`, `2.54cm`, `1in`, `72pt`, `96px` |\n\n**Dotted-attr aliases** — `font.\u003Cattr>` forms accepted on shape\u002Frun\u002Fparagraph\u002Ftable\u002Frow\u002Fcell\u002Fsection\u002Fstyles, e.g. `--prop font.color=red --prop font.bold=true --prop font.size=14pt`. Run `officecli help \u003Cfmt> \u003Celement>` for the full list.\n\n### find — format or replace matched text\n\nUse `find=` with `set` to target specific text for formatting or replacement. Format props are separate `--prop` flags — do NOT nest them.\n\n```bash\n# Format matched text (auto-splits runs)\nofficecli set doc.docx '\u002Fbody\u002Fp[1]' --prop find=weather --prop bold=true --prop color=red\n\n# Regex matching\nofficecli set doc.docx '\u002Fbody\u002Fp[1]' --prop 'find=\\d+%' --prop regex=true --prop color=red\n\n# Replace text (use `\u002F` for whole-document scope)\nofficecli set doc.docx \u002F --prop find=draft --prop replace=final\n\n# PPT — same syntax, different paths\nofficecli set slides.pptx \u002F --prop find=draft --prop replace=final\n```\n\n**Path controls search scope:** `\u002F` = whole document, `\u002Fbody\u002Fp[1]` or `\u002Fslide[N]\u002Fshape[M]` = specific element, `\u002Fheader[1]` \u002F `\u002Ffooter[1]` = headers\u002Ffooters.\n\n**Notes:**\n- Case-sensitive by default. Case-insensitive: `--prop 'find=(?i)error' --prop regex=true`\n- Matches work across run boundaries\n- No match = silent success. `--json` includes `\"matched\": N`\n- **Excel:** only `find` + `replace` supported (no find + format props)\n\n### add — add elements or clone\n\n```bash\nofficecli add \u003Cfile> \u003Cparent> --type \u003Ctype> [--prop ...]\nofficecli add \u003Cfile> \u003Cparent> --type \u003Ctype> --after \u003Cpath> [--prop ...]   # insert after anchor\nofficecli add \u003Cfile> \u003Cparent> --type \u003Ctype> --before \u003Cpath> [--prop ...]  # insert before anchor\nofficecli add \u003Cfile> \u003Cparent> --type \u003Ctype> --index N [--prop ...]        # 0-based position (legacy)\nofficecli add \u003Cfile> \u003Cparent> --from \u003Cpath>                               # clone existing element\n```\n\n`--after`, `--before`, `--index` are mutually exclusive. No position flag = append to end.\n\n**Element types (with aliases):**\n\n| Format | Types |\n|--------|-------|\n| **pptx** | slide (incl. hidden), shape (textbox — font.latin\u002Fea\u002Fcs, direction=rtl), picture (SVG, brightness\u002Fcontrast\u002Fglow\u002Fshadow), chart (direction=rtl), table (cell direction=rtl), row (tr), connector (connection\u002Fline), group, video (audio\u002Fmedia, trim), equation (formula\u002Fmath), notes (direction=rtl, lang), comment (RTL via U+200F bidi mark; full CRUD via \u002Fslide[N]\u002Fcomment[M]), paragraph (para), run, zoom (slidezoom), ole (oleobject\u002Fobject\u002Fembed), placeholder (phType=title\u002Fbody\u002Fsubtitle\u002Ffooter\u002F...). slideLayout\u002FslideMaster direction inheritance. |\n| **docx** | paragraph (para — direction\u002Ffont.latin\u002Fea\u002Fcs, bold.cs\u002Fitalic.cs\u002Fsize.cs for RTL\u002FCJK; lang.latin\u002Fea\u002Fcs BCP-47 tags on run; wordWrap toggle), run, table (direction=rtl → bidiVisual), row (tr), cell (td), image (picture\u002Fimg — SVG supported), header (direction), footer (direction), section (pageNumFmt full ECMA-376 enum incl. Hindi\u002FArabic\u002FThai\u002FCJK numerals; direction=rtl on Add\u002FSet; rtlGutter; pgBorders=box shorthand), bookmark, comment, footnote, endnote, formfield (text\u002Fcheckbox\u002Fdropdown), sdt (contentcontrol), chart, equation, field (28 types incl. mergefield\u002Fref\u002Fseq\u002Fstyleref\u002Fdocproperty\u002Fif), hyperlink, style (direction round-trip), toc, watermark, break (pagebreak\u002Fcolumnbreak), ole, **num \u002F abstractNum \u002F lvl** (numbering\u002Flist system), **tab** (paragraph or paragraph\u002Ftable style tab stops). docDefaults.rtl document-wide override; `get \u002F` exposes `locale`. Document protection: `set \u002F --prop protection=forms\\|readOnly\\|comments\\|trackedChanges\\|none` |\n| **xlsx** | sheet (visible\u002Fhidden\u002FveryHidden, print margins, printTitleRows\u002FCols, rightToLeft sheetView, cascade-aware rename), row, cell (type=richtext+runs, merge=range\u002Fsweep, direction=rtl, phonetic guide on add), chart (direction=rtl on per-axis txPr \u002F title; incl. pareto), image (picture — SVG), comment (direction=rtl), table (listobject), namedrange (definedname, volatile, `[@name=X]` selector), pivottable (pivot, calculatedField), sparkline, validation (datavalidation), autofilter, shape, textbox, databar\u002Fcolorscale\u002Ficonset\u002Fformulacf\u002FcellIs\u002FtopN\u002FaboveAverage (conditional formatting), ole, csv (tsv). Query supports `merge`\u002F`mergedrange` aliases for `mergeCell`. Workbook: password. `value=\"=SUM(...)\"` auto-detects as formula. Chart\u002Fpicture\u002Fshape\u002Fslicer accept `anchor=A1:E10`. |\n\n### Pivot tables (xlsx)\n\n```bash\nofficecli add data.xlsx \u002FSheet1 --type pivottable \\\n  --prop source=\"Sheet1!A1:E100\" --prop rows=Region,Category \\\n  --prop cols=Year --prop values=\"Sales:sum,Qty:count\" \\\n  --prop grandTotals=rows --prop subtotals=off --prop sort=asc\n```\n\nKey props: `rows`, `cols`, `values` (Field:func[:showDataAs]), `filters`, `source`, `position`, `layout` (compact\u002Foutline\u002Ftabular), `repeatLabels`, `blankRows`, `aggregate`, `showDataAs` (percent_of_total\u002Frow\u002Fcol, 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.\n\n### Document-level properties (all formats)\n\n```bash\nofficecli set doc.docx \u002F --prop docDefaults.font=Arial --prop docDefaults.fontSize=11pt\nofficecli set doc.docx \u002F --prop protection=forms --prop evenAndOddHeaders=true\nofficecli set data.xlsx \u002F --prop calc.mode=manual --prop calc.refMode=r1c1\nofficecli set slides.pptx \u002F --prop defaultFont=Arial --prop show.loop=true --prop print.what=handouts\n```\n\nRun `officecli help \u003Cformat> \u002F` for all document-level properties (docDefaults, docGrid, CJK spacing, calc, print, show, theme, extended).\n\n### Sort (xlsx)\n\n```bash\nofficecli set data.xlsx \u002FSheet1 --prop sort=\"C desc\" --prop sortHeader=true\nofficecli set data.xlsx '\u002FSheet1\u002FA1:D100' --prop sort=\"A asc\" --prop sortHeader=true\n```\n\nFormat: `COL DIR[, COL DIR ...]`. Rejects ranges with merged cells or formulas. Sidecar metadata (hyperlinks, comments, conditional formatting, drawings) follows rows automatically.\n\n### Text-anchored insert (`--after find:X` \u002F `--before find:X`)\n\nLocate 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.\n\n```bash\n# Word: inline run after matched text\nofficecli add doc.docx '\u002Fbody\u002Fp[1]' --type run --after find:weather --prop text=\" (sunny)\"\n\n# Word: block table after matched text (auto-splits paragraph)\nofficecli add doc.docx '\u002Fbody\u002Fp[1]' --type table --after \"find:First sentence.\" --prop rows=2 --prop cols=2\n```\n\n### Clone\n\n`officecli add \u003Cfile> \u002F --from '\u002Fslide[1]'` — copies with all cross-part relationships.\n\n### move, swap, remove\n\n```bash\nofficecli move \u003Cfile> \u003Cpath> [--to \u003Cparent>] [--index N] [--after \u003Cpath>] [--before \u003Cpath>]\nofficecli swap \u003Cfile> \u003Cpath1> \u003Cpath2>\nofficecli remove \u003Cfile> '\u002Fbody\u002Fp[4]'\n```\n\nWhen using `--after` or `--before`, `--to` can be omitted — the target container is inferred from the anchor.\n\n### batch — multiple operations in one save cycle\n\nContinues 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.\n\n`officecli dump \u003Cfile.docx> [\u003Cpath>]` emits a replayable batch JSON for round-trip. Path defaults to `\u002F` (whole document); pass a subtree path (`\u002Fbody`, `\u002Fbody\u002Fp[N]`, `\u002Fbody\u002Ftbl[N]`, `\u002Ftheme`, `\u002Fsettings`, `\u002Fnumbering`, `\u002Fstyles`) to scope the dump. `officecli refresh \u003Cfile.docx>` recalculates TOC page numbers \u002F PAGE \u002F cross-references after replay (Word backend on Windows; headless-HTML fallback elsewhere).\n\n```bash\necho '[\n  {\"command\":\"set\",\"path\":\"\u002FSheet1\u002FA1\",\"props\":{\"value\":\"Name\",\"bold\":\"true\"}},\n  {\"command\":\"set\",\"path\":\"\u002FSheet1\u002FB1\",\"props\":{\"value\":\"Score\",\"bold\":\"true\"}}\n]' | officecli batch data.xlsx --json\n\nofficecli batch data.xlsx --commands '[{\"op\":\"set\",\"path\":\"\u002FSheet1\u002FA1\",\"props\":{\"value\":\"Done\"}}]' --json\nofficecli batch data.xlsx --input updates.json --force --json\n```\n\nSupports: `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`.\n\n---\n\n## L3: Raw XML\n\nUse when L2 cannot express what you need. No xmlns declarations needed — prefixes auto-registered.\n\n```bash\nofficecli raw \u003Cfile> \u003Cpart>                          # view raw XML\nofficecli raw-set \u003Cfile> \u003Cpart> --xpath \"...\" --action replace --xml '\u003Cw:p>...\u003C\u002Fw:p>'\nofficecli add-part \u003Cfile> \u003Cparent>                   # create new document part (returns rId)\n```\n\n`raw-set` actions: `append`, `prepend`, `insertbefore`, `insertafter`, `replace`, `remove`, `setattr`. Run `officecli help \u003Cformat> raw` for available parts.\n\n---\n\n## Common Pitfalls\n\n| Pitfall | Correct Approach |\n|---------|-----------------|\n| `--name \"foo\"` | Use `--prop name=\"foo\"` — all attributes go through `--prop` |\n| Unquoted `[N]` paths in zsh\u002Fbash | Always quote: `'\u002Fslide[1]'` or `\"\u002Fslide[1]\"` (shell glob-expands brackets) |\n| PPT `shape[1]` for content | `shape[1]` is typically the title placeholder. Use `shape[2]+` for content shapes |\n| `\u002Fshape[myname]` | Name indexing not supported. Use numeric index or `@name=` (PPT only) |\n| Guessing property names | Run `officecli help \u003Cformat> \u003Celement>` to see exact names |\n| Modifying an open file | Close the file in PowerPoint\u002FWPS first |\n| `\\n` in shell strings | Use `\\\\n` for newlines in `--prop text=\"...\"` |\n| `$` in shell text | `--prop text=\"$15M\"` strips `$15`. Use single quotes: `--prop text='$15M'`, or heredoc batch |\n\n---\n\n## Specialized Skills\n\n`officecli load_skill \u003Cname>` — output is a SKILL.md, follow its rules.\n\n**Loading rule**:\n- Pick the most specific match in \"When to use\"; if none fits, load the format default (`word` \u002F `pptx` \u002F `excel`).\n- Scenes already contain the format default's rules — load **one** skill per artifact, never stack.\n- Loaded rules persist across turns; don't re-load each reply.\n- Two distinct artifacts → two separate loads.\n\n### Word (.docx)\n\n| Name | When to use |\n|------|-------------|\n| `word` | Reports, letters, memos, proposals, generic documents |\n| `academic-paper` | Journal \u002F conference \u002F thesis: APA \u002F Chicago \u002F IEEE \u002F MLA citations, equations, SEQ + PAGEREF cross-refs, multi-column journal layout, bibliography. NOT for business reports or letters (route those to `word`) |\n\n### PowerPoint (.pptx)\n\n| Name | When to use |\n|------|-------------|\n| `pptx` | Generic decks: board reviews, sales decks, all-hands, product launches |\n| `pitch-deck` | **Fundraising only** — seed \u002F Series A-C \u002F SAFE \u002F convertible \u002F strategic raise. NOT for sales \u002F product \u002F board decks (route those to `pptx`) |\n\n### Excel (.xlsx)\n\n| Name | When to use |\n|------|-------------|\n| `excel` | Generic workbooks, formulas, pivots, trackers |\n| `financial-model` | Financial models, scenarios, projections. NOT for general data analysis (route those to `excel`) |\n| `data-dashboard` | CSV\u002Ftabular data → KPI \u002F analytics \u002F executive dashboards with charts and sparklines. NOT for raw data tracking (route those to `excel`) |\n\nExample: a fundraising deck task → `officecli load_skill pitch-deck` → use the printed rules.\n\n---\n\n## Notes\n\n- Paths are **1-based** (XPath convention): `'\u002Fbody\u002Fp[3]'` = third paragraph\n- `--index` is **0-based** (array convention): `--index 0` = first position\n- **Excel exception**: for `add --type row` and `add --type col`, `--index N` is **1-based** (matches OOXML RowIndex \u002F column letter index). `--index 5` inserts at row 5 \u002F column 5.\n- After modifications, verify with `validate` and\u002For `view issues`\n- **When unsure**, run `officecli help \u003Cformat> \u003Celement>` instead of guessing\n",{"name":5,"description":7},"main","712c038e9101ebc41b9d37bd7c20b8ed1e18be70","crates\u002Fbackend\u002Fnomifun-skill-library\u002Fassets\u002Fbuiltin-skills\u002Fofficecli",69,"https:\u002F\u002Fgithub.com\u002Fnomifun\u002Fnomifun-desktop","https:\u002F\u002Fwww.nomifun.com","https:\u002F\u002Fgithub.com\u002Fnomifun","2026-11-10 13:11:32",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add nomifun\u002Fnomifun-desktop --skill officecli",{"tool":38,"command":39},"bunx","bunx skills add nomifun\u002Fnomifun-desktop --skill officecli",{"tool":41,"command":42},"pnpm","pnpm dlx skills add nomifun\u002Fnomifun-desktop --skill officecli","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnomifun\u002Fnomifun-desktop\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-skill-library\u002Fassets\u002Fbuiltin-skills\u002Fofficecli\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fruntime.md","REFERENCE","参考文档",4428,"https:\u002F\u002Fgithub.com\u002Fnomifun\u002Fnomifun-desktop\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-skill-library\u002Fassets\u002Fbuiltin-skills\u002Fofficecli\u002Freferences\u002Fruntime.md",[53,60,67,74,81,88],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M77M8MMWZJW7R64HE3Y439C7","drive-nomifun","Connect an authorized external client to NomiFun's canonical Remote ingress. Use an installation access token and a local-owner-created RemoteBinding, then operate the explicit open\u002Fturn\u002Fobserve\u002Fcancel AgentSession lifecycle.","https:\u002F\u002Fgithub.com\u002Fnomifun\u002Fnomifun-desktop\u002Fblob\u002Fmain\u002Fdocs\u002Fskills\u002Fdrive-nomifun\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M77M8KDABQ0M0067JYQR13TS","example-skill","Fixture skill used by startup_materialize integration tests.","https:\u002F\u002Fgithub.com\u002Fnomifun\u002Fnomifun-desktop\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-skill-library\u002Ftests\u002Ffixtures\u002Fbuiltin-skills-fixture\u002Fexample-skill\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M77M8GD07BZDGTPRCBR3PXD1","ui-ux-pro-max","Professional UI\u002FUX design research skill with a bundled searchable database for product patterns, visual styles, color palettes, typography, landing-page structure, dashboard charts, UX practices, and stack guidance. Use when designing, building, reviewing, or improving interfaces.","https:\u002F\u002Fgithub.com\u002Fnomifun\u002Fnomifun-desktop\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-skill-library\u002Fassets\u002Fbuiltin-skills\u002Fui-ux-pro-max\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M77M8CF6WHBCMRR4HNYT0Z7A","planning-with-files","Maintain durable task plans, findings, and progress logs in workspace files for long-running or research-heavy work. Use when a task spans many steps or sessions, needs an auditable evidence trail, or risks losing important decisions to context limits. Do not use for short tasks that fit comfortably in the active conversation.","https:\u002F\u002Fgithub.com\u002Fnomifun\u002Fnomifun-desktop\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-skill-library\u002Fassets\u002Fbuiltin-skills\u002Fplanning-with-files\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M77M80QV164C4FS33SHH8DW0","officecli-xlsx","Use this skill any time a .xlsx file is involved -- as input, output, or both. This includes: creating spreadsheets, financial models, dashboards, or trackers; reading, parsing, or extracting data from any .xlsx file; editing, modifying, or updating existing workbooks; working with formulas, charts, pivot tables, or templates; importing CSV\u002FTSV data into Excel format. Trigger whenever the user mentions 'spreadsheet', 'workbook', 'Excel', 'financial model', 'tracker', 'dashboard', or references a .xlsx\u002F.csv filename.","https:\u002F\u002Fgithub.com\u002Fnomifun\u002Fnomifun-desktop\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-skill-library\u002Fassets\u002Fbuiltin-skills\u002Fofficecli-xlsx\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M77M7MN09P079R3TF7GS70E3","officecli-word-form","Use this skill to create fillable Word forms (.docx) with real Content Controls (SDT) + legacy FormField checkboxes + MERGEFIELD mail-merge placeholders + document protection. Trigger on: 'fillable form', 'form fields', 'content controls', 'SDT', 'word form', 'fill in', 'only editable fields', 'protect document', 'onboarding form', 'HR intake', 'survey template', 'contract \u002F SOW template', 'mail-merge template', 'compliance checklist', 'medical intake questionnaire'. Output is a single .docx where specific fields are editable and the rest is locked. This skill is INDEPENDENT, not a scene layer on docx — payload is `\u003Cw:sdt>` + `\u003Cw:ffData>` + `\u003Cw:fldChar>` + `documentProtection`, none of which docx base skill covers. Do NOT trigger for regular reports, letters, memos, academic papers, pitch decks, or any document with no user-fillable fields — route those to officecli-docx or its scene layers.","https:\u002F\u002Fgithub.com\u002Fnomifun\u002Fnomifun-desktop\u002Fblob\u002Fmain\u002Fcrates\u002Fbackend\u002Fnomifun-skill-library\u002Fassets\u002Fbuiltin-skills\u002Fofficecli-word-form\u002FSKILL.md",[],[]]