{"owner":"DearVa","repo":"Everywhere","hasSkills":true,"totalSkillsCount":3,"totalTokensCount":9351,"categories":["root-instruction","anthropic-skill"],"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md","docs/References/AvaloniaViewPresentation.md","src/Everywhere.Core/Assets/Skills/OfficeCLI/SKILL.md"],"skills":{"AGENTS.md":"# Everywhere Agent Guidelines\n\nThis file contains repository-wide rules. Keep it short enough to read before every task.\nTopic-specific guidance lives under `docs/References` and must be read only when the task touches the corresponding area.\n\n## Code of Conduct\n- Never modify the code unless explicitly instructed to do so-for example, with a command such as \"Start implementation\". But you can still execute commands, write temporary probe code, or use other methods to gather information.\n- During implementation, if any deviations from the plan occur, need a temporary workaround, or face other unexpected situations, depending on the severity of the issue, either record it in `temp.md` or pause and discuss it with the user.\n\n## Required References\n\n- For Avalonia controls, Views, Presentation objects, DynamicData-backed UI collections, virtualization, or UI animation, read [`docs/References/AvaloniaViewPresentation.md`](docs/References/AvaloniaViewPresentation.md) before making changes.\n\n## Source of Truth and Change Discipline\n\n- Inspect the current implementation and its call sites before changing it. Design documents may lag behind the code after later refactoring and are not automatically authoritative.\n- Preserve unrelated and uncommitted user changes. Do not clean up, revert, reformat, or otherwise alter files outside the task's scope.\n- Do not run repository-wide or file-wide formatting when it would create unrelated diffs. Format only the code affected by the task.\n- Discuss new NuGet packages or other dependencies with the user before introducing them, especially when the existing code can implement the requirement at a reasonable cost.\n- Remove obsolete compatibility layers when they have no real callers and are not required by a public API, serialized format, or other compatibility boundary.\n\n## C# Style and Type Layout\n\n- Follow formatting rules in the applicable `.editorconfig`; inspect relevant sections rather than unrelated settings. Use nearby code for choices the configuration does not specify, and do not mechanically compact or expand code.\n- Follow standard .NET naming conventions, including .NET capitalization of acronyms.\n- Keep APIs open for future extensibility: prefer `public` when no concrete ownership, lifetime, or safety boundary requires `internal` or `private` visibility.\n- Use `var` for all local variable declarations.\n- Give Boolean properties, fields, parameters, and local variables a clear semantic prefix such as `Is`, `Has`, `Can`, or `Should`; private fields retain the underscore prefix, for example `_isDisposed` and `_hasCount`. Preserve established framework or API contract names whose Boolean semantics are already unambiguous, such as `Dispose(bool disposing)`.\n- Use expression-bodied members only when the complete declaration and expression fit readably on one line. If either the signature or expression spans multiple lines, use a block body. Prefer expression bodies for simple single-line properties. This rule does not apply to lambdas.\n- Prefer guard clauses and early returns over unnecessary nesting. This concerns control flow, not whether braces or line breaks should be omitted.\n- Keep simple declarations, invocations, and expressions on one line when readable. This preference does not extend to documentation or control-flow blocks. Follow configured brace rules and preserve clear visual grouping.\n- Within a type, normally order member categories as follows:\n  1. properties;\n  2. events;\n  3. fields;\n  4. methods.\n- Static or readonly members may be placed earlier within their category when that improves readability. Do not mechanically reorder existing code solely to enforce this preference.\n- Non-constant fields must be `private`. Constants may use the visibility appropriate to their API, including `public` or `internal`.\n- Public nested types may appear at the beginning or end of their containing type. Place private nested types at the end.\n- Do not retain unused positional-record parameters. They become captured state and implicitly participate in generated equality, hashing, and string formatting.\n- Never use `_ = DoAsync()` fire-and-forget pattern. Use `TaskExtensions.Detach` instead.\n- Avoid using `!` to suppress null warnings whenever possible. Best practices: Mark `out` parameters with the `NotNullWhenAttribute`; mark initialization methods with the `MemberNotNullAttribute`; use `if` statements to check for potential null fields in advance.\n- `#region` is allowed when it genuinely improves navigation; it is not a substitute for a well-factored type. `partial class` is preferred for large types that genuinely need to be split across files.\n\n## Architecture and Production APIs\n\n- Optimize for the application's real ownership, call paths, and lifetime. Do not design internal APIs as generic libraries for hypothetical consumers.\n- Match runtime argument validation to a real boundary. Within trusted, nullable-enabled solution code, rely on the type system and nullable analysis instead of repeating null or argument checks by default. Validate data that crosses external, serialization, reflection, plugin, native, or other boundaries where compile-time contracts do not apply.\n- Prefer fewer states, objects, synchronization mechanisms, and intermediate abstractions, but never at the cost of stable identity, incremental updates, correct lifetime, or readability. Judge simplicity by ownership and behavior, not line count.\n- Constructors must express a clear production purpose. Avoid ambiguous default parameters, forwarding-only constructor chains, and constructors added solely for tests.\n- Do not add production methods, constructors, properties, or other hooks solely to make tests easier. Tests should use normal production entry points, mocks, reflection, or `UnsafeAccessor` where appropriate. Reconsider tests that would materially distort the production design.\n\n## Comments and Documentation\n\n- Write all code comments and XML documentation comments in English.\n- Prefer multiline XML `<summary>` comments.\n- Add necessary XML documentation to public APIs. Use `<inheritdoc />` for interface implementations and overrides when the inherited contract is sufficient.\n- Preserve useful existing comments during refactoring. Do not remove documentation merely because the surrounding implementation is being rewritten.\n- Document non-obvious lifetime rules, thread boundaries, state transitions, algorithms, and performance tradeoffs in enough detail for a future maintainer to understand why the design exists.\n- Write technical specifications in English under an appropriate subdirectory of `docs`.\n\n## Localization\n\n- Everywhere uses source-generated localization APIs. Use those APIs instead of manually maintained resource accessors.\n- For persistent UI text, carry `IDynamicLocaleKey` through result models and RPC contracts and subscribe through bindings (e.g. `{Binding MessageKey^}`). It supports MessagePack serialization; do not resolve it before presentation.\n- Compose dynamic messages with `FormattedDynamicLocaleKey` and `AggregateDynamicLocaleKey`; use `DirectLocaleKey` for literal values such as paths. Avoid string interpolation or concatenation that discards localization structure.\n- `LocaleKey.SomeKey.I18N()` resolves once. Use it for intentional language snapshots such as Toast and Dialog text, not persistent UI state.\n- Logs and CLI stdout/stderr may remain English strings. Keep diagnostic text separate from localized UI messages; do not use CLI output as a structured UI message contract.\n- Name localization keys after their current semantic meaning and owning area. Do not preserve an obsolete feature prefix after a value becomes shared.\n- Prefix genuinely shared localization keys with `Common_`.\n\n## Tests\n\n- Name test methods in PascalCase, with underscores separating the scenario, action, and expected result. For example: `UpdateContent_WhenConditionBecomesFalse_ClearsChild`.\n- Follow the repository's existing build and test practices and choose verification proportionate to the scope and risk of the change.\n","docs/References/AvaloniaViewPresentation.md":"# Avalonia, View, and Presentation Reference\n\nRead this reference before modifying Avalonia controls, Views, Presentation objects, DynamicData-backed UI collections, virtualization, or UI animation. These rules are scoped to the UI and Presentation layers; they do not define the threading or collection model of plugins, network services, or other background components.\n\n## Presentation Objects and View Models\n\n- Treat ViewModels as relatively heavy objects. Do not create many ViewModels for simple projections or a handful of UI-only state values.\n- Prefer an existing model, a lightweight Presentation or row object, a custom control, or a View-layer projection when that provides a clear ownership boundary.\n- Keep Presentation objects stable where possible. Replacing all Presentation objects after a small source change causes binding churn, lost control state, animation discontinuities, and visible flicker.\n\n## UI Thread Boundary\n\n- State explicitly owned by a View or Presentation object may be UI-thread-affine.\n- Marshal genuine background ingress to the UI thread at the boundary. Once inside that boundary, keep the object model single-threaded and simple.\n- Do not add locks, concurrent collections, immutable snapshots, pending-operation queues, or defensive reentrancy state to code whose callbacks and timers are all guaranteed to execute on the UI thread.\n- Prefer the existing `Dispatcher.UIThread.PostOnDemand` helper when work may arrive on either thread. It executes immediately when already on the UI thread. Avalonia dispatcher invocation also performs its own access check, so avoid redundant layers of dispatching.\n\n## Collections and DynamicData\n\n- For a read-heavy reference collection confined to the UI thread, prefer a plain `List<T>`. Avoid immutable collections or repeated snapshots without a demonstrated need.\n- In this project, `SourceList.Items` may be read as a stable snapshot. Do not copy it again merely for defensive safety.\n- Use DynamicData change sets to update projections incrementally. Reconcile additions, removals, moves, replacements, and refreshes without rebuilding the entire output collection.\n- Preserve object identity when the logical item has not changed. Prefer reference identity when source objects already provide the correct lifetime identity.\n- When a parent control can naturally own and render a bounded child collection, prefer that ownership over complicated flattening or multi-list merge machinery.\n\n## Controls, Bindings, and Templates\n\n- Before creating or substantially redesigning AXAML, inspect similar controls in `Views/Chat` and `Views/Controls`, including their AXAML, code-behind, and relevant styles. Follow established resource, class, binding, and template patterns; verify binding ownership before reusing them.\n- For fixed presentation snapshots, omit absent items when constructing the data. Use `IsVisible` for optional sections and visibility that can change at runtime.\n- Give custom controls strongly typed Styled or Direct properties for their core input instead of relying on an ambiguous `DataContext`.\n- Continue to use `DataContext` where it is natural to Avalonia, including templates, `ItemsControl`, and ordinary binding scopes.\n- Prefer AXAML for controls with a visual tree, templates, or substantial styling. Pure C# is appropriate for layout algorithms, logic-only controls, or small controls that do not benefit from a template.\n- When runtime type determines the presentation structure, prefer strongly typed `DataTemplate`s over a single control containing many type checks and irrelevant properties.\n- Move shared styles to an appropriate common scope. Do not copy specialized control styles into multiple Views.\n- Keep visible text composable through bindings, localization, templates, and `Inlines`; avoid specialized controls that hard-code a sentence when only periodic refresh or formatting is specialized.\n\n## Lifetime and Lazy Visual Trees\n\n- Behaviors and periodic refresh components must register and unregister during attach/detach and must respond correctly when `IsEnabled` changes.\n- Create expensive visual trees only when they become visible. Terminals, detailed Markdown, diffs, and similarly complex content should normally be loaded on demand.\n- When hidden content has no state that must survive, allow it to be destroyed rather than keeping the visual tree alive indefinitely.\n- Keep the outer structure of a large scrolling list flat, stable, and virtualizable. A bounded, lazy-loaded detail region with its own maximum height and scrolling may intentionally remain non-virtualized when nested virtualization would add more complexity than value.\n\n## Animation and Layout\n\n- Use the simplest panel that directly expresses the layout intent. When multiple controls only need to share a single layout slot, prefer `Panel` over `Grid`.\n- When one child should keep its natural size and another should fill the remaining space, prefer `DockPanel`, docking the size-constrained child and leaving the fill child last. Use `HorizontalSpacing` or `VerticalSpacing` for separation.\n- Reserve `Grid` for layouts that genuinely require row or column sizing and alignment.\n- Use `RenderTransform` and opacity for visual-only movement and fading. These do not participate in measure or arrange and should be preferred over changing layout dimensions for animation.\n- Do not rebuild controls merely to animate a state change. Maintain stable control identity and animate the visual properties that changed.\n- Keep animation state minimal and tied to the real control lifetime. Avoid speculative fallback state machines unless the product requirement calls for them.\n","src/Everywhere.Core/Assets/Skills/OfficeCLI/SKILL.md":"---\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## Usage\n\n`officecli` is a built-in tool. If it's unavailable or not exist, please instruct the user to open the `OfficeCLI` tool in the chat window.\nThe tool allows you to call `officecli` directly without having to install or locate the executable.\nFor any of the commands in the following instructions, do not use any other tools; you MUST use the exact tool and pass the `commandLine` parameter to execute them.\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 <cmd> --help` ≡ `officecli help <cmd>` — 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`/`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`/`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/O 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`/`query`/`view`/`dump`) always see your latest edits, so you never need to save mid-workflow. Run `save` (keeps the resident) or `close` (flush + release) only **before a non-officecli program reads the file** — python-docx/openpyxl, Word, a renderer, delivery/upload. (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 / --type slide --prop title=\"Q4 Report\" --prop background=1A1A2E\nofficecli add slides.pptx '/slide[1]' --type shape --prop text=\"Revenue grew 25%\" --prop x=2cm --prop y=5cm --prop font=Arial --prop size=24 --prop color=FFFFFF\n```\n\n**Word:**\n```bash\nofficecli create report.docx\nofficecli add report.docx /body --type paragraph --prop text=\"Executive Summary\" --prop style=Heading1\nofficecli add report.docx /body --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 /Sheet1/A1 --prop value=\"Name\" --prop bold=true\nofficecli set data.xlsx /Sheet1/A2 --prop value=\"Alice\"\n```\n\n---\n\n## L1: Create, Read & Inspect\n\n```bash\nofficecli create <file>               # Create blank .docx/.xlsx/.pptx (type from extension)\nofficecli view <file> <mode>          # outline | stats | issues | text | annotated | html\nofficecli get <file> <path> --depth N # Get a node and its children [--json]\nofficecli query <file> <selector>     # CSS-like query\nofficecli validate <file>             # 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/content/structure 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` / `svg` / `pdf` / `forms` | PNG via headless browser / SVG (pptx slide) / PDF via exporter plugin / form-fields JSON via format-handler plugin | `-o`, `--screenshot-width/-height`, pptx `--grid N` |\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 '/body/p[3]' --depth 2 --json\nofficecli get slides.pptx '/slide[1]' --depth 1 # list all shapes on slide 1\nofficecli get data.xlsx '/Sheet1/B2' --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/delete, stable IDs do not.\n\n```\n/slide[1]/shape[@id=550950021]              # PPT shape\n/slide[1]/table[@id=1388430425]/tr[1]/tc[2] # PPT table\n/body/p[@paraId=1A2B3C4D]                   # Word paragraph\n/comments/comment[@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/tc, row) fall back to positional indices.\n\n### query\n\nCSS-like selectors: `[attr=value]`, `[attr!=value]`, `[attr~=text]`, `[attr>=value]`, `[attr<=value]`, `:contains(\"text\")`, `:empty`, `:has(formula)`, `:no-alt`. Boolean `and`/`or` supported across `query`/`set`/`remove`: `cell[value>5000 or value<100]`, `cell[(type=Number or type=Date) and value>0]`. Excel row-by-column-name: `Sheet1!row[Salary>5000]`. `set` accepts selectors and Excel-native paths (parity with `get`/`query`). Bare unscoped selectors rejected on `set`/`remove`.\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 / shift-click / box-drag to select shapes; the CLI can read the current browser selection and act on it.\n\n```bash\nofficecli watch <file> [--port N] # Start preview server (default port 26315)\nofficecli unwatch <file>          # Stop\nofficecli goto <file> <path>      # Scroll watching browser(s) to element (docx: p / table / tr / tc)\n```\n\nOpen the printed `http://localhost:N` URL. Click to select; shift/cmd/ctrl+click to multi-select; drag from empty space to box-select. PPT/Word use blue outline; Excel uses native-style green selection (double-click cell to edit inline; drag a chart to reposition).\n\n### `get <file> selected` — read what the user clicked\n\n```bash\nofficecli get <file> 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/pictures/tables/charts/connectors/groups; `.docx` top-level paragraphs and tables. Inherited layout/master decorations and Word nested elements (table cells, run-level) are not addressable. **`.xlsx` does not emit `data-path`** — `mark`/`selection` on xlsx always resolve `stale=true` (v2 candidate).\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 <file> <path> [--prop find=... color=... note=... tofix=... regex=true] [--json]\nofficecli unmark <file> [--path <p> | --all] [--json]\nofficecli get-marks <file> [--json]\n```\n\nProps: `find` (literal or regex when `regex=true`; raw form `find='r\"[abc]\"'`), `color` (hex / `rgb(...)` / 22 named whitelist), `note`, `tofix` (drives apply pipeline). **Path** must be `data-path` format from watch HTML — see subskills for full pipeline.\n\n---\n\n## L2: DOM Operations\n\n### set — modify properties\n\n```bash\nofficecli set <file> <path> --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/without `#`), 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.<attr>` forms accepted on shape/run/paragraph/table/row/cell/section/styles, e.g. `--prop font.color=red --prop font.bold=true --prop font.size=14pt`. Run `officecli help <fmt> <element>` for the full list.\n\n### find — format or replace matched text\n\nUse top-level `--find` / `--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 '/body/p[1]' --find weather --prop bold=true --prop color=red\n\n# Regex matching (regex= still a prop flag)\nofficecli set doc.docx '/body/p[1]' --find '\\d+%' --prop regex=true --prop color=red\n\n# Replace text (use `/` for whole-document scope)\nofficecli set doc.docx / --find draft --replace final\n\n# docx: tracked Find&Replace\nofficecli set doc.docx / --find draft --replace final --prop revision.author=Alice\n\n# PPT — same syntax, different paths\nofficecli set slides.pptx / --find draft --replace final\n```\n\n**Path controls search scope:** `/` = whole document, `/body/p[1]` or `/slide[N]/shape[M]` = specific element, `/header[1]` / `/footer[1]` = headers/footers.\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 <file> <parent> --type <type> [--prop ...]\nofficecli add <file> <parent> --type <type> --after <path> [--prop ...]  # insert after anchor\nofficecli add <file> <parent> --type <type> --before <path> [--prop ...] # insert before anchor\nofficecli add <file> <parent> --type <type> --index N [--prop ...]       # 0-based position (legacy)\nofficecli add <file> <parent> --from <path>                              # 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/ea/cs, direction=rtl, underline.color, highlight=COLOR (Add/Set/Get/HTML preview), effective.X+effective.X.src; arrow alias for rightArrow; slideMaster/slideLayout typed add/set/remove), picture (SVG, brightness/contrast/glow/shadow, rotation, link, tooltip), chart (direction=rtl, pieOfPie, barOfPie, axisLine/gridline per-attr setters, animation+chartBuild=byCategory|bySeries, line dropLines/hiLowLines/upDownBars, anchor=x,y,w,h shorthand), table (cell direction=rtl, fill/background, built-in PowerPoint style catalogue, /col[C] get + swap/copyFrom, row/col Move/CopyFrom), row (tr), connector (from/to accept full-path `@name=`/`@id=` forms — bare `@name=Foo` is rejected, must be `/slide[N]/shape[@name=Foo]` — startshape/endshape SetByPath; edge-to-edge anchoring by default, fromSide/toSide to force an edge, fromIdx/toIdx for raw cxn index), group (link, tooltip, deep walk by get/query/add/remove, ungroup=true dissolves back to slide-absolute), align/distribute (targets= accepts shape[@id=N] paths, not just positional), video/audio (loop, autoStart alias), equation, notes (direction=rtl, lang), comment (legacy + modern p188 threaded round-trip), animation (15 emphasis + 16 exit presets, multi-effect chains, motion-path presets, repeat/restart/autoReverse, chart animations), transition (12 p15 presets + morph/p14), paragraph (para), run, zoom, ole (preview=, full dump round-trip via add-part+raw-set), placeholder (phType=...), model3d (rotation=ax,ay,az; full dump round-trip), smartart (dump round-trip via add-part), diagram (add-only mermaid → native shapes or rendered image, `--type diagram`/`flowchart`). |\n| **docx** | paragraph (direction/font.latin/ea/cs, bold.cs/italic.cs/size.cs, lang.latin/ea/cs, wordWrap, framePr.\\*, tabs shorthand), run (lang slots, direction, underline.color, position half-pts, **revision.type=ins\\|del\\|format\\|moveFrom\\|moveTo + revision.action=accept\\|reject** with .author/.date — bare `@author=`/`@type=` selector on `set /revision[...]` for filtered accept/reject, but `query 'revision[...]'` needs the dotted `revision.author=`/`revision.type=` form; move+revision is run-level paths only, not paragraph-level; **range=START:END** on a paragraph/shape 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/nowrap on cell (both add+set), **virtual column ops**: add/remove/move/copyfrom on /body/tbl[N]/col), row (tr), cell (td), image, header/footer (direction), section (pageNumFmt full enum, direction=rtl, rtlGutter, pgBorders=box), bookmark, comment, footnote, endnote, formfield, sdt, chart, equation, field (28 types), hyperlink, style (direction, indents, pbdr, lineSpacing on Add/Set), toc, watermark, break, ole, **num/abstractNum/lvl**, **tab**, **textbox/shape** (add-mostly — Get returns raw XML preview only, no structured readback; Set is limited to width/height/geometry/fill/line.\\*; position is `anchor.x`/`anchor.y` not bare x/y; **textbox-only** `textDirection`/rotation/gradient/shadow — 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`/`flowchart`, no x/y at add-time — reposition via `set /body/group[N]`). docDefaults.rtl, autoHyphenation, `get /` exposes locale + /comments /footnotes /endnotes. `create --minimal` for raw OOXML scaffolding. |\n| **xlsx** | sheet (visible/hidden/veryHidden, print margins, printTitleRows/Cols, rightToLeft sheetView, cascade-aware rename), row (c{N}= cell-content shorthand; add accepts --from /Sheet/col[L]; formula-ref rewrite on insert), col (formula-ref rewrite, named-range follow on move), cell (type=richtext+runs, merge=range/sweep, direction=rtl, phonetic; **--shift left\\|up on remove, shift=right\\|down on add** — Excel UI dialog parity; formula auto-detect; OFFSET/INDIRECT in calc), chart (per-axis RTL/title, anchor=x,y,w,h, pareto), image (SVG), comment (direction=rtl), table (listobject), namedrange (definedname, volatile, `[@name=X]`; formula-body inlined at parse), pivottable (cache CoW + cross-pivot sharing, labelFilter=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/colorscale/iconset/formulacf/cellIs/topN/aboveAverage), ole, csv. Query supports `merge`/`mergedrange`. Workbook: password. Shape selector enumerates leaves inside grpSp. |\n\n### Pivot tables (xlsx)\n\n```bash\nofficecli add data.xlsx /Sheet1 --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/outline/tabular), `repeatLabels`, `blankRows`, `aggregate`, `showDataAs` (percent_of_total/row/col, running_total), `grandTotals`, `subtotals`, `sort`. Aggregators: sum, count, average, max, min, product, stdDev, stdDevp, var, varp, countNums. Date columns auto-group. Run `officecli help xlsx pivottable` for full schema.\n\n### Document-level properties (all formats)\n\n```bash\nofficecli set doc.docx / --prop docDefaults.font=Arial --prop docDefaults.fontSize=11pt\nofficecli set doc.docx / --prop protection=forms --prop evenAndOddHeaders=true\nofficecli set data.xlsx / --prop calc.mode=manual --prop calc.refMode=r1c1\nofficecli set slides.pptx / --prop defaultFont=Arial --prop show.loop=true --prop print.what=handouts\n```\n\nRun `officecli help <format> /` 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 /Sheet1 --prop sort=\"C desc\" --prop sortHeader=true\nofficecli set data.xlsx '/Sheet1/A1: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` / `--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 '/body/p[1]' --type run --after find:weather --prop text=\" (sunny)\"\n\n# Word: block table after matched text (auto-splits paragraph)\nofficecli add doc.docx '/body/p[1]' --type table --after \"find:First sentence.\" --prop rows=2 --prop cols=2\n```\n\n### Clone\n\n`officecli add <file> / --from '/slide[1]'` — copies with all cross-part relationships.\n\n### move, swap, remove\n\n```bash\nofficecli move <file> <path> [--to <parent>] [--index N] [--after <path>] [--before <path>]\nofficecli swap <file> <path1> <path2>\nofficecli remove <file> '/body/p[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 <file> [<path>]` emits a replayable batch JSON for round-trip — `.docx` (full coverage), `.pptx` (text/tables/pictures/charts/notes/theme + OLE/3D/video/audio/SmartArt/morph/p15 transitions via raw-set passthrough), and `.xlsx` (cells/formulas/styles + tables, conditional formatting, validations, comments, charts, sparklines, pictures, shapes, pivot tables; slicers/chartEx/OLE via verbatim carrier). Path defaults to `/` (whole document); pass a subtree path (docx: `/body`, `/body/p[N]`, `/body/tbl[N]`, `/theme`, `/settings`, `/numbering`, `/styles`; xlsx: `/SheetName`, `/sheet[N]`) to scope the dump. `officecli refresh <file.docx>` recalculates TOC page numbers / PAGE / cross-references after replay (Word backend on Windows; headless-HTML fallback elsewhere). `officecli plugins list` extends support to `.doc`, `.hwpx`, `.pdf` export.\n\n```bash\necho '[\n  {\"command\":\"set\",\"path\":\"/Sheet1/A1\",\"props\":{\"value\":\"Name\",\"bold\":\"true\"}},\n  {\"command\":\"set\",\"path\":\"/Sheet1/B1\",\"props\":{\"value\":\"Score\",\"bold\":\"true\"}}\n]' | officecli batch data.xlsx --json\n\nofficecli batch data.xlsx --commands '[{\"op\":\"set\",\"path\":\"/Sheet1/A1\",\"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 <file> <part>                          # view raw XML\nofficecli raw-set <file> <part> --xpath \"...\" --action replace --xml '<w:p>...</w:p>'\nofficecli add-part <file> <parent>                   # create new document part (returns rId)\n```\n\n`raw-set` actions: `append`, `prepend`, `insertbefore`, `insertafter`, `replace`, `remove`, `setattr`. Run `officecli help <format> 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/bash | Always quote: `'/slide[1]'` or `\"/slide[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| `/shape[myname]` | Name indexing not supported. Use numeric index or `@name=` (PPT only) |\n| Guessing property names | Run `officecli help <format> <element>` to see exact names |\n| Modifying an open file | Close the file in PowerPoint/WPS 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 <name>` — 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` / `pptx` / `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 / conference / thesis: APA / Chicago / IEEE / MLA citations, equations, SEQ + PAGEREF cross-refs, multi-column journal layout, bibliography. NOT for business reports or letters (route those to `word`) |\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 / Series A-C / SAFE / convertible / strategic raise. NOT for sales / product / 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/tabular data → KPI / analytics / 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): `'/body/p[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 / column letter index). `--index 5` inserts at row 5 / column 5.\n- After modifications, verify with `validate` and/or `view issues`\n- **When unsure**, run `officecli help <format> <element>` instead of guessing"},"files":{"AGENTS.md":"# Everywhere Agent Guidelines\n\nThis file contains repository-wide rules. Keep it short enough to read before every task.\nTopic-specific guidance lives under `docs/References` and must be read only when the task touches the corresponding area.\n\n## Code of Conduct\n- Never modify the code unless explicitly instructed to do so-for example, with a command such as \"Start implementation\". But you can still execute commands, write temporary probe code, or use other methods to gather information.\n- During implementation, if any deviations from the plan occur, need a temporary workaround, or face other unexpected situations, depending on the severity of the issue, either record it in `temp.md` or pause and discuss it with the user.\n\n## Required References\n\n- For Avalonia controls, Views, Presentation objects, DynamicData-backed UI collections, virtualization, or UI animation, read [`docs/References/AvaloniaViewPresentation.md`](docs/References/AvaloniaViewPresentation.md) before making changes.\n\n## Source of Truth and Change Discipline\n\n- Inspect the current implementation and its call sites before changing it. Design documents may lag behind the code after later refactoring and are not automatically authoritative.\n- Preserve unrelated and uncommitted user changes. Do not clean up, revert, reformat, or otherwise alter files outside the task's scope.\n- Do not run repository-wide or file-wide formatting when it would create unrelated diffs. Format only the code affected by the task.\n- Discuss new NuGet packages or other dependencies with the user before introducing them, especially when the existing code can implement the requirement at a reasonable cost.\n- Remove obsolete compatibility layers when they have no real callers and are not required by a public API, serialized format, or other compatibility boundary.\n\n## C# Style and Type Layout\n\n- Follow formatting rules in the applicable `.editorconfig`; inspect relevant sections rather than unrelated settings. Use nearby code for choices the configuration does not specify, and do not mechanically compact or expand code.\n- Follow standard .NET naming conventions, including .NET capitalization of acronyms.\n- Keep APIs open for future extensibility: prefer `public` when no concrete ownership, lifetime, or safety boundary requires `internal` or `private` visibility.\n- Use `var` for all local variable declarations.\n- Give Boolean properties, fields, parameters, and local variables a clear semantic prefix such as `Is`, `Has`, `Can`, or `Should`; private fields retain the underscore prefix, for example `_isDisposed` and `_hasCount`. Preserve established framework or API contract names whose Boolean semantics are already unambiguous, such as `Dispose(bool disposing)`.\n- Use expression-bodied members only when the complete declaration and expression fit readably on one line. If either the signature or expression spans multiple lines, use a block body. Prefer expression bodies for simple single-line properties. This rule does not apply to lambdas.\n- Prefer guard clauses and early returns over unnecessary nesting. This concerns control flow, not whether braces or line breaks should be omitted.\n- Keep simple declarations, invocations, and expressions on one line when readable. This preference does not extend to documentation or control-flow blocks. Follow configured brace rules and preserve clear visual grouping.\n- Within a type, normally order member categories as follows:\n  1. properties;\n  2. events;\n  3. fields;\n  4. methods.\n- Static or readonly members may be placed earlier within their category when that improves readability. Do not mechanically reorder existing code solely to enforce this preference.\n- Non-constant fields must be `private`. Constants may use the visibility appropriate to their API, including `public` or `internal`.\n- Public nested types may appear at the beginning or end of their containing type. Place private nested types at the end.\n- Do not retain unused positional-record parameters. They become captured state and implicitly participate in generated equality, hashing, and string formatting.\n- Never use `_ = DoAsync()` fire-and-forget pattern. Use `TaskExtensions.Detach` instead.\n- Avoid using `!` to suppress null warnings whenever possible. Best practices: Mark `out` parameters with the `NotNullWhenAttribute`; mark initialization methods with the `MemberNotNullAttribute`; use `if` statements to check for potential null fields in advance.\n- `#region` is allowed when it genuinely improves navigation; it is not a substitute for a well-factored type. `partial class` is preferred for large types that genuinely need to be split across files.\n\n## Architecture and Production APIs\n\n- Optimize for the application's real ownership, call paths, and lifetime. Do not design internal APIs as generic libraries for hypothetical consumers.\n- Match runtime argument validation to a real boundary. Within trusted, nullable-enabled solution code, rely on the type system and nullable analysis instead of repeating null or argument checks by default. Validate data that crosses external, serialization, reflection, plugin, native, or other boundaries where compile-time contracts do not apply.\n- Prefer fewer states, objects, synchronization mechanisms, and intermediate abstractions, but never at the cost of stable identity, incremental updates, correct lifetime, or readability. Judge simplicity by ownership and behavior, not line count.\n- Constructors must express a clear production purpose. Avoid ambiguous default parameters, forwarding-only constructor chains, and constructors added solely for tests.\n- Do not add production methods, constructors, properties, or other hooks solely to make tests easier. Tests should use normal production entry points, mocks, reflection, or `UnsafeAccessor` where appropriate. Reconsider tests that would materially distort the production design.\n\n## Comments and Documentation\n\n- Write all code comments and XML documentation comments in English.\n- Prefer multiline XML `<summary>` comments.\n- Add necessary XML documentation to public APIs. Use `<inheritdoc />` for interface implementations and overrides when the inherited contract is sufficient.\n- Preserve useful existing comments during refactoring. Do not remove documentation merely because the surrounding implementation is being rewritten.\n- Document non-obvious lifetime rules, thread boundaries, state transitions, algorithms, and performance tradeoffs in enough detail for a future maintainer to understand why the design exists.\n- Write technical specifications in English under an appropriate subdirectory of `docs`.\n\n## Localization\n\n- Everywhere uses source-generated localization APIs. Use those APIs instead of manually maintained resource accessors.\n- For persistent UI text, carry `IDynamicLocaleKey` through result models and RPC contracts and subscribe through bindings (e.g. `{Binding MessageKey^}`). It supports MessagePack serialization; do not resolve it before presentation.\n- Compose dynamic messages with `FormattedDynamicLocaleKey` and `AggregateDynamicLocaleKey`; use `DirectLocaleKey` for literal values such as paths. Avoid string interpolation or concatenation that discards localization structure.\n- `LocaleKey.SomeKey.I18N()` resolves once. Use it for intentional language snapshots such as Toast and Dialog text, not persistent UI state.\n- Logs and CLI stdout/stderr may remain English strings. Keep diagnostic text separate from localized UI messages; do not use CLI output as a structured UI message contract.\n- Name localization keys after their current semantic meaning and owning area. Do not preserve an obsolete feature prefix after a value becomes shared.\n- Prefix genuinely shared localization keys with `Common_`.\n\n## Tests\n\n- Name test methods in PascalCase, with underscores separating the scenario, action, and expected result. For example: `UpdateContent_WhenConditionBecomesFalse_ClearsChild`.\n- Follow the repository's existing build and test practices and choose verification proportionate to the scope and risk of the change.\n","docs/References/AvaloniaViewPresentation.md":"# Avalonia, View, and Presentation Reference\n\nRead this reference before modifying Avalonia controls, Views, Presentation objects, DynamicData-backed UI collections, virtualization, or UI animation. These rules are scoped to the UI and Presentation layers; they do not define the threading or collection model of plugins, network services, or other background components.\n\n## Presentation Objects and View Models\n\n- Treat ViewModels as relatively heavy objects. Do not create many ViewModels for simple projections or a handful of UI-only state values.\n- Prefer an existing model, a lightweight Presentation or row object, a custom control, or a View-layer projection when that provides a clear ownership boundary.\n- Keep Presentation objects stable where possible. Replacing all Presentation objects after a small source change causes binding churn, lost control state, animation discontinuities, and visible flicker.\n\n## UI Thread Boundary\n\n- State explicitly owned by a View or Presentation object may be UI-thread-affine.\n- Marshal genuine background ingress to the UI thread at the boundary. Once inside that boundary, keep the object model single-threaded and simple.\n- Do not add locks, concurrent collections, immutable snapshots, pending-operation queues, or defensive reentrancy state to code whose callbacks and timers are all guaranteed to execute on the UI thread.\n- Prefer the existing `Dispatcher.UIThread.PostOnDemand` helper when work may arrive on either thread. It executes immediately when already on the UI thread. Avalonia dispatcher invocation also performs its own access check, so avoid redundant layers of dispatching.\n\n## Collections and DynamicData\n\n- For a read-heavy reference collection confined to the UI thread, prefer a plain `List<T>`. Avoid immutable collections or repeated snapshots without a demonstrated need.\n- In this project, `SourceList.Items` may be read as a stable snapshot. Do not copy it again merely for defensive safety.\n- Use DynamicData change sets to update projections incrementally. Reconcile additions, removals, moves, replacements, and refreshes without rebuilding the entire output collection.\n- Preserve object identity when the logical item has not changed. Prefer reference identity when source objects already provide the correct lifetime identity.\n- When a parent control can naturally own and render a bounded child collection, prefer that ownership over complicated flattening or multi-list merge machinery.\n\n## Controls, Bindings, and Templates\n\n- Before creating or substantially redesigning AXAML, inspect similar controls in `Views/Chat` and `Views/Controls`, including their AXAML, code-behind, and relevant styles. Follow established resource, class, binding, and template patterns; verify binding ownership before reusing them.\n- For fixed presentation snapshots, omit absent items when constructing the data. Use `IsVisible` for optional sections and visibility that can change at runtime.\n- Give custom controls strongly typed Styled or Direct properties for their core input instead of relying on an ambiguous `DataContext`.\n- Continue to use `DataContext` where it is natural to Avalonia, including templates, `ItemsControl`, and ordinary binding scopes.\n- Prefer AXAML for controls with a visual tree, templates, or substantial styling. Pure C# is appropriate for layout algorithms, logic-only controls, or small controls that do not benefit from a template.\n- When runtime type determines the presentation structure, prefer strongly typed `DataTemplate`s over a single control containing many type checks and irrelevant properties.\n- Move shared styles to an appropriate common scope. Do not copy specialized control styles into multiple Views.\n- Keep visible text composable through bindings, localization, templates, and `Inlines`; avoid specialized controls that hard-code a sentence when only periodic refresh or formatting is specialized.\n\n## Lifetime and Lazy Visual Trees\n\n- Behaviors and periodic refresh components must register and unregister during attach/detach and must respond correctly when `IsEnabled` changes.\n- Create expensive visual trees only when they become visible. Terminals, detailed Markdown, diffs, and similarly complex content should normally be loaded on demand.\n- When hidden content has no state that must survive, allow it to be destroyed rather than keeping the visual tree alive indefinitely.\n- Keep the outer structure of a large scrolling list flat, stable, and virtualizable. A bounded, lazy-loaded detail region with its own maximum height and scrolling may intentionally remain non-virtualized when nested virtualization would add more complexity than value.\n\n## Animation and Layout\n\n- Use the simplest panel that directly expresses the layout intent. When multiple controls only need to share a single layout slot, prefer `Panel` over `Grid`.\n- When one child should keep its natural size and another should fill the remaining space, prefer `DockPanel`, docking the size-constrained child and leaving the fill child last. Use `HorizontalSpacing` or `VerticalSpacing` for separation.\n- Reserve `Grid` for layouts that genuinely require row or column sizing and alignment.\n- Use `RenderTransform` and opacity for visual-only movement and fading. These do not participate in measure or arrange and should be preferred over changing layout dimensions for animation.\n- Do not rebuild controls merely to animate a state change. Maintain stable control identity and animate the visual properties that changed.\n- Keep animation state minimal and tied to the real control lifetime. Avoid speculative fallback state machines unless the product requirement calls for them.\n","src/Everywhere.Core/Assets/Skills/OfficeCLI/SKILL.md":"---\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## Usage\n\n`officecli` is a built-in tool. If it's unavailable or not exist, please instruct the user to open the `OfficeCLI` tool in the chat window.\nThe tool allows you to call `officecli` directly without having to install or locate the executable.\nFor any of the commands in the following instructions, do not use any other tools; you MUST use the exact tool and pass the `commandLine` parameter to execute them.\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 <cmd> --help` ≡ `officecli help <cmd>` — 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`/`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`/`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/O 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`/`query`/`view`/`dump`) always see your latest edits, so you never need to save mid-workflow. Run `save` (keeps the resident) or `close` (flush + release) only **before a non-officecli program reads the file** — python-docx/openpyxl, Word, a renderer, delivery/upload. (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 / --type slide --prop title=\"Q4 Report\" --prop background=1A1A2E\nofficecli add slides.pptx '/slide[1]' --type shape --prop text=\"Revenue grew 25%\" --prop x=2cm --prop y=5cm --prop font=Arial --prop size=24 --prop color=FFFFFF\n```\n\n**Word:**\n```bash\nofficecli create report.docx\nofficecli add report.docx /body --type paragraph --prop text=\"Executive Summary\" --prop style=Heading1\nofficecli add report.docx /body --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 /Sheet1/A1 --prop value=\"Name\" --prop bold=true\nofficecli set data.xlsx /Sheet1/A2 --prop value=\"Alice\"\n```\n\n---\n\n## L1: Create, Read & Inspect\n\n```bash\nofficecli create <file>               # Create blank .docx/.xlsx/.pptx (type from extension)\nofficecli view <file> <mode>          # outline | stats | issues | text | annotated | html\nofficecli get <file> <path> --depth N # Get a node and its children [--json]\nofficecli query <file> <selector>     # CSS-like query\nofficecli validate <file>             # 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/content/structure 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` / `svg` / `pdf` / `forms` | PNG via headless browser / SVG (pptx slide) / PDF via exporter plugin / form-fields JSON via format-handler plugin | `-o`, `--screenshot-width/-height`, pptx `--grid N` |\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 '/body/p[3]' --depth 2 --json\nofficecli get slides.pptx '/slide[1]' --depth 1 # list all shapes on slide 1\nofficecli get data.xlsx '/Sheet1/B2' --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/delete, stable IDs do not.\n\n```\n/slide[1]/shape[@id=550950021]              # PPT shape\n/slide[1]/table[@id=1388430425]/tr[1]/tc[2] # PPT table\n/body/p[@paraId=1A2B3C4D]                   # Word paragraph\n/comments/comment[@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/tc, row) fall back to positional indices.\n\n### query\n\nCSS-like selectors: `[attr=value]`, `[attr!=value]`, `[attr~=text]`, `[attr>=value]`, `[attr<=value]`, `:contains(\"text\")`, `:empty`, `:has(formula)`, `:no-alt`. Boolean `and`/`or` supported across `query`/`set`/`remove`: `cell[value>5000 or value<100]`, `cell[(type=Number or type=Date) and value>0]`. Excel row-by-column-name: `Sheet1!row[Salary>5000]`. `set` accepts selectors and Excel-native paths (parity with `get`/`query`). Bare unscoped selectors rejected on `set`/`remove`.\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 / shift-click / box-drag to select shapes; the CLI can read the current browser selection and act on it.\n\n```bash\nofficecli watch <file> [--port N] # Start preview server (default port 26315)\nofficecli unwatch <file>          # Stop\nofficecli goto <file> <path>      # Scroll watching browser(s) to element (docx: p / table / tr / tc)\n```\n\nOpen the printed `http://localhost:N` URL. Click to select; shift/cmd/ctrl+click to multi-select; drag from empty space to box-select. PPT/Word use blue outline; Excel uses native-style green selection (double-click cell to edit inline; drag a chart to reposition).\n\n### `get <file> selected` — read what the user clicked\n\n```bash\nofficecli get <file> 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/pictures/tables/charts/connectors/groups; `.docx` top-level paragraphs and tables. Inherited layout/master decorations and Word nested elements (table cells, run-level) are not addressable. **`.xlsx` does not emit `data-path`** — `mark`/`selection` on xlsx always resolve `stale=true` (v2 candidate).\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 <file> <path> [--prop find=... color=... note=... tofix=... regex=true] [--json]\nofficecli unmark <file> [--path <p> | --all] [--json]\nofficecli get-marks <file> [--json]\n```\n\nProps: `find` (literal or regex when `regex=true`; raw form `find='r\"[abc]\"'`), `color` (hex / `rgb(...)` / 22 named whitelist), `note`, `tofix` (drives apply pipeline). **Path** must be `data-path` format from watch HTML — see subskills for full pipeline.\n\n---\n\n## L2: DOM Operations\n\n### set — modify properties\n\n```bash\nofficecli set <file> <path> --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/without `#`), 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.<attr>` forms accepted on shape/run/paragraph/table/row/cell/section/styles, e.g. `--prop font.color=red --prop font.bold=true --prop font.size=14pt`. Run `officecli help <fmt> <element>` for the full list.\n\n### find — format or replace matched text\n\nUse top-level `--find` / `--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 '/body/p[1]' --find weather --prop bold=true --prop color=red\n\n# Regex matching (regex= still a prop flag)\nofficecli set doc.docx '/body/p[1]' --find '\\d+%' --prop regex=true --prop color=red\n\n# Replace text (use `/` for whole-document scope)\nofficecli set doc.docx / --find draft --replace final\n\n# docx: tracked Find&Replace\nofficecli set doc.docx / --find draft --replace final --prop revision.author=Alice\n\n# PPT — same syntax, different paths\nofficecli set slides.pptx / --find draft --replace final\n```\n\n**Path controls search scope:** `/` = whole document, `/body/p[1]` or `/slide[N]/shape[M]` = specific element, `/header[1]` / `/footer[1]` = headers/footers.\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 <file> <parent> --type <type> [--prop ...]\nofficecli add <file> <parent> --type <type> --after <path> [--prop ...]  # insert after anchor\nofficecli add <file> <parent> --type <type> --before <path> [--prop ...] # insert before anchor\nofficecli add <file> <parent> --type <type> --index N [--prop ...]       # 0-based position (legacy)\nofficecli add <file> <parent> --from <path>                              # 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/ea/cs, direction=rtl, underline.color, highlight=COLOR (Add/Set/Get/HTML preview), effective.X+effective.X.src; arrow alias for rightArrow; slideMaster/slideLayout typed add/set/remove), picture (SVG, brightness/contrast/glow/shadow, rotation, link, tooltip), chart (direction=rtl, pieOfPie, barOfPie, axisLine/gridline per-attr setters, animation+chartBuild=byCategory|bySeries, line dropLines/hiLowLines/upDownBars, anchor=x,y,w,h shorthand), table (cell direction=rtl, fill/background, built-in PowerPoint style catalogue, /col[C] get + swap/copyFrom, row/col Move/CopyFrom), row (tr), connector (from/to accept full-path `@name=`/`@id=` forms — bare `@name=Foo` is rejected, must be `/slide[N]/shape[@name=Foo]` — startshape/endshape SetByPath; edge-to-edge anchoring by default, fromSide/toSide to force an edge, fromIdx/toIdx for raw cxn index), group (link, tooltip, deep walk by get/query/add/remove, ungroup=true dissolves back to slide-absolute), align/distribute (targets= accepts shape[@id=N] paths, not just positional), video/audio (loop, autoStart alias), equation, notes (direction=rtl, lang), comment (legacy + modern p188 threaded round-trip), animation (15 emphasis + 16 exit presets, multi-effect chains, motion-path presets, repeat/restart/autoReverse, chart animations), transition (12 p15 presets + morph/p14), paragraph (para), run, zoom, ole (preview=, full dump round-trip via add-part+raw-set), placeholder (phType=...), model3d (rotation=ax,ay,az; full dump round-trip), smartart (dump round-trip via add-part), diagram (add-only mermaid → native shapes or rendered image, `--type diagram`/`flowchart`). |\n| **docx** | paragraph (direction/font.latin/ea/cs, bold.cs/italic.cs/size.cs, lang.latin/ea/cs, wordWrap, framePr.\\*, tabs shorthand), run (lang slots, direction, underline.color, position half-pts, **revision.type=ins\\|del\\|format\\|moveFrom\\|moveTo + revision.action=accept\\|reject** with .author/.date — bare `@author=`/`@type=` selector on `set /revision[...]` for filtered accept/reject, but `query 'revision[...]'` needs the dotted `revision.author=`/`revision.type=` form; move+revision is run-level paths only, not paragraph-level; **range=START:END** on a paragraph/shape 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/nowrap on cell (both add+set), **virtual column ops**: add/remove/move/copyfrom on /body/tbl[N]/col), row (tr), cell (td), image, header/footer (direction), section (pageNumFmt full enum, direction=rtl, rtlGutter, pgBorders=box), bookmark, comment, footnote, endnote, formfield, sdt, chart, equation, field (28 types), hyperlink, style (direction, indents, pbdr, lineSpacing on Add/Set), toc, watermark, break, ole, **num/abstractNum/lvl**, **tab**, **textbox/shape** (add-mostly — Get returns raw XML preview only, no structured readback; Set is limited to width/height/geometry/fill/line.\\*; position is `anchor.x`/`anchor.y` not bare x/y; **textbox-only** `textDirection`/rotation/gradient/shadow — 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`/`flowchart`, no x/y at add-time — reposition via `set /body/group[N]`). docDefaults.rtl, autoHyphenation, `get /` exposes locale + /comments /footnotes /endnotes. `create --minimal` for raw OOXML scaffolding. |\n| **xlsx** | sheet (visible/hidden/veryHidden, print margins, printTitleRows/Cols, rightToLeft sheetView, cascade-aware rename), row (c{N}= cell-content shorthand; add accepts --from /Sheet/col[L]; formula-ref rewrite on insert), col (formula-ref rewrite, named-range follow on move), cell (type=richtext+runs, merge=range/sweep, direction=rtl, phonetic; **--shift left\\|up on remove, shift=right\\|down on add** — Excel UI dialog parity; formula auto-detect; OFFSET/INDIRECT in calc), chart (per-axis RTL/title, anchor=x,y,w,h, pareto), image (SVG), comment (direction=rtl), table (listobject), namedrange (definedname, volatile, `[@name=X]`; formula-body inlined at parse), pivottable (cache CoW + cross-pivot sharing, labelFilter=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/colorscale/iconset/formulacf/cellIs/topN/aboveAverage), ole, csv. Query supports `merge`/`mergedrange`. Workbook: password. Shape selector enumerates leaves inside grpSp. |\n\n### Pivot tables (xlsx)\n\n```bash\nofficecli add data.xlsx /Sheet1 --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/outline/tabular), `repeatLabels`, `blankRows`, `aggregate`, `showDataAs` (percent_of_total/row/col, running_total), `grandTotals`, `subtotals`, `sort`. Aggregators: sum, count, average, max, min, product, stdDev, stdDevp, var, varp, countNums. Date columns auto-group. Run `officecli help xlsx pivottable` for full schema.\n\n### Document-level properties (all formats)\n\n```bash\nofficecli set doc.docx / --prop docDefaults.font=Arial --prop docDefaults.fontSize=11pt\nofficecli set doc.docx / --prop protection=forms --prop evenAndOddHeaders=true\nofficecli set data.xlsx / --prop calc.mode=manual --prop calc.refMode=r1c1\nofficecli set slides.pptx / --prop defaultFont=Arial --prop show.loop=true --prop print.what=handouts\n```\n\nRun `officecli help <format> /` 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 /Sheet1 --prop sort=\"C desc\" --prop sortHeader=true\nofficecli set data.xlsx '/Sheet1/A1: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` / `--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 '/body/p[1]' --type run --after find:weather --prop text=\" (sunny)\"\n\n# Word: block table after matched text (auto-splits paragraph)\nofficecli add doc.docx '/body/p[1]' --type table --after \"find:First sentence.\" --prop rows=2 --prop cols=2\n```\n\n### Clone\n\n`officecli add <file> / --from '/slide[1]'` — copies with all cross-part relationships.\n\n### move, swap, remove\n\n```bash\nofficecli move <file> <path> [--to <parent>] [--index N] [--after <path>] [--before <path>]\nofficecli swap <file> <path1> <path2>\nofficecli remove <file> '/body/p[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 <file> [<path>]` emits a replayable batch JSON for round-trip — `.docx` (full coverage), `.pptx` (text/tables/pictures/charts/notes/theme + OLE/3D/video/audio/SmartArt/morph/p15 transitions via raw-set passthrough), and `.xlsx` (cells/formulas/styles + tables, conditional formatting, validations, comments, charts, sparklines, pictures, shapes, pivot tables; slicers/chartEx/OLE via verbatim carrier). Path defaults to `/` (whole document); pass a subtree path (docx: `/body`, `/body/p[N]`, `/body/tbl[N]`, `/theme`, `/settings`, `/numbering`, `/styles`; xlsx: `/SheetName`, `/sheet[N]`) to scope the dump. `officecli refresh <file.docx>` recalculates TOC page numbers / PAGE / cross-references after replay (Word backend on Windows; headless-HTML fallback elsewhere). `officecli plugins list` extends support to `.doc`, `.hwpx`, `.pdf` export.\n\n```bash\necho '[\n  {\"command\":\"set\",\"path\":\"/Sheet1/A1\",\"props\":{\"value\":\"Name\",\"bold\":\"true\"}},\n  {\"command\":\"set\",\"path\":\"/Sheet1/B1\",\"props\":{\"value\":\"Score\",\"bold\":\"true\"}}\n]' | officecli batch data.xlsx --json\n\nofficecli batch data.xlsx --commands '[{\"op\":\"set\",\"path\":\"/Sheet1/A1\",\"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 <file> <part>                          # view raw XML\nofficecli raw-set <file> <part> --xpath \"...\" --action replace --xml '<w:p>...</w:p>'\nofficecli add-part <file> <parent>                   # create new document part (returns rId)\n```\n\n`raw-set` actions: `append`, `prepend`, `insertbefore`, `insertafter`, `replace`, `remove`, `setattr`. Run `officecli help <format> 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/bash | Always quote: `'/slide[1]'` or `\"/slide[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| `/shape[myname]` | Name indexing not supported. Use numeric index or `@name=` (PPT only) |\n| Guessing property names | Run `officecli help <format> <element>` to see exact names |\n| Modifying an open file | Close the file in PowerPoint/WPS 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 <name>` — 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` / `pptx` / `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 / conference / thesis: APA / Chicago / IEEE / MLA citations, equations, SEQ + PAGEREF cross-refs, multi-column journal layout, bibliography. NOT for business reports or letters (route those to `word`) |\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 / Series A-C / SAFE / convertible / strategic raise. NOT for sales / product / 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/tabular data → KPI / analytics / 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): `'/body/p[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 / column letter index). `--index 5` inserts at row 5 / column 5.\n- After modifications, verify with `validate` and/or `view issues`\n- **When unsure**, run `officecli help <format> <element>` instead of guessing"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","rawUrl":"https://raw.githubusercontent.com/DearVa/Everywhere/HEAD/AGENTS.md","title":"AI Agent Protocol & Instructions","category":"root-instruction","format":"markdown","content":"# Everywhere Agent Guidelines\n\nThis file contains repository-wide rules. Keep it short enough to read before every task.\nTopic-specific guidance lives under `docs/References` and must be read only when the task touches the corresponding area.\n\n## Code of Conduct\n- Never modify the code unless explicitly instructed to do so-for example, with a command such as \"Start implementation\". But you can still execute commands, write temporary probe code, or use other methods to gather information.\n- During implementation, if any deviations from the plan occur, need a temporary workaround, or face other unexpected situations, depending on the severity of the issue, either record it in `temp.md` or pause and discuss it with the user.\n\n## Required References\n\n- For Avalonia controls, Views, Presentation objects, DynamicData-backed UI collections, virtualization, or UI animation, read [`docs/References/AvaloniaViewPresentation.md`](docs/References/AvaloniaViewPresentation.md) before making changes.\n\n## Source of Truth and Change Discipline\n\n- Inspect the current implementation and its call sites before changing it. Design documents may lag behind the code after later refactoring and are not automatically authoritative.\n- Preserve unrelated and uncommitted user changes. Do not clean up, revert, reformat, or otherwise alter files outside the task's scope.\n- Do not run repository-wide or file-wide formatting when it would create unrelated diffs. Format only the code affected by the task.\n- Discuss new NuGet packages or other dependencies with the user before introducing them, especially when the existing code can implement the requirement at a reasonable cost.\n- Remove obsolete compatibility layers when they have no real callers and are not required by a public API, serialized format, or other compatibility boundary.\n\n## C# Style and Type Layout\n\n- Follow formatting rules in the applicable `.editorconfig`; inspect relevant sections rather than unrelated settings. Use nearby code for choices the configuration does not specify, and do not mechanically compact or expand code.\n- Follow standard .NET naming conventions, including .NET capitalization of acronyms.\n- Keep APIs open for future extensibility: prefer `public` when no concrete ownership, lifetime, or safety boundary requires `internal` or `private` visibility.\n- Use `var` for all local variable declarations.\n- Give Boolean properties, fields, parameters, and local variables a clear semantic prefix such as `Is`, `Has`, `Can`, or `Should`; private fields retain the underscore prefix, for example `_isDisposed` and `_hasCount`. Preserve established framework or API contract names whose Boolean semantics are already unambiguous, such as `Dispose(bool disposing)`.\n- Use expression-bodied members only when the complete declaration and expression fit readably on one line. If either the signature or expression spans multiple lines, use a block body. Prefer expression bodies for simple single-line properties. This rule does not apply to lambdas.\n- Prefer guard clauses and early returns over unnecessary nesting. This concerns control flow, not whether braces or line breaks should be omitted.\n- Keep simple declarations, invocations, and expressions on one line when readable. This preference does not extend to documentation or control-flow blocks. Follow configured brace rules and preserve clear visual grouping.\n- Within a type, normally order member categories as follows:\n  1. properties;\n  2. events;\n  3. fields;\n  4. methods.\n- Static or readonly members may be placed earlier within their category when that improves readability. Do not mechanically reorder existing code solely to enforce this preference.\n- Non-constant fields must be `private`. Constants may use the visibility appropriate to their API, including `public` or `internal`.\n- Public nested types may appear at the beginning or end of their containing type. Place private nested types at the end.\n- Do not retain unused positional-record parameters. They become captured state and implicitly participate in generated equality, hashing, and string formatting.\n- Never use `_ = DoAsync()` fire-and-forget pattern. Use `TaskExtensions.Detach` instead.\n- Avoid using `!` to suppress null warnings whenever possible. Best practices: Mark `out` parameters with the `NotNullWhenAttribute`; mark initialization methods with the `MemberNotNullAttribute`; use `if` statements to check for potential null fields in advance.\n- `#region` is allowed when it genuinely improves navigation; it is not a substitute for a well-factored type. `partial class` is preferred for large types that genuinely need to be split across files.\n\n## Architecture and Production APIs\n\n- Optimize for the application's real ownership, call paths, and lifetime. Do not design internal APIs as generic libraries for hypothetical consumers.\n- Match runtime argument validation to a real boundary. Within trusted, nullable-enabled solution code, rely on the type system and nullable analysis instead of repeating null or argument checks by default. Validate data that crosses external, serialization, reflection, plugin, native, or other boundaries where compile-time contracts do not apply.\n- Prefer fewer states, objects, synchronization mechanisms, and intermediate abstractions, but never at the cost of stable identity, incremental updates, correct lifetime, or readability. Judge simplicity by ownership and behavior, not line count.\n- Constructors must express a clear production purpose. Avoid ambiguous default parameters, forwarding-only constructor chains, and constructors added solely for tests.\n- Do not add production methods, constructors, properties, or other hooks solely to make tests easier. Tests should use normal production entry points, mocks, reflection, or `UnsafeAccessor` where appropriate. Reconsider tests that would materially distort the production design.\n\n## Comments and Documentation\n\n- Write all code comments and XML documentation comments in English.\n- Prefer multiline XML `<summary>` comments.\n- Add necessary XML documentation to public APIs. Use `<inheritdoc />` for interface implementations and overrides when the inherited contract is sufficient.\n- Preserve useful existing comments during refactoring. Do not remove documentation merely because the surrounding implementation is being rewritten.\n- Document non-obvious lifetime rules, thread boundaries, state transitions, algorithms, and performance tradeoffs in enough detail for a future maintainer to understand why the design exists.\n- Write technical specifications in English under an appropriate subdirectory of `docs`.\n\n## Localization\n\n- Everywhere uses source-generated localization APIs. Use those APIs instead of manually maintained resource accessors.\n- For persistent UI text, carry `IDynamicLocaleKey` through result models and RPC contracts and subscribe through bindings (e.g. `{Binding MessageKey^}`). It supports MessagePack serialization; do not resolve it before presentation.\n- Compose dynamic messages with `FormattedDynamicLocaleKey` and `AggregateDynamicLocaleKey`; use `DirectLocaleKey` for literal values such as paths. Avoid string interpolation or concatenation that discards localization structure.\n- `LocaleKey.SomeKey.I18N()` resolves once. Use it for intentional language snapshots such as Toast and Dialog text, not persistent UI state.\n- Logs and CLI stdout/stderr may remain English strings. Keep diagnostic text separate from localized UI messages; do not use CLI output as a structured UI message contract.\n- Name localization keys after their current semantic meaning and owning area. Do not preserve an obsolete feature prefix after a value becomes shared.\n- Prefix genuinely shared localization keys with `Common_`.\n\n## Tests\n\n- Name test methods in PascalCase, with underscores separating the scenario, action, and expected result. For example: `UpdateContent_WhenConditionBecomesFalse_ClearsChild`.\n- Follow the repository's existing build and test practices and choose verification proportionate to the scope and risk of the change.\n","isInternal":false,"tokens":1525,"sizeBytes":8098},{"name":"AvaloniaViewPresentation.md","path":"docs/References/AvaloniaViewPresentation.md","rawUrl":"https://raw.githubusercontent.com/DearVa/Everywhere/HEAD/docs/References/AvaloniaViewPresentation.md","title":"References Skill","category":"anthropic-skill","format":"markdown","content":"# Avalonia, View, and Presentation Reference\n\nRead this reference before modifying Avalonia controls, Views, Presentation objects, DynamicData-backed UI collections, virtualization, or UI animation. These rules are scoped to the UI and Presentation layers; they do not define the threading or collection model of plugins, network services, or other background components.\n\n## Presentation Objects and View Models\n\n- Treat ViewModels as relatively heavy objects. Do not create many ViewModels for simple projections or a handful of UI-only state values.\n- Prefer an existing model, a lightweight Presentation or row object, a custom control, or a View-layer projection when that provides a clear ownership boundary.\n- Keep Presentation objects stable where possible. Replacing all Presentation objects after a small source change causes binding churn, lost control state, animation discontinuities, and visible flicker.\n\n## UI Thread Boundary\n\n- State explicitly owned by a View or Presentation object may be UI-thread-affine.\n- Marshal genuine background ingress to the UI thread at the boundary. Once inside that boundary, keep the object model single-threaded and simple.\n- Do not add locks, concurrent collections, immutable snapshots, pending-operation queues, or defensive reentrancy state to code whose callbacks and timers are all guaranteed to execute on the UI thread.\n- Prefer the existing `Dispatcher.UIThread.PostOnDemand` helper when work may arrive on either thread. It executes immediately when already on the UI thread. Avalonia dispatcher invocation also performs its own access check, so avoid redundant layers of dispatching.\n\n## Collections and DynamicData\n\n- For a read-heavy reference collection confined to the UI thread, prefer a plain `List<T>`. Avoid immutable collections or repeated snapshots without a demonstrated need.\n- In this project, `SourceList.Items` may be read as a stable snapshot. Do not copy it again merely for defensive safety.\n- Use DynamicData change sets to update projections incrementally. Reconcile additions, removals, moves, replacements, and refreshes without rebuilding the entire output collection.\n- Preserve object identity when the logical item has not changed. Prefer reference identity when source objects already provide the correct lifetime identity.\n- When a parent control can naturally own and render a bounded child collection, prefer that ownership over complicated flattening or multi-list merge machinery.\n\n## Controls, Bindings, and Templates\n\n- Before creating or substantially redesigning AXAML, inspect similar controls in `Views/Chat` and `Views/Controls`, including their AXAML, code-behind, and relevant styles. Follow established resource, class, binding, and template patterns; verify binding ownership before reusing them.\n- For fixed presentation snapshots, omit absent items when constructing the data. Use `IsVisible` for optional sections and visibility that can change at runtime.\n- Give custom controls strongly typed Styled or Direct properties for their core input instead of relying on an ambiguous `DataContext`.\n- Continue to use `DataContext` where it is natural to Avalonia, including templates, `ItemsControl`, and ordinary binding scopes.\n- Prefer AXAML for controls with a visual tree, templates, or substantial styling. Pure C# is appropriate for layout algorithms, logic-only controls, or small controls that do not benefit from a template.\n- When runtime type determines the presentation structure, prefer strongly typed `DataTemplate`s over a single control containing many type checks and irrelevant properties.\n- Move shared styles to an appropriate common scope. Do not copy specialized control styles into multiple Views.\n- Keep visible text composable through bindings, localization, templates, and `Inlines`; avoid specialized controls that hard-code a sentence when only periodic refresh or formatting is specialized.\n\n## Lifetime and Lazy Visual Trees\n\n- Behaviors and periodic refresh components must register and unregister during attach/detach and must respond correctly when `IsEnabled` changes.\n- Create expensive visual trees only when they become visible. Terminals, detailed Markdown, diffs, and similarly complex content should normally be loaded on demand.\n- When hidden content has no state that must survive, allow it to be destroyed rather than keeping the visual tree alive indefinitely.\n- Keep the outer structure of a large scrolling list flat, stable, and virtualizable. A bounded, lazy-loaded detail region with its own maximum height and scrolling may intentionally remain non-virtualized when nested virtualization would add more complexity than value.\n\n## Animation and Layout\n\n- Use the simplest panel that directly expresses the layout intent. When multiple controls only need to share a single layout slot, prefer `Panel` over `Grid`.\n- When one child should keep its natural size and another should fill the remaining space, prefer `DockPanel`, docking the size-constrained child and leaving the fill child last. Use `HorizontalSpacing` or `VerticalSpacing` for separation.\n- Reserve `Grid` for layouts that genuinely require row or column sizing and alignment.\n- Use `RenderTransform` and opacity for visual-only movement and fading. These do not participate in measure or arrange and should be preferred over changing layout dimensions for animation.\n- Do not rebuild controls merely to animate a state change. Maintain stable control identity and animate the visual properties that changed.\n- Keep animation state minimal and tied to the real control lifetime. Avoid speculative fallback state machines unless the product requirement calls for them.\n","isInternal":false,"tokens":1056,"sizeBytes":5685},{"name":"SKILL.md","path":"src/Everywhere.Core/Assets/Skills/OfficeCLI/SKILL.md","rawUrl":"https://raw.githubusercontent.com/DearVa/Everywhere/HEAD/src/Everywhere.Core/Assets/Skills/OfficeCLI/SKILL.md","title":"officecli","category":"anthropic-skill","format":"markdown","content":"---\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## Usage\n\n`officecli` is a built-in tool. If it's unavailable or not exist, please instruct the user to open the `OfficeCLI` tool in the chat window.\nThe tool allows you to call `officecli` directly without having to install or locate the executable.\nFor any of the commands in the following instructions, do not use any other tools; you MUST use the exact tool and pass the `commandLine` parameter to execute them.\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 <cmd> --help` ≡ `officecli help <cmd>` — 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`/`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`/`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/O 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`/`query`/`view`/`dump`) always see your latest edits, so you never need to save mid-workflow. Run `save` (keeps the resident) or `close` (flush + release) only **before a non-officecli program reads the file** — python-docx/openpyxl, Word, a renderer, delivery/upload. (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 / --type slide --prop title=\"Q4 Report\" --prop background=1A1A2E\nofficecli add slides.pptx '/slide[1]' --type shape --prop text=\"Revenue grew 25%\" --prop x=2cm --prop y=5cm --prop font=Arial --prop size=24 --prop color=FFFFFF\n```\n\n**Word:**\n```bash\nofficecli create report.docx\nofficecli add report.docx /body --type paragraph --prop text=\"Executive Summary\" --prop style=Heading1\nofficecli add report.docx /body --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 /Sheet1/A1 --prop value=\"Name\" --prop bold=true\nofficecli set data.xlsx /Sheet1/A2 --prop value=\"Alice\"\n```\n\n---\n\n## L1: Create, Read & Inspect\n\n```bash\nofficecli create <file>               # Create blank .docx/.xlsx/.pptx (type from extension)\nofficecli view <file> <mode>          # outline | stats | issues | text | annotated | html\nofficecli get <file> <path> --depth N # Get a node and its children [--json]\nofficecli query <file> <selector>     # CSS-like query\nofficecli validate <file>             # 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/content/structure 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` / `svg` / `pdf` / `forms` | PNG via headless browser / SVG (pptx slide) / PDF via exporter plugin / form-fields JSON via format-handler plugin | `-o`, `--screenshot-width/-height`, pptx `--grid N` |\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 '/body/p[3]' --depth 2 --json\nofficecli get slides.pptx '/slide[1]' --depth 1 # list all shapes on slide 1\nofficecli get data.xlsx '/Sheet1/B2' --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/delete, stable IDs do not.\n\n```\n/slide[1]/shape[@id=550950021]              # PPT shape\n/slide[1]/table[@id=1388430425]/tr[1]/tc[2] # PPT table\n/body/p[@paraId=1A2B3C4D]                   # Word paragraph\n/comments/comment[@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/tc, row) fall back to positional indices.\n\n### query\n\nCSS-like selectors: `[attr=value]`, `[attr!=value]`, `[attr~=text]`, `[attr>=value]`, `[attr<=value]`, `:contains(\"text\")`, `:empty`, `:has(formula)`, `:no-alt`. Boolean `and`/`or` supported across `query`/`set`/`remove`: `cell[value>5000 or value<100]`, `cell[(type=Number or type=Date) and value>0]`. Excel row-by-column-name: `Sheet1!row[Salary>5000]`. `set` accepts selectors and Excel-native paths (parity with `get`/`query`). Bare unscoped selectors rejected on `set`/`remove`.\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 / shift-click / box-drag to select shapes; the CLI can read the current browser selection and act on it.\n\n```bash\nofficecli watch <file> [--port N] # Start preview server (default port 26315)\nofficecli unwatch <file>          # Stop\nofficecli goto <file> <path>      # Scroll watching browser(s) to element (docx: p / table / tr / tc)\n```\n\nOpen the printed `http://localhost:N` URL. Click to select; shift/cmd/ctrl+click to multi-select; drag from empty space to box-select. PPT/Word use blue outline; Excel uses native-style green selection (double-click cell to edit inline; drag a chart to reposition).\n\n### `get <file> selected` — read what the user clicked\n\n```bash\nofficecli get <file> 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/pictures/tables/charts/connectors/groups; `.docx` top-level paragraphs and tables. Inherited layout/master decorations and Word nested elements (table cells, run-level) are not addressable. **`.xlsx` does not emit `data-path`** — `mark`/`selection` on xlsx always resolve `stale=true` (v2 candidate).\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 <file> <path> [--prop find=... color=... note=... tofix=... regex=true] [--json]\nofficecli unmark <file> [--path <p> | --all] [--json]\nofficecli get-marks <file> [--json]\n```\n\nProps: `find` (literal or regex when `regex=true`; raw form `find='r\"[abc]\"'`), `color` (hex / `rgb(...)` / 22 named whitelist), `note`, `tofix` (drives apply pipeline). **Path** must be `data-path` format from watch HTML — see subskills for full pipeline.\n\n---\n\n## L2: DOM Operations\n\n### set — modify properties\n\n```bash\nofficecli set <file> <path> --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/without `#`), 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.<attr>` forms accepted on shape/run/paragraph/table/row/cell/section/styles, e.g. `--prop font.color=red --prop font.bold=true --prop font.size=14pt`. Run `officecli help <fmt> <element>` for the full list.\n\n### find — format or replace matched text\n\nUse top-level `--find` / `--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 '/body/p[1]' --find weather --prop bold=true --prop color=red\n\n# Regex matching (regex= still a prop flag)\nofficecli set doc.docx '/body/p[1]' --find '\\d+%' --prop regex=true --prop color=red\n\n# Replace text (use `/` for whole-document scope)\nofficecli set doc.docx / --find draft --replace final\n\n# docx: tracked Find&Replace\nofficecli set doc.docx / --find draft --replace final --prop revision.author=Alice\n\n# PPT — same syntax, different paths\nofficecli set slides.pptx / --find draft --replace final\n```\n\n**Path controls search scope:** `/` = whole document, `/body/p[1]` or `/slide[N]/shape[M]` = specific element, `/header[1]` / `/footer[1]` = headers/footers.\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 <file> <parent> --type <type> [--prop ...]\nofficecli add <file> <parent> --type <type> --after <path> [--prop ...]  # insert after anchor\nofficecli add <file> <parent> --type <type> --before <path> [--prop ...] # insert before anchor\nofficecli add <file> <parent> --type <type> --index N [--prop ...]       # 0-based position (legacy)\nofficecli add <file> <parent> --from <path>                              # 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/ea/cs, direction=rtl, underline.color, highlight=COLOR (Add/Set/Get/HTML preview), effective.X+effective.X.src; arrow alias for rightArrow; slideMaster/slideLayout typed add/set/remove), picture (SVG, brightness/contrast/glow/shadow, rotation, link, tooltip), chart (direction=rtl, pieOfPie, barOfPie, axisLine/gridline per-attr setters, animation+chartBuild=byCategory|bySeries, line dropLines/hiLowLines/upDownBars, anchor=x,y,w,h shorthand), table (cell direction=rtl, fill/background, built-in PowerPoint style catalogue, /col[C] get + swap/copyFrom, row/col Move/CopyFrom), row (tr), connector (from/to accept full-path `@name=`/`@id=` forms — bare `@name=Foo` is rejected, must be `/slide[N]/shape[@name=Foo]` — startshape/endshape SetByPath; edge-to-edge anchoring by default, fromSide/toSide to force an edge, fromIdx/toIdx for raw cxn index), group (link, tooltip, deep walk by get/query/add/remove, ungroup=true dissolves back to slide-absolute), align/distribute (targets= accepts shape[@id=N] paths, not just positional), video/audio (loop, autoStart alias), equation, notes (direction=rtl, lang), comment (legacy + modern p188 threaded round-trip), animation (15 emphasis + 16 exit presets, multi-effect chains, motion-path presets, repeat/restart/autoReverse, chart animations), transition (12 p15 presets + morph/p14), paragraph (para), run, zoom, ole (preview=, full dump round-trip via add-part+raw-set), placeholder (phType=...), model3d (rotation=ax,ay,az; full dump round-trip), smartart (dump round-trip via add-part), diagram (add-only mermaid → native shapes or rendered image, `--type diagram`/`flowchart`). |\n| **docx** | paragraph (direction/font.latin/ea/cs, bold.cs/italic.cs/size.cs, lang.latin/ea/cs, wordWrap, framePr.\\*, tabs shorthand), run (lang slots, direction, underline.color, position half-pts, **revision.type=ins\\|del\\|format\\|moveFrom\\|moveTo + revision.action=accept\\|reject** with .author/.date — bare `@author=`/`@type=` selector on `set /revision[...]` for filtered accept/reject, but `query 'revision[...]'` needs the dotted `revision.author=`/`revision.type=` form; move+revision is run-level paths only, not paragraph-level; **range=START:END** on a paragraph/shape 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/nowrap on cell (both add+set), **virtual column ops**: add/remove/move/copyfrom on /body/tbl[N]/col), row (tr), cell (td), image, header/footer (direction), section (pageNumFmt full enum, direction=rtl, rtlGutter, pgBorders=box), bookmark, comment, footnote, endnote, formfield, sdt, chart, equation, field (28 types), hyperlink, style (direction, indents, pbdr, lineSpacing on Add/Set), toc, watermark, break, ole, **num/abstractNum/lvl**, **tab**, **textbox/shape** (add-mostly — Get returns raw XML preview only, no structured readback; Set is limited to width/height/geometry/fill/line.\\*; position is `anchor.x`/`anchor.y` not bare x/y; **textbox-only** `textDirection`/rotation/gradient/shadow — 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`/`flowchart`, no x/y at add-time — reposition via `set /body/group[N]`). docDefaults.rtl, autoHyphenation, `get /` exposes locale + /comments /footnotes /endnotes. `create --minimal` for raw OOXML scaffolding. |\n| **xlsx** | sheet (visible/hidden/veryHidden, print margins, printTitleRows/Cols, rightToLeft sheetView, cascade-aware rename), row (c{N}= cell-content shorthand; add accepts --from /Sheet/col[L]; formula-ref rewrite on insert), col (formula-ref rewrite, named-range follow on move), cell (type=richtext+runs, merge=range/sweep, direction=rtl, phonetic; **--shift left\\|up on remove, shift=right\\|down on add** — Excel UI dialog parity; formula auto-detect; OFFSET/INDIRECT in calc), chart (per-axis RTL/title, anchor=x,y,w,h, pareto), image (SVG), comment (direction=rtl), table (listobject), namedrange (definedname, volatile, `[@name=X]`; formula-body inlined at parse), pivottable (cache CoW + cross-pivot sharing, labelFilter=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/colorscale/iconset/formulacf/cellIs/topN/aboveAverage), ole, csv. Query supports `merge`/`mergedrange`. Workbook: password. Shape selector enumerates leaves inside grpSp. |\n\n### Pivot tables (xlsx)\n\n```bash\nofficecli add data.xlsx /Sheet1 --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/outline/tabular), `repeatLabels`, `blankRows`, `aggregate`, `showDataAs` (percent_of_total/row/col, running_total), `grandTotals`, `subtotals`, `sort`. Aggregators: sum, count, average, max, min, product, stdDev, stdDevp, var, varp, countNums. Date columns auto-group. Run `officecli help xlsx pivottable` for full schema.\n\n### Document-level properties (all formats)\n\n```bash\nofficecli set doc.docx / --prop docDefaults.font=Arial --prop docDefaults.fontSize=11pt\nofficecli set doc.docx / --prop protection=forms --prop evenAndOddHeaders=true\nofficecli set data.xlsx / --prop calc.mode=manual --prop calc.refMode=r1c1\nofficecli set slides.pptx / --prop defaultFont=Arial --prop show.loop=true --prop print.what=handouts\n```\n\nRun `officecli help <format> /` 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 /Sheet1 --prop sort=\"C desc\" --prop sortHeader=true\nofficecli set data.xlsx '/Sheet1/A1: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` / `--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 '/body/p[1]' --type run --after find:weather --prop text=\" (sunny)\"\n\n# Word: block table after matched text (auto-splits paragraph)\nofficecli add doc.docx '/body/p[1]' --type table --after \"find:First sentence.\" --prop rows=2 --prop cols=2\n```\n\n### Clone\n\n`officecli add <file> / --from '/slide[1]'` — copies with all cross-part relationships.\n\n### move, swap, remove\n\n```bash\nofficecli move <file> <path> [--to <parent>] [--index N] [--after <path>] [--before <path>]\nofficecli swap <file> <path1> <path2>\nofficecli remove <file> '/body/p[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 <file> [<path>]` emits a replayable batch JSON for round-trip — `.docx` (full coverage), `.pptx` (text/tables/pictures/charts/notes/theme + OLE/3D/video/audio/SmartArt/morph/p15 transitions via raw-set passthrough), and `.xlsx` (cells/formulas/styles + tables, conditional formatting, validations, comments, charts, sparklines, pictures, shapes, pivot tables; slicers/chartEx/OLE via verbatim carrier). Path defaults to `/` (whole document); pass a subtree path (docx: `/body`, `/body/p[N]`, `/body/tbl[N]`, `/theme`, `/settings`, `/numbering`, `/styles`; xlsx: `/SheetName`, `/sheet[N]`) to scope the dump. `officecli refresh <file.docx>` recalculates TOC page numbers / PAGE / cross-references after replay (Word backend on Windows; headless-HTML fallback elsewhere). `officecli plugins list` extends support to `.doc`, `.hwpx`, `.pdf` export.\n\n```bash\necho '[\n  {\"command\":\"set\",\"path\":\"/Sheet1/A1\",\"props\":{\"value\":\"Name\",\"bold\":\"true\"}},\n  {\"command\":\"set\",\"path\":\"/Sheet1/B1\",\"props\":{\"value\":\"Score\",\"bold\":\"true\"}}\n]' | officecli batch data.xlsx --json\n\nofficecli batch data.xlsx --commands '[{\"op\":\"set\",\"path\":\"/Sheet1/A1\",\"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 <file> <part>                          # view raw XML\nofficecli raw-set <file> <part> --xpath \"...\" --action replace --xml '<w:p>...</w:p>'\nofficecli add-part <file> <parent>                   # create new document part (returns rId)\n```\n\n`raw-set` actions: `append`, `prepend`, `insertbefore`, `insertafter`, `replace`, `remove`, `setattr`. Run `officecli help <format> 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/bash | Always quote: `'/slide[1]'` or `\"/slide[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| `/shape[myname]` | Name indexing not supported. Use numeric index or `@name=` (PPT only) |\n| Guessing property names | Run `officecli help <format> <element>` to see exact names |\n| Modifying an open file | Close the file in PowerPoint/WPS 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 <name>` — 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` / `pptx` / `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 / conference / thesis: APA / Chicago / IEEE / MLA citations, equations, SEQ + PAGEREF cross-refs, multi-column journal layout, bibliography. NOT for business reports or letters (route those to `word`) |\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 / Series A-C / SAFE / convertible / strategic raise. NOT for sales / product / 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/tabular data → KPI / analytics / 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): `'/body/p[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 / column letter index). `--index 5` inserts at row 5 / column 5.\n- After modifications, verify with `validate` and/or `view issues`\n- **When unsure**, run `officecli help <format> <element>` instead of guessing","frontmatter":{"name":"officecli","description":"Create, analyze, proofread, and modify Office documents (.docx, .xlsx, .pptx) using the officecli CLI tool. Use when the user wants to create, inspect, check formatting, find issues, add charts, or modify Office documents."},"isInternal":false,"tokens":6770,"sizeBytes":25131}],"systemPromptSnippet":"<yakaai_skills repo=\"DearVa/Everywhere\">\n<!-- File: AGENTS.md (Tokens: ~1525 | Category: root-instruction) -->\n# Everywhere Agent Guidelines\n\nThis file contains repository-wide rules. Keep it short enough to read before every task.\nTopic-specific guidance lives under `docs/References` and must be read only when the task touches the corresponding area.\n\n## Code of Conduct\n- Never modify the code unless explicitly instructed to do so-for example, with a command such as \"Start implementation\". But you can still execute commands, write temporary probe code, or use other methods to gather information.\n- During implementation, if any deviations from the plan occur, need a temporary workaround, or face other unexpected situations, depending on the severity of the issue, either record it in `temp.md` or pause and discuss it with the user.\n\n## Required References\n\n- For Avalonia controls, Views, Presentation objects, DynamicData-backed UI collections, virtualization, or UI animation, read [`docs/References/AvaloniaViewPresentation.md`](docs/References/AvaloniaViewPresentation.md) before making changes.\n\n## Source of Truth and Change Discipline\n\n- Inspect the current implementation and its call sites before changing it. Design documents may lag behind the code after later refactoring and are not automatically authoritative.\n- Preserve unrelated and uncommitted user changes. Do not clean up, revert, reformat, or otherwise alter files outside the task's scope.\n- Do not run repository-wide or file-wide formatting when it would create unrelated diffs. Format only the code affected by the task.\n- Discuss new NuGet packages or other dependencies with the user before introducing them, especially when the existing code can implement the requirement at a reasonable cost.\n- Remove obsolete compatibility layers when they have no real callers and are not required by a public API, serialized format, or other compatibility boundary.\n\n## C# Style and Type Layout\n\n- Follow formatting rules in the applicable `.editorconfig`; inspect relevant sections rather than unrelated settings. Use nearby code for choices the configuration does not specify, and do not mechanically compact or expand code.\n- Follow standard .NET naming conventions, including .NET capitalization of acronyms.\n- Keep APIs open for future extensibility: prefer `public` when no concrete ownership, lifetime, or safety boundary requires `internal` or `private` visibility.\n- Use `var` for all local variable declarations.\n- Give Boolean properties, fields, parameters, and local variables a clear semantic prefix such as `Is`, `Has`, `Can`, or `Should`; private fields retain the underscore prefix, for example `_isDisposed` and `_hasCount`. Preserve established framework or API contract names whose Boolean semantics are already unambiguous, such as `Dispose(bool disposing)`.\n- Use expression-bodied members only when the complete declaration and expression fit readably on one line. If either the signature or expression spans multiple lines, use a block body. Prefer expression bodies for simple single-line properties. This rule does not apply to lambdas.\n- Prefer guard clauses and early returns over unnecessary nesting. This concerns control flow, not whether braces or line breaks should be omitted.\n- Keep simple declarations, invocations, and expressions on one line when readable. This preference does not extend to documentation or control-flow blocks. Follow configured brace rules and preserve clear visual grouping.\n- Within a type, normally order member categories as follows:\n  1. properties;\n  2. events;\n  3. fields;\n  4. methods.\n- Static or readonly members may be placed earlier within their category when that improves readability. Do not mechanically reorder existing code solely to enforce this preference.\n- Non-constant fields must be `private`. Constants may use the visibility appropriate to their API, including `public` or `internal`.\n- Public nested types may appear at the beginning or end of their containing type. Place private nested types at the end.\n- Do not retain unused positional-record parameters. They become captured state and implicitly participate in generated equality, hashing, and string formatting.\n- Never use `_ = DoAsync()` fire-and-forget pattern. Use `TaskExtensions.Detach` instead.\n- Avoid using `!` to suppress null warnings whenever possible. Best practices: Mark `out` parameters with the `NotNullWhenAttribute`; mark initialization methods with the `MemberNotNullAttribute`; use `if` statements to check for potential null fields in advance.\n- `#region` is allowed when it genuinely improves navigation; it is not a substitute for a well-factored type. `partial class` is preferred for large types that genuinely need to be split across files.\n\n## Architecture and Production APIs\n\n- Optimize for the application's real ownership, call paths, and lifetime. Do not design internal APIs as generic libraries for hypothetical consumers.\n- Match runtime argument validation to a real boundary. Within trusted, nullable-enabled solution code, rely on the type system and nullable analysis instead of repeating null or argument checks by default. Validate data that crosses external, serialization, reflection, plugin, native, or other boundaries where compile-time contracts do not apply.\n- Prefer fewer states, objects, synchronization mechanisms, and intermediate abstractions, but never at the cost of stable identity, incremental updates, correct lifetime, or readability. Judge simplicity by ownership and behavior, not line count.\n- Constructors must express a clear production purpose. Avoid ambiguous default parameters, forwarding-only constructor chains, and constructors added solely for tests.\n- Do not add production methods, constructors, properties, or other hooks solely to make tests easier. Tests should use normal production entry points, mocks, reflection, or `UnsafeAccessor` where appropriate. Reconsider tests that would materially distort the production design.\n\n## Comments and Documentation\n\n- Write all code comments and XML documentation comments in English.\n- Prefer multiline XML `<summary>` comments.\n- Add necessary XML documentation to public APIs. Use `<inheritdoc />` for interface implementations and overrides when the inherited contract is sufficient.\n- Preserve useful existing comments during refactoring. Do not remove documentation merely because the surrounding implementation is being rewritten.\n- Document non-obvious lifetime rules, thread boundaries, state transitions, algorithms, and performance tradeoffs in enough detail for a future maintainer to understand why the design exists.\n- Write technical specifications in English under an appropriate subdirectory of `docs`.\n\n## Localization\n\n- Everywhere uses source-generated localization APIs. Use those APIs instead of manually maintained resource accessors.\n- For persistent UI text, carry `IDynamicLocaleKey` through result models and RPC contracts and subscribe through bindings (e.g. `{Binding MessageKey^}`). It supports MessagePack serialization; do not resolve it before presentation.\n- Compose dynamic messages with `FormattedDynamicLocaleKey` and `AggregateDynamicLocaleKey`; use `DirectLocaleKey` for literal values such as paths. Avoid string interpolation or concatenation that discards localization structure.\n- `LocaleKey.SomeKey.I18N()` resolves once. Use it for intentional language snapshots such as Toast and Dialog text, not persistent UI state.\n- Logs and CLI stdout/stderr may remain English strings. Keep diagnostic text separate from localized UI messages; do not use CLI output as a structured UI message contract.\n- Name localization keys after their current semantic meaning and owning area. Do not preserve an obsolete feature prefix after a value becomes shared.\n- Prefix genuinely shared localization keys with `Common_`.\n\n## Tests\n\n- Name test methods in PascalCase, with underscores separating the scenario, action, and expected result. For example: `UpdateContent_WhenConditionBecomesFalse_ClearsChild`.\n- Follow the repository's existing build and test practices and choose verification proportionate to the scope and risk of the change.\n\n<!-- File: docs/References/AvaloniaViewPresentation.md (Tokens: ~1056 | Category: anthropic-skill) -->\n# Avalonia, View, and Presentation Reference\n\nRead this reference before modifying Avalonia controls, Views, Presentation objects, DynamicData-backed UI collections, virtualization, or UI animation. These rules are scoped to the UI and Presentation layers; they do not define the threading or collection model of plugins, network services, or other background components.\n\n## Presentation Objects and View Models\n\n- Treat ViewModels as relatively heavy objects. Do not create many ViewModels for simple projections or a handful of UI-only state values.\n- Prefer an existing model, a lightweight Presentation or row object, a custom control, or a View-layer projection when that provides a clear ownership boundary.\n- Keep Presentation objects stable where possible. Replacing all Presentation objects after a small source change causes binding churn, lost control state, animation discontinuities, and visible flicker.\n\n## UI Thread Boundary\n\n- State explicitly owned by a View or Presentation object may be UI-thread-affine.\n- Marshal genuine background ingress to the UI thread at the boundary. Once inside that boundary, keep the object model single-threaded and simple.\n- Do not add locks, concurrent collections, immutable snapshots, pending-operation queues, or defensive reentrancy state to code whose callbacks and timers are all guaranteed to execute on the UI thread.\n- Prefer the existing `Dispatcher.UIThread.PostOnDemand` helper when work may arrive on either thread. It executes immediately when already on the UI thread. Avalonia dispatcher invocation also performs its own access check, so avoid redundant layers of dispatching.\n\n## Collections and DynamicData\n\n- For a read-heavy reference collection confined to the UI thread, prefer a plain `List<T>`. Avoid immutable collections or repeated snapshots without a demonstrated need.\n- In this project, `SourceList.Items` may be read as a stable snapshot. Do not copy it again merely for defensive safety.\n- Use DynamicData change sets to update projections incrementally. Reconcile additions, removals, moves, replacements, and refreshes without rebuilding the entire output collection.\n- Preserve object identity when the logical item has not changed. Prefer reference identity when source objects already provide the correct lifetime identity.\n- When a parent control can naturally own and render a bounded child collection, prefer that ownership over complicated flattening or multi-list merge machinery.\n\n## Controls, Bindings, and Templates\n\n- Before creating or substantially redesigning AXAML, inspect similar controls in `Views/Chat` and `Views/Controls`, including their AXAML, code-behind, and relevant styles. Follow established resource, class, binding, and template patterns; verify binding ownership before reusing them.\n- For fixed presentation snapshots, omit absent items when constructing the data. Use `IsVisible` for optional sections and visibility that can change at runtime.\n- Give custom controls strongly typed Styled or Direct properties for their core input instead of relying on an ambiguous `DataContext`.\n- Continue to use `DataContext` where it is natural to Avalonia, including templates, `ItemsControl`, and ordinary binding scopes.\n- Prefer AXAML for controls with a visual tree, templates, or substantial styling. Pure C# is appropriate for layout algorithms, logic-only controls, or small controls that do not benefit from a template.\n- When runtime type determines the presentation structure, prefer strongly typed `DataTemplate`s over a single control containing many type checks and irrelevant properties.\n- Move shared styles to an appropriate common scope. Do not copy specialized control styles into multiple Views.\n- Keep visible text composable through bindings, localization, templates, and `Inlines`; avoid specialized controls that hard-code a sentence when only periodic refresh or formatting is specialized.\n\n## Lifetime and Lazy Visual Trees\n\n- Behaviors and periodic refresh components must register and unregister during attach/detach and must respond correctly when `IsEnabled` changes.\n- Create expensive visual trees only when they become visible. Terminals, detailed Markdown, diffs, and similarly complex content should normally be loaded on demand.\n- When hidden content has no state that must survive, allow it to be destroyed rather than keeping the visual tree alive indefinitely.\n- Keep the outer structure of a large scrolling list flat, stable, and virtualizable. A bounded, lazy-loaded detail region with its own maximum height and scrolling may intentionally remain non-virtualized when nested virtualization would add more complexity than value.\n\n## Animation and Layout\n\n- Use the simplest panel that directly expresses the layout intent. When multiple controls only need to share a single layout slot, prefer `Panel` over `Grid`.\n- When one child should keep its natural size and another should fill the remaining space, prefer `DockPanel`, docking the size-constrained child and leaving the fill child last. Use `HorizontalSpacing` or `VerticalSpacing` for separation.\n- Reserve `Grid` for layouts that genuinely require row or column sizing and alignment.\n- Use `RenderTransform` and opacity for visual-only movement and fading. These do not participate in measure or arrange and should be preferred over changing layout dimensions for animation.\n- Do not rebuild controls merely to animate a state change. Maintain stable control identity and animate the visual properties that changed.\n- Keep animation state minimal and tied to the real control lifetime. Avoid speculative fallback state machines unless the product requirement calls for them.\n\n<!-- File: src/Everywhere.Core/Assets/Skills/OfficeCLI/SKILL.md (Tokens: ~6770 | Category: anthropic-skill) -->\n---\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## Usage\n\n`officecli` is a built-in tool. If it's unavailable or not exist, please instruct the user to open the `OfficeCLI` tool in the chat window.\nThe tool allows you to call `officecli` directly without having to install or locate the executable.\nFor any of the commands in the following instructions, do not use any other tools; you MUST use the exact tool and pass the `commandLine` parameter to execute them.\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 <cmd> --help` ≡ `officecli help <cmd>` — 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`/`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`/`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/O 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`/`query`/`view`/`dump`) always see your latest edits, so you never need to save mid-workflow. Run `save` (keeps the resident) or `close` (flush + release) only **before a non-officecli program reads the file** — python-docx/openpyxl, Word, a renderer, delivery/upload. (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 / --type slide --prop title=\"Q4 Report\" --prop background=1A1A2E\nofficecli add slides.pptx '/slide[1]' --type shape --prop text=\"Revenue grew 25%\" --prop x=2cm --prop y=5cm --prop font=Arial --prop size=24 --prop color=FFFFFF\n```\n\n**Word:**\n```bash\nofficecli create report.docx\nofficecli add report.docx /body --type paragraph --prop text=\"Executive Summary\" --prop style=Heading1\nofficecli add report.docx /body --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 /Sheet1/A1 --prop value=\"Name\" --prop bold=true\nofficecli set data.xlsx /Sheet1/A2 --prop value=\"Alice\"\n```\n\n---\n\n## L1: Create, Read & Inspect\n\n```bash\nofficecli create <file>               # Create blank .docx/.xlsx/.pptx (type from extension)\nofficecli view <file> <mode>          # outline | stats | issues | text | annotated | html\nofficecli get <file> <path> --depth N # Get a node and its children [--json]\nofficecli query <file> <selector>     # CSS-like query\nofficecli validate <file>             # 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/content/structure 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` / `svg` / `pdf` / `forms` | PNG via headless browser / SVG (pptx slide) / PDF via exporter plugin / form-fields JSON via format-handler plugin | `-o`, `--screenshot-width/-height`, pptx `--grid N` |\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 '/body/p[3]' --depth 2 --json\nofficecli get slides.pptx '/slide[1]' --depth 1 # list all shapes on slide 1\nofficecli get data.xlsx '/Sheet1/B2' --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/delete, stable IDs do not.\n\n```\n/slide[1]/shape[@id=550950021]              # PPT shape\n/slide[1]/table[@id=1388430425]/tr[1]/tc[2] # PPT table\n/body/p[@paraId=1A2B3C4D]                   # Word paragraph\n/comments/comment[@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/tc, row) fall back to positional indices.\n\n### query\n\nCSS-like selectors: `[attr=value]`, `[attr!=value]`, `[attr~=text]`, `[attr>=value]`, `[attr<=value]`, `:contains(\"text\")`, `:empty`, `:has(formula)`, `:no-alt`. Boolean `and`/`or` supported across `query`/`set`/`remove`: `cell[value>5000 or value<100]`, `cell[(type=Number or type=Date) and value>0]`. Excel row-by-column-name: `Sheet1!row[Salary>5000]`. `set` accepts selectors and Excel-native paths (parity with `get`/`query`). Bare unscoped selectors rejected on `set`/`remove`.\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 / shift-click / box-drag to select shapes; the CLI can read the current browser selection and act on it.\n\n```bash\nofficecli watch <file> [--port N] # Start preview server (default port 26315)\nofficecli unwatch <file>          # Stop\nofficecli goto <file> <path>      # Scroll watching browser(s) to element (docx: p / table / tr / tc)\n```\n\nOpen the printed `http://localhost:N` URL. Click to select; shift/cmd/ctrl+click to multi-select; drag from empty space to box-select. PPT/Word use blue outline; Excel uses native-style green selection (double-click cell to edit inline; drag a chart to reposition).\n\n### `get <file> selected` — read what the user clicked\n\n```bash\nofficecli get <file> 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/pictures/tables/charts/connectors/groups; `.docx` top-level paragraphs and tables. Inherited layout/master decorations and Word nested elements (table cells, run-level) are not addressable. **`.xlsx` does not emit `data-path`** — `mark`/`selection` on xlsx always resolve `stale=true` (v2 candidate).\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 <file> <path> [--prop find=... color=... note=... tofix=... regex=true] [--json]\nofficecli unmark <file> [--path <p> | --all] [--json]\nofficecli get-marks <file> [--json]\n```\n\nProps: `find` (literal or regex when `regex=true`; raw form `find='r\"[abc]\"'`), `color` (hex / `rgb(...)` / 22 named whitelist), `note`, `tofix` (drives apply pipeline). **Path** must be `data-path` format from watch HTML — see subskills for full pipeline.\n\n---\n\n## L2: DOM Operations\n\n### set — modify properties\n\n```bash\nofficecli set <file> <path> --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/without `#`), 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.<attr>` forms accepted on shape/run/paragraph/table/row/cell/section/styles, e.g. `--prop font.color=red --prop font.bold=true --prop font.size=14pt`. Run `officecli help <fmt> <element>` for the full list.\n\n### find — format or replace matched text\n\nUse top-level `--find` / `--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 '/body/p[1]' --find weather --prop bold=true --prop color=red\n\n# Regex matching (regex= still a prop flag)\nofficecli set doc.docx '/body/p[1]' --find '\\d+%' --prop regex=true --prop color=red\n\n# Replace text (use `/` for whole-document scope)\nofficecli set doc.docx / --find draft --replace final\n\n# docx: tracked Find&Replace\nofficecli set doc.docx / --find draft --replace final --prop revision.author=Alice\n\n# PPT — same syntax, different paths\nofficecli set slides.pptx / --find draft --replace final\n```\n\n**Path controls search scope:** `/` = whole document, `/body/p[1]` or `/slide[N]/shape[M]` = specific element, `/header[1]` / `/footer[1]` = headers/footers.\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 <file> <parent> --type <type> [--prop ...]\nofficecli add <file> <parent> --type <type> --after <path> [--prop ...]  # insert after anchor\nofficecli add <file> <parent> --type <type> --before <path> [--prop ...] # insert before anchor\nofficecli add <file> <parent> --type <type> --index N [--prop ...]       # 0-based position (legacy)\nofficecli add <file> <parent> --from <path>                              # 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/ea/cs, direction=rtl, underline.color, highlight=COLOR (Add/Set/Get/HTML preview), effective.X+effective.X.src; arrow alias for rightArrow; slideMaster/slideLayout typed add/set/remove), picture (SVG, brightness/contrast/glow/shadow, rotation, link, tooltip), chart (direction=rtl, pieOfPie, barOfPie, axisLine/gridline per-attr setters, animation+chartBuild=byCategory|bySeries, line dropLines/hiLowLines/upDownBars, anchor=x,y,w,h shorthand), table (cell direction=rtl, fill/background, built-in PowerPoint style catalogue, /col[C] get + swap/copyFrom, row/col Move/CopyFrom), row (tr), connector (from/to accept full-path `@name=`/`@id=` forms — bare `@name=Foo` is rejected, must be `/slide[N]/shape[@name=Foo]` — startshape/endshape SetByPath; edge-to-edge anchoring by default, fromSide/toSide to force an edge, fromIdx/toIdx for raw cxn index), group (link, tooltip, deep walk by get/query/add/remove, ungroup=true dissolves back to slide-absolute), align/distribute (targets= accepts shape[@id=N] paths, not just positional), video/audio (loop, autoStart alias), equation, notes (direction=rtl, lang), comment (legacy + modern p188 threaded round-trip), animation (15 emphasis + 16 exit presets, multi-effect chains, motion-path presets, repeat/restart/autoReverse, chart animations), transition (12 p15 presets + morph/p14), paragraph (para), run, zoom, ole (preview=, full dump round-trip via add-part+raw-set), placeholder (phType=...), model3d (rotation=ax,ay,az; full dump round-trip), smartart (dump round-trip via add-part), diagram (add-only mermaid → native shapes or rendered image, `--type diagram`/`flowchart`). |\n| **docx** | paragraph (direction/font.latin/ea/cs, bold.cs/italic.cs/size.cs, lang.latin/ea/cs, wordWrap, framePr.\\*, tabs shorthand), run (lang slots, direction, underline.color, position half-pts, **revision.type=ins\\|del\\|format\\|moveFrom\\|moveTo + revision.action=accept\\|reject** with .author/.date — bare `@author=`/`@type=` selector on `set /revision[...]` for filtered accept/reject, but `query 'revision[...]'` needs the dotted `revision.author=`/`revision.type=` form; move+revision is run-level paths only, not paragraph-level; **range=START:END** on a paragraph/shape 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/nowrap on cell (both add+set), **virtual column ops**: add/remove/move/copyfrom on /body/tbl[N]/col), row (tr), cell (td), image, header/footer (direction), section (pageNumFmt full enum, direction=rtl, rtlGutter, pgBorders=box), bookmark, comment, footnote, endnote, formfield, sdt, chart, equation, field (28 types), hyperlink, style (direction, indents, pbdr, lineSpacing on Add/Set), toc, watermark, break, ole, **num/abstractNum/lvl**, **tab**, **textbox/shape** (add-mostly — Get returns raw XML preview only, no structured readback; Set is limited to width/height/geometry/fill/line.\\*; position is `anchor.x`/`anchor.y` not bare x/y; **textbox-only** `textDirection`/rotation/gradient/shadow — 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`/`flowchart`, no x/y at add-time — reposition via `set /body/group[N]`). docDefaults.rtl, autoHyphenation, `get /` exposes locale + /comments /footnotes /endnotes. `create --minimal` for raw OOXML scaffolding. |\n| **xlsx** | sheet (visible/hidden/veryHidden, print margins, printTitleRows/Cols, rightToLeft sheetView, cascade-aware rename), row (c{N}= cell-content shorthand; add accepts --from /Sheet/col[L]; formula-ref rewrite on insert), col (formula-ref rewrite, named-range follow on move), cell (type=richtext+runs, merge=range/sweep, direction=rtl, phonetic; **--shift left\\|up on remove, shift=right\\|down on add** — Excel UI dialog parity; formula auto-detect; OFFSET/INDIRECT in calc), chart (per-axis RTL/title, anchor=x,y,w,h, pareto), image (SVG), comment (direction=rtl), table (listobject), namedrange (definedname, volatile, `[@name=X]`; formula-body inlined at parse), pivottable (cache CoW + cross-pivot sharing, labelFilter=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/colorscale/iconset/formulacf/cellIs/topN/aboveAverage), ole, csv. Query supports `merge`/`mergedrange`. Workbook: password. Shape selector enumerates leaves inside grpSp. |\n\n### Pivot tables (xlsx)\n\n```bash\nofficecli add data.xlsx /Sheet1 --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/outline/tabular), `repeatLabels`, `blankRows`, `aggregate`, `showDataAs` (percent_of_total/row/col, running_total), `grandTotals`, `subtotals`, `sort`. Aggregators: sum, count, average, max, min, product, stdDev, stdDevp, var, varp, countNums. Date columns auto-group. Run `officecli help xlsx pivottable` for full schema.\n\n### Document-level properties (all formats)\n\n```bash\nofficecli set doc.docx / --prop docDefaults.font=Arial --prop docDefaults.fontSize=11pt\nofficecli set doc.docx / --prop protection=forms --prop evenAndOddHeaders=true\nofficecli set data.xlsx / --prop calc.mode=manual --prop calc.refMode=r1c1\nofficecli set slides.pptx / --prop defaultFont=Arial --prop show.loop=true --prop print.what=handouts\n```\n\nRun `officecli help <format> /` 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 /Sheet1 --prop sort=\"C desc\" --prop sortHeader=true\nofficecli set data.xlsx '/Sheet1/A1: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` / `--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 '/body/p[1]' --type run --after find:weather --prop text=\" (sunny)\"\n\n# Word: block table after matched text (auto-splits paragraph)\nofficecli add doc.docx '/body/p[1]' --type table --after \"find:First sentence.\" --prop rows=2 --prop cols=2\n```\n\n### Clone\n\n`officecli add <file> / --from '/slide[1]'` — copies with all cross-part relationships.\n\n### move, swap, remove\n\n```bash\nofficecli move <file> <path> [--to <parent>] [--index N] [--after <path>] [--before <path>]\nofficecli swap <file> <path1> <path2>\nofficecli remove <file> '/body/p[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 <file> [<path>]` emits a replayable batch JSON for round-trip — `.docx` (full coverage), `.pptx` (text/tables/pictures/charts/notes/theme + OLE/3D/video/audio/SmartArt/morph/p15 transitions via raw-set passthrough), and `.xlsx` (cells/formulas/styles + tables, conditional formatting, validations, comments, charts, sparklines, pictures, shapes, pivot tables; slicers/chartEx/OLE via verbatim carrier). Path defaults to `/` (whole document); pass a subtree path (docx: `/body`, `/body/p[N]`, `/body/tbl[N]`, `/theme`, `/settings`, `/numbering`, `/styles`; xlsx: `/SheetName`, `/sheet[N]`) to scope the dump. `officecli refresh <file.docx>` recalculates TOC page numbers / PAGE / cross-references after replay (Word backend on Windows; headless-HTML fallback elsewhere). `officecli plugins list` extends support to `.doc`, `.hwpx`, `.pdf` export.\n\n```bash\necho '[\n  {\"command\":\"set\",\"path\":\"/Sheet1/A1\",\"props\":{\"value\":\"Name\",\"bold\":\"true\"}},\n  {\"command\":\"set\",\"path\":\"/Sheet1/B1\",\"props\":{\"value\":\"Score\",\"bold\":\"true\"}}\n]' | officecli batch data.xlsx --json\n\nofficecli batch data.xlsx --commands '[{\"op\":\"set\",\"path\":\"/Sheet1/A1\",\"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 <file> <part>                          # view raw XML\nofficecli raw-set <file> <part> --xpath \"...\" --action replace --xml '<w:p>...</w:p>'\nofficecli add-part <file> <parent>                   # create new document part (returns rId)\n```\n\n`raw-set` actions: `append`, `prepend`, `insertbefore`, `insertafter`, `replace`, `remove`, `setattr`. Run `officecli help <format> 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/bash | Always quote: `'/slide[1]'` or `\"/slide[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| `/shape[myname]` | Name indexing not supported. Use numeric index or `@name=` (PPT only) |\n| Guessing property names | Run `officecli help <format> <element>` to see exact names |\n| Modifying an open file | Close the file in PowerPoint/WPS 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 <name>` — 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` / `pptx` / `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 / conference / thesis: APA / Chicago / IEEE / MLA citations, equations, SEQ + PAGEREF cross-refs, multi-column journal layout, bibliography. NOT for business reports or letters (route those to `word`) |\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 / Series A-C / SAFE / convertible / strategic raise. NOT for sales / product / 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/tabular data → KPI / analytics / 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): `'/body/p[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 / column letter index). `--index 5` inserts at row 5 / column 5.\n- After modifications, verify with `validate` and/or `view issues`\n- **When unsure**, run `officecli help <format> <element>` instead of guessing\n</yakaai_skills>"}