HL Patents Style template: add {{…}} placeholders so production output reflects real branding + variable substitution #107
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
m's report (2026-05-25 16:22)
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:What to do
Phase 1 — Inventory the HL formatting source
m/mWorkRepo. Verify the path frominternal/services/submission_templates.gofallback chain. Likely path:6 - material/Templates/Word/HL Patents Style.dotm.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:
templates/_base/_hl-skeleton.docx) that copies all HL styles + adds placeholders. The fallback chain prefers .docx when present.(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:{{firm.name}}{{party.claimant.name}} ./. {{party.defendant.name}}, court ({{project.court}}), case number ({{project.case_number}}){{project.patent_number}}{{procedural_event.name_de}}+{{procedural_event.legal_source_pretty}}{{today}}+ firm address + page numbersApply 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.docxBEFORE the existing universal .dotm fallback. So lookup order becomes:templates/{FIRM_NAME}/{submission_code}.docx(firm-specific per-code)templates/_base/{submission_code}.docxtemplates/_base/_skeleton.docx(brunel's generic skeleton from #90)templates/{FIRM_NAME}/_hl-skeleton.docx(NEW — HL-styled skeleton with placeholders) ← inserted hereHL 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
scripts/gen-hl-skeleton-template/main.go— generator script for the .docx bytes.docxtom/mWorkRepoat the firm-specific pathinternal/services/submission_templates.go— fallback chain insertioninternal/handlers/files.gofileRegistry — new slug + fetcherHard rules
HL Patents Style.dotm. The new .docx is parallel.go build ./... && go test ./internal/... && cd frontend && bun run buildclean.mai/<worker>/hl-skeleton-template-with-placeholders.Out of scope
submission_codeHL templates (Slice B — different task).Reporting
mai report completedwith 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).