docx
Part 1: Routing
read file / cat only extracts plain text from .docx — all formatting is lost. If the task involves appearance or structure, use WIR engine's session.read() instead.
Route = What You Have
1. WIR (references/wir-reference.md) — A .docx exists whose format/style matters to the output.
The user provides a template, a document to edit/modify/review/annotate, or any file whose formatting should be preserved or referenced. This file is your output foundation — read it, modify it, fill it.
For existing .docx edits or redesigns, WIR is the required first path; use Create only when the file is merely a data source or after a named WIR failure.
If the .docx is merely a content/data source (e.g., reference papers, raw data exports) and its formatting is irrelevant, just read file to extract text — that is NOT a WIR case.
.doc format → convert first: libreoffice --headless --convert-to docx
2. md2docx (references/md2docx-reference.md) — A Markdown file is the intended content source for a new Word document.
Use md2docx when ANY of these conditions applies: