[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BMHPFRTBXSRA4GD1DJ9QAM":3,"skill-same:01M7BMHPFRTBXSRA4GD1DJ9QAM":45},{"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":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7BMHPFRTBXSRA4GD1DJ9QAM","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.","kipyin\u002Fkstack","kipyin","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F28321392?v=4","01M7BMGXGJYY2NYKEDBA4NQET4","Kip","01M7BMGXHMYJVHMS0TF8B1M2SV",0,"MIT","https:\u002F\u002Fgithub.com\u002Fkipyin\u002Fkstack\u002Fblob\u002Fmain\u002Fglobal\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## Install\n\nIf `officecli` is not installed:\n\n```bash\n# macOS \u002F Linux\ncurl -fsSL https:\u002F\u002Fd.officecli.ai\u002Finstall.sh | bash\n\n# Windows (PowerShell)\nirm https:\u002F\u002Fd.officecli.ai\u002Finstall.ps1 | iex\n```\n\nVerify with `officecli --version`. If still not found after install, open a new terminal.\n\n---\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 the single `command` string param: `{\"command\":\"help docx paragraph\"}` (not a structured `{\"format\":...,\"type\":...}` object — the MCP tool has exactly one param, `command`, and passes it through to the CLI verbatim).\n\n---\n\n## Performance: Resident Mode\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**Flush only at the non-officecli boundary.** officecli's own reads (`get`\u002F`query`\u002F`view`\u002F`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\u002Fopenpyxl, Word, a renderer, delivery\u002Fupload. (Idle sessions auto-flush within seconds; `OFFICECLI_RESIDENT_FLUSH=each` makes every mutation flush before returning.)\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| `screenshot` \u002F `svg` \u002F `pdf` \u002F `forms` | PNG via headless browser \u002F SVG (pptx slide) \u002F PDF via exporter plugin \u002F form-fields JSON via format-handler plugin | `-o`, `--screenshot-width\u002F-height`, pptx `--grid N` |\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`. Boolean `and`\u002F`or` supported across `query`\u002F`set`\u002F`remove`: `cell[value>5000 or value\u003C100]`, `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`\u002F`query`). Bare unscoped selectors rejected on `set`\u002F`remove`.\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\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 top-level `--find` \u002F `--replace` on `set` (and `--find` on `query`). Legacy `--prop find=X` still works but emits a hint.\n\n```bash\n# Format matched text (auto-splits runs)\nofficecli set doc.docx '\u002Fbody\u002Fp[1]' --find weather --prop bold=true --prop color=red\n\n# Regex matching (regex= still a prop flag)\nofficecli set doc.docx '\u002Fbody\u002Fp[1]' --find '\\d+%' --prop regex=true --prop color=red\n\n# Replace text (use `\u002F` for whole-document scope)\nofficecli set doc.docx \u002F --find draft --replace final\n\n# docx: tracked Find&Replace\nofficecli set doc.docx \u002F --find draft --replace final --prop revision.author=Alice\n\n# PPT — same syntax, different paths\nofficecli set slides.pptx \u002F --find draft --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 (font.latin\u002Fea\u002Fcs, direction=rtl, underline.color, highlight=COLOR (Add\u002FSet\u002FGet\u002FHTML preview), effective.X+effective.X.src; arrow alias for rightArrow; slideMaster\u002FslideLayout typed add\u002Fset\u002Fremove), picture (SVG, brightness\u002Fcontrast\u002Fglow\u002Fshadow, rotation, link, tooltip), chart (direction=rtl, pieOfPie, barOfPie, axisLine\u002Fgridline per-attr setters, animation+chartBuild=byCategory|bySeries, line dropLines\u002FhiLowLines\u002FupDownBars, anchor=x,y,w,h shorthand), table (cell direction=rtl, fill\u002Fbackground, built-in PowerPoint style catalogue, \u002Fcol[C] get + swap\u002FcopyFrom, row\u002Fcol Move\u002FCopyFrom), row (tr), connector (from\u002Fto accept full-path `@name=`\u002F`@id=` forms — bare `@name=Foo` is rejected, must be `\u002Fslide[N]\u002Fshape[@name=Foo]` — startshape\u002Fendshape SetByPath; edge-to-edge anchoring by default, fromSide\u002FtoSide to force an edge, fromIdx\u002FtoIdx for raw cxn index), group (link, tooltip, deep walk by get\u002Fquery\u002Fadd\u002Fremove, ungroup=true dissolves back to slide-absolute), align\u002Fdistribute (targets= accepts shape[@id=N] paths, not just positional), video\u002Faudio (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\u002Frestart\u002FautoReverse, chart animations), transition (12 p15 presets + morph\u002Fp14), 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), diagram (add-only mermaid → native shapes or rendered image, `--type diagram`\u002F`flowchart`). |\n| **docx** | paragraph (direction\u002Ffont.latin\u002Fea\u002Fcs, bold.cs\u002Fitalic.cs\u002Fsize.cs, lang.latin\u002Fea\u002Fcs, 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\u002F.date — bare `@author=`\u002F`@type=` selector on `set \u002Frevision[...]` for filtered accept\u002Freject, but `query 'revision[...]'` needs the dotted `revision.author=`\u002F`revision.type=` form; move+revision is run-level paths only, not paragraph-level; **range=START:END** on a paragraph\u002Fshape path formats a char span by explicit 0-based half-open offset instead of addressing a run — the offset sibling of find=), table (direction=rtl, hMerge, cantSplit on row\u002Fnowrap on cell (both add+set), **virtual column ops**: add\u002Fremove\u002Fmove\u002Fcopyfrom on \u002Fbody\u002Ftbl[N]\u002Fcol), row (tr), cell (td), image, header\u002Ffooter (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\u002FSet), toc, watermark, break, ole, **num\u002FabstractNum\u002Flvl**, **tab**, **textbox\u002Fshape** (add-mostly — Get returns raw XML preview only, no structured readback; Set is limited to width\u002Fheight\u002Fgeometry\u002Ffill\u002Fline.\\*; position is `anchor.x`\u002F`anchor.y` not bare x\u002Fy; **textbox-only** `textDirection`\u002Frotation\u002Fgradient\u002Fshadow — docx shape itself has neither rotation nor gradient), embedded **OLE round-trip on dump→batch**, **diagram** (add-only mermaid → native shapes or rendered image, `--type diagram`\u002F`flowchart`, no x\u002Fy at add-time — reposition via `set \u002Fbody\u002Fgroup[N]`). docDefaults.rtl, autoHyphenation, `get \u002F` exposes locale + \u002Fcomments \u002Ffootnotes \u002Fendnotes. `create --minimal` for raw OOXML scaffolding. |\n| **xlsx** | sheet (visible\u002Fhidden\u002FveryHidden, print margins, printTitleRows\u002FCols, rightToLeft sheetView, cascade-aware rename), row (c{N}= cell-content shorthand; add accepts --from \u002FSheet\u002Fcol[L]; formula-ref rewrite on insert), col (formula-ref rewrite, named-range follow on move), cell (type=richtext+runs, merge=range\u002Fsweep, direction=rtl, phonetic; **--shift left\\|up on remove, shift=right\\|down on add** — Excel UI dialog parity; formula auto-detect; OFFSET\u002FINDIRECT in calc), chart (per-axis RTL\u002Ftitle, 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=field:type:value add-time-only, topN=integer add-time-only, fillDownLabels is an alias of repeatLabels not a separate feature, calculatedField), sparkline, validation, autofilter, shape, textbox, CF (databar\u002Fcolorscale\u002Ficonset\u002Fformulacf\u002FcellIs\u002FtopN\u002FaboveAverage), ole, csv. Query supports `merge`\u002F`mergedrange`. Workbook: password. Shape selector enumerates leaves inside grpSp. |\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\n**Atomic by default (v1.0.137+):** every item still runs and is reported (so `N succeeded, M failed` stays meaningful and every failure surfaces), but if *any* item fails the whole batch rolls back — the file on disk is left byte-identical to before the batch ran (confirmed live in both standalone and resident mode). Use `--best-effort` to restore the old apply-what-succeeds behavior (useful for lossy `dump→batch` replays where losing the whole thing over one unsupported item is worse than a partial result). `--stop-on-error` only changes how early the run stops (remaining items are `skipped`), not whether what ran gets kept — combine it with `--best-effort` if you want \"stop at first failure but keep what already succeeded.\" `--force` is unrelated — it's only the docx-protection bypass. Failed items carry a machine-readable `code` field (same list as `error.code`); a rolled-back batch's JSON summary carries `\"atomicRolledBack\": true`.\n\n`officecli dump \u003Cfile> [\u003Cpath>]` emits a replayable batch JSON for round-trip — `.docx` (full coverage), `.pptx` (text\u002Ftables\u002Fpictures\u002Fcharts\u002Fnotes\u002Ftheme + OLE\u002F3D\u002Fvideo\u002Faudio\u002FSmartArt\u002Fmorph\u002Fp15 transitions via raw-set passthrough), and `.xlsx` (cells\u002Fformulas\u002Fstyles + tables, conditional formatting, validations, comments, charts, sparklines, pictures, shapes, pivot tables; slicers\u002FchartEx\u002FOLE via verbatim carrier). Path defaults to `\u002F` (whole document); pass a subtree path (docx: `\u002Fbody`, `\u002Fbody\u002Fp[N]`, `\u002Fbody\u002Ftbl[N]`, `\u002Ftheme`, `\u002Fsettings`, `\u002Fnumbering`, `\u002Fstyles`; xlsx: `\u002FSheetName`, `\u002Fsheet[N]`) 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). `officecli plugins list` extends support to `.doc`, `.hwpx`, `.pdf` export.\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 --best-effort --json   # keep whatever succeeds even if some items fail\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| `morph-ppt` | Cinematic Morph-animated presentations. NOT for static decks (route those to `pptx`) |\n| `morph-ppt-3d` | 3D Morph: GLB models, camera moves, depth. NOT for 2D-only Morph (route those to `morph-ppt`) |\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## Install\n\nIf `officecli` is not installed:\n\n```bash\n# macOS \u002F Linux\ncurl -fsSL https:\u002F\u002Fd.officecli.ai\u002Finstall.sh | bash\n\n# Windows (PowerShell)\nirm https:\u002F\u002Fd.officecli.ai\u002Finstall.ps1 | iex\n```\n\nVerify with `officecli --version`. If still not found after install, open a new terminal.\n\n---\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 the single `command` string param: `{\"command\":\"help docx paragraph\"}` (not a structured `{\"format\":...,\"type\":...}` object — the MCP tool has exactly one param, `command`, and passes it through to the CLI verbatim).\n\n---\n\n## Performance: Resident Mode\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**Flush only at the non-officecli boundary.** officecli's own reads (`get`\u002F`query`\u002F`view`\u002F`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\u002Fopenpyxl, Word, a renderer, delivery\u002Fupload. (Idle sessions auto-flush within seconds; `OFFICECLI_RESIDENT_FLUSH=each` makes every mutation flush before returning.)\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| `screenshot` \u002F `svg` \u002F `pdf` \u002F `forms` | PNG via headless browser \u002F SVG (pptx slide) \u002F PDF via exporter plugin \u002F form-fields JSON via format-handler plugin | `-o`, `--screenshot-width\u002F-height`, pptx `--grid N` |\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`. Boolean `and`\u002F`or` supported across `query`\u002F`set`\u002F`remove`: `cell[value>5000 or value\u003C100]`, `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`\u002F`query`). Bare unscoped selectors rejected on `set`\u002F`remove`.\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\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 top-level `--find` \u002F `--replace` on `set` (and `--find` on `query`). Legacy `--prop find=X` still works but emits a hint.\n\n```bash\n# Format matched text (auto-splits runs)\nofficecli set doc.docx '\u002Fbody\u002Fp[1]' --find weather --prop bold=true --prop color=red\n\n# Regex matching (regex= still a prop flag)\nofficecli set doc.docx '\u002Fbody\u002Fp[1]' --find '\\d+%' --prop regex=true --prop color=red\n\n# Replace text (use `\u002F` for whole-document scope)\nofficecli set doc.docx \u002F --find draft --replace final\n\n# docx: tracked Find&Replace\nofficecli set doc.docx \u002F --find draft --replace final --prop revision.author=Alice\n\n# PPT — same syntax, different paths\nofficecli set slides.pptx \u002F --find draft --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 (font.latin\u002Fea\u002Fcs, direction=rtl, underline.color, highlight=COLOR (Add\u002FSet\u002FGet\u002FHTML preview), effective.X+effective.X.src; arrow alias for rightArrow; slideMaster\u002FslideLayout typed add\u002Fset\u002Fremove), picture (SVG, brightness\u002Fcontrast\u002Fglow\u002Fshadow, rotation, link, tooltip), chart (direction=rtl, pieOfPie, barOfPie, axisLine\u002Fgridline per-attr setters, animation+chartBuild=byCategory|bySeries, line dropLines\u002FhiLowLines\u002FupDownBars, anchor=x,y,w,h shorthand), table (cell direction=rtl, fill\u002Fbackground, built-in PowerPoint style catalogue, \u002Fcol[C] get + swap\u002FcopyFrom, row\u002Fcol Move\u002FCopyFrom), row (tr), connector (from\u002Fto accept full-path `@name=`\u002F`@id=` forms — bare `@name=Foo` is rejected, must be `\u002Fslide[N]\u002Fshape[@name=Foo]` — startshape\u002Fendshape SetByPath; edge-to-edge anchoring by default, fromSide\u002FtoSide to force an edge, fromIdx\u002FtoIdx for raw cxn index), group (link, tooltip, deep walk by get\u002Fquery\u002Fadd\u002Fremove, ungroup=true dissolves back to slide-absolute), align\u002Fdistribute (targets= accepts shape[@id=N] paths, not just positional), video\u002Faudio (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\u002Frestart\u002FautoReverse, chart animations), transition (12 p15 presets + morph\u002Fp14), 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), diagram (add-only mermaid → native shapes or rendered image, `--type diagram`\u002F`flowchart`). |\n| **docx** | paragraph (direction\u002Ffont.latin\u002Fea\u002Fcs, bold.cs\u002Fitalic.cs\u002Fsize.cs, lang.latin\u002Fea\u002Fcs, 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\u002F.date — bare `@author=`\u002F`@type=` selector on `set \u002Frevision[...]` for filtered accept\u002Freject, but `query 'revision[...]'` needs the dotted `revision.author=`\u002F`revision.type=` form; move+revision is run-level paths only, not paragraph-level; **range=START:END** on a paragraph\u002Fshape path formats a char span by explicit 0-based half-open offset instead of addressing a run — the offset sibling of find=), table (direction=rtl, hMerge, cantSplit on row\u002Fnowrap on cell (both add+set), **virtual column ops**: add\u002Fremove\u002Fmove\u002Fcopyfrom on \u002Fbody\u002Ftbl[N]\u002Fcol), row (tr), cell (td), image, header\u002Ffooter (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\u002FSet), toc, watermark, break, ole, **num\u002FabstractNum\u002Flvl**, **tab**, **textbox\u002Fshape** (add-mostly — Get returns raw XML preview only, no structured readback; Set is limited to width\u002Fheight\u002Fgeometry\u002Ffill\u002Fline.\\*; position is `anchor.x`\u002F`anchor.y` not bare x\u002Fy; **textbox-only** `textDirection`\u002Frotation\u002Fgradient\u002Fshadow — docx shape itself has neither rotation nor gradient), embedded **OLE round-trip on dump→batch**, **diagram** (add-only mermaid → native shapes or rendered image, `--type diagram`\u002F`flowchart`, no x\u002Fy at add-time — reposition via `set \u002Fbody\u002Fgroup[N]`). docDefaults.rtl, autoHyphenation, `get \u002F` exposes locale + \u002Fcomments \u002Ffootnotes \u002Fendnotes. `create --minimal` for raw OOXML scaffolding. |\n| **xlsx** | sheet (visible\u002Fhidden\u002FveryHidden, print margins, printTitleRows\u002FCols, rightToLeft sheetView, cascade-aware rename), row (c{N}= cell-content shorthand; add accepts --from \u002FSheet\u002Fcol[L]; formula-ref rewrite on insert), col (formula-ref rewrite, named-range follow on move), cell (type=richtext+runs, merge=range\u002Fsweep, direction=rtl, phonetic; **--shift left\\|up on remove, shift=right\\|down on add** — Excel UI dialog parity; formula auto-detect; OFFSET\u002FINDIRECT in calc), chart (per-axis RTL\u002Ftitle, 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=field:type:value add-time-only, topN=integer add-time-only, fillDownLabels is an alias of repeatLabels not a separate feature, calculatedField), sparkline, validation, autofilter, shape, textbox, CF (databar\u002Fcolorscale\u002Ficonset\u002Fformulacf\u002FcellIs\u002FtopN\u002FaboveAverage), ole, csv. Query supports `merge`\u002F`mergedrange`. Workbook: password. Shape selector enumerates leaves inside grpSp. |\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\n**Atomic by default (v1.0.137+):** every item still runs and is reported (so `N succeeded, M failed` stays meaningful and every failure surfaces), but if *any* item fails the whole batch rolls back — the file on disk is left byte-identical to before the batch ran (confirmed live in both standalone and resident mode). Use `--best-effort` to restore the old apply-what-succeeds behavior (useful for lossy `dump→batch` replays where losing the whole thing over one unsupported item is worse than a partial result). `--stop-on-error` only changes how early the run stops (remaining items are `skipped`), not whether what ran gets kept — combine it with `--best-effort` if you want \"stop at first failure but keep what already succeeded.\" `--force` is unrelated — it's only the docx-protection bypass. Failed items carry a machine-readable `code` field (same list as `error.code`); a rolled-back batch's JSON summary carries `\"atomicRolledBack\": true`.\n\n`officecli dump \u003Cfile> [\u003Cpath>]` emits a replayable batch JSON for round-trip — `.docx` (full coverage), `.pptx` (text\u002Ftables\u002Fpictures\u002Fcharts\u002Fnotes\u002Ftheme + OLE\u002F3D\u002Fvideo\u002Faudio\u002FSmartArt\u002Fmorph\u002Fp15 transitions via raw-set passthrough), and `.xlsx` (cells\u002Fformulas\u002Fstyles + tables, conditional formatting, validations, comments, charts, sparklines, pictures, shapes, pivot tables; slicers\u002FchartEx\u002FOLE via verbatim carrier). Path defaults to `\u002F` (whole document); pass a subtree path (docx: `\u002Fbody`, `\u002Fbody\u002Fp[N]`, `\u002Fbody\u002Ftbl[N]`, `\u002Ftheme`, `\u002Fsettings`, `\u002Fnumbering`, `\u002Fstyles`; xlsx: `\u002FSheetName`, `\u002Fsheet[N]`) 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). `officecli plugins list` extends support to `.doc`, `.hwpx`, `.pdf` export.\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 --best-effort --json   # keep whatever succeeds even if some items fail\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| `morph-ppt` | Cinematic Morph-animated presentations. NOT for static decks (route those to `pptx`) |\n| `morph-ppt-3d` | 3D Morph: GLB models, camera moves, depth. NOT for 2D-only Morph (route those to `morph-ppt`) |\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","3e2ae0890f16fe2dfef9ecac09bdbb79b70035c5","global\u002Fofficecli","https:\u002F\u002Fgithub.com\u002Fkipyin\u002Fkstack","https:\u002F\u002Forigin.cursor.com\u002Fkipyin\u002Fkstack","https:\u002F\u002Fgithub.com\u002Fkipyin","2026-11-14 23:09:00",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add kipyin\u002Fkstack --skill officecli",{"tool":37,"command":38},"bunx","bunx skills add kipyin\u002Fkstack --skill officecli",{"tool":40,"command":41},"pnpm","pnpm dlx skills add kipyin\u002Fkstack --skill officecli","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fkipyin\u002Fkstack\u002Fblob\u002Fmain\u002Fglobal\u002Fofficecli\u002FSKILL.md",true,[],[46,53,60,67,74,81],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M7BMMEZ4VVAGVZM0GQFDR382","solvency-agent-playbook","solvency playbook: use at the start of any solvency\u002F work — develop, debug, test, refactor, or query. Covers edits under solvency\u002F, solvency pytest, Postgres reads\u002Fwrites for solvency tables, and solvency diffs.","https:\u002F\u002Fgithub.com\u002Fkipyin\u002Fkstack\u002Fblob\u002Fmain\u002Flighthouse\u002Fsolvency-agent-playbook\u002FSKILL.md",[],[],{"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},"01M7BMMBMAK765Y8AQRG3RRXTJ","pr-debrief","给 PR 出一份业务验收 debrief：在做什么 \u002F 做对了吗 \u002F 真人要验什么，人话，贴到 Gitee。","https:\u002F\u002Fgithub.com\u002Fkipyin\u002Fkstack\u002Fblob\u002Fmain\u002Flighthouse\u002Fpr-debrief\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},"01M7BMM7H9JABR5RD2N4M1262D","issue-title-convention","Lint and autofix open Gitee issue titles to the four team prefixes.","https:\u002F\u002Fgithub.com\u002Fkipyin\u002Fkstack\u002Fblob\u002Fmain\u002Flighthouse\u002Fissue-title-convention\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},"01M7BMM3MCMFYAFZ4RG3SF6KJB","issue-summary","Add a Chinese nav summary + HITL checklist to a ready-for-agent Gitee issue.","https:\u002F\u002Fgithub.com\u002Fkipyin\u002Fkstack\u002Fblob\u002Fmain\u002Flighthouse\u002Fissue-summary\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},"01M7BMKTBPDW3N19J3YBWQE5DN","gitee-pr-workflow","End-to-end workflow for landing a change on both Gitee and GitHub using the `gitee` Rust CLI. Delegates commit + PR creation to `gitee-pr-submit` (plain-language body, HITL verification, `Linked: #IKxxxx`), then approves it, squash-merges with `--no-close-issue`, adds an evidence comment and closes the linked issue, syncs Gitee main back to local, pushes local main to GitHub, then watches GitHub Actions Build py_total and replaces artifacts\u002Fpy_total.exe. Post-land CI failures use a hotfix PR; never push new commits directly to main. Trigger: \"gitee pr workflow\", \"commit and pr to gitee\", \"land changes on gitee and github\", \"create gitee pr\", \"approve and merge gitee pr\", \"watch py_total\", \"download py_total artifact\".","https:\u002F\u002Fgithub.com\u002Fkipyin\u002Fkstack\u002Fblob\u002Fmain\u002Flighthouse\u002Fgitee-pr-workflow\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},"01M7BMKJXX2DP9CYGZWZVSJFPY","gitee-pr-submit","Commit local changes in logical chunks, push a feature branch to Gitee, and open a PR whose body is plain language: what we did, what we verified, with human-in-the-loop (HITL) verification called out explicitly. Links the related issue with `#IKxxxx` in the body (the # is mandatory; without it Gitee neither links nor autocloses the issue). Submit only: do not approve, merge, or sync here. Trigger: \"submit pr\", \"提交 PR\", \"create gitee pr\", \"开个 PR\", \"commit and pr\", \"提交评审\".","https:\u002F\u002Fgithub.com\u002Fkipyin\u002Fkstack\u002Fblob\u002Fmain\u002Flighthouse\u002Fgitee-pr-submit\u002FSKILL.md",[],[]]