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)
| Id | Rule | Checked by | Why |
|---|---|---|---|
| W1 | Live formulas. Every derived number is a formula; never a typed result. | spec, render | A model's mental arithmetic is the most common silent error; a formula is auditable and survives edits. |
| W2 | Assumptions 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, vision | The owner changes one input and the whole model follows; hidden constants make a model unchangeable. |
| W3 | Colour by role. input blue, calc black, link green, plus header/label/total/note. Set the role, not a colour. | spec, vision | The finance convention every accountant reads at a glance. The compiler maps roles to colours (packages/office-compile/src/xlsx/styles.ts). |
| W4 | Formats 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, vision | Text-numbers break SUM and sorting; unformatted money reads as noise. |
| W5 | Formula syntax. English function names, comma separators, quoted sheet names with spaces/accents, every referenced sheet/name exists. | spec, render | The file format stores English syntax; Excel localises display. checkWorkbookSpec catches localised function names, ; separators and missing sheets. |
| W6 | Clean 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. | render | An error cell in a delivered model destroys trust in every other number. |
| W7 | One purpose per sheet. Summary, inputs, calculations, data, in reading order; records as tables with frozen headers and totals; merges only for titles. | spec, vision | A reader finds the answer on the first sheet and the evidence behind it. |
| W8 | Native charts with a point. Native charts over ranges, titled with the point, value-axis format, beside the data. | spec, vision | Native charts update with the data and stay editable; pictures of charts do not. |
| W9 | No invented data. Only figures from the brief, attachments or tools; a missing input is an empty input cell with a note. | vision | A plausible invented figure is worse than a visible gap. |
| W10 | Plain 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. | scorecard | Labels are read hundreds of times; filler and headline case make a non-English workbook look translated. |
Decks (.pptx)
| Id | Rule | Checked by | Why |
|---|---|---|---|
| D1 | One message per slide. The title states the takeaway as a short sentence; detail goes to speaker notes. | spec, vision | An owner skims titles; the titles alone should tell the story. |
| D2 | Pick 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. | vision | Walls of bullets are the clearest sign of a generated deck. |
| D3 | Room to breathe. Stay inside the density limits (DECK_FIT_LIMITS in packages/office-spec/src/check-deck.ts); split rather than shrink. | spec, render | Overflowing or 12 pt text is unreadable when projected. The compiler's size ladder is a backstop, not a licence. |
| D4 | Palette 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, vision | A deliberate palette looks designed; the compiler warns on low-contrast themes. |
| D5 | Charts carry the numbers. A number series is a native chart with a takeaway, unit and numFmt, never bullets describing a trend. | vision | The chart is the evidence; the takeaway is the claim. |
| D6 | Deck structure. Title slide first, section dividers past eight slides, a closing slide with next steps or the ask; situation, insight, recommendation. | spec, vision | Business decks exist to get a decision. |
| D7 | Tables stay small. Genuinely tabular data only, numbers right-aligned, totals row highlighted; big tables go to a spreadsheet. | spec, vision | A 15-row table on a slide is a spreadsheet nobody can read. |
| D8 | No 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. | vision | A placeholder in a delivered deck is a visible failure. |
| D9 | Layout belongs to the compiler. The model picks kinds and fills slots, never positions or sizes. | spec | One grid and size ladder across every slide is what makes a deck look consistent; the spec has no fields for positions. |
| D10 | Plain 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. | scorecard | Stock AI wording ("it is important to note", "seamless") is the first sign a reader spots in a generated deck. |
Word documents (.docx, default path)
| Id | Rule | Checked by | Why |
|---|---|---|---|
| P1 | Real structure. Strict heading hierarchy; lists and clause numbering are Word numbering, not typed numbers. | spec, render, vision | Typed numbering breaks the moment a clause is inserted. |
| P2 | Clean pages. No empty pages, no lone heading at a page bottom, tables within page width, one body font. | spec, render, vision | Layout faults are what a reader notices first in print or PDF. |
| P3 | Finished text. No placeholders unless a template was asked for; dates and amounts in the document's locale. | spec, vision | Same reason as D8. |
| P4 | Plain 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. | scorecard | Business 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.
| Locale | Date | Default money |
|---|---|---|
| hu-HU | yyyy.mm.dd. | #,##0 "Ft" |
| cs-CZ | d.m.yyyy | #,##0 "Kč" |
| sk-SK, sl-SI | d.m.yyyy | #,##0.00 "€" |
| hr-HR | d.m.yyyy. | #,##0.00 "€" |
| pl-PL | dd.mm.yyyy | #,##0.00 "zł" |
| de-DE, de-AT, bg-BG | dd.mm.yyyy | #,##0.00 "€" |
| ro-RO | dd.mm.yyyy | #,##0.00 "lei" |
| sr-RS | d.m.yyyy. | #,##0 "din." |
| en-GB / en-US | dd/mm/yyyy / mm/dd/yyyy | from 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.
| Token | Colour | Used for |
|---|---|---|
ink | #1F2937 | Body text |
accent | #1F3A5F | Headings, header bands, title rules, chart series 1 |
accent2 | #C2410C | Highlights, chart series 2 |
muted | #6B7280 | Captions, notes, footers, field labels |
placeholder | #A4161A | [[...]] on light backgrounds, bold, no fill |
inputText / inputFill | #0000FF / #FFF2CC | Workbook 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.