--- name: docx-automation description: | Generate DOCX documents from pipeline results or structured data. Uses python-docx library for Word document generation. Independent utility skill (can be called standalone or post-pipeline). user-invocable: true context: fork model: opus version: "3.1.0" argument-hint: "generate | from-json | report | --workload " allowed-tools: - Read - Bash - Write - Task - mcp__sequential-thinking__sequentialthinking hooks: Setup: - type: command command: "source /home/palantir/.claude/skills/shared/workload-files.sh" timeout: 5000 # EFL Pattern Configuration (Utility Skill - Minimal) agent_delegation: enabled: false reason: "Utility skill - direct execution for document generation" parallel_agent_config: enabled: false reason: "Sequential document generation preferred for consistency" internal_validation: enabled: true checks: - "Source data is readable and valid" - "python-docx library is installed" - "Output directory is writable" max_retries: 2 output_paths: l1: ".agent/prompts/{slug}/docx-automation/l1_summary.yaml" l2: ".agent/prompts/{slug}/docx-automation/l2_index.md" --- # /docx-automation - DOCX Document Generation > **Version:** 3.1.0 | **Type:** Independent Utility Skill > **Role:** Generate Word documents from pipeline results or data > **Pipeline:** Standalone or post-pipeline utility ## 1. Purpose Generate Microsoft Word documents from: - Pipeline export results (mathpix_pipeline) - Structured data (JSON/YAML/Dict) - Template-based reports ## 2. Prerequisites ```bash pip install python-docx>=0.8.11 ``` ## 3. Invocation ```bash # Generate from pipeline results /docx-automation generate [--output ] # Convert JSON to DOCX /docx-automation from-json --output report.docx # Generate report from pipeline data /docx-automation report --format detailed # With workload context /docx-automation generate synthesis-report --workload ``` ## 4. L1/L2/L3 Output Format ### L1 Summary (returned to main context) ```yaml taskId: docx-{timestamp} agentType: docx-automation status: success summary: "Generated report.docx (125KB)" filePath: ".agent/prompts/{slug}/docx/report.docx" fileSize: 128000 pageCount: 5 l2Path: .agent/prompts/{slug}/docx-automation/l2_index.md requiresL2Read: false nextActionHint: "Document at {filePath}" ``` ### L2 Report Structure ```markdown # DOCX Generation Summary ## Document Info - **Output:** report.docx - **Size:** 125 KB - **Pages:** 5 ## Content Structure 1. Title Section 2. Content (equations, graphs) 3. Metadata 4. Provenance ## Generation Details - Font: Times New Roman, 11pt - Margins: 1 inch - Header/Footer: Enabled ``` ## 5. Actions ### generate Generate DOCX from pipeline results. ```bash /docx-automation generate [--output ] [--config ] ``` ### from-json Convert structured JSON to formatted DOCX. ```bash /docx-automation from-json --output [--template