Export editorial content to branded Word document (.docx) using python-docx. Generates texto alumno and guia docente as separate files ready for layout team. Trigger on: exportar docx, export word, generar word, documento word, maquetacion, docx, enviar a diagramacion.
The Word document bridges AI-generated content with human layout workflows. It must be clean, well-structured, and immediately usable by diagramadores.
Generate branded Word documents from editorial content using python-docx, producing separate files for texto alumno and guia docente.
Read brand-config.json for color tokens and typography settings. Fallback: JM Labs defaults (#6366F1 primary, #22D3EE accent, #EFEAE4 background, Inter font).
Collect all generated units (read from units/ directory or session state).
Generate texto alumno DOCX:
Generate guia docente DOCX:
Write DOCX files using python-docx script:
from docx import Document
from docx.shared import Inches, Pt, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPHSave to exports/ directory.
| Name | Source | Required |
|---|---|---|
| Generated units | units/ directory | Yes |
| Generated guides | guides/ directory | For guia docente |
| brand-config.json | references/ | Recommended |
| Artifact | Format | Destination |
|---|---|---|
| Texto alumno | .docx | exports/ |
| Guia docente | .docx | exports/ |
# Export DOCX — Report
## Archivos Generados
| Archivo | Tamano | Unidades | Estado |
|---------|--------|----------|--------|
| exports/{asig}_{grado}_texto_alumno.docx | N KB | N | OK |
| exports/{asig}_{grado}_guia_docente.docx | N KB | N | OK |
## Estructura del Documento
- Portada: {present/absent}
- Tabla de contenidos: {present/absent}
- Unidades: N/N incluidas
- Tablas de rubrica: N formateadas
- Saltos de pagina: {correct/issues}
## Branding
- Colores: {applied from brand-config / JM Labs defaults}
- Fuente: {Inter / fallback}pip install python-docx automatically/scriba:unit firstreferences/docx-generation-patterns.md — python-docx patterns and style templates4bc8492
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.