HL Patents Style template: add {{…}} placeholders so production output reflects real branding + variable substitution #107

Open
opened 2026-05-25 14:24:13 +00:00 by mAi · 0 comments
Collaborator

m's report (2026-05-25 16:22)

can you not edit our previous docx which had all the specific hl formatting and include it there? I want to see how it would start to look like in production.

m explicitly authorises editing the HL Patents Style template (previously protected by "don't touch the universal .dotm" rule — m is the firm, his call).

Scope

The HL Patents Style template (universal letterhead used as fallback in the submission-template chain) currently has zero {{…}} placeholders. m wants the full firm-letterhead .docx to ALSO carry the standard placeholder set so production-quality submissions render with both:

  1. Real HL branding (header logo, fonts, paragraph styles, footer with firm address)
  2. Substituted variables (firm.name, project.case_number, parties, today, etc.)

What to do

Phase 1 — Inventory the HL formatting source

  1. Locate the current HL Patents Style .dotm (or .docx) in m/mWorkRepo. Verify the path from internal/services/submission_templates.go fallback chain. Likely path: 6 - material/Templates/Word/HL Patents Style.dotm.
  2. Read the current document's content + style definitions. Note every header/footer/caption block, the firm address footer, the case-caption paragraph styles, the body text styles.

Phase 2 — Decide on .docx vs .dotm authoring

The per-submission template registry uses .docx (per t-paliad-241 + brunel's #84 work). The universal fallback uses .dotm. Either:

  • A. Keep the .dotm as the legacy letterhead-only file AND author a NEW universal .docx template (templates/_base/_hl-skeleton.docx) that copies all HL styles + adds placeholders. The fallback chain prefers .docx when present.
  • B. Convert the .dotm to a .docx in-place and edit it to add placeholders. Simpler; risks losing macro behavior (the .dotm name implies macros were once present — verify they're not load-bearing).

(R) = A (parallel skeleton, don't touch the .dotm). Lawyers using the .dotm directly (outside paliad) keep their existing tool. paliad picks up the new .docx automatically.

Phase 3 — Author the universal skeleton with placeholders

Use the same approach brunel used in scripts/gen-skeleton-submission-template/main.go — programmatically generate a valid .docx with the HL styles inlined + the full 48-variable placeholder set in sensible positions:

  • Header: firm logo + {{firm.name}}
  • Case caption: {{party.claimant.name}} ./. {{party.defendant.name}}, court ({{project.court}}), case number ({{project.case_number}})
  • Patent reference: {{project.patent_number}}
  • Submission title block: {{procedural_event.name_de}} + {{procedural_event.legal_source_pretty}}
  • Body skeleton: section headings (Sachverhalt, Anträge, Rechtsausführungen, Beweis) without legal content — just placeholders for the lawyer to fill
  • Footer: {{today}} + firm address + page numbers

Apply Word's HL Patents Style paragraph styles + character styles to each placeholder so they pick up the firm's typography.

Phase 4 — Wire in the fallback chain

In internal/services/submission_templates.go (or wherever the chain is), insert the new _hl-skeleton.docx BEFORE the existing universal .dotm fallback. So lookup order becomes:

  1. templates/{FIRM_NAME}/{submission_code}.docx (firm-specific per-code)
  2. templates/_base/{submission_code}.docx
  3. templates/_base/_skeleton.docx (brunel's generic skeleton from #90)
  4. templates/{FIRM_NAME}/_hl-skeleton.docx (NEW — HL-styled skeleton with placeholders) ← inserted here
  5. HL Patents Style.dotm (existing letterhead fallback, no placeholders)

Wait — m's intent is that #4 takes priority. Reorder: put _hl-skeleton BEFORE generic skeleton when FIRM_NAME==HLC. Coder picks the cleanest dispatch.

Files most likely touched

  • New file scripts/gen-hl-skeleton-template/main.go — generator script for the .docx bytes
  • Commit the resulting .docx to m/mWorkRepo at the firm-specific path
  • internal/services/submission_templates.go — fallback chain insertion
  • Possibly internal/handlers/files.go fileRegistry — new slug + fetcher

Hard rules

  • Do not modify the existing HL Patents Style.dotm. The new .docx is parallel.
  • Do preserve all HL paragraph + character + table styles. The lawyer-visible output must look identical to opening the bare .dotm.
  • Cover all 48 SubmissionVarsService keys in the placeholder body.
  • go build ./... && go test ./internal/... && cd frontend && bun run build clean.
  • Branch: mai/<worker>/hl-skeleton-template-with-placeholders.

Out of scope

  • Authoring per-submission_code HL templates (Slice B — different task).
  • Removing the legacy .dotm fallback.
  • Macros / VBA logic.

Reporting

mai report completed with branch + SHAs + the mWorkRepo commit hash + an extracted screenshot-equivalent description of the rendered preview (header / caption / footer with all variables substituted on a real test project).

## m's report (2026-05-25 16:22) > can you not edit our previous docx which had all the specific hl formatting and include it there? I want to see how it would start to look like in production. m explicitly authorises editing the HL Patents Style template (previously protected by "don't touch the universal .dotm" rule — m is the firm, his call). ## Scope The HL Patents Style template (universal letterhead used as fallback in the submission-template chain) currently has zero `{{…}}` placeholders. m wants the full firm-letterhead .docx to ALSO carry the standard placeholder set so production-quality submissions render with both: 1. Real HL branding (header logo, fonts, paragraph styles, footer with firm address) 2. Substituted variables (firm.name, project.case_number, parties, today, etc.) ## What to do ### Phase 1 — Inventory the HL formatting source 1. Locate the current HL Patents Style .dotm (or .docx) in `m/mWorkRepo`. Verify the path from `internal/services/submission_templates.go` fallback chain. Likely path: `6 - material/Templates/Word/HL Patents Style.dotm`. 2. Read the current document's content + style definitions. Note every header/footer/caption block, the firm address footer, the case-caption paragraph styles, the body text styles. ### Phase 2 — Decide on .docx vs .dotm authoring The per-submission template registry uses .docx (per t-paliad-241 + brunel's #84 work). The universal fallback uses .dotm. Either: - **A.** Keep the .dotm as the legacy letterhead-only file AND author a NEW universal .docx template (`templates/_base/_hl-skeleton.docx`) that copies all HL styles + adds placeholders. The fallback chain prefers .docx when present. - **B.** Convert the .dotm to a .docx in-place and edit it to add placeholders. Simpler; risks losing macro behavior (the .dotm name implies macros were once present — verify they're not load-bearing). **(R) = A** (parallel skeleton, don't touch the .dotm). Lawyers using the .dotm directly (outside paliad) keep their existing tool. paliad picks up the new .docx automatically. ### Phase 3 — Author the universal skeleton with placeholders Use the same approach brunel used in `scripts/gen-skeleton-submission-template/main.go` — programmatically generate a valid .docx with the HL styles inlined + the full 48-variable placeholder set in sensible positions: - Header: firm logo + `{{firm.name}}` - Case caption: `{{party.claimant.name}} ./. {{party.defendant.name}}`, court (`{{project.court}}`), case number (`{{project.case_number}}`) - Patent reference: `{{project.patent_number}}` - Submission title block: `{{procedural_event.name_de}}` + `{{procedural_event.legal_source_pretty}}` - Body skeleton: section headings (Sachverhalt, Anträge, Rechtsausführungen, Beweis) without legal content — just placeholders for the lawyer to fill - Footer: `{{today}}` + firm address + page numbers Apply Word's HL Patents Style paragraph styles + character styles to each placeholder so they pick up the firm's typography. ### Phase 4 — Wire in the fallback chain In `internal/services/submission_templates.go` (or wherever the chain is), insert the new `_hl-skeleton.docx` BEFORE the existing universal .dotm fallback. So lookup order becomes: 1. `templates/{FIRM_NAME}/{submission_code}.docx` (firm-specific per-code) 2. `templates/_base/{submission_code}.docx` 3. `templates/_base/_skeleton.docx` (brunel's generic skeleton from #90) 4. `templates/{FIRM_NAME}/_hl-skeleton.docx` (NEW — HL-styled skeleton with placeholders) ← inserted here 5. `HL Patents Style.dotm` (existing letterhead fallback, no placeholders) Wait — m's intent is that #4 takes priority. Reorder: put _hl-skeleton BEFORE generic skeleton when FIRM_NAME==HLC. Coder picks the cleanest dispatch. ## Files most likely touched - New file `scripts/gen-hl-skeleton-template/main.go` — generator script for the .docx bytes - Commit the resulting `.docx` to `m/mWorkRepo` at the firm-specific path - `internal/services/submission_templates.go` — fallback chain insertion - Possibly `internal/handlers/files.go` fileRegistry — new slug + fetcher ## Hard rules - **Do not** modify the existing `HL Patents Style.dotm`. The new .docx is parallel. - **Do** preserve all HL paragraph + character + table styles. The lawyer-visible output must look identical to opening the bare .dotm. - **Cover all 48 SubmissionVarsService keys** in the placeholder body. - `go build ./... && go test ./internal/... && cd frontend && bun run build` clean. - Branch: `mai/<worker>/hl-skeleton-template-with-placeholders`. ## Out of scope - Authoring per-`submission_code` HL templates (Slice B — different task). - Removing the legacy .dotm fallback. - Macros / VBA logic. ## Reporting `mai report completed` with branch + SHAs + the mWorkRepo commit hash + an extracted screenshot-equivalent description of the rendered preview (header / caption / footer with all variables substituted on a real test project).
mAi self-assigned this 2026-05-25 14:24:14 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: m/paliad#107
No description provided.