Contracts and legal agreements
A contract is legal text with data inside: parties, dates, amounts, deadlines. In STXT the text remains text, clause by clause, and the data is data, in the same document.
This page is about the source format of a contract: the file from which the PDF, the next version and the data other systems need all come. It does not replace the signed document or the legal process.
A services agreement
Agreement (com.acme.legal.contract):
Id: AGR-2026-001
Title: Technical support services agreement
Status: Signed
Effective date: 2026-02-01
Parties:
Party: ACME Corp
Role: Provider
Registration: B-12345678
Party: Example Ltd
Role: Client
Registration: GB-87654321
Term:
Start: 2026-02-01
End: 2027-01-31
Payment:
Fee: 12000
Currency: EUR
Billing period: Monthly
Clauses:
Clause: Subject matter
Number: 1
Text >>
The Provider shall render to the Client the technical support
services described in Annex I, within the hours and at the service
levels established therein.
Clause: Limitation of liability
Number: 2
Text >>
The total liability of each party shall not exceed the annual amount
of the contract.
This limitation shall not apply in case of wilful misconduct or gross
negligence.
Internal notes >>
Standard clause LEG-07, approved by the legal department on
2025-11-03. Do not modify without legal review.In this example we have:
- Data: the parties, the dates and the payment. It is what a billing system or an expiry alert needs.
- Clauses: each one is a node with its title as the value, its number and its text.
- Text: the legal wording of each clause, as is, in a block node that accepts several paragraphs.
- Internal notes: they go inside the clause they refer to, and whoever generates the PDF omits them.
For example, a program can get these values without reading the contract:
| Node | Value |
|---|---|
Term/End |
2027-01-31 |
Payment/Fee |
12000 |
Payment/Currency |
EUR |
The template
Template (@stxt.template): com.acme.legal.contract
Structure >>
Agreement:
Id: (1)
Title: (1)
Status: (1) ENUM [Draft, Signed, Terminated]
Effective date: (?) DATE
Parties: (1)
Party: (2+)
Role: (1)
Registration: (?)
Term: (?)
Start: (1) DATE
End: (?) DATE
Payment: (?)
Fee: (1) NUMBER
Currency: (1) ENUM [EUR, USD, GBP]
Billing period: (?) ENUM [Monthly, Quarterly, Yearly]
Clauses: (?)
Clause: (*)
Number: (?) NATURAL
Text: (1) TEXT
Internal notes: (?) TEXTThe template checks the data and does not restrict the wording of the clauses, their number or their order.
An agreement that does not validate
# ERROR: this document does not validate
Agreement (com.acme.legal.contract):
Id: AGR-2026-002
Title: Non-disclosure agreement
Status: Draft
# An agreement has at least two parties: (2+)
Parties:
Party: ACME Corp
Role: Provider
Payment:
# A NUMBER has no thousands separator or symbol
Fee: 12,000 €
# `Euros` is not a value of the list
Currency: Euros
Clauses:
# A clause without `Text` is not a clause
Clause: Confidentiality
Number: 1A service level agreement
An SLA is the case with the most data inside legal text: targets, times and penalties.
SLA (com.acme.legal.sla):
Service: Payments platform
Agreement: AGR-2026-001
Effective date: 2026-03-01
Availability:
Target percentage: 99.9
Measurement period: Monthly
Response times:
Severity: Critical
Max response minutes: 30
Severity: High
Max response minutes: 120
Severity: Normal
Max response minutes: 480
Penalties:
Penalty: Availability breach
Condition >>
Monthly availability below the target.
Consequence >>
10 % discount on the invoice of the affected month.
Legal text >>
Metrics shall be measured according to the procedures described in the
technical annex. The parties shall review the targets yearly.And its template:
Template (@stxt.template): com.acme.legal.sla
Structure >>
SLA:
Service: (1)
Agreement: (?)
Effective date: (1) DATE
Availability: (1)
Target percentage: (1) NUMBER
Measurement period: (1) ENUM [Monthly, Quarterly]
Response times: (?)
Severity: (*)
Max response minutes: (1) NATURAL
Penalties: (?)
Penalty: (*)
Condition: (1) TEXT
Consequence: (1) TEXT
Legal text: (?) TEXTAgreement: AGR-2026-001 links the SLA to its contract. The dashboard that measures the service
can read the availability target and the response times from the same file
the parties signed.
How it is used
- Versions: each contract is a file in a repository, and each revision is a diff that shows which clause changed or which date moved.
- Standard clauses: a program compares each clause with the version approved by the legal department, and flags those that differ.
- Validation:
stxt validate --recursive contracts/(The command line) in continuous integration. - Extraction: the quarter's expiries or the amounts per client come out of the tree.
- Publishing: the PDF is generated from the file, without the internal notes.
Limits
STXT does not provide legal validity, electronic signature or custody.
It does not interpret the text of the clauses either: "except in case of wilful misconduct" is text, and only a person can evaluate it.
The template does not check consistency between fields (that End is later than Start,
or that the contract the SLA cites exists). That is done by the program that walks the repository.
See also Corporate documents and the comparison STXT vs XML.