$npx -y skills add iOfficeAI/OfficeCLI --skill officecli-word-formUse this skill to create fillable Word forms (.docx) with real Content Controls (SDT) + legacy FormField checkboxes + MERGEFIELD mail-merge placeholders + document protection. Trigger on: 'fillable form', 'form fields', 'content controls', 'SDT', 'word form', 'fill in', 'only edi
| 1 | # OfficeCLI Word-Form Skill |
| 2 | |
| 3 | **This skill is INDEPENDENT, not a scene layer on docx.** A form's payload — `<w:sdt>` controls, `<w:ffData>` legacy fields, `<w:fldChar>` mail-merge, `documentProtection` — is a distinct element class from docx's paragraph/heading/style primitives. Its QA is different too: docx's Delivery Gate cares about visual layout and live PAGE fields, this skill's cares about data plumbing (protection enforced / alias+tag / items injected / name ≤ 20 / no underscore anti-pattern). **Reverse handoff:** if the user's document has no fillable fields (report, letter, memo, thesis, proposal), route to `officecli-docx` or a docx scene skill — don't use this one. |
| 4 | |
| 5 | ## BEFORE YOU START (CRITICAL) |
| 6 | |
| 7 | **If `officecli` is not installed:** |
| 8 | |
| 9 | `macOS / Linux` |
| 10 | |
| 11 | ```bash |
| 12 | if ! command -v officecli >/dev/null 2>&1; then |
| 13 | curl -fsSL https://d.officecli.ai/install.sh | bash |
| 14 | fi |
| 15 | ``` |
| 16 | |
| 17 | `Windows (PowerShell)` |
| 18 | |
| 19 | ```powershell |
| 20 | if (-not (Get-Command officecli -ErrorAction SilentlyContinue)) { |
| 21 | irm https://d.officecli.ai/install.ps1 | iex |
| 22 | } |
| 23 | ``` |
| 24 | |
| 25 | Verify: `officecli --version` |
| 26 | |
| 27 | If `officecli` is still not found after first install, open a new terminal and run the verify command again. |
| 28 | |
| 29 | If the install command above fails (e.g. blocked by security policy, no network access, or insufficient permissions), install manually — download the binary for your platform from https://github.com/iOfficeAI/OfficeCLI/releases — then re-run the verify command. |
| 30 | |
| 31 | ## Help-First Rule |
| 32 | |
| 33 | This skill teaches what a real form needs, not every CLI flag. When a prop / alias / enum is uncertain, consult help BEFORE guessing: `officecli help docx [element] [--json]` (e.g. `sdt`, `formfield`, `field`). Help is pinned to the installed CLI version and is authoritative — when this skill and help disagree, **help wins** (the prop set on `sdt` in particular has grown over time; trust `help docx sdt`, not a hardcoded list). |
| 34 | |
| 35 | ## Mental Model & Inheritance |
| 36 | |
| 37 | A Word form is a `.docx` plus four OpenXML payload layers plain-docx skills do not touch: **`<w:sdt>`** content controls (types: text / richtext / dropdown / combobox / date / picture / group), **`<w:ffData>`** legacy FormField (still the only way to get a real checkbox — SDT `type=checkbox` is not implemented), **`<w:fldChar>`** complex fields (MERGEFIELD, REF, PAGEREF, SEQ, IF — template-time, not user-fill), and **`documentProtection`** (the lock that makes non-field text read-only in Word — and, on the CLI, `protection=forms` locks non-field content edits (those need `--force` or `raw-set`) but still allows form-field (SDT) edits, which is the point of forms protection). |
| 38 | |
| 39 | **No inheritance from docx v2.** docx's Delivery Gate (cover-fill %, live-PAGE check) does NOT apply — form QA is `view forms` + `query sdt alias+tag` + `protectionEnforced`. |
| 40 | |
| 41 | **Reverse handoff to docx.** Route back to `officecli-docx` for reports / letters / memos / thesis / pitch decks / any document with no editable fields. Use **this** skill when the document's purpose is data capture or template merge. |
| 42 | |
| 43 | ## Shell & Execution Discipline |
| 44 | |
| 45 | **One command at a time. Read output before the next.** OfficeCLI is incremental — every `add` / `set` / `remove` immediately mutates the file. All recipes below use `FILE=form.docx` as a shell variable. |
| 46 | |
| 47 | **Three shell-escape layers:** |
| 48 | |
| 49 | 1. **Quote every path with `[N]`** — zsh/bash glob-expand brackets. `officecli get "$FILE" /body/sdt[1]` fails with `no matches found`. Correct: `officecli get "$FILE" '/body/sdt[1]'`. |
| 50 | 2. **Single-quote any prop containing `$`** — `"Total: $50,000"` becomes `"Total: ,000"` after `$50` variable expansion. Correct: `'Total: $50,000'`. |
| 51 | 3. **`--after find:<text>` uses outer single quotes, never inner double quotes** — `--after find:"Client Signature:"` makes the quotes part of the search string; match fails. Correct: `--after 'find:Client Signature:'`. |
| 52 | |
| 53 | **`WARNING: UNSUPPORTED` (exit 2) is a silently-wrong element.** The CLI created the element *without* the rejected prop. Any UNSUPPORTED in your build log means a prop name the curre |