@uselazuli/cli 0.0.0-stage → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/LICENSE +21 -0
  3. package/README.md +202 -2
  4. package/agents/lazuli-design-reviewer.md +30 -0
  5. package/agents/lazuli-first-look.md +22 -0
  6. package/agents/lazuli-task-tester.md +25 -0
  7. package/bin/lazuli.mjs +747 -0
  8. package/package.json +11 -4
  9. package/rules/accessibility/HYPOTHESES.md +8 -0
  10. package/rules/accessibility/_area.yaml +7 -0
  11. package/rules/accessibility/operable.yaml +100 -0
  12. package/rules/accessibility/perceivable.yaml +153 -0
  13. package/rules/accessibility/robust.yaml +24 -0
  14. package/rules/accessibility/understandable.yaml +72 -0
  15. package/rules/color/HYPOTHESES.md +27 -0
  16. package/rules/color/_area.yaml +10 -0
  17. package/rules/color/adapt.yaml +183 -0
  18. package/rules/color/create.yaml +259 -0
  19. package/rules/color/review.yaml +215 -0
  20. package/rules/color/signal.yaml +196 -0
  21. package/rules/content/HYPOTHESES.md +19 -0
  22. package/rules/content/_area.yaml +8 -0
  23. package/rules/content/review.yaml +378 -0
  24. package/rules/content/voice.yaml +144 -0
  25. package/rules/content/writing.yaml +202 -0
  26. package/rules/data/HYPOTHESES.md +11 -0
  27. package/rules/data/_area.yaml +7 -0
  28. package/rules/data/charts.yaml +189 -0
  29. package/rules/data/dashboards.yaml +141 -0
  30. package/rules/data/review.yaml +159 -0
  31. package/rules/graphic/HYPOTHESES.md +18 -0
  32. package/rules/graphic/_area.yaml +8 -0
  33. package/rules/graphic/identity.yaml +141 -0
  34. package/rules/graphic/pieces.yaml +164 -0
  35. package/rules/graphic/review.yaml +271 -0
  36. package/rules/graphic/symbol.yaml +141 -0
  37. package/rules/motion/HYPOTHESES.md +19 -0
  38. package/rules/motion/_area.yaml +7 -0
  39. package/rules/motion/micro.yaml +143 -0
  40. package/rules/motion/review.yaml +347 -0
  41. package/rules/motion/transitions.yaml +169 -0
  42. package/rules/typography/HYPOTHESES.md +12 -0
  43. package/rules/typography/_area.yaml +8 -0
  44. package/rules/typography/adapt.yaml +45 -0
  45. package/rules/typography/create.yaml +126 -0
  46. package/rules/typography/review.yaml +127 -0
  47. package/rules/ui/HYPOTHESES.md +23 -0
  48. package/rules/ui/_area.yaml +9 -0
  49. package/rules/ui/compose.yaml +246 -0
  50. package/rules/ui/grid.yaml +75 -0
  51. package/rules/ui/review.yaml +400 -0
  52. package/rules/ui/states.yaml +257 -0
  53. package/rules/ux/HYPOTHESES.md +13 -0
  54. package/rules/ux/_area.yaml +8 -0
  55. package/rules/ux/flows.yaml +164 -0
  56. package/rules/ux/forms.yaml +142 -0
  57. package/rules/ux/review.yaml +186 -0
  58. package/skills/lazuli/SKILL.md +183 -0
  59. package/skills/lazuli/procedures/create.md +29 -0
  60. package/skills/lazuli/procedures/explain-decisions.md +22 -0
  61. package/skills/lazuli/procedures/improve.md +30 -0
  62. package/skills/lazuli/procedures/remember-this.md +41 -0
  63. package/skills/lazuli/procedures/review-design.md +36 -0
  64. package/skills/lazuli/procedures/show-options.md +33 -0
  65. package/skills/lazuli-accessibility-check/SKILL.md +68 -0
  66. package/skills/lazuli-color-context-and-culture/SKILL.md +53 -0
  67. package/skills/lazuli-color-context-and-culture/references/sectors.md +26 -0
  68. package/skills/lazuli-color-palette-by-intent/SKILL.md +54 -0
  69. package/skills/lazuli-color-palette-by-intent/references/intent-chords.md +51 -0
  70. package/skills/lazuli-color-screen-review/SKILL.md +51 -0
  71. package/skills/lazuli-color-states-and-signals/SKILL.md +53 -0
  72. package/skills/lazuli-content-interface-writing/SKILL.md +53 -0
  73. package/skills/lazuli-content-voice/SKILL.md +40 -0
  74. package/skills/lazuli-data-charts-and-dashboards/SKILL.md +59 -0
  75. package/skills/lazuli-graphic-derived-pieces/SKILL.md +40 -0
  76. package/skills/lazuli-graphic-derived-pieces/references/piece-template.html +24 -0
  77. package/skills/lazuli-graphic-identity/SKILL.md +45 -0
  78. package/skills/lazuli-motion-micro-and-transitions/SKILL.md +49 -0
  79. package/skills/lazuli-typography-choose-and-pair/SKILL.md +50 -0
  80. package/skills/lazuli-typography-screen-review/SKILL.md +51 -0
  81. package/skills/lazuli-ui-composition/SKILL.md +42 -0
  82. package/skills/lazuli-ui-composition/references/option-template.html +34 -0
  83. package/skills/lazuli-ui-layout-review/SKILL.md +47 -0
  84. package/skills/lazuli-ui-states-and-system/SKILL.md +54 -0
  85. package/skills/lazuli-ux-flows-and-forms/SKILL.md +51 -0
  86. package/skills/lazuli-ux-task-test/SKILL.md +44 -0
  87. package/src/browser.mjs +162 -0
  88. package/src/commands/capture.mjs +313 -0
  89. package/src/commands/catalog.mjs +37 -0
  90. package/src/commands/check-design.mjs +463 -0
  91. package/src/commands/check-goals.mjs +57 -0
  92. package/src/commands/compare-designs.mjs +160 -0
  93. package/src/commands/draft-memo.mjs +162 -0
  94. package/src/commands/hooks.mjs +345 -0
  95. package/src/commands/install-hooks.mjs +120 -0
  96. package/src/commands/install.mjs +132 -0
  97. package/src/commands/list-rules.mjs +49 -0
  98. package/src/commands/map-page.mjs +594 -0
  99. package/src/commands/record-answers.mjs +79 -0
  100. package/src/commands/record-log.mjs +325 -0
  101. package/src/commands/record-task.mjs +250 -0
  102. package/src/commands/render-options.mjs +227 -0
  103. package/src/commands/start-project.mjs +32 -0
  104. package/src/measure/a11y.mjs +391 -0
  105. package/src/measure/asset.mjs +206 -0
  106. package/src/measure/at-rest.mjs +49 -0
  107. package/src/measure/cases.mjs +566 -0
  108. package/src/measure/chart-read.mjs +401 -0
  109. package/src/measure/chart.mjs +264 -0
  110. package/src/measure/coherence.mjs +145 -0
  111. package/src/measure/color.mjs +86 -0
  112. package/src/measure/content.mjs +82 -0
  113. package/src/measure/cvd.mjs +24 -0
  114. package/src/measure/extreme.mjs +241 -0
  115. package/src/measure/forms.mjs +150 -0
  116. package/src/measure/in-page/a11y.js +522 -0
  117. package/src/measure/in-page/color.js +348 -0
  118. package/src/measure/in-page/composition.js +1496 -0
  119. package/src/measure/in-page/contrast.js +15 -0
  120. package/src/measure/in-page/cvd.js +173 -0
  121. package/src/measure/in-page/extreme.js +377 -0
  122. package/src/measure/in-page/frames.js +781 -0
  123. package/src/measure/in-page/look.js +28 -0
  124. package/src/measure/in-page/motion-probe.js +171 -0
  125. package/src/measure/in-page/style.js +107 -0
  126. package/src/measure/in-page/svg-strokes.js +112 -0
  127. package/src/measure/in-page/svg-uses.js +50 -0
  128. package/src/measure/in-page/symbol.js +123 -0
  129. package/src/measure/in-page/type.js +269 -0
  130. package/src/measure/in-page/weight.js +207 -0
  131. package/src/measure/layout.mjs +100 -0
  132. package/src/measure/motion.mjs +509 -0
  133. package/src/measure/piece.mjs +195 -0
  134. package/src/measure/registry.mjs +253 -0
  135. package/src/measure/rhythm.mjs +81 -0
  136. package/src/measure/signature.mjs +65 -0
  137. package/src/measure/states.mjs +240 -0
  138. package/src/measure/style.mjs +13 -0
  139. package/src/measure/symbol.mjs +268 -0
  140. package/src/measure/terms.mjs +153 -0
  141. package/src/measure/tiles.mjs +20 -0
  142. package/src/measure/timeline.mjs +621 -0
  143. package/src/measure/type.mjs +167 -0
  144. package/src/measure/weight.mjs +18 -0
  145. package/src/private-strings.mjs +81 -0
  146. package/src/project/blind.mjs +70 -0
  147. package/src/project/edits.mjs +154 -0
  148. package/src/project/gate.mjs +168 -0
  149. package/src/project/lazuli-md.mjs +521 -0
  150. package/src/project/log.mjs +335 -0
  151. package/src/project/match.mjs +200 -0
  152. package/src/project/records.mjs +380 -0
  153. package/src/project/tasks.mjs +153 -0
  154. package/src/report/evaluate.mjs +27 -0
  155. package/src/report/evaluators/a11y.mjs +227 -0
  156. package/src/report/evaluators/chart.mjs +151 -0
  157. package/src/report/evaluators/coherence.mjs +103 -0
  158. package/src/report/evaluators/color.mjs +133 -0
  159. package/src/report/evaluators/content.mjs +112 -0
  160. package/src/report/evaluators/extreme.mjs +87 -0
  161. package/src/report/evaluators/forms.mjs +116 -0
  162. package/src/report/evaluators/layout.mjs +103 -0
  163. package/src/report/evaluators/motion.mjs +280 -0
  164. package/src/report/evaluators/piece.mjs +69 -0
  165. package/src/report/evaluators/rhythm.mjs +99 -0
  166. package/src/report/evaluators/states.mjs +39 -0
  167. package/src/report/evaluators/style.mjs +35 -0
  168. package/src/report/evaluators/symbol.mjs +110 -0
  169. package/src/report/evaluators/terms.mjs +49 -0
  170. package/src/report/evaluators/type.mjs +166 -0
  171. package/src/report/evaluators/weight.mjs +51 -0
  172. package/src/report/evidence.mjs +4 -0
  173. package/src/report/finding.mjs +11 -0
  174. package/src/report/format.mjs +215 -0
  175. package/src/rules/hypotheses.mjs +28 -0
  176. package/src/rules/load.mjs +274 -0
  177. package/src/rules/public-text.mjs +56 -0
  178. package/src/rules/schema.mjs +220 -0
  179. package/templates/LAZULI.md +88 -0
