{"skill":{"slug":"word","displayName":"Word","summary":"Control Word app sessions, documents, selections, comments, export, and review state with osascript workflows.","description":"---\nname: Word\nslug: word\nversion: 1.0.0\nhomepage: https://clawic.com/skills/word\ndescription: Control Word app sessions, documents, selections, comments, export, and review state with osascript workflows.\nchangelog: Initial release with live Word automation patterns for sessions, selections, review actions, export, and recovery.\nmetadata: {\"clawdbot\":{\"emoji\":\"📝\",\"requires\":{\"bins\":[\"osascript\"]},\"os\":[\"darwin\"],\"configPaths\":[\"~/word/\"]}}\n---\n\n## When to Use\n\nUser needs Microsoft Word controlled as a live application, not treated as a `.docx` file format.\nAgent handles app attach, active document state, selection-aware edits, comments, track changes, export, and clean shutdown through the official `osascript` CLI.\nIf the main artifact is offline DOCX creation or structural file editing, use `word-docx` instead.\n\n## Architecture\n\nMemory lives in `~/word/`. If `~/word/` does not exist, run `setup.md`. See `memory-template.md` for structure.\n\n```text\n~/word/\n├── memory.md             # Environment facts, safe defaults, and last working control path\n├── incidents.md          # Reusable failures and proven recovery steps\n└── document-notes.md     # Non-sensitive notes about trusted documents, views, and export targets\n```\n\n## Quick Reference\n\nLoad only the smallest file that matches the current Word task and risk level.\n\n| Topic | File |\n|-------|------|\n| Setup guide | `setup.md` |\n| Memory template | `memory-template.md` |\n| Interface selection | `execution-matrix.md` |\n| Live control patterns | `live-control-patterns.md` |\n| Destructive action guardrails | `safety-checklist.md` |\n| Debug and recovery | `troubleshooting.md` |\n\n## Requirements\n\n- Microsoft Word installed locally.\n- macOS with `osascript` available.\n- Explicit confirmation before destructive document actions.\n\n## Core Rules\n\n### 1. Choose the app-control path by document state\n- Use `osascript` for live Word document control through the app's scripting dictionary.\n- Keep automation inside the live Word session instead of falling back to file-only DOCX tooling.\n- Do not switch to offline document libraries when the requested job depends on the current live Word app state.\n\n### 2. Identify the exact document and view before acting\n- Confirm whether the target is the active document, a named open document, or a path to open now.\n- Read the current view, selection, and review mode before making edits tied to cursor position or markup state.\n- Never assume the frontmost Word window is the intended document.\n\n### 3. Read before write, then verify the final state\n- Pre-read document name, current selection, target paragraph, comment count, or export target before mutation.\n- After edits, comments, accept/reject actions, or exports, re-read the affected state and report what changed.\n- If Word does not reach the requested state, stop and diagnose instead of layering more edits.\n\n### 4. Treat selection-driven actions as high-risk\n- Selection-based commands can land in the wrong paragraph, story range, header, or comment balloon.\n- When possible, anchor the action to a specific document object instead of only the current insertion point.\n- If the selection context is ambiguous, clarify first.\n\n### 5. Separate reversible review actions from destructive cleanup\n- Adding comments, changing view, and exporting are usually reversible.\n- Accept all changes, reject all changes, remove comments, close without save, and overwrite exports require explicit confirmation.\n- If review state matters, preserve track changes and display settings unless the user explicitly asks to change them.\n\n### 6. Keep provenance explicit\n- State whether the target was already open or opened just for this task.\n- Report what document was changed, which review mode was active, and where exports were written.\n- Preserve user-owned open documents that were outside the task scope.\n\n### 7. Recover cleanly and avoid orphaned app sessions\n- If you opened Word just for this task, keep ownership clear and close only what you created.\n- If you attached to an existing session, do not close unrelated documents or quit Word without explicit approval.\n- On failure, record the exact blocker: protected document, modal dialog, compatibility mode, track changes mismatch, or missing permissions.\n\n## Word Traps\n\n- Treating a live document like a static `.docx` file -> review state, comments, fields, and view context drift apart.\n- Writing relative to the current cursor without verifying selection -> text lands in the wrong story range.\n- Accepting or rejecting changes globally when only one section was intended -> irreversible editorial loss.\n- Exporting before fields, references, or TOC are updated -> stale output delivered as final.\n- Closing an attached user session after automation -> unrelated writing work is interrupted.\n- Ignoring protected view or tracked-change mode -> edits silently fail or create the wrong markup history.\n\n## Security & Privacy\n\n**Data that stays local:**\n- Document paths, environment notes, and reusable fixes in `~/word/`.\n- Document contents accessed through local Word automation.\n\n**Data that may leave your machine:**\n- Nothing by default from this skill itself.\n- A document's own links, add-ins, macros, or cloud-backed autosave behavior may contact external systems.\n\n**This skill does NOT:**\n- Use Microsoft Graph, cloud document APIs, or OAuth flows.\n- Disable review warnings silently.\n- Accept destructive document-wide changes without explicit confirmation.\n- Bypass Word protection prompts.\n\n## Related Skills\nInstall with `clawhub install <slug>` if user confirms:\n- `word-docx` — Offline DOCX generation and editing when Word does not need to stay open.\n- `office` — Broader Office task routing across documents, spreadsheets, and presentations.\n- `applescript` — macOS app automation patterns when Word dictionary work needs deeper script design.\n\n## Feedback\n\n- If useful: `clawhub star word`\n- Stay updated: `clawhub sync`\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":2752,"installsAllTime":94,"installsCurrent":27,"stars":1,"versions":1},"createdAt":1773403317663,"updatedAt":1778491885889},"latestVersion":{"version":"1.0.0","createdAt":1773403317663,"changelog":"Initial release with live Word automation patterns for sessions, selections, review actions, export, and recovery.","license":"MIT-0"},"metadata":{"setup":[],"os":["darwin"],"systems":null},"owner":{"handle":"ivangdavila","userId":"s178jdk12x4qj3gs2se3etxf3h83h7ft","displayName":"Iván","image":"https://avatars.githubusercontent.com/u/81719670?v=4"},"moderation":null}