Skip to Content
Vatson Office

Design rules

The quality bar for the workbooks, decks and documents the tools make. Findings point to these rule ids.

The quality bar for the Word, Excel and PowerPoint files these packages produce.

The rules live in code: packages/office-spec/src/rules.ts (DESIGN_RULES). This page explains them for people. A test fails when a rule id exists in one place and not the other.

Checked by says who catches a broken rule: spec = semantic checks before compiling (checkWorkbookSpec, checkDeckSpec, checkDocumentSpec), render = the render/recalc toolkit after compiling (office-render), vision = a reviewer looking at rendered pages in the look-and-fix loop, scorecard = counted by proseStats (packages/office-spec/src/prose.ts) in the scorecards only, never sent to a reviser. The built-in filler list (FILLER_PHRASES) is English; other languages pass their own list.

Workbooks (.xlsx)

IdRuleChecked byWhy
W1Live formulas. Every derived number is a formula; never a typed result.spec, renderA model's mental arithmetic is the most common silent error; a formula is auditable and survives edits.
W2Assumptions in labelled cells. Formulas reference input cells or defined names, not typed constants; only 0, 1, 12, 100 as literals. Inputs sit together on an assumptions sheet or block, one per row, name and unit on the left.spec, visionThe owner changes one input and the whole model follows; hidden constants make a model unchangeable.
W3Colour by role. input blue, calc black, link green, plus header/label/total/note. Set the role, not a colour.spec, visionThe finance convention every accountant reads at a glance. The compiler maps roles to colours (packages/office-compile/src/xlsx/styles.ts).
W4Formats on every number. Money with currency, 0.0%, dates as ISO YYYY-MM-DD strings under a date format (the compiler stores real dates), #,##0 counts; numbers are numbers, not text.spec, visionText-numbers break SUM and sorting; unformatted money reads as noise.
W5Formula syntax. English function names, comma separators, quoted sheet names with spaces/accents, every referenced sheet/name exists.spec, renderThe file format stores English syntax; Excel localises display. checkWorkbookSpec catches localised function names, ; separators and missing sheets.
W6Clean recalculation. No #REF!, #DIV/0!, #NAME?, #VALUE!, #N/A after recalculation; a divisor that can be blank or zero is tested with IF first; IFERROR only where blank is the honest answer.renderAn error cell in a delivered model destroys trust in every other number.
W7One purpose per sheet. Summary, inputs, calculations, data, in reading order; records as tables with frozen headers and totals; merges only for titles.spec, visionA reader finds the answer on the first sheet and the evidence behind it.
W8Native charts with a point. Native charts over ranges, titled with the point, value-axis format, beside the data.spec, visionNative charts update with the data and stay editable; pictures of charts do not.
W9No invented data. Only figures from the brief, attachments or tools; a missing input is an empty input cell with a note.visionA plausible invented figure is worse than a visible gap.
W10Plain labels and notes. Sheet names, headers and labels are short noun phrases, notes and chart titles one plain sentence; sentence case; no filler, no em dashes.scorecardLabels are read hundreds of times; filler and headline case make a non-English workbook look translated.

Decks (.pptx)

IdRuleChecked byWhy
D1One message per slide. The title states the takeaway as a short sentence; detail goes to speaker notes.spec, visionAn owner skims titles; the titles alone should tell the story.
D2Pick the slide kind for the content. Numbers to chart/stat, sequences to timeline, comparisons to two columns/table; plain bullet slides a minority, at most two in a row.visionWalls of bullets are the clearest sign of a generated deck.
D3Room to breathe. Stay inside the density limits (DECK_FIT_LIMITS in packages/office-spec/src/check-deck.ts); split rather than shrink.spec, renderOverflowing or 12 pt text is unreadable when projected. The compiler's size ladder is a backstop, not a licence.
D4Palette from the topic. Accent from subject or brand, one dominant accent plus accent2 for charts, dark ink on light paper, contrast at least 4.5:1, no gradients.render, visionA deliberate palette looks designed; the compiler warns on low-contrast themes.
D5Charts carry the numbers. A number series is a native chart with a takeaway, unit and numFmt, never bullets describing a trend.visionThe chart is the evidence; the takeaway is the claim.
D6Deck structure. Title slide first, section dividers past eight slides, a closing slide with next steps or the ask; situation, insight, recommendation.spec, visionBusiness decks exist to get a decision.
D7Tables stay small. Genuinely tabular data only, numbers right-aligned, totals row highlighted; big tables go to a spreadsheet.spec, visionA 15-row table on a slide is a spreadsheet nobody can read.
D8No placeholders, no invented facts. No lorem ipsum, TBD, XX or bracketed fill-ins; figures and images only from provided sources, alt text on every image.visionA placeholder in a delivered deck is a visible failure.
D9Layout belongs to the compiler. The model picks kinds and fills slots, never positions or sizes.specOne grid and size ladder across every slide is what makes a deck look consistent; the spec has no fields for positions.
D10Plain business prose. Short concrete sentences, active verbs, one term for one thing; no filler or stock phrases; sentence-case titles; no em dashes; bullets are phrases.scorecardStock AI wording ("it is important to note", "seamless") is the first sign a reader spots in a generated deck.

Word documents (.docx, default path)

IdRuleChecked byWhy
P1Real structure. Strict heading hierarchy; lists and clause numbering are Word numbering, not typed numbers.spec, render, visionTyped numbering breaks the moment a clause is inserted.
P2Clean pages. No empty pages, no lone heading at a page bottom, tables within page width, one body font.spec, render, visionLayout faults are what a reader notices first in print or PDF.
P3Finished text. No placeholders unless a template was asked for; dates and amounts in the document's locale.spec, visionSame reason as D8.
P4Plain business prose. Short concrete sentences, active verbs, one term for one thing; no filler; sentence-case headings; no em dashes; list items at most 30 words.scorecardBusiness readers skim; filler and paragraph-long bullets hide the point.

The Word rules are the look-and-fix checklist for Word documents.

Locale conventions

localeConventions(locale) gives the language every visible string is written in, the Excel date format, and a default money format used only when the brief names no currency. These are display conventions of the language/locale; they never pick the applicable law, VAT rate or jurisdiction (language and jurisdiction are separate). English locales have no default currency.

LocaleDateDefault money
hu-HUyyyy.mm.dd.#,##0 "Ft"
cs-CZd.m.yyyy#,##0 "Kč"
sk-SK, sl-SId.m.yyyy#,##0.00 "€"
hr-HRd.m.yyyy.#,##0.00 "€"
pl-PLdd.mm.yyyy#,##0.00 "zł"
de-DE, de-AT, bg-BGdd.mm.yyyy#,##0.00 "€"
ro-ROdd.mm.yyyy#,##0.00 "lei"
sr-RSd.m.yyyy.#,##0 "din."
en-GB / en-USdd/mm/yyyy / mm/dd/yyyyfrom the brief

Default look

Every workbook, deck and document gets one look by default, so a deck and the workbook behind it read as one set. A spec can set its own deck theme, workbook font or cell styles; these are the defaults.

TokenColourUsed for
ink#1F2937Body text
accent#1F3A5FHeadings, header bands, title rules, chart series 1
accent2#C2410CHighlights, chart series 2
muted#6B7280Captions, notes, footers, field labels
placeholder#A4161A[[...]] on light backgrounds, bold, no fill
inputText / inputFill#0000FF / #FFF2CCWorkbook input cells (the finance convention)

One font family per file: Calibri by default. It ships with Office, and LibreOffice sets it in Carlito with the same widths, so a line breaks in the same place in Office and in the renders the checks measure.

On this page