@@ -0,0 +1,202 @@
1
+ # Interface writing. The words of the interface: buttons, links, headings, labels, error and empty-state
2
+ # messages, and the names of things across screens. These rules are for the moment the text is written. The
3
+ # reviewer judges them from the screens and the code; the review rules that check-design reads come later in
4
+ # this area. CW6 is WCAG 2.2 Success Criterion 2.4.6, a norm that a declared break never waives.
5
+
6
+ - id: CW1
7
+ name: A button or link says what happens
8
+ area: content
9
+ moment: create
10
+ skill: lazuli-content-interface-writing
11
+ rule: >-
12
+ A button or link says what happens when it is pressed, in the words of the outcome: "Send message", "Save and continue", "See pricing". Never only "Submit", "OK" or "Click here". For links, AU2 covers a name that says where the link goes. The phrase list the kit reads as naming no outcome is the hypothesis H1 in `HYPOTHESES.md` of this area.
13
+ why: >-
14
+ A person scanning a screen reads the controls first; a label that names the outcome lets them act without reading the text around it, and one that names nothing makes them guess. (our claim)
15
+ origin: hypothesis
16
+ status: hypothesis
17
+ hypothesis: H1
18
+ source: >-
19
+ Our claim: the phrase list of H1 was written before any page was read. Related reading, not the source of the rule: GOV.UK Design System, Button, https://design-system.service.gov.uk/components/button/ (section "How it works", opened 2026-11-26) says to write button text in sentence case, describing the action it performs, and to add words where needed to describe the action.
20
+ when_to_break: >-
21
+ A word that is generic elsewhere may be the outcome in this product ("Send" in a mail app, "Done" closing an editor whose work is already saved), declared with break-a-rule first.
22
+ break_effect: >-
23
+ A shorter label where the outcome is already plain from the screen, at the cost of meaning when the control is read alone.
24
+ test: >-
25
+ The reviewer reads every button and link name alone, out of its screen, and says what pressing it does; a name that does not say it is a finding. Link names are also checked by AU2, and check-design lists buttons named only by a generic word (CR1).
26
+ example: >-
27
+ "Book a first visit" on the button that books it, and "Save and continue" where the answers are saved.
28
+ counterexample: >-
29
+ "Submit" under a booking form, and "Click here" after a sentence about pricing.
30
+
31
+ - id: CW2
32
+ name: One name per thing on every screen
33
+ area: content
34
+ moment: create
35
+ skill: lazuli-content-interface-writing
36
+ rule: >-
37
+ The same action, page or object keeps one name and one spelling on every screen, in navigation, buttons, headings and messages. Choose the name once, list it under `## Voice` (CV3), and reuse it. Two names for one destination and one term written two ways ("E-mail" and "Email", "Log in" and "Login") are the hypotheses H5 and H6 in `HYPOTHESES.md` of this area.
38
+ why: >-
39
+ When a thing changes name between screens, people wonder whether it is a different thing, and the second name costs a moment of doubt each time. (our claim)
40
+ origin: hypothesis
41
+ status: hypothesis
42
+ hypothesis: [H5, H6]
43
+ source: >-
44
+ Our claim: no page opened on 2026-11-26 states this as a rule. It comes from the kit author's internal product plan (content row: terms consistent across screens).
45
+ when_to_break: >-
46
+ A name that changes on purpose with the person's progress ("Cart" before paying, "Order" after), declared with break-a-rule first, with the change said on the screen where it happens.
47
+ break_effect: >-
48
+ The name follows the state of the thing, at the cost of one more name to learn.
49
+ test: >-
50
+ The reviewer lists the names used for each page, action and object across the screens of the product and marks any thing with two names or two spellings; check-design compares navigation names (CR5) and spellings (CR6) when it gets two or more screens.
51
+ example: >-
52
+ "Plans" in the menu, "Plans" as the page heading and "See plans" on the home page button.
53
+ counterexample: >-
54
+ "Plans" in the menu, "Pricing" as the heading of the same page, and "Log in" in the header beside "Login" in the footer.
55
+
56
+ - id: CW3
57
+ name: Labels lead with the meaning and stay short
58
+ area: content
59
+ moment: create
60
+ skill: lazuli-content-interface-writing
61
+ rule: >-
62
+ A label leads with the words that carry its meaning and stays short: the verb and the object first, no filler in front ("Download the report", not "Click here in order to download the report"). The word cutoff the kit uses for button labels is the hypothesis H2 in `HYPOTHESES.md` of this area.
63
+ why: >-
64
+ People read the start of a label and skip the rest; the first words decide whether the control is the one they want. (our claim)
65
+ origin: hypothesis
66
+ status: hypothesis
67
+ hypothesis: H2
68
+ source: >-
69
+ Our claim: the cutoff is the round starting value of H2, set before any page was measured. Related reading, not the source of the cutoff and never a reason to move it: GOV.UK Design System, Button, https://design-system.service.gov.uk/components/button/ (section "How it works", opened 2026-11-26) says you may need more or different words to describe the action; W3C, Understanding SC 2.4.6 Headings and Labels, https://www.w3.org/WAI/WCAG22/Understanding/headings-and-labels.html (section "Intent", opened 2026-11-26) says labels and headings do not need to be lengthy.
70
+ when_to_break: >-
71
+ A label that needs more words to be exact (a legal confirmation, a payment that cannot be undone), declared with break-a-rule first.
72
+ break_effect: >-
73
+ The label carries the whole consequence, at the cost of a slower scan.
74
+ test: >-
75
+ The reviewer reads the first words of each label and says whether they name the action or the object; check-design reads the word count of button names (CR2).
76
+ example: >-
77
+ "Download the report" and "Pay now".
78
+ counterexample: >-
79
+ "Click here if you would like to download the full report".
80
+
81
+ - id: CW4
82
+ name: An error says what went wrong and how to fix it
83
+ area: content
84
+ moment: create
85
+ skill: lazuli-content-interface-writing
86
+ rule: >-
87
+ An error message says what went wrong, on which field, and how to fix it, in the person's words, without blame and never as a code alone. Where the message sits and how it is tied to its field are XM5 and XR5 of the ux area. The generic-error phrase list the kit reads is the hypothesis H4 in `HYPOTHESES.md` of this area.
88
+ why: >-
89
+ A message that only says something failed leaves the person to find the field and guess the fix; one that names both lets them repair it in one step. (our claim)
90
+ origin: hypothesis
91
+ status: hypothesis
92
+ hypothesis: H4
93
+ source: >-
94
+ Our claim: the phrase list of H4 was written before any page was read. Related reading, not the source of the rule: GOV.UK Design System, Error message, https://design-system.service.gov.uk/components/error-message/ (sections "Be clear and concise" and "Be specific", opened 2026-11-26) says to describe what has happened and tell people how to fix it, and not to use technical jargon, "valid" and "invalid", or blaming words such as "you forgot"; Nielsen Norman Group, Tim Neusesser and Evan Sunwall, Error-Message Guidelines, https://www.nngroup.com/articles/error-message-guidelines/ (section "Communication Guidelines", opened 2026-11-26) says to offer remedies, to avoid phrasing that blames users, and to show error codes for diagnosis only. W3C, Understanding SC 3.3.1 Error Identification, https://www.w3.org/WAI/WCAG22/Understanding/error-identification.html, and Understanding SC 3.3.3 Error Suggestion, https://www.w3.org/WAI/WCAG22/Understanding/error-suggestion.html (sections "Success Criterion" and "Intent", opened 2026-11-26), are related reading only and are not restated here as a norm.
95
+ when_to_break: >-
96
+ A message that cannot say the fix without exposing data (a failed sign in that must not say which of the two answers was wrong), declared with break-a-rule first.
97
+ break_effect: >-
98
+ The account stays private, at the cost of a less specific message.
99
+ test: >-
100
+ The reviewer reads each error message of the product and marks the parts it lacks: what went wrong, which field, how to fix it; a message that blames or shows only a code is a finding. XR5 checks that the message is tied to its field, and check-design reads the messages shown on the page (CR4).
101
+ example: >-
102
+ "Enter your phone number with the area code, like 31 98765 4321".
103
+ counterexample: >-
104
+ "Invalid input", "Error 0x0643" and "You forgot the phone".
105
+
106
+ - id: CW5
107
+ name: One capitalization style for every control
108
+ area: content
109
+ moment: create
110
+ skill: lazuli-content-interface-writing
111
+ rule: >-
112
+ Every control of the product uses one capitalization style, sentence case or title case, chosen once and written under `## Voice`. Proper nouns and brand names keep their own capitals. How the style of a label is read is the hypothesis H3 in `HYPOTHESES.md` of this area.
113
+ why: >-
114
+ Mixed styles make controls look as if they came from different products and draw the eye to the difference instead of the words. (our claim)
115
+ origin: hypothesis
116
+ status: hypothesis
117
+ hypothesis: H3
118
+ source: >-
119
+ Our claim: no page opened on 2026-11-26 sets which style to use. Related reading, not the source of the rule: GOV.UK Design System, Button, https://design-system.service.gov.uk/components/button/ (section "How it works", opened 2026-11-26) writes button text in sentence case.
120
+ when_to_break: >-
121
+ A single control in capitals as part of the brand (a logo-like call to action), declared with break-a-rule first.
122
+ break_effect: >-
123
+ One control stands apart on purpose, at the cost of reading as louder than the rest.
124
+ test: >-
125
+ The reviewer lists the capitalization of every button, link, tab and menu item and marks any that breaks the declared style; check-design reads the styles of button names (CR3).
126
+ example: >-
127
+ "Book a visit", "See plans" and "Contact us", all in sentence case.
128
+ counterexample: >-
129
+ "Book a Visit" beside "See plans" and "CONTACT US".
130
+
131
+ - id: CW6
132
+ name: Headings and labels describe topic or purpose
133
+ area: content
134
+ moment: create
135
+ skill: lazuli-content-interface-writing
136
+ rule: >-
137
+ WCAG 2.2 Success Criterion 2.4.6 Headings and Labels (Level AA): Headings and labels describe topic or purpose. Write each heading so it names the topic of the section under it, and each form label so it names what to enter.
138
+ why: >-
139
+ Clear and descriptive headings and labels let people find the information they seek and understand how the parts of a page relate.
140
+ origin: norm
141
+ source: >-
142
+ W3C, Understanding SC 2.4.6 Headings and Labels, https://www.w3.org/WAI/WCAG22/Understanding/headings-and-labels.html (sections "Success Criterion" and "Intent", opened 2026-11-26): the criterion reads "Headings and labels describe topic or purpose.", Level AA; the intent is to help users understand what information is contained in web pages and how it is organized; labels and headings do not need to be lengthy.
143
+ when_to_break: >-
144
+ No room: the criterion is met or not. A declared break never waives this norm.
145
+ break_effect: >-
146
+ No effect is bought by a heading or label that does not say its topic or purpose.
147
+ test: >-
148
+ The reviewer reads each heading and label of the page alone and says the topic or purpose it names; one that names neither is a finding, and a declared break never waives it.
149
+ example: >-
150
+ A section headed "Delivery times by region" and a field labelled "Postcode".
151
+ counterexample: >-
152
+ A section headed "Welcome" over the delivery table, and a field labelled "Info".
153
+
154
+ - id: CW7
155
+ name: Text can grow and the interface still works
156
+ area: content
157
+ moment: create
158
+ skill: lazuli-content-interface-writing
159
+ rule: >-
160
+ The interface keeps working when text grows in another language or arrives longer from real content: buttons wrap or grow instead of cutting their label, headings wrap without covering what follows, and no box with a fixed height hides text. Design with the longest real text in view, Portuguese included. The growth factor and the long samples the kit uses are the hypotheses H7 and H8 in `HYPOTHESES.md` of this area.
161
+ why: >-
162
+ Text written in English and laid out to fit is the shortest it will ever be; translations and real names arrive longer, and a layout fitted to the sample breaks on them. (our claim)
163
+ origin: hypothesis
164
+ status: hypothesis
165
+ hypothesis: [H7, H8]
166
+ source: >-
167
+ Our claim: the factor of H7 and the samples of H8 were set before any page was measured. Related reading, not the source of the factor and never a reason to move it: W3C Internationalization, Text size in translation, https://www.w3.org/International/articles/article-text-size.en (opened 2026-11-26) gives a table of average expansion from English to European languages, larger for short strings, and says short labels are the most likely to be squeezed into small spaces.
168
+ when_to_break: >-
169
+ A label that will never be translated and whose text is fixed by the product (a product name on a badge), declared with break-a-rule first.
170
+ break_effect: >-
171
+ A tighter box where the text cannot change, at the cost of a fix if it ever does.
172
+ test: >-
173
+ The reviewer replaces the text of buttons, headings and paragraphs with longer text and looks at each width for cut, spilled or overlapping text; check-design runs the longer-text cases (CR7 and CR8).
174
+ example: >-
175
+ A button that wraps "Solicitar orçamento personalizado para minha empresa" onto two lines and keeps all of it.
176
+ counterexample: >-
177
+ A tab bar that cuts "Configurações" to "Configura" in a box sized for "Settings".
178
+
179
+ - id: CW8
180
+ name: Every list works with none, one and hundreds
181
+ area: content
182
+ moment: create
183
+ skill: lazuli-content-interface-writing
184
+ rule: >-
185
+ Every list is designed for zero, one and hundreds of items: an empty list says what to do next, one item does not look broken, and hundreds stay usable (search, filter or pages). How the empty state looks is designed with `lazuli-ui-states-and-system`; this rule covers its words and the list in each case. How lists are found and the size of the hundreds case are the hypothesis H9 in `HYPOTHESES.md` of this area.
186
+ why: >-
187
+ Lists are designed with a handful of sample items, and the first real account has none while the busiest has hundreds; both ends are where people get stuck. (our claim)
188
+ origin: hypothesis
189
+ status: hypothesis
190
+ hypothesis: H9
191
+ source: >-
192
+ Our claim: no page opened on 2026-11-26 states this as a rule. It comes from the kit author's internal product plan (extreme content: empty lists, one item, hundreds of items).
193
+ when_to_break: >-
194
+ A list whose length is fixed by the product (the days of the week, the steps of a fixed flow), declared with break-a-rule first.
195
+ break_effect: >-
196
+ No empty or huge case to design, since it cannot happen.
197
+ test: >-
198
+ The reviewer renders each list empty, with one item and with hundreds, and says what the person can do in each; check-design runs the list cases (CR9, CR10 and CR11).
199
+ example: >-
200
+ An empty orders list that says "No orders yet. Your first order will show here after checkout." with a link "Browse products".
201
+ counterexample: >-
202
+ An empty table with its headers and nothing under them, and a single card stretched across the whole row.
@@ -0,0 +1,11 @@
1
+ # Data hypotheses to validate in the A/B
2
+
3
+ Numbers and measures of charts and dashboards that are not from a source or a norm yet. They stay in the rules only as hints (status hypothesis, never a verdict) and become firm only after the A/B shows they improve the result. A row with a cutoff starts with `Cutoff: <key> <value>.`, says how the value was picked before any chart was measured, and lists chart readings under "Observed so far, not evidence".
4
+
5
+ | ID | Principle | Candidate limit | How to validate in the A/B |
6
+ |---|---|---|---|
7
+ | H1 | DC8 (chart labels are set at a size people read at every width) | Cutoff: minLabelPx 12. How it was picked: a round starting value, our claim, set before any chart was measured. Published guidance opened on 2026-11-26 is related reading and never moves it: Government Analysis Function (UK), Data visualisation: charts, https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-charts/ (section "Chart labels") asks for a large enough font for all labels and says it is not possible to suggest a specific minimum font size. What is measured: the rendered size of each chart text (axis ticks, series names, values, annotations, and the legend texts), the computed font size times the scale of its screen transform, at each width; the chart's HTML title and caption are not chart labels. Limits: canvas text is not read (a canvas chart is read from its pixels only); a label can be large and still unreadable on its background or in a thin weight; text drawn as paths is not text. Observed so far, not evidence (local fixtures only): rainbow.html, 9 labels at 9 px at 1440 and 390 px (hint); bars-zero.html, bars-truncated.html, log-axis.html, lines-legend.html and lines-direct.html, every label at 12 px or more at both widths (pass); the labels of canvas-bars.html are not read. | Needs pairs of the same chart with labels under and over the cutoff, shown at the smallest width to readers of the audience, checked for how many read the values correctly |
8
+ | H2 | DR3 (series are named at the data, not only in a legend, chart.direct-labels) | Our claim, a hint only; no number is used as a cutoff. How it was picked: no value is picked; the reading rests on definitions fixed before any chart was measured: `LEGEND_WORD` (a legend is an element whose class, id or label has the word legend), `SWATCH_PX` (a legend swatch is at most 24 px on both sides), `LABEL_GAP_PX` (a text within 8 px of a series' marks labels it, each text labeling at most the one series whose marks are nearest), a text in the series' own color labels it, and axis texts (tick numbers, texts under an axis, grid or tick class) never name a series. It borrows WCAG 2.2 1.4.1 for a heuristic reading, so it is never a norm fail; the norm is DC6, judged by the reviewer. Limits: a legend whose markup lacks the word is read as marks (its swatches become series); a series told apart by dash or marker shape is still counted, since only names are read; value labels do not name series; a canvas chart's labels and legend are not read (pixels only); a series drawn through `use` with paint set on the referenced shapes is read with the `use`'s paint; gradient paints and clip paths other than one rect are not read. Observed so far, not evidence (local fixtures only): lines-legend.html names Online, Retail stores and Partners only in the legend at 1440 and 390 px (hint); rainbow.html names its nine series only in the legend (hint); lines-direct.html and lines-direct-close.html label every series at the data (pass); canvas-bars.html is not read for labels. | Needs pairs of the same chart with direct labels and with a legend only, shown to readers of the audience, checked for how many match every series to its data, and how fast |
9
+ | H3 | DR4 (few saturated colors per chart, chart.categories) | Cutoff: maxCategories 6, minSaturation 60, minLightness 25, maxLightness 75. How it was picked: carried over unchanged from the color area, the count of color H19 (ES8, at most 6 saturated colors in a categorical chart) and the definition of a saturated color of color H2 (PA4: HSL saturation above 60 percent, lightness from 25 to 75 percent), set before any chart was measured; never tuned here. What is measured: the series colors of an svg chart, and for a canvas chart the color buckets of its pixels (4 bits per channel, mean real color per bucket) covering at least `MIN_SERIES_SHARE` of the capture; the saturated ones are counted with the color measurer's rounded HSL. Limits: an svg series in gray is never counted; canvas antialiasing may add a bucket over `MIN_SERIES_SHARE`; a canvas outside the first view, or still changing, is not read; gradient paints and clip paths other than one rect are not read. Observed so far, not evidence (local fixtures only): rainbow.html uses 9 saturated colors (hint) at 1440 and 390 px; lines-legend.html, lines-direct.html, bars-zero.html and canvas-bars.html stay at or under the count (pass); the busy canvases of canvas-busy.html were not read. | Needs charts with 3, 6 and 9 saturated series colors shown to readers of the audience, checked for accuracy and reading time of the chart, as color H19 asks |
10
+ | H4 | DR5 (series colors stay apart for color vision deficiencies, chart.cvd) | Cutoff: minDeltaE 10, minSaturation 60, minLightness 25, maxLightness 75. How it was picked: minDeltaE is a round starting value, our claim, set before any chart was measured; the saturation keys are those of color H2 and only say which canvas buckets are read as series. The model: Machado, Oliveira and Fernandes (2009), matrices of Table 1 of the authors' page at severity 1.0 (the page's "highest severity or a case of dichromacy"), applied in linear sRGB (our claim, the page names no space), the result clamped and encoded with the CSS Color 4 conversions; grayscale is the sRGB gray of the WCAG 2 relative luminance; the distance is Delta E 1976 in CIELAB (CSS Color 4 conversions, D65 to D50 by Bradford). A pair is close when any of normal vision, protanopia, deuteranopia, tritanopia or grayscale is under the cutoff, unless both series are labeled at the data. Limits: the simulation is of dichromats; severities below 1 (the anomalous trichromacies most people with a deficiency have) are not read; a mark's size and its neighbors change how far apart colors must be, and the distance ignores both; canvas series are only the saturated buckets, so a gray canvas series is never compared; gradient paints and clip paths other than one rect are not read. Observed so far, not evidence (local fixtures only): lines-legend.html, #5a9824 and #d26c3c at Delta E 0 with grayscale and 3.9 with deuteranopia (hint); canvas-bars.html, the same pair read from pixels (hint); rainbow.html, 12 close pairs; lines-direct.html passes in every view; lines-direct-close.html has one close pair labeled at the data, not counted. | Needs pairs of charts whose series colors are under and over the cutoff, shown to readers with protanopia, deuteranopia and tritanopia (and in grey print), checked for how many match every series |
11
+ | H5 | DR6 (the chart's message shows at first look) | Our claim, judged in words; no number is used as a cutoff. How it was picked: the kit leaves to the first look what no measure can say (whether the message shows); the CLI never says a chart is clear. The goal's `Understand:` line states the chart's message; the first look (`lazuli capture`, `record-first-look`) sees only the captures, never the chart sheet, and says what the chart says; the reviewer compares that with the Understand line. Limits, as GR5 and the first look: an agent's reading is not a person's; an agent may know a common chart from training; the answer is reported in words only and is not counted beyond the first look record. Observed so far, not evidence (local fixtures only): no first look of a chart has been recorded yet. | Validated with the same captures shown to people from the audience, comparing the message each states with the first look's answer and the Understand line; the look holds when they name the same finding |
@@ -0,0 +1,7 @@
1
+ area: data
2
+ title: Data
3
+ summary: "Charts and dashboards whose message shows at first look: bars from zero, readable labels, series named at the data, few colors, and colors that stay apart for color vision deficiencies."
4
+ order: 90
5
+ prefixes: [DC, DD, DR]
6
+ skills:
7
+ - lazuli-data-charts-and-dashboards
@@ -0,0 +1,189 @@
1
+ # Charts. One chart, one message, in the form that fits the comparison, read at first look. These rules are for
2
+ # the moment the chart is made. The reviewer judges them from the code and the rendered page, and the first look
3
+ # says whether the message shows; the review rules that read the chart measure come later in this area.
4
+
5
+ - id: DC1
6
+ name: One message per chart, written as its title
7
+ area: data
8
+ moment: create
9
+ skill: lazuli-data-charts-and-dashboards
10
+ rule: >-
11
+ Before drawing, write the one thing the chart has to show as a sentence, and make that sentence the chart's title: the finding, not the topic. A second statistical line under it may say what the data is, where and when. When the data holds two messages, make two charts.
12
+ why: >-
13
+ A title that states the finding tells the reader what to look for, so the chart confirms a message instead of asking the reader to find one; a topic title leaves every reader to draw their own, often different, conclusion.
14
+ origin: source
15
+ source: >-
16
+ Government Analysis Function (UK), Data visualisation: charts, publication date 19 May 2022, https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-charts/ (sections "What is the message?" and "Titles", opened 2026-11-26): asks whether a chart tries to communicate too many messages, and says the headline title should communicate the headline message of the chart, with a statistical subtitle saying what the data is, the geography and the time period. That the title is the place where the message is written for every chart, dashboards included, is our claim.
17
+ when_to_break: >-
18
+ A chart meant for exploration (a tool where the reader picks the series and the period) has no single finding; it may carry a topic title, declared with break-a-rule first, and says in its first line what the reader can explore.
19
+ break_effect: >-
20
+ The reader gets freedom to look for their own finding, at the cost of a chart that shows nothing at first look.
21
+ test: >-
22
+ The reviewer reads every chart title and asks whether it states a finding a reader could check against the chart; the first look on the rendered page says what the chart shows, and the reviewer compares it with the title (DR6).
23
+ example: >-
24
+ A line chart titled "Online sales passed store sales in March", with the subtitle "Monthly sales by channel, Brazil, 2025 to 2026".
25
+ counterexample: >-
26
+ A chart titled "Sales by channel" with four lines and no hint of which change matters.
27
+
28
+ - id: DC2
29
+ name: The form follows the comparison
30
+ area: data
31
+ moment: create
32
+ skill: lazuli-data-charts-and-dashboards
33
+ rule: >-
34
+ Name the comparison the message makes, then pick the form for it: amounts and rankings in bars, change over time in lines (more than one time series always in lines, never in clustered bars), relation between two measures in dots, parts of a whole in bars, and in a pie or donut only when there are few parts that differ clearly. When no form fits, a table or one sentence with the number may be the answer.
35
+ why: >-
36
+ Each form makes one comparison easy and the others hard: lengths from a common base are read well, angles and areas poorly, so the wrong form hides the message even when the data is right.
37
+ origin: source
38
+ source: >-
39
+ Government Analysis Function (UK), Data visualisation: charts, publication date 19 May 2022, https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-charts/ (sections "Statistical relationships", "Using bar charts" and "Using pie charts", opened 2026-11-26): a table matches statistical relationships (distribution, time series, ranking, deviation, correlation, magnitude, part-to-whole) to recommended chart types; it says to use a line chart instead of a bar chart when there is more than one time series, that small differences are hard to see on a pie chart, and that pie charts should be limited to a few categories. That lengths are read better than angles and areas is our claim here: no page on perception was opened in this task.
40
+ when_to_break: >-
41
+ An audience that knows one form by convention (a population pyramid, a candlestick chart for traders) may keep it for a comparison another form would show better, declared with break-a-rule first.
42
+ break_effect: >-
43
+ The familiar form is read without learning, at the cost of the comparison it does not make easy.
44
+ test: >-
45
+ The reviewer names the comparison each chart makes from its title and checks the form against it; a pie with many similar parts, or two time series in clustered bars, is a finding.
46
+ example: >-
47
+ Sales by region compared as horizontal bars sorted from largest to smallest.
48
+ counterexample: >-
49
+ A pie of nine regions whose slices differ by a sliver, read only through a legend.
50
+
51
+ - id: DC3
52
+ name: Bars start at zero, and a cut line axis says so
53
+ area: data
54
+ moment: create
55
+ skill: lazuli-data-charts-and-dashboards
56
+ rule: >-
57
+ The value axis of a bar chart starts at zero, so the length of each bar is proportional to its value. A line chart may start its axis elsewhere only when the range is the message (values that never come near zero, a small change that matters), and then the axis shows the cut with a break mark, the cut starts at a round number, and the text alternative mentions it.
58
+ why: >-
59
+ Bars are read by their length: a bar axis that does not start at zero makes a small difference look large. Lines are read by their slope and position, so a cut axis distorts them less, but only when the reader can see that it is cut.
60
+ origin: source
61
+ source: >-
62
+ Government Analysis Function (UK), Data visualisation: charts, publication date 19 May 2022, https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-charts/ (sections "Formatting bar charts", "Do not break the numerical axis on bar charts", and "Considerations for line charts", "Breaking the y-axis", opened 2026-11-26): breaking the numerical axis on a bar chart distorts the relative proportions of the bars; it is acceptable to break a numerical y-axis on a line chart when necessary, with a clear broken axis symbol, a break from a rounded number, and a mention of the break in the text description.
63
+ when_to_break: >-
64
+ None for bars: when zero hides the story, change the form (a dot plot, or the difference from an average) instead of cutting the bars. A line chart may cut its axis only as the rule says.
65
+ break_effect: >-
66
+ Not applicable to bars; a cut line axis shows the range at the cost of some mental effort from the reader.
67
+ test: >-
68
+ The reviewer reads the lowest value of every bar chart's axis in the code or on the rendered page and checks that it is zero; for a line axis that does not start at zero, the reviewer looks for the break mark and the mention in the text alternative. check-design reads the base of svg bar charts (DR1).
69
+ example: >-
70
+ A line chart of an immunisation rate whose axis runs over the upper part of the scale, with a broken axis symbol and the sentence "the axis starts above zero to show the fall" under it.
71
+ counterexample: >-
72
+ A bar chart of inflation whose axis starts high, so a small fall looks like a collapse.
73
+
74
+ - id: DC4
75
+ name: Name the series at the data, not in a legend
76
+ area: data
77
+ moment: create
78
+ skill: lazuli-data-charts-and-dashboards
79
+ rule: >-
80
+ Write the name of each series next to its data: at the end of each line, on or beside each bar or slice, on the first cluster of a grouped bar chart. Use a legend only when direct labels cannot fit, and then keep the legend in the same order and orientation as the data and say so above the chart. Labels are dark text, not the series color, unless lines are so close that only color shows which label is whose.
81
+ why: >-
82
+ A legend makes the reader match each name to its data by color, back and forth, which is slow for everyone and impossible for some people with color vision deficiencies; a name next to its data needs no matching.
83
+ origin: source
84
+ source: >-
85
+ Government Analysis Function (UK), Data visualisation: charts, publication date 19 May 2022, https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-charts/ (sections "Formatting line charts", "Labelling lines", and "Formatting stacked bar charts", "Legends", opened 2026-11-26): avoid legends unless necessary because they use colour to match labels to data; label lines directly, at the end of the line if needed; label stacks directly where possible; when a legend is needed, match the order and orientation of the data and state it above the chart; use black or dark grey text for labels.
86
+ when_to_break: >-
87
+ A chart whose series overlap so densely that no label fits next to its data (many lines in a small space) may use a legend, declared with break-a-rule first, ordered as the data; consider small multiples or a focus chart before.
88
+ break_effect: >-
89
+ The chart keeps every series, at the cost of a color matching step for the reader.
90
+ test: >-
91
+ The reviewer lists each chart's series and checks that each name sits next to its data; a legend is a finding unless the chart cannot fit direct labels, and then its order is checked against the data. check-design hints with series named only in a legend or not at all (DR3).
92
+ example: >-
93
+ A line chart with four lines, each named in dark text at its right end.
94
+ counterexample: >-
95
+ A line chart with six colored lines and a legend in a box below it, in a different order than the lines.
96
+
97
+ - id: DC5
98
+ name: Color by intent, one highlight and the rest neutral
99
+ area: data
100
+ moment: create
101
+ skill: lazuli-data-charts-and-dashboards
102
+ rule: >-
103
+ Give color to the series that carries the message and keep the others neutral (a light grey), so the highlight is the first thing seen. Use few categorical colors, and when categories outgrow them, group the small ones or use small multiples. Show ordered data (low to high) in one hue from light to dark, and data that goes both ways from a middle value in two hues with a neutral middle. Status colors in a chart (an alert, a target missed) follow `lazuli-color-states-and-signals`, never a series color.
104
+ why: >-
105
+ Color draws the eye before anything else in a chart, so it should point at the message; many strong colors compete with each other, and a rainbow scale on ordered data reads as categories instead of an order.
106
+ origin: source
107
+ source: >-
108
+ Government Analysis Function (UK), Data visualisation: charts, publication date 19 May 2022, https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-charts/ (section "Considerations for line charts", "Alternative example: focus chart", opened 2026-11-26): give a colour to the line showing the series of interest and a light grey to all other lines; it says presenting many lines often makes the chart cluttered. The clauses on ordered data in one hue, on data both ways from a middle in two hues and on grouping categories are our claim: no page saying them was opened in this task.
109
+ when_to_break: >-
110
+ A chart whose categories are all equal in weight and must each be found (a map legend of parties) may color every category, declared with break-a-rule first, keeping the colors apart for color vision deficiencies (DC6).
111
+ break_effect: >-
112
+ Every category can be found by color, at the cost of a chart with no single point of attention.
113
+ test: >-
114
+ The reviewer counts the strong colors of each chart and names the series each points at; the first look on the rendered page says what it saw first, and the reviewer compares it with the title. check-design counts the saturated series colors (DR4) and the pairs that come close in simulated color vision deficiencies (DR5).
115
+ example: >-
116
+ A line chart where the company's own line is dark blue and the competitors' lines are light grey.
117
+ counterexample: >-
118
+ A bar chart of eight months with a different bright color for every bar.
119
+
120
+ - id: DC6
121
+ name: Never tell series apart by color alone
122
+ area: data
123
+ moment: create
124
+ skill: lazuli-data-charts-and-dashboards
125
+ rule: >-
126
+ WCAG 2.2 1.4.1 Use of Color (level A): Color is not used as the only visual means of conveying information, indicating an action, prompting a response, or distinguishing a visual element. In a chart, every series and every meaning that has a color also has a second cue: a direct label, a position, a line style, a marker shape, a pattern, or a difference in lightness with a contrast ratio of at least 3:1 between the colors. A smaller difference in lightness is color alone (our claim).
127
+ why: >-
128
+ People with color vision deficiencies, and anyone reading a grey print or a screen in sunlight, cannot match series by hue; a chart that conveys its series only through color, with a legend that only repeats the colors, fails them.
129
+ origin: norm
130
+ source: >-
131
+ W3C, Web Content Accessibility Guidelines (WCAG) 2.2, Understanding Success Criterion 1.4.1: Use of Color, https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html (sections "Success Criterion", "Intent" and "Failures", opened 2026-11-26): the criterion text quoted in the rule, level A; a note in "Intent" counts colors that also differ significantly in lightness as an additional visual distinction as long as the difference in relative luminance between the colors leads to a contrast ratio of 3:1 or greater; the failure F13 names a chart that conveys information by color with a text alternative that does not include the information conveyed by color. Related reading: Understanding SC 1.4.11 Non-text Contrast, https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html (section "Graphical Objects", opened 2026-11-26), says each line in a graph is a graphical object whose contrast matters when it is required to understand the content.
132
+ when_to_break: >-
133
+ No break waives 1.4.1. A chart may lean on color for decoration that carries no information; the information itself always has a second cue.
134
+ break_effect: >-
135
+ Not applicable: the criterion is a norm of level A.
136
+ test: >-
137
+ The reviewer covers the hue of each chart (in a grey or color vision deficiency view of the rendered page) and checks that every series can still be named; a series found only by its color is a finding. check-design hints with series named only in a legend or not at all (DR3) and with close color pairs, and writes the simulated views on the chart sheet (DR5).
138
+ example: >-
139
+ Two lines, one solid and one dashed, each named at its end, that can still be told apart in grey.
140
+ counterexample: >-
141
+ A red and a green line of the same lightness, named only in a legend of colored squares.
142
+
143
+ - id: DC7
144
+ name: Every chart has a text alternative with its message
145
+ area: data
146
+ moment: create
147
+ skill: lazuli-data-charts-and-dashboards
148
+ rule: >-
149
+ WCAG 2.2 1.1.1 Non-text Content (level A): all non-text content that is presented to the user has a text alternative that serves the equivalent purpose. For a chart, the text alternative states the message (the title's finding), the type of chart and the trend that supports it, including anything the chart shows only through color or annotation; a chart drawn as an svg or canvas has it through a name or a description in the page (our claim). Giving the data itself as a table next to the chart, or behind a link, is part of this rule (our claim).
150
+ why: >-
151
+ A person who cannot see the chart gets the same message only from text; a text alternative that only repeats the title, or lists every point, does not serve the equivalent purpose.
152
+ origin: norm
153
+ source: >-
154
+ W3C, Web Content Accessibility Guidelines (WCAG) 2.2, Understanding Success Criterion 1.1.1: Non-text Content, https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html (sections "Success Criterion" and "Examples", "A data chart", opened 2026-11-26): the criterion text quoted in the rule, level A; the chart example gives a short label and a longer description that identifies the type of chart and summarizes the data, trends and implications, and provides the actual data in a table where possible and practical. Related: Government Analysis Function (UK), Data visualisation: charts, https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-charts/ (section "Alternative text", opened 2026-11-26): the text description says what users should understand from the chart, not a literal description of every point.
155
+ when_to_break: >-
156
+ No break waives 1.1.1. A chart that is pure decoration (a sparkline whose trend is written in the text next to it) may be hidden from assistive technology, because the text next to it carries the information.
157
+ break_effect: >-
158
+ Not applicable: the criterion is a norm of level A.
159
+ test: >-
160
+ The reviewer finds the text alternative of every chart in the code (its name, its description, the text under it) and checks that it states the finding of the title; a chart with no text alternative is a finding.
161
+ example: >-
162
+ A bar chart followed by the sentence "Bar chart: the north region sold the most in 2026, ahead of the south and the centre" and a link to the data as a table.
163
+ counterexample: >-
164
+ A canvas chart with no name at all, or an image whose alternative text is "chart".
165
+
166
+ - id: DC8
167
+ name: Labels people read, with units and their number format
168
+ area: data
169
+ moment: create
170
+ skill: lazuli-data-charts-and-dashboards
171
+ rule: >-
172
+ Set every chart label (axis ticks, series names, values, annotations) at a size people read at every width the page runs at, written horizontally, never scaled down with the chart. Every number carries its unit, and numbers use the audience's format: the thousands and decimal marks of their language, their currency sign. The size the kit uses is the hypothesis H1 in `HYPOTHESES.md` of this area.
173
+ why: >-
174
+ A chart scaled to fit a phone shrinks its text with it, and a label nobody can read hides the message; a number without a unit or in a foreign format is misread even when it is legible. (our claim)
175
+ origin: hypothesis
176
+ status: hypothesis
177
+ hypothesis: H1
178
+ source: >-
179
+ Our claim: the size is the round starting value of H1, set before any chart was measured. Related reading, not the source of the size and never a reason to move it: Government Analysis Function (UK), Data visualisation: charts, https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-charts/ (section "Chart labels", opened 2026-11-26) asks for a large enough font for all labels, says it is not possible to suggest a specific minimum font size because images are resized when published, asks for horizontal text on axes, and for separators of thousands.
180
+ when_to_break: >-
181
+ A dense chart for a large screen only (a control room wall) may set smaller labels, declared with break-a-rule first, when the page never runs at a small width.
182
+ break_effect: >-
183
+ More labels fit, at the cost of the readers who view the chart closer or smaller than planned.
184
+ test: >-
185
+ The reviewer reads the font size of chart labels in the code at the smallest width against H1 and checks that every number has a unit and the audience's format; the first look on the rendered page at the smallest width says whether the labels can be read. check-design reads the rendered size of svg chart labels (DR2).
186
+ example: >-
187
+ An axis that reads "R$ 1.200 mil" for a Brazilian audience, with tick labels that stay the same size when the chart narrows.
188
+ counterexample: >-
189
+ An svg chart scaled with its viewBox, whose tick labels shrink to a blur on a phone and read "1200000" with no unit.
@@ -0,0 +1,141 @@
1
+ # Dashboards. Many charts and key numbers on one screen that answer named questions for a named person. These
2
+ # rules are for the moment the dashboard is made; each of its charts also follows charts.yaml. The reviewer judges
3
+ # them from the code and the rendered page, and the first look says what the dashboard shows first.
4
+
5
+ - id: DD1
6
+ name: Named questions for a named person, the most important first
7
+ area: data
8
+ moment: create
9
+ skill: lazuli-data-charts-and-dashboards
10
+ rule: >-
11
+ Before laying out panels, write who reads the dashboard and the questions they come to answer, in order of importance. Each panel answers one of those questions, and the panel of the most important question comes first in reading order (top left in a left to right language). A panel that answers no named question is left out.
12
+ why: >-
13
+ A dashboard built from the data that happens to exist shows everything with equal weight, and the person has to search it for the answer they came for; one built from their questions puts the answer where the eye starts. (our claim)
14
+ origin: hypothesis
15
+ source: >-
16
+ Our claim: no page opened on 2026-11-26 states this for dashboards. It extends to a screen of charts what the chart guidance says of one chart: Government Analysis Function (UK), Data visualisation: charts, https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-charts/ (section "What is the message?", opened 2026-11-26) asks to decide the message before choosing the chart.
17
+ when_to_break: >-
18
+ A monitoring wall whose every panel matters equally (a status board of servers) may give every panel the same weight, declared with break-a-rule first, and still names the person and the questions.
19
+ break_effect: >-
20
+ Nothing is ranked above anything else, at the cost of no starting point for the eye.
21
+ test: >-
22
+ The reviewer asks for the named person and questions, matches each panel to a question and checks the reading order; the first look on the rendered page says what it saw first, and the reviewer compares it with the most important question.
23
+ example: >-
24
+ A sales manager's dashboard whose first panel answers "are we on target this month?" and whose last answers "which product is slipping?".
25
+ counterexample: >-
26
+ A grid of every chart the database can produce, in the order the tables were created.
27
+
28
+ - id: DD2
29
+ name: A key number comes with its comparison
30
+ area: data
31
+ moment: create
32
+ skill: lazuli-data-charts-and-dashboards
33
+ rule: >-
34
+ Every key number on a dashboard is shown next to what it is compared with: its target, the previous period, the same period last year, or a benchmark, with the difference written out and its direction named in words or a sign as well as color. A number shown alone is not a key number.
35
+ why: >-
36
+ A number alone cannot be judged: the reader cannot tell whether it is good, bad or normal without its comparison, so the dashboard gives data without an answer. (our claim)
37
+ origin: hypothesis
38
+ source: >-
39
+ Our claim: no page opened on 2026-11-26 states this for key numbers. Related reading: Government Analysis Function (UK), Data visualisation: charts, https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-charts/ (section "Considerations for line charts", "Breaking the y-axis", opened 2026-11-26) shows a chart improved by adding a target line as context.
40
+ when_to_break: >-
41
+ A number that has no meaningful comparison yet (the first month of a new product) may stand alone, declared with break-a-rule first, saying when its comparison arrives.
42
+ break_effect: >-
43
+ The number is shown as soon as it exists, at the cost of a reading the person cannot judge.
44
+ test: >-
45
+ The reviewer lists every key number of the dashboard and checks that each has a comparison and a written difference; a lone number is a finding.
46
+ example: >-
47
+ "Revenue this month: R$ 412 mil, target R$ 450 mil, below by R$ 38 mil".
48
+ counterexample: >-
49
+ A large "R$ 412 mil" in a tile with a green arrow and nothing to compare it with.
50
+
51
+ - id: DD3
52
+ name: The same measure looks the same in every panel
53
+ area: data
54
+ moment: create
55
+ skill: lazuli-data-charts-and-dashboards
56
+ rule: >-
57
+ A measure keeps one color, one scale and one number format in every panel where it appears, and a category keeps its color across panels. Small multiples share their axes, so their marks can be compared directly; when a panel needs another scale, its axis says so.
58
+ why: >-
59
+ Readers carry what they learned in one panel to the next: a color that changes meaning, or two panels with different scales side by side, make them compare things that are not comparable.
60
+ origin: source
61
+ source: >-
62
+ Government Analysis Function (UK), Data visualisation: charts, publication date 19 May 2022, https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-charts/ (section "Considerations for line charts", "Alternative example: small multiples", opened 2026-11-26): in small multiple charts it is essential for all the y-axes to have the same scale to avoid misunderstandings. That the same holds for color, scale and number format across the panels of a dashboard is our claim.
63
+ when_to_break: >-
64
+ Small multiples whose values differ so much that a shared axis flattens all but one may use free axes, declared with break-a-rule first, with each axis labelled and the difference stated above them.
65
+ break_effect: >-
66
+ The shape of every series shows, at the cost of comparisons across panels that the reader must not make.
67
+ test: >-
68
+ The reviewer lists the measures and categories that appear in more than one panel and compares their color, scale and format in the code; the reviewer also checks that small multiples share their axes.
69
+ example: >-
70
+ Six regional line charts with the same value axis, each region in the same color it has on the map panel.
71
+ counterexample: >-
72
+ A dashboard where revenue is blue in one panel and orange in the next, in thousands in one and in millions in the other.
73
+
74
+ - id: DD4
75
+ name: Nothing decorates the data
76
+ area: data
77
+ moment: create
78
+ skill: lazuli-data-charts-and-dashboards
79
+ rule: >-
80
+ Draw only what carries a value: no 3D shapes, no shadows, no textures, no ornamental gauges or dials, no shaded backgrounds or boxes around panels and legends that separate nothing, no thick or dark gridlines. Brand and personality go in the frame of the dashboard (type, the color of the highlight), never into the marks.
81
+ why: >-
82
+ Decoration competes with the data for the eye and, in 3D or in gauges, distorts the lengths and angles the reader compares.
83
+ origin: source
84
+ source: >-
85
+ Government Analysis Function (UK), Data visualisation: charts, publication date 19 May 2022, https://analysisfunction.civilservice.gov.uk/policy-store/data-visualisation-charts/ (section "Formatting charts", "Keep it simple", opened 2026-11-26): avoid shaded backgrounds, unnecessary borders, boxes around legends and other content, patterns, textures and shadows, 3D shapes, unnecessary data markers on line charts, thick or dark gridlines. That ornamental gauges and dials belong to the same list is our claim.
86
+ when_to_break: >-
87
+ A single gauge for a value with a fixed, known range (a fuel level on a vehicle screen) may stay, declared with break-a-rule first, when its range and current value are written as text too.
88
+ break_effect: >-
89
+ A familiar picture of the range, at the cost of space and a slower reading than a bar.
90
+ test: >-
91
+ The reviewer lists the visual effects in each panel's code (3D, shadows, gradients on marks, gauges, boxes, dark gridlines) and names the value each carries; an effect that carries none is a finding.
92
+ example: >-
93
+ Flat bars on a white panel with light grey gridlines, the brand showing only in the title type and the highlight color.
94
+ counterexample: >-
95
+ A 3D pie with a drop shadow next to three chrome speedometer gauges.
96
+
97
+ - id: DD5
98
+ name: Every panel has its empty, loading and error states
99
+ area: data
100
+ moment: create
101
+ skill: lazuli-data-charts-and-dashboards
102
+ rule: >-
103
+ Design each panel's states as well as its full one, with `lazuli-ui-states-and-system`: loading (the panel's frame stays in place), empty (says why there is no data and what makes it appear), error (says what failed and what the person can do), and partial or stale data (says the time of the last update). A panel never shows a blank chart or an axis with nothing on it as if it were data.
104
+ why: >-
105
+ Real data is late, missing or wrong often; a panel with no designed state shows a blank or a zero line that the person reads as a real value, and a layout that jumps while panels load loses their place. (our claim)
106
+ origin: hypothesis
107
+ source: >-
108
+ Our claim: no page opened on 2026-11-26 states this for dashboard panels. The states themselves are the component states of the ui area, designed with the skill named in the rule.
109
+ when_to_break: >-
110
+ A panel fed by a value that is always present (a clock) may skip the empty state, declared with break-a-rule first; the error state stays.
111
+ break_effect: >-
112
+ Less to design, at the cost of an undefined screen if the value ever goes missing.
113
+ test: >-
114
+ The reviewer finds the loading, empty, error and stale states of each panel in the code and checks what each says; a panel with only its full state is a finding.
115
+ example: >-
116
+ A revenue panel that, with no sales yet, says "No sales yet this month. Sales appear here within an hour of the first order."
117
+ counterexample: >-
118
+ A chart that renders an empty axis with a flat line on the zero mark when the request fails.
119
+
120
+ - id: DD6
121
+ name: At the smallest width the panels stack in their order
122
+ area: data
123
+ moment: create
124
+ skill: lazuli-data-charts-and-dashboards
125
+ rule: >-
126
+ At the smallest width the dashboard runs at, the panels stack in one column in the order of DD1, the most important first, and each chart keeps its labels readable (DC8) instead of shrinking to fit; a chart too wide to read becomes a simpler form, a table, or scrolls inside its own box with its labels in view.
127
+ why: >-
128
+ A grid shrunk to a phone keeps every panel and loses every label; stacking keeps the order of the questions, so the first screen still answers the most important one. (our claim)
129
+ origin: hypothesis
130
+ source: >-
131
+ Our claim: no page opened on 2026-11-26 states this for dashboards. It applies to a dashboard the order of DD1 and the label rule of DC8.
132
+ when_to_break: >-
133
+ A dashboard that never runs below a desktop width (an internal wall screen) may skip the stacked layout, declared with break-a-rule first, saying the widths it supports.
134
+ break_effect: >-
135
+ One layout to design, at the cost of anyone who opens it on a phone.
136
+ test: >-
137
+ The reviewer renders the dashboard at the smallest width and checks the order of the panels against DD1; the first look at that width says what it saw first and whether the labels can be read.
138
+ example: >-
139
+ On a phone, the "are we on target?" panel fills the first screen, and the regional charts follow one per row with the same label size.
140
+ counterexample: >-
141
+ A four column grid scaled down whole to a phone, with every chart the size of a stamp.