When to Use
User needs Microsoft Word controlled as a live application, not treated as a .docx file format.
Agent handles app attach, active document state, selection-aware edits, comments, track changes, export, and clean shutdown through the official osascript CLI.
If the main artifact is offline DOCX creation or structural file editing, use word-docx instead.
Architecture
Memory lives in ~/word/. If ~/word/ does not exist, run setup.md. See memory-template.md for structure.
~/word/
├── memory.md # Environment facts, safe defaults, and last working control path
├── incidents.md # Reusable failures and proven recovery steps
└── document-notes.md # Non-sensitive notes about trusted documents, views, and export targets
Quick Reference
Load only the smallest file that matches the current Word task and risk level.
| Topic |
File |
| Setup guide |
setup.md |
| Memory template |
memory-template.md |
| Interface selection |
execution-matrix.md |
| Live control patterns |
live-control-patterns.md |
| Destructive action guardrails |
safety-checklist.md |
| Debug and recovery |
troubleshooting.md |
Requirements
- Microsoft Word installed locally.
- macOS with
osascript available.
- Explicit confirmation before destructive document actions.
Core Rules
1. Choose the app-control path by document state
- Use
osascript for live Word document control through the app's scripting dictionary.
- Keep automation inside the live Word session instead of falling back to file-only DOCX tooling.
- Do not switch to offline document libraries when the requested job depends on the current live Word app state.
2. Identify the exact document and view before acting
- Confirm whether the target is the active document, a named open document, or a path to open now.
- Read the current view, selection, and review mode before making edits tied to cursor position or markup state.
- Never assume the frontmost Word window is the intended document.
3. Read before write, then verify the final state
- Pre-read document name, current selection, target paragraph, comment count, or export target before mutation.
- After edits, comments, accept/reject actions, or exports, re-read the affected state and report what changed.
- If Word does not reach the requested state, stop and diagnose instead of layering more edits.
4. Treat selection-driven actions as high-risk
- Selection-based commands can land in the wrong paragraph, story range, header, or comment balloon.
- When possible, anchor the action to a specific document object instead of only the current insertion point.
- If the selection context is ambiguous, clarify first.
5. Separate reversible review actions from destructive cleanup
- Adding comments, changing view, and exporting are usually reversible.
- Accept all changes, reject all changes, remove comments, close without save, and overwrite exports require explicit confirmation.
- If review state matters, preserve track changes and display settings unless the user explicitly asks to change them.
6. Keep provenance explicit
- State whether the target was already open or opened just for this task.
- Report what document was changed, which review mode was active, and where exports were written.
- Preserve user-owned open documents that were outside the task scope.
7. Recover cleanly and avoid orphaned app sessions
- If you opened Word just for this task, keep ownership clear and close only what you created.
- If you attached to an existing session, do not close unrelated documents or quit Word without explicit approval.
- On failure, record the exact blocker: protected document, modal dialog, compatibility mode, track changes mismatch, or missing permissions.
Word Traps
- Treating a live document like a static
.docx file -> review state, comments, fields, and view context drift apart.
- Writing relative to the current cursor without verifying selection -> text lands in the wrong story range.
- Accepting or rejecting changes globally when only one section was intended -> irreversible editorial loss.
- Exporting before fields, references, or TOC are updated -> stale output delivered as final.
- Closing an attached user session after automation -> unrelated writing work is interrupted.
- Ignoring protected view or tracked-change mode -> edits silently fail or create the wrong markup history.
Security & Privacy
Data that stays local:
- Document paths, environment notes, and reusable fixes in
~/word/.
- Document contents accessed through local Word automation.
Data that may leave your machine:
- Nothing by default from this skill itself.
- A document's own links, add-ins, macros, or cloud-backed autosave behavior may contact external systems.
This skill does NOT:
- Use Microsoft Graph, cloud document APIs, or OAuth flows.
- Disable review warnings silently.
- Accept destructive document-wide changes without explicit confirmation.
- Bypass Word protection prompts.
Related Skills
Install with clawhub install <slug> if user confirms:
word-docx — Offline DOCX generation and editing when Word does not need to stay open.
office — Broader Office task routing across documents, spreadsheets, and presentations.
applescript — macOS app automation patterns when Word dictionary work needs deeper script design.
Feedback
- If useful:
clawhub star word
- Stay updated:
clawhub sync
1---2name: word3slug: word4version: 1.0.05homepage: https://clawic.com/skills/word6description: Control Word app sessions, documents, selections, comments, export, and review state with osascript workflows.7changelog: Initial release with live Word automation patterns for sessions, selections, review actions, export, and recovery.8metadata:9 source: https://skillmd.com/skills/jinhong270/word10 clawdbot:11 emoji: 📝12 requires:13 bins:14 - osascript15 os:16 - darwin17 configPaths:18 - ~/word/19---2021## When to Use2223User needs Microsoft Word controlled as a live application, not treated as a `.docx` file format.24Agent handles app attach, active document state, selection-aware edits, comments, track changes, export, and clean shutdown through the official `osascript` CLI.25If the main artifact is offline DOCX creation or structural file editing, use `word-docx` instead.2627## Architecture2829Memory lives in `~/word/`. If `~/word/` does not exist, run `setup.md`. See `memory-template.md` for structure.3031```text32~/word/33├── memory.md # Environment facts, safe defaults, and last working control path34├── incidents.md # Reusable failures and proven recovery steps35└── document-notes.md # Non-sensitive notes about trusted documents, views, and export targets36```3738## Quick Reference3940Load only the smallest file that matches the current Word task and risk level.4142| Topic | File |43|-------|------|44| Setup guide | `setup.md` |45| Memory template | `memory-template.md` |46| Interface selection | `execution-matrix.md` |47| Live control patterns | `live-control-patterns.md` |48| Destructive action guardrails | `safety-checklist.md` |49| Debug and recovery | `troubleshooting.md` |5051## Requirements5253- Microsoft Word installed locally.54- macOS with `osascript` available.55- Explicit confirmation before destructive document actions.5657## Core Rules5859### 1. Choose the app-control path by document state60- Use `osascript` for live Word document control through the app's scripting dictionary.61- Keep automation inside the live Word session instead of falling back to file-only DOCX tooling.62- Do not switch to offline document libraries when the requested job depends on the current live Word app state.6364### 2. Identify the exact document and view before acting65- Confirm whether the target is the active document, a named open document, or a path to open now.66- Read the current view, selection, and review mode before making edits tied to cursor position or markup state.67- Never assume the frontmost Word window is the intended document.6869### 3. Read before write, then verify the final state70- Pre-read document name, current selection, target paragraph, comment count, or export target before mutation.71- After edits, comments, accept/reject actions, or exports, re-read the affected state and report what changed.72- If Word does not reach the requested state, stop and diagnose instead of layering more edits.7374### 4. Treat selection-driven actions as high-risk75- Selection-based commands can land in the wrong paragraph, story range, header, or comment balloon.76- When possible, anchor the action to a specific document object instead of only the current insertion point.77- If the selection context is ambiguous, clarify first.7879### 5. Separate reversible review actions from destructive cleanup80- Adding comments, changing view, and exporting are usually reversible.81- Accept all changes, reject all changes, remove comments, close without save, and overwrite exports require explicit confirmation.82- If review state matters, preserve track changes and display settings unless the user explicitly asks to change them.8384### 6. Keep provenance explicit85- State whether the target was already open or opened just for this task.86- Report what document was changed, which review mode was active, and where exports were written.87- Preserve user-owned open documents that were outside the task scope.8889### 7. Recover cleanly and avoid orphaned app sessions90- If you opened Word just for this task, keep ownership clear and close only what you created.91- If you attached to an existing session, do not close unrelated documents or quit Word without explicit approval.92- On failure, record the exact blocker: protected document, modal dialog, compatibility mode, track changes mismatch, or missing permissions.9394## Word Traps9596- Treating a live document like a static `.docx` file -> review state, comments, fields, and view context drift apart.97- Writing relative to the current cursor without verifying selection -> text lands in the wrong story range.98- Accepting or rejecting changes globally when only one section was intended -> irreversible editorial loss.99- Exporting before fields, references, or TOC are updated -> stale output delivered as final.100- Closing an attached user session after automation -> unrelated writing work is interrupted.101- Ignoring protected view or tracked-change mode -> edits silently fail or create the wrong markup history.102103## Security & Privacy104105**Data that stays local:**106- Document paths, environment notes, and reusable fixes in `~/word/`.107- Document contents accessed through local Word automation.108109**Data that may leave your machine:**110- Nothing by default from this skill itself.111- A document's own links, add-ins, macros, or cloud-backed autosave behavior may contact external systems.112113**This skill does NOT:**114- Use Microsoft Graph, cloud document APIs, or OAuth flows.115- Disable review warnings silently.116- Accept destructive document-wide changes without explicit confirmation.117- Bypass Word protection prompts.118119## Related Skills120Install with `clawhub install <slug>` if user confirms:121- `word-docx` — Offline DOCX generation and editing when Word does not need to stay open.122- `office` — Broader Office task routing across documents, spreadsheets, and presentations.123- `applescript` — macOS app automation patterns when Word dictionary work needs deeper script design.124125## Feedback126127- If useful: `clawhub star word`128- Stay updated: `clawhub sync`