excrtx-produce-oficios

Generate institutional official letters in DOCX, PDF, or HTML from Markdown templates.

1|Updated May 26, 2026
One-click install
npx skills add https://github.com/elderbernardi/exocortex.saas --skill excrtx-produce-oficios-elderbernardi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: excrtx-produce-oficios
Source: https://github.com/elderbernardi/exocortex.saas/tree/main/skills/excrtx-produce-oficios
Command: npx skills add https://github.com/elderbernardi/exocortex.saas --skill excrtx-produce-oficios-elderbernardi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python-docx, weasyprint, pyyaml, and includes scripts (resource) and references (resource) components.

What problem does it solve? Drafting formal institutional letters (ofícios) with correct official formatting, mandatory fields, and protocol language is repetitive and error-prone. This Skill collects required fields, validates them, and renders a properly formatted official document from a persisted template. ## Core Features & Use Cases - Template-Driven Generation: Reads Markdown templates with YAML frontmatter defining required fields, then fills placeholders with validated data. - Multi-Format Output: Produces DOCX (via python-docx), PDF (via WeasyPrint), or styled HTML with institutional margins, Times New Roman 12pt, and justified text. - Mandatory Field Validation: Blocks generation until all required fields (number, date, recipient, subject) are collected, never assuming values. - Use Case: An executive asks for an official letter to a government ministry requesting a deadline extension; the Skill asks for missing fields, generates a draft DOCX, and logs the creation in the acervo. ## Quick Start Ask the agent to prepare an official letter, providing the recipient, sender, subject, and body, and choose DOCX, PDF, or HTML as the output format.

Frequently Asked Questions about excrtx-produce-oficios

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a formal official letter in DOCX format?▼

Provide the required fields (letter number, date, recipient, subject, body) and run the gerar_oficio.py script with the template path, JSON data, docx format, and output path. The script validates mandatory fields before rendering the document with python-docx.

How to convert a Markdown template into a PDF official document?▼

The script first renders the filled template as styled HTML, then converts it to PDF using WeasyPrint. If WeasyPrint is not installed, the script exits with an error and suggests generating HTML as an alternative.

What Python libraries are needed for DOCX and PDF generation?▼

DOCX generation requires python-docx installed in a virtual environment at /tmp/oficio_env. PDF generation additionally requires WeasyPrint. PyYAML is optional; a basic regex fallback parser handles frontmatter without it.

Why does the script fail with missing mandatory fields error?▼

The script validates all campos_requeridos marked obrigatorio in the template frontmatter against the provided JSON data. Fields without a default value must be supplied; the error lists each missing field label so you can complete the data.

When should I not use this official letter generator?▼

Do not use it for memos, reports, or generic documents, which need their own template skills, nor for drafting emails or informal messages. It is scoped to institutional correspondence within the gabinete context.