This editor starts with a sample help-desk contract. Change the document, or design a contract for your own data in the wizard. The sample is not required to use .mini. Explore explained examples →
.mini document
Canonical JSON (edit and press “JSON → .mini”)
Contract signature
Prompt block for a generative model (EN)
Bloque de especificación para un modelo generativo (ES)
contract.json
The current editor document (canonical object) serialized into every format from the same data. TOON is encoded with the official TOON reference implementation (v4.1.1, bundled). Token counts use ….
Tokens per format
Serialized output
Design your own contract: start blank or extend the sample, add fields, inspect the generated document and prompt, then download contract.json. To check a directory of contracts and fixtures later, run mini --forks DIR check-forks.
1 · Identity
2 · Fields
Invariant check
3 · Generated contract
Prompt block
Example document
Structure
prefix|n=12|key=value|key=a,b,c ← header (contract + count + metadata)
f1|f2|f3,f4*,f5|a,b,c|… ← one record per line, fields by position
list elements separated by ','
selected element ends with *
tuple = fixed comma-separated group
Escapes
\| literal vertical bar (everywhere) \\ literal backslash (everywhere) \n line break inside a value (everywhere) \, literal list separator (inside list elements) \* literal trailing asterisk (inside list elements)
Fork invariants
I1 one line = one valid record I4 new fields only at the tail I2 prefix and n are mandatory I5 fixtures must round-trip I3 inherited core never changes (breaking change ⇒ new prefix)
Error codes
| Code | Condition |
|---|---|
| E01 | no header |
| E02 | prefix ≠ contract |
| E03 | missing n |
| E04 | record count ≠ n |
| E05 | record arity outside core…core+extensions |
| E06 | type mismatch / required empty |
| E07 | list or tuple arity |
| E08 | marker rule violated |
| E09 | bad escape |
| E10 | enum violation |
| E11 | duplicate unique value |
| E12 | header entry malformed/missing |
| E13 | numeric range |
| E20/E21 | invalid contract / fork invariant |
Full specification: SPEC.md in the repository. Reference implementation: Python (src/minifmt) and TypeScript (ts/src); the engine of this page, js/mini.js, is generated from the TypeScript library and passes the conformance suite.