Agreement generator

Pick an approved template, let the matter fill the form, let the rules block what is wrong, and generate a draft that nobody may release without a partner.

PROTOTYPE · SAMPLE DATA
What this screen proves. A lawyer picks an approved template, the form arrives mostly filled from the matter record, conditional blocks come from the firm's clause library, the validation engine blocks anything that would be wrong on its face, and the document is generated, scanned and watermarked DRAFT until a partner approves it. Nothing leaves the firm without that approval.
Two hard rules of the engine. (1) Placeholders that Word has split across runs must be repaired before generation, or the replacement fails silently and the document goes out with {{name}} inside it. (2) Every generated document records the template version and the clause set used, so a file signed today can always be reproduced exactly.

1 Template studio - the library a firm may draw from

TemplateVersionOwnerApprovedGolden testsStatus
Engagement letter and costs estimate
Firm-wide
v4.2S. Ariffin (partner)12 Aug 20268 / 8livehistory · tests · use
Tenancy agreement - residential
Conveyancing
v6.0S. Ariffin (partner)02 Sep 202610 / 10livehistory · tests · use
Tenancy agreement - commercial
Conveyancing
v3.4L. Tan (partner)02 Sep 20267 / 7livehistory · tests · use
Sale and purchase agreement - subsale (acts for purchaser)
Conveyancing
v9.1S. Ariffin (partner)28 Aug 202612 / 12livehistory · tests · use
Sale and purchase agreement - subsale (acts for vendor)
Conveyancing
v7.3S. Ariffin (partner)28 Aug 202611 / 11livehistory · tests · use
Sale and purchase agreement - developer (HDA, Schedule G/H)
Conveyancing
v2.0L. Tan (partner)05 Sep 20266 / 6live (HIMS e-SPA route)history · tests · use
Deed of assignment (master title)
Conveyancing
v5.2L. Tan (partner)19 Aug 20265 / 5livehistory · tests · use
Discharge of charge
Conveyancing
v2.6L. Tan (partner)19 Aug 20264 / 4livehistory · tests · use
Will (testator with minor children)
Family and estate
v1.4N. Devi (partner)-0 / 4draft - not approvedhistory · tests · use
Letter of demand
Litigation
v0.9--0 / 3parked for phase 4history · tests · use

Only templates with status live can be generated. A template without an owner, without a passing test set, or without partner approval cannot be promoted - the system simply does not offer it.

2 Generate an agreement - the form a clerk sees

Sale and purchase agreement (subsale, acting for purchaser) v9.1

Matter CV-2026-0142. Fields marked auto from matter were filled by the system; only the rest is typed.

FieldSourceValueType
Purchaser nameauto from matterNurul Ain binti Hassantext
Purchaser identificationauto from matter900101-14-6078ic
Vendor nameauto from matterTan Wei Mingtext
Property titleauto from matterGeran 45678, Lot 1234, Mukim Kajangtext
Purchase pricetypedRM650,000.00money
Deposit paid on signingrule (10%)RM65,000.00money
Completion daterule (SPA + 3 months)11 Dec 2026date
Financierauto from matterCIMB Bank Berhadtext
Late payment interestclause library default8% per annumpct
Chattels and inventory listtyped (optional)Air-conditioners (3 units), kitchen cabinettext

Live check - change a value and press generate

Ready. Press generate to run the validation engine and assemble the document.

Conditional blocks drawn from the clause library

BlockStateWhy
Strata management (Act 757) notices and by-lawsIncludedProperty is a stratified parcel
Restriction in interest - state authority consentNot includedFreehold, no restriction
Bumiputera lot releaseNot includedNot a Bumiputera lot
Existing tenancy - purchaser takes subject to tenancyNot includedVacant possession
Redemption of existing charge by vendor's financierIncludedCharge in favour of Maybank Islamic
Loan rejection - refund of depositIncludedPurchaser financing 80%
Furniture, fittings and chattelsIncludedInventory list attached
Late delivery charges (developer only)Not applicableNot an HDA transaction

Post-generation scan (runs on every output)

  • No leftover placeholders - scanned for {{ }}, {% %}, XXX, TBC
  • Parties named consistently in all 23 references
  • Price RM650,000.00 matches the payment schedule and the words
  • Inventory list referenced and attached
  • !
    Page range 38 pages - inside the expected band for a subsale SPA

Output package

For review
DOCX
track changes on, watermark DRAFT
For signature
PDF
wet ink only for this document
For archive
PDF/A
with template version and hash
Evidence
sealed
who generated, when, from which version

3 Validation engine - the 40 rules that make this a legal tool

Hard blocks (the document cannot be generated)

  • Price in figures does not match the price in words
  • Completion date is not the SPA date plus three months
  • Identification number fails format or check digit
  • Strata property on a landed template, or the reverse
  • Restriction in interest present but no state consent clause
  • Existing charge with no redemption clause
  • Instrument of transfer or charge routed to e-signature
  • Developer SPA outside the HIMS e-SPA route

Warnings (a partner must acknowledge, with a reason)

  • !
    Late payment interest outside the firm's 8-10% band
  • !
    No chattels and inventory list although the offer letter promised fittings
  • !
    No loan rejection clause although the purchaser is financing
  • !
    Taxes and assessment apportionment missing or ambiguous
  • !
    Extension period exists but the extension interest rate is blank
  • !
    Discount on scale fees exceeds the firm's policy

Every acknowledgement is recorded: who accepted it, when, and why. Silence is never consent.

4 Comparing the other side's mark-up

OptionCostKeeps formattingExports tracked changesNote
Text diff in the browser
difflib or diff-match-patch
FreeNoNoScreen review only
LibreOffice unoserver / unocompare
LibreOffice UNO
Free (self-hosted)PartialYesFallback if native track changes misbehave
Native track changes - python-redlines (Docxodus engine)
Python
Free (open source)HighYes - real w:ins / w:delChosen for phase 1
Draftable
Hosted or self-hosted API
USD129-261 per user per yearVery highYesLater phase if needed
Aspose.Words
.NET / Python / Java SDK
USD1,000-3,000+ per developer per year; OEM/SaaS from USD10,000+Very highYesAvoid unless justified
Why this matters. The point of automatic comparison is not convenience - it is detection. If the other side edits text without turning tracked changes on, the firm still sees every change, in writing, on the record.

5 Artificial intelligence - what it may and may not do

May

  • Suggest a clause from the firm's own approved library
  • Summarise the other side's mark-up into a one-page list
  • Explain a clause to the client in plain language

May not

  • Write a clause that is not in the approved library, unattended
  • Send anything to a client, the other side or the land office
  • Be used to train a model on client documents

Controls

  • Per-firm off switch - some bank panels forbid external AI
  • Every use logged: who, when, model, output, decision
  • Bar Council Circular 242/2025 and the 2025 update built into the policy text
The rule behind the rule. A lawyer's professional judgement cannot be delegated to software. The system is a drafting assistant that never becomes the lawyer of record.

6 What the firm gets on day one

Fields auto-filled
70%
straight from the matter record
First draft in
< 2 min
against 2-4 hours by hand
Templates at launch
10
conveyancing set first
Approval gate
Always
no partner, no release

How the ten minutes are spent now

Open the matter, press generate agreement, glance at the validation panel, fix the two typed fields, read the assembled outline block by block, send for partner review. The clerk no longer copies last month's file and hunts for names to change - which is exactly where the errors used to live.