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.
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) — When you are the Orchestrator (you have create_subagent and dispatch task) and your sub-agents have returned .md files. Convert their output to a formatted Word document using the md2docx pipeline.
If you do NOT have create_subagent / task tools, you are not an Orchestrator and md2docx does not apply. Do not write markdown yourself and convert with pandoc — the result is mediocre. Use Create (C#) for high-quality output.
3. Create (references/openxml-sdk-reference.md) — Neither of the above.