---
name: erne-protocol-document-layout
description: Create ERNE AG Holzbau protocol and agenda documents in the user's approved Corporate Design layout, with DOCX/PDF export and formatting rules.
version: 1.0.0
author: Hermes Agent
license: MIT
metadata:
  hermes:
    tags: [erne, protocols, traktandenliste, docx, pdf, corporate-design, construction]
---

# ERNE Protocol / Traktandenliste Document Layout

Use when creating or revising ERNE AG Holzbau protocols, Fachplaner-Jour-fixe Protokolle, Traktandenlisten, or similar meeting documents for the user.

## Source inputs to prefer

- Start from the user's latest manually optimised DOCX when provided.
- For protocols, prefer the **last approved protocol DOCX / Gestaltungsvorlage as the actual base document**, not just as visual inspiration. Preserve its header/footer parts so the ERNE logo top-left, beige/stripe design graphic top-right, page-number footer, and `www.erne.net` remain intact.
- Use the ERNE marketing DOCX template for Kopf-/Fusszeile when starting from scratch.
- Use ERNE CD Manual values:
  - Office font: Arial.
  - ERNE blue: `#365294`.
  - ERNE beige: `#E2D3C4`, plus a light beige table fill such as `#F5F0EA`.

## Approved layout rules

- Page margins / header spacing:
  - Keep generous distance between header and body text/title.
  - For A4, use roughly top margin `2.35 cm`, bottom `1.85 cm`, left `1.55 cm`, right `1.35 cm`, header/footer distance about `0.85 cm`.
- Title sizes:
  - Document overline such as `PROTOKOLL` or `TRAKTANDENLISTE`: **11 pt**.
  - Main title such as `1. FACHPLANER-JOUR-FIXE` / `2. FACHPLANER-JOUR-FIXE`: **16 pt**.
  - Main section headings: **13 pt**, blue, uppercase, with blue bottom rule.
- Header graphic:
  - Ensure the top-right ERNE graphic sits fully inside the printable/page area; if using the marketing template, correct the header anchor so it does not extend beyond A4. For the wide top-right graphic in the current template, set the anchor relative to page with a safe inset (roughly x = page width - graphic width - 0.25 cm, y = 0.25 cm).
- Tables:
  - All tables should span the same full content width.
  - Use fixed table layout with explicit column widths; do not rely on autofit when narrow columns are requested.
  - Header row: ERNE blue fill, white text, **10 pt**.
  - Body text: **8.5 pt**.
  - Alternating body row fill: white / light beige.
  - Repeat table header row on page breaks where possible.
  - Prevent row splitting (`w:cantSplit`) where possible.
  - For long fields, allow line breaks inside cells rather than reducing font excessively.
  - Agenda/goal tables: keep `Nr.` narrow but wide enough not to wrap (about 1.0 cm). Keep `Bereich` and `Priorität` narrow (about 3.0 cm and 2.1 cm respectively), giving the remaining width to the description column.
- Normal body / bullets: **8.5 pt**.
- Traktanden blocks and page breaks:
  - Keep each Traktandum together as far as DOCX allows (`keep_with_next` / `keep_together`).
  - Add visible spacing after one Traktandum before the next.
  - If page space is tight, prefer moving a whole Traktandum to the next page over splitting awkwardly.
  - Do **not** leave major headings orphaned shortly before a page break. If a heading such as `Ampelstatus`, a new Fachthema (`Bauphysik / Schallschutz`, `Elektro / HLKS`, etc.), `Risiken und Chancen`, or `Pendenzenliste` would start near the bottom of a page, insert a manual page break before it so the section starts cleanly on the next page.
  - After PDF export, inspect the page before and the page of each forced break; the previous page should not contain only a stranded heading, and the new page must clear the ERNE header graphic.
- Markdown/source cleanup:
  - Convert all heading levels before DOCX export, including `####` subsections. Raw Markdown markers such as `#### 7.1 ...` must never appear in the final PDF.
- Risks / Chancen table:
  - Avoid page breaks inside this table. If needed, start the section on a new page.
- Pendenzenliste:
  - Avoid tiny fonts.
  - Current approved columns: `Nr.`, `Pendenz`, `Verantwortlich`, `Termin`, `Relevanz`, `Status`.
  - Remove `Prio` unless explicitly requested.
- Do not include `Kurzversion zum Weiterleiten` if the user has requested it removed.

## Workflow

1. Extract source DOCX/PDF text with real tools; do not rely on visual assumptions.
2. Create or update DOCX using `python-docx`.
   - If using a Gestaltungsvorlage/last protocol as base, open it with `Document(template.docx)`, remove only the body XML while keeping `w:sectPr`, then write the new body. Do **not** create a blank `Document()` unless no template exists.
   - Template DOCX files may not contain built-in style names such as `Heading 1`, `List Bullet`, or `Table Grid`; wrap style assignments in fallbacks and apply font/colour directly to runs/cells.
   - Never overwrite template footer text with a homemade footer when a template footer exists; preserve its page-number field.
3. Convert DOCX to PDF using LibreOffice headless:
   ```bash
   libreoffice --headless --convert-to pdf --outdir <outdir> <file.docx>
   ```
4. Verify:
   - Read DOCX text with `read_file` or `python-docx`.
   - Inspect PDF page count and key text with `pdfplumber`.
   - Confirm the generated DOCX still has header relationships/images and footer paragraphs from the template.
   - Render important PDF pages using PyMuPDF (`fitz`) and visually inspect with `vision_analyze`, especially first page, risk/pendenzen pages, and last page.
   - On page 1 explicitly check: ERNE logo top-left, design graphic top-right, body starts below header without overlap, footer shows page count + `www.erne.net`.
   - On the last page explicitly check: footer visible, no table/content collision with the footer.
5. Deliver both DOCX and PDF via `MEDIA:/absolute/path`.

## Traktandenliste content pattern

For a follow-up Fachplaner-Jour-fixe, derive agenda items from:

- Management Summary.
- Offene Fragen.
- Risiken/Chancen.
- Pendenzenliste.
- Next meeting points.

Typical sections:

1. Begrüssung / Organisation
2. Terminplan / nächste Meilensteine
3. Architektur / Modellkoordination
4. Landschaft / Höhen / Tiefgaragendecke
5. Bauingenieur / Tragwerk / Holzbau
6. Bauphysik / Energie / Akustik
7. Werkleitungen / Entwässerung / Retention
8. Elektro
9. HLKS / Gebäudetechnik / Tiefgaragenlüftung
10. Offene Fragen / Entscheide
11. Pendenzenkontrolle
12. Nächste Termine / Abschluss

Also add `Vorbereitung durch Fachplaner` and `Pendenzenfokus` tables when useful.
