docx-cmr-generator

Convert Markdown documents to DOCX files using CMR Advogados formatting standards.

5|3|Updated Nov 4, 2025
One-click install
npx skills add https://github.com/PedroGiudice/Claude-Code-Projetos --skill docx-cmr-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx-cmr-generator
Source: https://github.com/PedroGiudice/Claude-Code-Projetos/tree/main/skills/docx-cmr-generator
Command: npx skills add https://github.com/PedroGiudice/Claude-Code-Projetos --skill docx-cmr-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python-docx, lxml.

What problem does it solve?

This Skill automates converting Markdown into Word documents (.docx) following the CMR Advogados formatting standards, ensuring consistent fonts, margins, and layout.

Core Features & Use Cases

  • Markdown to DOCX conversion with DNA-driven styles.
  • Template style extraction from existing templates to align new documents.
  • Multi-document consensus: generate a consistent style across multiple documents.

Quick Start

Activate the environment and run:

  • Activate: cd skills/docx-cmr-generator and source .venv/bin/activate
  • Convert Markdown: python doc_builder.py <entrada.md> [saida.docx]
  • Example: python doc_builder.py ../CONTESTACAO.md ../CONTESTACAO.docx
  • Extract DNA: python style_extractor.py <template.docx> [estilos.json]
  • Generate consensus: python style_extractor.py --consensus ./pasta/ [consenso.json]

Frequently Asked Questions about docx-cmr-generator

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

FAQPage Schema
How do I convert Markdown documents to Word DOCX files with consistent formatting?

Convert Markdown to DOCX by running `python doc_builder.py <entrada.md> [saida.docx]`. The tool applies CMR Advogados formatting standards automatically, mapping Markdown structure to predefined styles like Title_Peca, Chapter_Heading, and Paragraph_Numbered for consistent fonts, margins, and layout across your legal documents.

Can I extract and reuse formatting styles from an existing Word template?

Yes. Run `python style_extractor.py <template.docx> [estilos.json]` to extract the style DNA from any template. This generates a cmr_styles.json configuration file that maps fonts, margins, and styling rules, which doc_builder then applies to new Markdown conversions.

What's the best way to ensure consistent formatting across multiple legal documents?

Generate consensus styling across multiple documents by running `python style_extractor.py --consensus ./pasta/ [consenso.json]`. This analyzes all DOCX files in a folder, identifies shared formatting patterns, and outputs a unified style configuration for standardized conversions.

Do I need python-docx and lxml to use this Skill?

Yes. Both python-docx and lxml are required dependencies. Activate the environment with `cd skills/docx-cmr-generator` and `source .venv/bin/activate` before running doc_builder.py or style_extractor.py to ensure all dependencies are available.

What Markdown elements and legal document types does this support?

This Skill supports legal briefs and templates with Markdown-to-DOCX conversion targeting CMR Advogados standards. It maps Markdown structure to seven style types: Enderecamento, Title_Peca, Chapter_Heading, Subcapitulo, Paragraph_Numbered, Citation, Item_Lista, and Assinatura for professional legal formatting.

Can I customize fonts and margins for my documents?

Yes. Font and margin settings are managed through the cmr_styles.json configuration file extracted from templates. Modify the style configuration before running doc_builder.py to apply custom fonts, margins, and page layout rules to your Markdown conversions.