Skip to content

engagement-letter-generator

Interactive skill for generating legal Engagement Letters and Terms of Business for The Building Law Practice Limited using Typst. Guides the user socratically through required template parameters and compiles or updates Typst document files.

Source: .opencode/skills/engagement-letter-generator/SKILL.md — site rebuilt 2026-09-05.


Engagement Letter Generator Skill

This skill automates the creation of formal legal Engagement Letters and Terms of Business for The Building Law Practice Limited t/a Building Law.

Core Template Reference

  • Master engagement letter: h:/My Drive/Engagement Letters/engagement_letter_and_terms.typ
  • Master BLP letter template (all other letters): C:\Users\antho\.config\opencode\skills\Letter Skill\resources\letter.typ
  • BLP letterhead (GREYSCALE): h:/My Drive/Engagement Letters/Word Letterhead Template Greyscale.png (300dpi PyMuPDF render; house style is grey scale — never embed the colour Word Letterhead Template.pdf directly)

This skill follows the same conventions as the master letter.typ. The layout sequence is:

#v(3.8cm)                            clear the letterhead header

*STRICTLY PRIVATE & CONFIDENTIAL*   always present, bold, flush left
#v(12pt)

*[Client Company Name]*              bold company name
[Address Line 1] \
[City] \
[Postcode] \
_([For the attention of: Name — By Email: email@firm.com])_

#v(12pt)
Date: [DD Month YYYY] \
Our Ref: [Reference]
#v(12pt)

Dear Sirs,

#v(8pt)
#block(width: 100%)[
  #set text(size: 11pt, weight: "bold")
  LETTER OF ENGAGEMENT  ALL MATTERS FROM THE DATE OF THIS LETTER ("THE ENGAGEMENTS")
]
#v(10pt)

[Introductory paragraph  no section number]

#sec("1.", "The scope of our services")
#item("1.1.", [...])

NEVER use a large centred = LETTER OF ENGAGEMENT heading. The subject line is always a #block(...) with bold text, matching UK legal letter conventions.

The Terms of Business section title is also a bold block — not a = heading:

#block(width: 100%)[
  #set text(size: 13pt, weight: "bold")
  TERMS OF BUSINESS
]


Page Setup (copy exactly from master letter.typ)

#set page(
  paper: "a4",
  margin: (x: 20mm, top: 25mm, bottom: 5cm),
  background: context {
    if counter(page).get().at(0) == 1 {
      image("Word Letterhead Template Greyscale.png", width: 100%, height: 100%)    GREYSCALE letterhead (house style)
    }
  },
  footer: context {
    let current_page = counter(page).get().at(0)
    if current_page > 1 {            NO footer on page 1 (letterhead has its own footer band)
      set text(9pt, fill: rgb("#555555"), font: ("Libertinus Serif",))
      [#h(1fr) Page #counter(page).display("1") of #counter(page).final().at(0)]
    }
  }
)
#set text(font: ("Libertinus Serif",), size: 11pt, fill: black)
#set par(justify: true, leading: 0.75em)

Hanging Paragraph Helpers (3.5em grid — matches master letter.typ)

#let sec(num, title) = {
  v(16pt)
  grid(columns: (3.5em, 1fr),
    text(weight: "bold")[#num],
    text(weight: "bold")[#title])
  v(10pt)
}

#let item(num, body) = {
  grid(columns: (3.5em, 1fr), [#num], [#body])
  v(0.75em)
}

Typst Font Rule (CRITICAL)

  • ALWAYS use "Libertinus Serif" — ships natively inside Typst, zero warnings on all platforms.
  • NEVER use "Liberation Sans", "Linux Libertine", or "Arial".
  • After compiling, verify zero warnings before presenting output.

Template Parameter Mapping

Field Description
[Client Company Name] Bold company name in recipient block
[Address Lines] Client postal address
[Attention / Email] Italic attention line
[DD Month YYYY] Date in full e.g. 03 August 2026
[Reference] Matter reference e.g. BLP/ACME/2026/001
[Name of Partner] Signing partner
[Insert Name of Director/Partner] Client Relations Manager (Clause 23 complaints)
Hourly Rates Standard: Director/Partner £295, Associate £230, Assistant £195, Trainee £140, Paralegal £130, Support £30
Clause 16 Applicable or Not Applicable — if Applicable, include the director guarantee block
Clause 24 Privacy URL: www.buildinglawpractice.com/privacy

Interactive Workflow (Socratic Questioning)

  1. Ask for required fields: Client name & address, date, reference, partner name, fee arrangements, Clause 16 applicable?
  2. Create client file: Copy master template → [ClientName]_engagement_letter.typ, substitute placeholders.
  3. Compile & render:
  4. PNG preview: typst compile <file>.typ <artifacts_dir>/letter-page-{0p}.png --ppi 144
  5. PDF: typst compile <file>.typ <file>.pdf
  6. Use view_file on each PNG to show pages directly in chat.
  7. Verify zero warnings.