@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.
- package/CHANGELOG.md +120 -0
- package/LICENSE +21 -0
- package/README.md +202 -2
- package/agents/lazuli-design-reviewer.md +30 -0
- package/agents/lazuli-first-look.md +22 -0
- package/agents/lazuli-task-tester.md +25 -0
- package/bin/lazuli.mjs +747 -0
- package/package.json +11 -4
- package/rules/accessibility/HYPOTHESES.md +8 -0
- package/rules/accessibility/_area.yaml +7 -0
- package/rules/accessibility/operable.yaml +100 -0
- package/rules/accessibility/perceivable.yaml +153 -0
- package/rules/accessibility/robust.yaml +24 -0
- package/rules/accessibility/understandable.yaml +72 -0
- package/rules/color/HYPOTHESES.md +27 -0
- package/rules/color/_area.yaml +10 -0
- package/rules/color/adapt.yaml +183 -0
- package/rules/color/create.yaml +259 -0
- package/rules/color/review.yaml +215 -0
- package/rules/color/signal.yaml +196 -0
- package/rules/content/HYPOTHESES.md +19 -0
- package/rules/content/_area.yaml +8 -0
- package/rules/content/review.yaml +378 -0
- package/rules/content/voice.yaml +144 -0
- package/rules/content/writing.yaml +202 -0
- package/rules/data/HYPOTHESES.md +11 -0
- package/rules/data/_area.yaml +7 -0
- package/rules/data/charts.yaml +189 -0
- package/rules/data/dashboards.yaml +141 -0
- package/rules/data/review.yaml +159 -0
- package/rules/graphic/HYPOTHESES.md +18 -0
- package/rules/graphic/_area.yaml +8 -0
- package/rules/graphic/identity.yaml +141 -0
- package/rules/graphic/pieces.yaml +164 -0
- package/rules/graphic/review.yaml +271 -0
- package/rules/graphic/symbol.yaml +141 -0
- package/rules/motion/HYPOTHESES.md +19 -0
- package/rules/motion/_area.yaml +7 -0
- package/rules/motion/micro.yaml +143 -0
- package/rules/motion/review.yaml +347 -0
- package/rules/motion/transitions.yaml +169 -0
- package/rules/typography/HYPOTHESES.md +12 -0
- package/rules/typography/_area.yaml +8 -0
- package/rules/typography/adapt.yaml +45 -0
- package/rules/typography/create.yaml +126 -0
- package/rules/typography/review.yaml +127 -0
- package/rules/ui/HYPOTHESES.md +23 -0
- package/rules/ui/_area.yaml +9 -0
- package/rules/ui/compose.yaml +246 -0
- package/rules/ui/grid.yaml +75 -0
- package/rules/ui/review.yaml +400 -0
- package/rules/ui/states.yaml +257 -0
- package/rules/ux/HYPOTHESES.md +13 -0
- package/rules/ux/_area.yaml +8 -0
- package/rules/ux/flows.yaml +164 -0
- package/rules/ux/forms.yaml +142 -0
- package/rules/ux/review.yaml +186 -0
- package/skills/lazuli/SKILL.md +183 -0
- package/skills/lazuli/procedures/create.md +29 -0
- package/skills/lazuli/procedures/explain-decisions.md +22 -0
- package/skills/lazuli/procedures/improve.md +30 -0
- package/skills/lazuli/procedures/remember-this.md +41 -0
- package/skills/lazuli/procedures/review-design.md +36 -0
- package/skills/lazuli/procedures/show-options.md +33 -0
- package/skills/lazuli-accessibility-check/SKILL.md +68 -0
- package/skills/lazuli-color-context-and-culture/SKILL.md +53 -0
- package/skills/lazuli-color-context-and-culture/references/sectors.md +26 -0
- package/skills/lazuli-color-palette-by-intent/SKILL.md +54 -0
- package/skills/lazuli-color-palette-by-intent/references/intent-chords.md +51 -0
- package/skills/lazuli-color-screen-review/SKILL.md +51 -0
- package/skills/lazuli-color-states-and-signals/SKILL.md +53 -0
- package/skills/lazuli-content-interface-writing/SKILL.md +53 -0
- package/skills/lazuli-content-voice/SKILL.md +40 -0
- package/skills/lazuli-data-charts-and-dashboards/SKILL.md +59 -0
- package/skills/lazuli-graphic-derived-pieces/SKILL.md +40 -0
- package/skills/lazuli-graphic-derived-pieces/references/piece-template.html +24 -0
- package/skills/lazuli-graphic-identity/SKILL.md +45 -0
- package/skills/lazuli-motion-micro-and-transitions/SKILL.md +49 -0
- package/skills/lazuli-typography-choose-and-pair/SKILL.md +50 -0
- package/skills/lazuli-typography-screen-review/SKILL.md +51 -0
- package/skills/lazuli-ui-composition/SKILL.md +42 -0
- package/skills/lazuli-ui-composition/references/option-template.html +34 -0
- package/skills/lazuli-ui-layout-review/SKILL.md +47 -0
- package/skills/lazuli-ui-states-and-system/SKILL.md +54 -0
- package/skills/lazuli-ux-flows-and-forms/SKILL.md +51 -0
- package/skills/lazuli-ux-task-test/SKILL.md +44 -0
- package/src/browser.mjs +162 -0
- package/src/commands/capture.mjs +313 -0
- package/src/commands/catalog.mjs +37 -0
- package/src/commands/check-design.mjs +463 -0
- package/src/commands/check-goals.mjs +57 -0
- package/src/commands/compare-designs.mjs +160 -0
- package/src/commands/draft-memo.mjs +162 -0
- package/src/commands/hooks.mjs +345 -0
- package/src/commands/install-hooks.mjs +120 -0
- package/src/commands/install.mjs +132 -0
- package/src/commands/list-rules.mjs +49 -0
- package/src/commands/map-page.mjs +594 -0
- package/src/commands/record-answers.mjs +79 -0
- package/src/commands/record-log.mjs +325 -0
- package/src/commands/record-task.mjs +250 -0
- package/src/commands/render-options.mjs +227 -0
- package/src/commands/start-project.mjs +32 -0
- package/src/measure/a11y.mjs +391 -0
- package/src/measure/asset.mjs +206 -0
- package/src/measure/at-rest.mjs +49 -0
- package/src/measure/cases.mjs +566 -0
- package/src/measure/chart-read.mjs +401 -0
- package/src/measure/chart.mjs +264 -0
- package/src/measure/coherence.mjs +145 -0
- package/src/measure/color.mjs +86 -0
- package/src/measure/content.mjs +82 -0
- package/src/measure/cvd.mjs +24 -0
- package/src/measure/extreme.mjs +241 -0
- package/src/measure/forms.mjs +150 -0
- package/src/measure/in-page/a11y.js +522 -0
- package/src/measure/in-page/color.js +348 -0
- package/src/measure/in-page/composition.js +1496 -0
- package/src/measure/in-page/contrast.js +15 -0
- package/src/measure/in-page/cvd.js +173 -0
- package/src/measure/in-page/extreme.js +377 -0
- package/src/measure/in-page/frames.js +781 -0
- package/src/measure/in-page/look.js +28 -0
- package/src/measure/in-page/motion-probe.js +171 -0
- package/src/measure/in-page/style.js +107 -0
- package/src/measure/in-page/svg-strokes.js +112 -0
- package/src/measure/in-page/svg-uses.js +50 -0
- package/src/measure/in-page/symbol.js +123 -0
- package/src/measure/in-page/type.js +269 -0
- package/src/measure/in-page/weight.js +207 -0
- package/src/measure/layout.mjs +100 -0
- package/src/measure/motion.mjs +509 -0
- package/src/measure/piece.mjs +195 -0
- package/src/measure/registry.mjs +253 -0
- package/src/measure/rhythm.mjs +81 -0
- package/src/measure/signature.mjs +65 -0
- package/src/measure/states.mjs +240 -0
- package/src/measure/style.mjs +13 -0
- package/src/measure/symbol.mjs +268 -0
- package/src/measure/terms.mjs +153 -0
- package/src/measure/tiles.mjs +20 -0
- package/src/measure/timeline.mjs +621 -0
- package/src/measure/type.mjs +167 -0
- package/src/measure/weight.mjs +18 -0
- package/src/private-strings.mjs +81 -0
- package/src/project/blind.mjs +70 -0
- package/src/project/edits.mjs +154 -0
- package/src/project/gate.mjs +168 -0
- package/src/project/lazuli-md.mjs +521 -0
- package/src/project/log.mjs +335 -0
- package/src/project/match.mjs +200 -0
- package/src/project/records.mjs +380 -0
- package/src/project/tasks.mjs +153 -0
- package/src/report/evaluate.mjs +27 -0
- package/src/report/evaluators/a11y.mjs +227 -0
- package/src/report/evaluators/chart.mjs +151 -0
- package/src/report/evaluators/coherence.mjs +103 -0
- package/src/report/evaluators/color.mjs +133 -0
- package/src/report/evaluators/content.mjs +112 -0
- package/src/report/evaluators/extreme.mjs +87 -0
- package/src/report/evaluators/forms.mjs +116 -0
- package/src/report/evaluators/layout.mjs +103 -0
- package/src/report/evaluators/motion.mjs +280 -0
- package/src/report/evaluators/piece.mjs +69 -0
- package/src/report/evaluators/rhythm.mjs +99 -0
- package/src/report/evaluators/states.mjs +39 -0
- package/src/report/evaluators/style.mjs +35 -0
- package/src/report/evaluators/symbol.mjs +110 -0
- package/src/report/evaluators/terms.mjs +49 -0
- package/src/report/evaluators/type.mjs +166 -0
- package/src/report/evaluators/weight.mjs +51 -0
- package/src/report/evidence.mjs +4 -0
- package/src/report/finding.mjs +11 -0
- package/src/report/format.mjs +215 -0
- package/src/rules/hypotheses.mjs +28 -0
- package/src/rules/load.mjs +274 -0
- package/src/rules/public-text.mjs +56 -0
- package/src/rules/schema.mjs +220 -0
- package/templates/LAZULI.md +88 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Forms. What a form asks and how it asks it: labels, input types, autofill tokens, required marks,
|
|
2
|
+
# error links and the number of questions. These rules are for the moment the form is designed.
|
|
3
|
+
# The CLI reads forms without typing into them or submitting them; the reviewer judges the rest.
|
|
4
|
+
# That every field has an accessible name at all is AR1 (accessibility); these rules add the visible design.
|
|
5
|
+
|
|
6
|
+
- id: XM1
|
|
7
|
+
name: Every field has a visible label, a placeholder is not one
|
|
8
|
+
area: ux
|
|
9
|
+
moment: create
|
|
10
|
+
skill: lazuli-ux-flows-and-forms
|
|
11
|
+
rule: >-
|
|
12
|
+
Give every field a label that stays visible while the person types, above or beside the field. Placeholder text is not a label and is not the place for hints or examples. That the field has an accessible name at all is AR1; this rule asks that the name be seen.
|
|
13
|
+
why: >-
|
|
14
|
+
A placeholder disappears as soon as the person types, so they cannot check their answers, recover from an error or remember what a field wanted; some screen readers do not announce it, and its default gray often fails contrast.
|
|
15
|
+
origin: source
|
|
16
|
+
source: >-
|
|
17
|
+
GOV.UK Design System, Text input, https://design-system.service.gov.uk/components/text-input/ (sections "Labels" and "Avoid placeholder text", opened 2026-11-25): all text inputs must have labels, in most cases visible; do not use placeholder text in place of a label or for hints. Nielsen Norman Group, Placeholders in Form Fields Are Harmful, https://www.nngroup.com/articles/form-design-placeholders/ (sections "Placeholders That Replace Labels" and "Placeholders and Accessibility", opened 2026-11-25). W3C, Understanding SC 3.3.2 Labels or Instructions, https://www.w3.org/WAI/WCAG22/Understanding/labels-or-instructions.html (section "Intent", opened 2026-11-25): labels or instructions need to be persistently available; the page does not say a placeholder fails the criterion.
|
|
18
|
+
when_to_break: >-
|
|
19
|
+
A single search field in a header, whose purpose the magnifier icon and the button next to it make plain, may show its label only to screen readers, declared with break-a-rule first. AR1 still applies.
|
|
20
|
+
break_effect: >-
|
|
21
|
+
The header stays compact, and the cost is small because the field has one well-known purpose.
|
|
22
|
+
test: >-
|
|
23
|
+
check-design runs the forms measurer at review (XR1) and lists, as a hint, the fields with no visible label. The reviewer checks floating labels and labels drawn by a script in the capture.
|
|
24
|
+
example: >-
|
|
25
|
+
A field labeled "E-mail" above it, with "We only use it to confirm the booking" as a hint below the label.
|
|
26
|
+
counterexample: >-
|
|
27
|
+
A field whose only label is the gray text "Your e-mail" inside it, gone at the first keystroke.
|
|
28
|
+
|
|
29
|
+
- id: XM2
|
|
30
|
+
name: The input type and keyboard match the data
|
|
31
|
+
area: ux
|
|
32
|
+
moment: create
|
|
33
|
+
skill: lazuli-ux-flows-and-forms
|
|
34
|
+
rule: >-
|
|
35
|
+
Use the input type and the inputmode that match the data, so a phone keyboard shows the right keys: type email for an e-mail, type tel for a phone, inputmode numeric for digits that are not a quantity (a postal code, a document number) and inputmode decimal for amounts with decimals.
|
|
36
|
+
why: >-
|
|
37
|
+
The right keyboard saves the person from switching layouts on a phone and cuts typing errors, at no cost on a desktop.
|
|
38
|
+
origin: source
|
|
39
|
+
source: >-
|
|
40
|
+
WHATWG HTML Living Standard, 6.8.9 Input modalities: the inputmode attribute, https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute (opened 2026-11-25): inputmode hints which virtual keyboard to show (text, tel, url, email, numeric, decimal, search, none); without it the browser chooses from the type. GOV.UK Design System, Text input, https://design-system.service.gov.uk/components/text-input/ (sections on numbers, opened 2026-11-25): inputmode numeric for whole numbers, decimal for decimals, and avoid type number unless research shows a need. That a wrong keyboard causes typing errors, and that the right one costs nothing on a desktop, are our claim.
|
|
41
|
+
when_to_break: >-
|
|
42
|
+
A field that accepts letters and digits mixed (a promo code, a postal code with letters) keeps the text keyboard, declared with break-a-rule first.
|
|
43
|
+
break_effect: >-
|
|
44
|
+
The person can type every character the field accepts without switching keyboards back.
|
|
45
|
+
test: >-
|
|
46
|
+
check-design runs the forms measurer at review (XR3) and lists, as a hint, the fields whose name or label reads as e-mail, phone or a number while their type and inputmode do not. The reviewer confirms on a phone width capture.
|
|
47
|
+
example: >-
|
|
48
|
+
A CEP field with inputmode numeric and a phone field with type tel.
|
|
49
|
+
counterexample: >-
|
|
50
|
+
An e-mail field of type text, so the phone keyboard has no at sign on its first screen.
|
|
51
|
+
|
|
52
|
+
- id: XM3
|
|
53
|
+
name: Data about the person carries its autocomplete token
|
|
54
|
+
area: ux
|
|
55
|
+
moment: create
|
|
56
|
+
skill: lazuli-ux-flows-and-forms
|
|
57
|
+
rule: >-
|
|
58
|
+
Every field that collects information about the person (name, e-mail, phone, address, postal code, birthday, company) carries the autocomplete token for its purpose, for example autocomplete="email" or autocomplete="postal-code". Fields about something else (an amount, a message) do not need one.
|
|
59
|
+
why: >-
|
|
60
|
+
The token lets the browser fill the field and lets assistive tools show its purpose in a form the person knows, which saves typing, most of all for people with memory or motor disabilities.
|
|
61
|
+
origin: norm
|
|
62
|
+
source: >-
|
|
63
|
+
W3C, Understanding SC 1.3.5 Identify Input Purpose (level AA), https://www.w3.org/WAI/WCAG22/Understanding/identify-input-purpose.html (sections "Success Criterion", "Intent" and the note on information about the user, opened 2026-11-25): the purpose of each field collecting information about the user can be programmatically determined; the autocomplete attribute is the technique; fields not about the user need not expose it. WHATWG HTML Living Standard, 4.10.19.7.1 Autofilling form controls: the autocomplete attribute, https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill (opened 2026-11-25): the token list, among them name, given-name, family-name, email, tel, tel-national, street-address, address-line1, postal-code, address-level2, organization, bday. GOV.UK Design System, Text input, https://design-system.service.gov.uk/components/text-input/ (section on autocomplete, opened 2026-11-25).
|
|
64
|
+
when_to_break: >-
|
|
65
|
+
The criterion leaves no room for a field about the person: a declared break never waives it. A form may still turn browser autofill off for one field (a one-time code) when that field is not information about the person.
|
|
66
|
+
break_effect: >-
|
|
67
|
+
No effect is bought by leaving the token out of a personal field; the person types again what the browser already knows.
|
|
68
|
+
test: >-
|
|
69
|
+
check-design runs the forms measurer at review (XR2) and lists, as a hint, the fields whose name or label reads as personal data and that carry no matching token (reading the purpose from words is a guess). The reviewer confirms each one.
|
|
70
|
+
example: >-
|
|
71
|
+
input type email autocomplete email, and a CEP field with autocomplete postal-code.
|
|
72
|
+
counterexample: >-
|
|
73
|
+
A delivery form whose name, phone and address fields carry no autocomplete attribute.
|
|
74
|
+
|
|
75
|
+
- id: XM4
|
|
76
|
+
name: Required and optional are marked one way across the form
|
|
77
|
+
area: ux
|
|
78
|
+
moment: create
|
|
79
|
+
skill: lazuli-ux-flows-and-forms
|
|
80
|
+
rule: >-
|
|
81
|
+
Mark required or optional fields in one way, in the label, the same on every step of the form. Mark the smaller group: when most fields are required, mark the optional ones with "(optional)"; when most are optional, mark the required ones with the word "(required)" in the label, not an asterisk alone (GOV.UK, the source below, marks only optional fields and never uses asterisks; marking required fields at all is our departure from it). Never mix both kinds of mark in one form.
|
|
82
|
+
why: >-
|
|
83
|
+
A consistent mark lets the person see at a glance what they may skip; marking the smaller group keeps the labels quiet. A mark that changes between steps makes them guess. (the last two clauses are our claim)
|
|
84
|
+
origin: source
|
|
85
|
+
source: >-
|
|
86
|
+
GOV.UK Design System, Question pages, https://design-system.service.gov.uk/patterns/question-pages/ (section on optional and mandatory fields, opened 2026-11-25): add "(optional)" to the label of optional fields and never mark mandatory fields with asterisks. W3C, Understanding SC 3.3.2 Labels or Instructions, https://www.w3.org/WAI/WCAG22/Understanding/labels-or-instructions.html (techniques H90 and ARIA2, opened 2026-11-25): required controls can be indicated in the label or legend. Marking the smaller group, and allowing a required mark when required fields are few, are our claim and depart from GOV.UK, which marks only optional fields.
|
|
87
|
+
when_to_break: >-
|
|
88
|
+
A form where every field is required may carry no mark at all, with one line above the form saying so, declared with break-a-rule first.
|
|
89
|
+
break_effect: >-
|
|
90
|
+
The labels stay clean, and the one line does the work of every mark.
|
|
91
|
+
test: >-
|
|
92
|
+
check-design runs the forms measurer at review (XR4) and lists, as a hint, forms that mix required and optional marks. The reviewer checks that the mark is the same on every step.
|
|
93
|
+
example: >-
|
|
94
|
+
A signup of five required fields and one field labeled "Company (optional)".
|
|
95
|
+
counterexample: >-
|
|
96
|
+
A form with asterisks on some required fields, "(optional)" on one field and no mark on the rest.
|
|
97
|
+
|
|
98
|
+
- id: XM5
|
|
99
|
+
name: An error message is tied to its field and says the fix
|
|
100
|
+
area: ux
|
|
101
|
+
moment: create
|
|
102
|
+
skill: lazuli-ux-flows-and-forms
|
|
103
|
+
rule: >-
|
|
104
|
+
Tie each error message to its field in the markup, with aria-describedby (listing the hint and the error) or with aria-errormessage on a field marked aria-invalid, and write the message so it says how to fix the answer. XF6 covers where the message sits and that the input is kept.
|
|
105
|
+
why: >-
|
|
106
|
+
A message that is linked is read out when the person reaches the field, so a screen reader user hears the problem where it is; a message that names the fix saves them a guess.
|
|
107
|
+
origin: source
|
|
108
|
+
source: >-
|
|
109
|
+
W3C, WAI-ARIA 1.2, https://www.w3.org/TR/wai-aria-1.2/ (property definitions aria-describedby and aria-errormessage, opened 2026-11-25): aria-describedby identifies the element or elements that describe the object; aria-errormessage identifies the element that provides an error message for an object, see aria-invalid. GOV.UK Design System, Error message, https://design-system.service.gov.uk/components/error-message/ (opened 2026-11-25): explain what went wrong and how to fix it; the examples link hint and error to the input with aria-describedby. W3C, Understanding SC 3.3.3 Error Suggestion, https://www.w3.org/WAI/WCAG22/Understanding/error-suggestion.html (opened 2026-11-25): a known correction is suggested. That a linked message is read out at the field is our claim about screen readers.
|
|
110
|
+
when_to_break: >-
|
|
111
|
+
None that the person benefits from: an error the form detects is always tied to its field. What a designer can vary is the wording and whether a summary at the top repeats it.
|
|
112
|
+
break_effect: >-
|
|
113
|
+
No effect is bought by an unlinked message.
|
|
114
|
+
test: >-
|
|
115
|
+
check-design runs the forms measurer at review (XR5) on a rendered error state (staged on a local run) and lists, as a hint, invalid fields with no linked message. The reviewer reads each message for the fix.
|
|
116
|
+
example: >-
|
|
117
|
+
An e-mail field with aria-invalid true and aria-describedby pointing to "Enter an e-mail address in the correct format, like name@example.com".
|
|
118
|
+
counterexample: >-
|
|
119
|
+
A red "Required" paragraph at the end of the form, not linked to any field.
|
|
120
|
+
|
|
121
|
+
- id: XM6
|
|
122
|
+
name: Ask only what the task needs
|
|
123
|
+
area: ux
|
|
124
|
+
moment: create
|
|
125
|
+
skill: lazuli-ux-flows-and-forms
|
|
126
|
+
rule: >-
|
|
127
|
+
Keep in the form only the fields the task needs; each other field goes, or moves after the task (XF7), or becomes optional and marked so (XM4). Before adding a field, write why it is asked. XF2 applies the same test to the steps of the whole flow.
|
|
128
|
+
why: >-
|
|
129
|
+
Every field is work the person must do before the task is done, and a form that looks long is abandoned before it is started. (the second clause is our claim)
|
|
130
|
+
origin: source
|
|
131
|
+
source: >-
|
|
132
|
+
GOV.UK Design System, Question pages, https://design-system.service.gov.uk/patterns/question-pages/ (section on asking only what you need, opened 2026-11-25): make sure you know why you are asking every question and check each is needed with a question protocol. GOV.UK Service Manual, Designing good questions, https://www.gov.uk/service-manual/design/designing-good-questions (opened 2026-11-25): know why you are asking every question. No opened page gives a number of fields; any count the kit uses is a hypothesis.
|
|
133
|
+
when_to_break: >-
|
|
134
|
+
A form whose task is the information itself (an insurance quote, a tax return) asks many questions, declared with break-a-rule first, split into short steps.
|
|
135
|
+
break_effect: >-
|
|
136
|
+
The person gets an exact answer at the end, and the steps keep the length from showing all at once.
|
|
137
|
+
test: >-
|
|
138
|
+
check-design runs the forms measurer at review (XR6) and gives a hint when a form asks many questions. The reviewer checks that each field has a written reason.
|
|
139
|
+
example: >-
|
|
140
|
+
A newsletter signup with one e-mail field.
|
|
141
|
+
counterexample: >-
|
|
142
|
+
A newsletter signup asking for name, phone, city and date of birth.
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Measured form checks and the simulated task. XR1 to XR6 read the forms report of the render (the forms
|
|
2
|
+
# measurer reads a page at rest and never types into a field or submits a form) and give a hint, never a
|
|
3
|
+
# verdict: reading a field's purpose or a visible label from the page is a guess, so each one is a
|
|
4
|
+
# hypothesis with its own id in HYPOTHESES.md until the A/B shows it helps. XR7 is the simulated task.
|
|
5
|
+
|
|
6
|
+
- id: XR1
|
|
7
|
+
name: Every field has a visible label
|
|
8
|
+
area: ux
|
|
9
|
+
moment: review
|
|
10
|
+
skill: lazuli-ux-flows-and-forms
|
|
11
|
+
rule: >-
|
|
12
|
+
Check that every named field of the page shows a label a person can see (XM1). A placeholder, a title or an aria-label alone is not a visible label, and neither is a label hidden from sight (sr-only, clipped, inside a collapsed parent). A field with no name at all is AR1's and is left out of this count.
|
|
13
|
+
why: >-
|
|
14
|
+
A field whose only label is a placeholder or a name for screen readers leaves a sighted person guessing what it wants once they start typing.
|
|
15
|
+
origin: source
|
|
16
|
+
status: hypothesis
|
|
17
|
+
hypothesis: H1
|
|
18
|
+
source: >-
|
|
19
|
+
GOV.UK Design System, Text input, https://design-system.service.gov.uk/components/text-input/ (sections "Labels" and "Avoid placeholder text", opened 2026-11-25): all text inputs must have labels, in most cases visible; do not use placeholder text in place of a label. Nielsen Norman Group, Placeholders in Form Fields Are Harmful, https://www.nngroup.com/articles/form-design-placeholders/ (section "Placeholders That Replace Labels", opened 2026-11-25). Reading from the render which label a person sees, and listing a field whose name comes from a placeholder, title, aria-label or hidden label alone, is our claim; no number is used as a cutoff (H1).
|
|
20
|
+
measure: forms.labels
|
|
21
|
+
when_to_break: >-
|
|
22
|
+
A single search field in a header whose purpose the icon and the button make plain, declared with break-a-rule first (XM1).
|
|
23
|
+
break_effect: >-
|
|
24
|
+
The header stays compact, and the cost is small because the field has one well-known purpose.
|
|
25
|
+
test: >-
|
|
26
|
+
check-design runs the forms measurer at review and lists, as a hint, the named fields with no visible label and where their name comes from. The reviewer checks floating labels and labels drawn by a script in the capture.
|
|
27
|
+
example: >-
|
|
28
|
+
A signup whose every field has its label painted above it.
|
|
29
|
+
counterexample: >-
|
|
30
|
+
A signup whose e-mail field is named only by its placeholder and whose password label is sr-only.
|
|
31
|
+
|
|
32
|
+
- id: XR2
|
|
33
|
+
name: Data about the person carries its autocomplete token
|
|
34
|
+
area: ux
|
|
35
|
+
moment: review
|
|
36
|
+
skill: lazuli-ux-flows-and-forms
|
|
37
|
+
rule: >-
|
|
38
|
+
Check that every field that asks for data about the person carries the autocomplete token for its purpose (XM3). The purpose is guessed from the field's type and from the words of its name, id and label (company, e-mail, phone, postal code, address, city, birthday, name); a field whose words name no purpose is not checked. Boxes to tick, radios, files, sliders and color pickers are not checked.
|
|
39
|
+
why: >-
|
|
40
|
+
A personal field without its token makes the person type again what the browser already knows, and hides its purpose from assistive tools.
|
|
41
|
+
origin: source
|
|
42
|
+
status: hypothesis
|
|
43
|
+
hypothesis: H2
|
|
44
|
+
source: >-
|
|
45
|
+
W3C, Understanding SC 1.3.5 Identify Input Purpose (level AA), https://www.w3.org/WAI/WCAG22/Understanding/identify-input-purpose.html (sections "Success Criterion", "Intent" and the note on information about the user, opened 2026-11-25): the purpose of each field collecting information about the user can be programmatically determined; the autocomplete attribute is the technique. WHATWG HTML Living Standard, 4.10.19.7.1 Autofilling form controls: the autocomplete attribute, https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill (opened 2026-11-25): the token list. The criterion is a norm (XM3), but guessing a field's purpose from its words is our claim, so this check is a hint and never a fail; no number is used as a cutoff (H2).
|
|
46
|
+
measure: forms.autocomplete
|
|
47
|
+
when_to_break: >-
|
|
48
|
+
None for a field about the person (XM3 is a norm). A field about something else (a one-time code) needs no token, and the reviewer drops it from the list when its words were misread.
|
|
49
|
+
break_effect: >-
|
|
50
|
+
No effect is bought by leaving the token out of a personal field.
|
|
51
|
+
test: >-
|
|
52
|
+
check-design runs the forms measurer at review and lists, as a hint, each field whose words read as personal data with the token it expected and the one it found. The reviewer confirms each purpose, since reading it from words is a guess.
|
|
53
|
+
example: >-
|
|
54
|
+
A delivery form whose name, e-mail, phone and CEP fields carry name, email, tel and postal-code.
|
|
55
|
+
counterexample: >-
|
|
56
|
+
A contact form whose e-mail and phone fields carry no autocomplete attribute.
|
|
57
|
+
|
|
58
|
+
- id: XR3
|
|
59
|
+
name: The keyboard matches the data
|
|
60
|
+
area: ux
|
|
61
|
+
moment: review
|
|
62
|
+
skill: lazuli-ux-flows-and-forms
|
|
63
|
+
rule: >-
|
|
64
|
+
Check that a field that reads as e-mail, phone or a number opens the matching keyboard on a phone (XM2): type email or inputmode email for an e-mail, type tel or inputmode tel for a phone, type number or tel or inputmode numeric, decimal or tel for digits. Only fields a person types into are checked; a select named quantity opens no keyboard.
|
|
65
|
+
why: >-
|
|
66
|
+
The wrong keyboard makes the person switch layouts on every field, which slows them and invites typing errors.
|
|
67
|
+
origin: source
|
|
68
|
+
status: hypothesis
|
|
69
|
+
hypothesis: H3
|
|
70
|
+
source: >-
|
|
71
|
+
WHATWG HTML Living Standard, 6.8.9 Input modalities: the inputmode attribute, https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute (opened 2026-11-25): inputmode hints which virtual keyboard to show; without it the browser chooses from the type. GOV.UK Design System, Text input, https://design-system.service.gov.uk/components/text-input/ (sections on numbers, opened 2026-11-25): inputmode numeric for whole numbers, decimal for decimals. Reading a field as numeric from the words of its name, id and label is our claim; no number is used as a cutoff (H3).
|
|
72
|
+
measure: forms.input-mode
|
|
73
|
+
when_to_break: >-
|
|
74
|
+
A field that takes letters and digits mixed (a promo code, a postal code with letters) keeps the text keyboard, declared with break-a-rule first (XM2).
|
|
75
|
+
break_effect: >-
|
|
76
|
+
The person can type every character the field accepts without switching keyboards back.
|
|
77
|
+
test: >-
|
|
78
|
+
check-design runs the forms measurer at review and lists, as a hint, the fields whose words read as e-mail, phone or numeric data while their type and inputmode open another keyboard. The reviewer confirms on a capture at a phone width.
|
|
79
|
+
example: >-
|
|
80
|
+
A CEP field with inputmode numeric and a phone field with type tel.
|
|
81
|
+
counterexample: >-
|
|
82
|
+
A CPF field of type text with no inputmode, so the phone opens the letter keyboard.
|
|
83
|
+
|
|
84
|
+
- id: XR4
|
|
85
|
+
name: Required and optional are marked one way
|
|
86
|
+
area: ux
|
|
87
|
+
moment: review
|
|
88
|
+
skill: lazuli-ux-flows-and-forms
|
|
89
|
+
rule: >-
|
|
90
|
+
Check that each form that holds both required and optional questions marks them one way (XM4): every required question carries a required mark (an asterisk or the word required) or every optional one carries the word optional. A field marked required that the form does not require is listed too. A radio or checkbox group is one question; a mark written only on a group's legend is not read.
|
|
91
|
+
why: >-
|
|
92
|
+
A form that marks some required fields and not others makes the person guess which ones they may skip.
|
|
93
|
+
origin: source
|
|
94
|
+
status: hypothesis
|
|
95
|
+
hypothesis: H4
|
|
96
|
+
source: >-
|
|
97
|
+
GOV.UK Design System, Question pages, https://design-system.service.gov.uk/patterns/question-pages/ (section on optional and mandatory fields, opened 2026-11-25): add "(optional)" to the label of optional fields and never mark mandatory fields with asterisks. W3C, Understanding SC 3.3.2 Labels or Instructions, https://www.w3.org/WAI/WCAG22/Understanding/labels-or-instructions.html (techniques H90 and ARIA2, opened 2026-11-25): required controls can be indicated in the label or legend. Accepting a required mark, an asterisk included, departs from GOV.UK, which marks only optional fields (our claim, as in XM4). Reading the marks from the label words and setting them against the required attribute is our claim; no number is used as a cutoff (H4).
|
|
98
|
+
measure: forms.required
|
|
99
|
+
when_to_break: >-
|
|
100
|
+
A form where every field is required may carry no mark, with one line above the form saying so, declared with break-a-rule first (XM4).
|
|
101
|
+
break_effect: >-
|
|
102
|
+
The labels stay clean, and the one line does the work of every mark.
|
|
103
|
+
test: >-
|
|
104
|
+
check-design runs the forms measurer at review and lists, as a hint, the required questions with no mark in a form that marks neither group fully, and the fields marked required that the form does not require. The reviewer checks that the mark is the same on every step.
|
|
105
|
+
example: >-
|
|
106
|
+
A form of five required fields and one labeled "Company (optional)".
|
|
107
|
+
counterexample: >-
|
|
108
|
+
A form with an asterisk on two of its four required fields and no other mark.
|
|
109
|
+
|
|
110
|
+
- id: XR5
|
|
111
|
+
name: An error message is tied to its field
|
|
112
|
+
area: ux
|
|
113
|
+
moment: review
|
|
114
|
+
skill: lazuli-ux-flows-and-forms
|
|
115
|
+
rule: >-
|
|
116
|
+
Check that every field marked aria-invalid has a visible error message tied to it with aria-errormessage or aria-describedby (XM5). Only an invalid field already in the render is seen: the CLI never submits a form, so the error state is staged as US8 says (on a local run, through the app's own means) and check-design runs on the staged render.
|
|
117
|
+
why: >-
|
|
118
|
+
A message that is not tied to its field is not read out when a screen reader user reaches the field, so they hear that something is wrong without hearing where.
|
|
119
|
+
origin: source
|
|
120
|
+
status: hypothesis
|
|
121
|
+
hypothesis: H5
|
|
122
|
+
source: >-
|
|
123
|
+
W3C, WAI-ARIA 1.2, https://www.w3.org/TR/wai-aria-1.2/ (property definitions aria-describedby and aria-errormessage, opened 2026-11-25): aria-errormessage identifies the element that provides an error message for an object, see aria-invalid. GOV.UK Design System, Error message, https://design-system.service.gov.uk/components/error-message/ (opened 2026-11-25): the examples link hint and error to the input with aria-describedby. Listing an invalid field whose linked text is missing or hidden is our claim; whether the message says the fix is left to the reviewer; no number is used as a cutoff (H5).
|
|
124
|
+
measure: forms.errors
|
|
125
|
+
when_to_break: >-
|
|
126
|
+
None that the person benefits from (XM5); the wording and a summary at the top may vary.
|
|
127
|
+
break_effect: >-
|
|
128
|
+
No effect is bought by an unlinked message.
|
|
129
|
+
test: >-
|
|
130
|
+
check-design runs the forms measurer at review on a staged error render and lists, as a hint, the fields marked invalid with no visible message tied to them. Silent when the render holds no invalid field, and the report notes it. The reviewer reads each message for the fix.
|
|
131
|
+
example: >-
|
|
132
|
+
An e-mail field with aria-invalid true and aria-describedby pointing to "Enter an e-mail address like name@example.com".
|
|
133
|
+
counterexample: >-
|
|
134
|
+
A field with aria-invalid true and a red "Invalid" line under it that nothing points to.
|
|
135
|
+
|
|
136
|
+
- id: XR6
|
|
137
|
+
name: A form asks few questions
|
|
138
|
+
area: ux
|
|
139
|
+
moment: review
|
|
140
|
+
skill: lazuli-ux-flows-and-forms
|
|
141
|
+
rule: >-
|
|
142
|
+
Check that each form asks no more questions than the cutoff, counting each field once and each radio or checkbox group once (XM6). Fields outside any form (a header search, a footer signup) are not counted as one form. More questions than the cutoff asks whether each one has a written reason, never that the form is wrong.
|
|
143
|
+
why: >-
|
|
144
|
+
Every question is work before the task is done, and a form that looks long is abandoned before it is started (our claim).
|
|
145
|
+
origin: source
|
|
146
|
+
status: hypothesis
|
|
147
|
+
hypothesis: H6
|
|
148
|
+
source: >-
|
|
149
|
+
GOV.UK Design System, Question pages, https://design-system.service.gov.uk/patterns/question-pages/ (section on asking only what you need, opened 2026-11-25): make sure you know why you are asking every question. No opened page gives a number of questions: the cutoff is a round starting value set before any form was measured, our claim; the H6 row says how and lists what was observed afterwards, which is not evidence.
|
|
150
|
+
measure: forms.field-count
|
|
151
|
+
threshold: { maxFields: 6 }
|
|
152
|
+
when_to_break: >-
|
|
153
|
+
A form whose task is the information itself (an insurance quote, a tax return), split into short steps, declared with break-a-rule first (XM6).
|
|
154
|
+
break_effect: >-
|
|
155
|
+
The person gets an exact answer at the end, and the steps keep the length from showing all at once.
|
|
156
|
+
test: >-
|
|
157
|
+
check-design runs the forms measurer at review and counts the questions of each form. Hint when a form asks more than the cutoff, naming the form and its count. The reviewer checks that each field has a written reason.
|
|
158
|
+
example: >-
|
|
159
|
+
A newsletter signup with one e-mail field.
|
|
160
|
+
counterexample: >-
|
|
161
|
+
A newsletter signup asking for name, phone, city, birthday, company, job title and e-mail.
|
|
162
|
+
|
|
163
|
+
- id: XR7
|
|
164
|
+
name: The main task runs without getting stuck
|
|
165
|
+
area: ux
|
|
166
|
+
moment: review
|
|
167
|
+
skill: lazuli-ux-task-test
|
|
168
|
+
rule: >-
|
|
169
|
+
Run the main task (the goal's Do line on its piece, XF1) as a simulated task: one agent with the audience profile of LAZULI.md, fresh for the task and continued at each step, sees one screen at a time, picks what it would press, and record-task counts the steps, the choices offered in the first view, the hesitations, the scrolls and the outcome. Read the steps where it hesitated or stopped before the review.
|
|
170
|
+
why: >-
|
|
171
|
+
A flow that reads well to its designer can still lose a newcomer at one screen; walking it with the audience profile points at that screen before people meet it (our claim).
|
|
172
|
+
origin: hypothesis
|
|
173
|
+
status: hypothesis
|
|
174
|
+
hypothesis: H7
|
|
175
|
+
source: >-
|
|
176
|
+
Our claim, not verified yet. That an agent with the audience profile hesitates and stops where people from that audience would is the hypothesis H7 states; no number is used as a cutoff, and the counts are reported as counts, never a score.
|
|
177
|
+
when_to_break: >-
|
|
178
|
+
A page with no task to finish (a manifesto, a single image) has no walk to run.
|
|
179
|
+
break_effect: >-
|
|
180
|
+
Not applicable; the review covers what the page has.
|
|
181
|
+
test: >-
|
|
182
|
+
map-page reads each screen and record-task records the tester's answer for it; the CLI never acts on the page: it loads, scrolls and moves the pointer, never clicks, types, selects or submits, and on a site that is not local the walk follows links only. The reviewer reads the steps where the tester hesitated, the outcome (done, stuck, stopped or left) and why. A recorded task does not satisfy the review gate for the goal.
|
|
183
|
+
example: >-
|
|
184
|
+
A booking task done in four steps, with one hesitation at the date screen that the reviewer then fixes.
|
|
185
|
+
counterexample: >-
|
|
186
|
+
A review that approves a booking flow no one walked, with no word on where a newcomer would stop.
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lazuli
|
|
3
|
+
description: Use when working on the design of a screen, page, brand or interface with Lazuli, or when the user types /lazuli or one of its commands (start-project, set-goals, show-options, create, improve, check-design, break-a-rule, review-design, remember-this, explain-decisions), or asks to make, improve, review, check or consciously break a design rule.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Lazuli
|
|
7
|
+
|
|
8
|
+
Lazuli is a design kit for AI agents. Its thesis is "from defect to effect": every design piece is a hypothesis about the effect it causes on people. Instead of only listing defects, the kit measures what it can on the rendered screen and leaves the effect itself to a separate reviewer or a test with people. Its golden facet: a correct rule can be broken on purpose, with the intended effect declared before and the check for it planned when the break is logged.
|
|
9
|
+
|
|
10
|
+
## Two modes
|
|
11
|
+
Set in `## Mode` of `LAZULI.md`.
|
|
12
|
+
- `director`: the person decides. Ask before applying any change that breaks a rule.
|
|
13
|
+
- `delegate`: the kit decides and explains. Apply a break only if its check passes, and list every break at the end of the answer.
|
|
14
|
+
|
|
15
|
+
## Commands
|
|
16
|
+
| Command | What it does | Who runs it |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| `start-project` | Creates `LAZULI.md` in the current folder. Never overwrites. `--mode director` or `--mode delegate` sets the mode. | CLI (see "Running the CLI") |
|
|
19
|
+
| `set-goals` | Procedure: ask what each screen or piece must make people understand, feel and do, then write it under `## Goals`. | You, the agent: `/lazuli set-goals` |
|
|
20
|
+
| `show-options` | Procedure: explore 6 to 9 measured compositions as thumbnails and choose one before code. | You, the agent: `/lazuli show-options` |
|
|
21
|
+
| `create` | Procedure: make the piece asked for, in any area, with each decision logged. | You, the agent: `/lazuli create` |
|
|
22
|
+
| `improve` | Procedure: make something that exists better while keeping its identity. | You, the agent: `/lazuli improve` |
|
|
23
|
+
| `check-design <target>` | Renders a URL or HTML file, measures it against the rules of every area that has a measurer and prints the report. Exit 1 when any rule fails. | CLI |
|
|
24
|
+
| `break-a-rule` | Procedure: record and check a deliberate exception under `## Breaks`. | You, the agent: `/lazuli break-a-rule` |
|
|
25
|
+
| `review-design` | Procedure: a separate first look and a separate reviewer give a verdict: redo, fix or approve. | You, the agent: `/lazuli review-design` |
|
|
26
|
+
| `remember-this` | Procedure: turn a correction into a project rule with a condition and a test. | You, the agent: `/lazuli remember-this` |
|
|
27
|
+
| `explain-decisions` | Procedure: write the memo that explains each decision to the client. | You, the agent: `/lazuli explain-decisions` |
|
|
28
|
+
|
|
29
|
+
## Agent helpers
|
|
30
|
+
The procedures below call these through the CLI (see "Running the CLI"). They are not slash commands.
|
|
31
|
+
| Helper | What it does |
|
|
32
|
+
|---|---|
|
|
33
|
+
| `list-rules` | Lists the rules (kit and learned) for a moment or an area, as text or JSON. |
|
|
34
|
+
| `record-break` | Writes or updates one entry of the Breaks log in LAZULI.md. |
|
|
35
|
+
| `record-decision` | Writes or updates one entry of the Decisions log in LAZULI.md. |
|
|
36
|
+
| `capture` | Screenshots a page and writes a blind first-look prompt and a reviewer packet under .lazuli/captures. |
|
|
37
|
+
| `record-first-look` | Stores the blind first-look answers for a capture after checking every width is answered. |
|
|
38
|
+
| `record-review` | Stores a reviewer verdict for a capture after checking it judges every goal of the page. |
|
|
39
|
+
| `check-goals` | Reports each goal's recorded check (met, partly, missed, stale or not checked) and whether the gate passes. |
|
|
40
|
+
| `draft-memo` | Gathers decisions, breaks, first looks and verdicts per goal into a draft for explain-decisions, and lists the gaps. |
|
|
41
|
+
| `render-options` | Renders 6 to 9 option HTML files, measures each and writes one contact sheet per width, with no ranking. `--height <px>` sets the viewport height and `--screens <n>` shows the first n screens in each thumbnail, and `--baseline <page>` adds each option's distance from that page to its label. |
|
|
42
|
+
| `compare-designs` | Reports the structural distance of a page from a baseline made without the kit, per width, with no verdict (hypothesis H1). `--options <folder>` places each option file of a folder from near to far against the baseline. |
|
|
43
|
+
| `map-page` | Maps one step of a simulated task, read only: screenshots and a numbered list of what can be used, stopping at forms and checkout off local targets. |
|
|
44
|
+
| `record-task` | Stores the tester's answer for the last mapped step of a simulated task and prints the next step, or closes the task with counts. |
|
|
45
|
+
|
|
46
|
+
## Areas
|
|
47
|
+
Each area is a folder of rules plus skills that carry the content. Use the area skills for the content: they point to rule ids instead of repeating them.
|
|
48
|
+
- **Color** (`color`): Palette by intent, review on the rendered screen, culture and sector, states and signals. Skills: `lazuli-color-palette-by-intent` (choose a palette from an intent), `lazuli-color-screen-review` (review a finished screen), `lazuli-color-context-and-culture` (audience, country, sector, age), `lazuli-color-states-and-signals` (error, success, alert, status, color blindness of signals).
|
|
49
|
+
- **Typography** (`typography`): Choosing and pairing type, and reviewing it on the rendered page. Skills: `lazuli-typography-choose-and-pair` (choose and pair fonts, build the scale, before a page exists), `lazuli-typography-screen-review` (judge type on a rendered page: fallbacks, line length, headings, translated text).
|
|
50
|
+
- **UI** (`ui`): Pages composed as a whole (moves, grid, scroll as a sequence) and components with every state, looking the same on every screen. Skills: `lazuli-ui-composition` (compose a page as one composition, choose moves and the grid, write the rhythm map, sketch options before code), `lazuli-ui-layout-review` (judge the composition of a rendered page: scroll rhythm, climax, crossings, distance from the default), `lazuli-ui-states-and-system` (design and check every component state, and the same component looking the same across screens).
|
|
51
|
+
- **Accessibility** (`accessibility`): WCAG 2.2 checks that run with every other area. Skills: `lazuli-accessibility-check` (check a finished page for names, focus, target size, reflow, text spacing, titles and language). Run it next to every other area, and never say a page "is accessible", only which criteria were checked.
|
|
52
|
+
- **UX** (`ux`): Flows that cut the steps nobody needs and keep one moment worth remembering, forms that ask little and recover from errors, checked by a simulated task with the audience profile. Skills: `lazuli-ux-flows-and-forms` (design or review a flow or form: steps, fields, labels, input types, autocomplete, required marks, error recovery), `lazuli-ux-task-test` (run a simulated task with the audience profile, step by step, and record where it hesitates or gets stuck).
|
|
53
|
+
- **Graphic design** (`graphic`): A symbol with an idea only this brand could have, read from large down to 16 px on light and dark, and derived pieces that take every color, font and symbol from the Brand tokens. Skills: `lazuli-graphic-identity` (create or review a logo, symbol or brand mark, its small version, light and dark versions and the Brand tokens), `lazuli-graphic-derived-pieces` (make social posts, Open Graph images, a favicon set or a presentation cover from the Brand tokens and check them against it).
|
|
54
|
+
- **Motion** (`motion`): Microinteractions and transitions recorded frame by frame: durations, curves, jumps, long frames, bands, flashes, time to settle and reduced motion, measured, never described. Skills: `lazuli-motion-micro-and-transitions` (design or review hover, press and focus feedback, entrances, page and scroll transitions, durations and curves, jumps, flashing or endless motion, and reduced motion).
|
|
55
|
+
- **Content** (`content`): Interface text and voice: generic or long labels, error message parts, one term per thing across screens, and what breaks with longer, Portuguese, empty, single and hundreds of items. Skills: `lazuli-content-interface-writing` (write or review button and link labels, headings, form labels, error and empty-state messages, one term per thing, and layouts under longer, Portuguese, empty, single and hundreds of items), `lazuli-content-voice` (define or review how the product speaks: voice, words to use and avoid, tone by moment, plain language, copy only this product could have).
|
|
56
|
+
- **Data** (`data`): 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. Skills: `lazuli-data-charts-and-dashboards` (design or review charts and dashboards: chart form, axes and baselines, labels and legends, chart colors and color blindness, key numbers and panel layout).
|
|
57
|
+
|
|
58
|
+
Rules are in `rules/<area>/*.yaml` in a kit checkout. After install they sit in the `rules` folder of this skill (`<skills-folder>/lazuli/rules/<area>/*.yaml`), and the area skills reach them as `../lazuli/rules/<area>/<file>.yaml`. Each area folder also holds `_area.yaml` (title, summary, prefixes, skills) and `HYPOTHESES.md` (the numbers that are not from a source or a norm yet).
|
|
59
|
+
|
|
60
|
+
## Running the CLI
|
|
61
|
+
1. Read the file `KIT_PATH` in this skill's folder (`<skills-folder>/lazuli/KIT_PATH`). It holds the absolute path of the kit folder that ran `install` (the global npm package or a checkout).
|
|
62
|
+
2. Run `node "<KIT_PATH>/bin/lazuli.mjs" <command>`, for example `node "<KIT_PATH>/bin/lazuli.mjs" check-design ./index.html`.
|
|
63
|
+
3. No `KIT_PATH` (the kit is loaded as a plugin): the kit root is two folders up from this skill's folder, so run `node "<this skill folder>/../../bin/lazuli.mjs" <command>`.
|
|
64
|
+
4. Only if neither exists, use `npx @uselazuli/cli <command>` (not for `install`).
|
|
65
|
+
|
|
66
|
+
If no CLI can run, do `start-project` by hand: copy `templates/LAZULI.md` from this skill's folder to `LAZULI.md` in the project folder, only when that file does not exist yet.
|
|
67
|
+
|
|
68
|
+
Setup, once: `npm i -g @uselazuli/cli`, then `lazuli install` copies these skills into `~/.claude/skills` and writes `KIT_PATH`.
|
|
69
|
+
|
|
70
|
+
## LAZULI.md
|
|
71
|
+
`## Product`, `## Audience`, `## Brand`, `## Platform and constraints`, `## Language`, `## Voice`, `## Mode`, `## Goals`, `## Breaks`, `## Learned rules`. Read it before any design work. If it does not exist, offer to run `start-project`. If `## Goals` is empty, run `set-goals` before proposing visuals, because every effect is judged against a goal. The simulated task reads `## Audience` and the goal's `Do`.
|
|
72
|
+
|
|
73
|
+
A goal is one entry per piece. The optional `Target:` line names the page it applies to; `check-design` shows the goals whose `Target:` is the page it checked, however the path or URL is written (relative path, absolute path, `file://` URL, trailing slash):
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
- Piece: checkout page
|
|
77
|
+
- Target: ./checkout.html
|
|
78
|
+
- Understand: what I pay and when
|
|
79
|
+
- Feel: safe
|
|
80
|
+
- Do: finish the payment
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
A derived piece (a social post, an Open Graph image, a favicon set, a presentation cover) is a goal with a `Size:` line: the canvas in pixels, `1200x630`, or square sizes `16, 32, 180, 512`. A goal with a `Size:` or a symbol or image `Target:` is not a screen, so `--site` and the post-edit hook leave it out.
|
|
84
|
+
|
|
85
|
+
For the options stage, one goal can cover the folder of option files: a `*` in its `Target:` (`Target: ./.lazuli/options/home/*.html`) matches any file name in that one folder. It is never a screen and never gated, because an option review never counts for the page: the chosen page gets its own goal.
|
|
86
|
+
|
|
87
|
+
`## Brand` holds the Brand tokens, one bullet each, anywhere in the section. Every color, font and symbol of a derived piece is read from these lines; prose around them is ignored, and a token line that cannot be read is named as a problem:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
- Color: ink #1a1a1a
|
|
91
|
+
- Font: Inter
|
|
92
|
+
- Symbol: brand/symbol.svg
|
|
93
|
+
- Symbol: brand/symbol-small.svg (up to 32 px)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
A color is an optional name and a hex. One Symbol line is the main symbol; a simplified version for small sizes says `(up to <n> px)`.
|
|
97
|
+
|
|
98
|
+
## set-goals
|
|
99
|
+
1. Read `LAZULI.md`. List the screens or pieces in play.
|
|
100
|
+
2. For each one, get three short statements: what people must understand, feel and do (write `Do` as a task a person can try on that page, for example `book a first visit`), and the page it lives on if there is one (`Target:`). For a page that scrolls, ask for the rhythm map too: one `Rhythm:` line under the piece, one beat per section from top to bottom, each `breathe`, `steady`, `accelerate` or `climax`, separated by commas, with exactly one `climax` (for example `- Rhythm: breathe, steady, accelerate, climax, breathe`). Ask all questions in one batch.
|
|
101
|
+
3. Write them under `## Goals`, one entry per piece, in the format above. In delegate mode, propose them from the brief, state the assumptions, and write them.
|
|
102
|
+
4. When a goal line changes later (`Understand`, `Feel`, `Do`, `Target`, `Rhythm`), log it with `lazuli record-decision --rule none --decision "<Field> changed: was <old>; now <new>. <reason>"`, so `explain-decisions` can say why the goal moved.
|
|
103
|
+
|
|
104
|
+
## check-design
|
|
105
|
+
Run `node "<KIT_PATH>/bin/lazuli.mjs" check-design <url-or-html-path>` (see "Running the CLI"). Options: `--width 1440,390`, `--height <px>` (the viewport height, 100 to 10000, 900 by default; `--height 844` reads a phone's first view; not with `--asset`), `--area color` (a comma list; an unknown name exits 2 and lists the known areas), `--json`, `--out <file>` (also writes the report there; `.lazuli/report.json` is still written). More screens of the same product follow the first target (`check-design ./index.html ./about.html`); `--site` adds the `Target` line of every page goal in `LAZULI.md` (not the pieces and symbols), since those are the screens of one product. Page findings stay for the first target; findings that compare screens are marked "across N screens". With `--site` and fewer than two distinct screens it exits 2. `LAZULI_RULES_DIR` points the CLI at another rules folder; it is a debugging switch, so leave it unset in normal work.
|
|
106
|
+
|
|
107
|
+
`check-design --asset <file-or-url>` checks one symbol or derived piece instead of a page: an SVG, PNG or ICO is a symbol; an HTML file, or a PNG, JPG or WebP with a size, is a piece. A piece takes its sizes from the `Size:` line of its goal or from `--size 1200x630`. Only the areas with a rule the asset measurers read are reported (unless `--area` names others); the report reads `Asset:` and `Sizes:` and lists the `Files written:`, and a finding's width is a size label such as `1200x630`. It takes no page target, `--site` or `--width`; a piece with no size exits 2 naming the line to write. A piece or a symbol is delivered like a page: `capture` it and have it reviewed (review-design) before check-goals counts its goal; `--asset` measures it but is not that review.
|
|
108
|
+
|
|
109
|
+
`--area motion` records the page's motion (animations, frames, a run with reduced motion asked for) at the first width of the run, never in the post-edit hook, and writes `filmstrip.png` under `.lazuli/motion`. Run it yourself after motion work and quote its findings with the limits the `lazuli-motion-micro-and-transitions` skill lists.
|
|
110
|
+
|
|
111
|
+
`--area content` reads the words of the page (button names, error messages, capitalization) and, on a script-free copy of the page (nothing runs, and nothing but styles, fonts and images is requested, on any host), what breaks when text grows, is long Portuguese, or lists hold none, one or hundreds of items; it reports only the breaks that the case adds. Navigation names and term spellings (CR5, CR6) compare screens and run only with two or more screens (`--site` or several targets). The area runs in `check-design` but not in the post-edit hook, so run it yourself after writing copy and quote its findings with the limits the `lazuli-content-interface-writing` skill lists.
|
|
112
|
+
|
|
113
|
+
The data area reads the charts of the page (svg geometry and paint, canvas pixels) without hovering, clicking or scrolling, and writes the chart sheet `.lazuli/charts/<target key>/charts-<width>.png` (each chart as captured and in simulated protanopia, deuteranopia, tritanopia and grayscale), printed as `Charts for review: <path>`. The post-edit hook writes no chart sheet: the sheet comes only from a `check-design` run that includes the data area. The sheet is reviewer material, never for the first look; quote the findings with the limits the `lazuli-data-charts-and-dashboards` skill lists.
|
|
114
|
+
|
|
115
|
+
What the report shows:
|
|
116
|
+
- One block per area, with how many of its rules `check-design` measures (the others are checked by you or by people). An area with no measured rule says so instead of looking like a pass.
|
|
117
|
+
- The goals declared for the page checked (`Target:`). They are shown, not measured.
|
|
118
|
+
- `break` findings: a declared break whose `Status` is `trying` or `kept` and whose `Piece` is a goal of the page turns a fail or hint of that rule into a `break` that shows the declared effect. A `reverted` break changes nothing. Norms are never waived: a break on a norm rule leaves the fail as it is and the report says the break was not applied.
|
|
119
|
+
- Notes, for example a measurer that failed while the others still ran.
|
|
120
|
+
|
|
121
|
+
Quote the report's measurements, rule ids and notes. A finding names the rule, the widths where it appears and the measured evidence. A main action found without `data-primary` is a guess, so say so. A finding marked as a hypothesis is a hint from a claim that is not verified yet, never a verdict. Never say an effect was achieved because the report is clean: it measures, it does not ask people.
|
|
122
|
+
|
|
123
|
+
## create
|
|
124
|
+
1. Read `LAZULI.md`; if `## Goals` is empty, run set-goals first. Write one sentence under `## Idea`.
|
|
125
|
+
2. Propose directions with show-options before any code. Director mode waits for the choice; delegate mode chooses and explains.
|
|
126
|
+
3. Read only the rules of the moment: `list-rules --moment create --area <areas in play>`, plus `--area project`.
|
|
127
|
+
4. Build. Log each decision with `record-decision` and each break through break-a-rule.
|
|
128
|
+
5. `check-design` at 1440, 768 and 390, then review-design and `check-goals`, then deliver with explain-decisions.
|
|
129
|
+
Full procedure: procedures/create.md
|
|
130
|
+
|
|
131
|
+
## show-options
|
|
132
|
+
1. Needs an idea in `LAZULI.md`; without one, write it first (create step 2).
|
|
133
|
+
2. Write 6 to 9 option files from the template of `lazuli-ui-composition`, each a different composition (moves or grid, not colors), naming its moves by UC id.
|
|
134
|
+
3. `render-options <folder> --width 1440`, then open the sheet (the option canvas is one first view, 1440 px wide; 390 px with `--width 390 --height 844` when `## Audience` names a phone). It measures scale, empty space and focal point and never ranks; name the tension in words.
|
|
135
|
+
4. Director waits for the choice. Delegate chooses and says why. Log it with `record-decision`, one call per rule id, each with its own decision text (the same text replaces the earlier entry); a pushed move or a broken grid goes through `break-a-rule` first.
|
|
136
|
+
Full procedure: procedures/show-options.md
|
|
137
|
+
|
|
138
|
+
## improve
|
|
139
|
+
1. Before changing anything: `check-design`, `capture` and a first look of the existing piece are the baseline.
|
|
140
|
+
2. Write the identity elements to keep as `record-decision` entries marked `followed`; an element no rule covers first becomes a project rule through remember-this, and that `LR` id is cited.
|
|
141
|
+
3. Then work as in create. The review compares the new first look with the baseline answers.
|
|
142
|
+
Full procedure: procedures/improve.md
|
|
143
|
+
|
|
144
|
+
## review-design
|
|
145
|
+
1. `check-design` at 1440, 768 and 390, then `capture`. Take the paths from the order it prints (first look prompt in step 1, reviewer packet in step 3).
|
|
146
|
+
2. A fresh `lazuli-first-look` agent gets only the first look prompt path; store its JSON with `record-first-look`.
|
|
147
|
+
3. A fresh `lazuli-design-reviewer` agent gets only the reviewer packet path; store its JSON unchanged with `record-review`; quote the verdict.
|
|
148
|
+
4. `fix`: make the fixes and review again. `redo`: back to the directions step of create. No subagents: ask the person or a separate session; never answer yourself. If neither can, record the review as pending with its reason (procedures/review-design.md); the gate stays closed.
|
|
149
|
+
Full procedure: procedures/review-design.md
|
|
150
|
+
|
|
151
|
+
## remember-this
|
|
152
|
+
1. Turn the correction into a condition (a CSS selector when visual), a rule and a test.
|
|
153
|
+
2. Write it to `.lazuli/rules/learned.yaml` with the next free `LR` id, `origin: project`, and `measure: style.value` when it can be measured.
|
|
154
|
+
3. Check it with `list-rules --area project` and `check-design`, then add one line under `## Learned rules`.
|
|
155
|
+
Full procedure: procedures/remember-this.md
|
|
156
|
+
|
|
157
|
+
## explain-decisions
|
|
158
|
+
1. Run `draft-memo`; it gathers decisions, breaks, first looks and verdicts, and lists the gaps.
|
|
159
|
+
2. Write `DECISIONS.md` for the client in plain language, one paragraph per decision, and state every gap.
|
|
160
|
+
3. Update `DESIGN.md` with the visual system actually shipped.
|
|
161
|
+
Full procedure: procedures/explain-decisions.md
|
|
162
|
+
|
|
163
|
+
## break-a-rule
|
|
164
|
+
Each rule has `when_to_break` and `break_effect`. To break one:
|
|
165
|
+
1. Name the rule id (for example PA2) and the piece it applies to. The piece must be a goal under `## Goals`, with a `Target:`, or `check-design` cannot match the break to the page.
|
|
166
|
+
2. State the intended effect: what people should feel or understand because of the break. Take it from the rule's `break_effect` and from `## Goals`.
|
|
167
|
+
3. State how it will be checked: a measurement from `check-design`, or a short test with people from the audience.
|
|
168
|
+
4. Director mode: ask the person before applying. Delegate mode: apply the break only if the check passes.
|
|
169
|
+
5. Record it with `record-break`, then run the check after applying:
|
|
170
|
+
`node "<KIT_PATH>/bin/lazuli.mjs" record-break --rule PA2 --piece "checkout page" --effect "the black block makes the payment button feel heavy and final" --check "check-design on ./checkout.html, plus a short test with people from the audience" --status trying`
|
|
171
|
+
6. Entries under `## Breaks` are written and changed only with `record-break`, never by hand. `--rule` takes one id or a comma list (`--rule PA11,RV9`), one entry per id; when a rule shares its measure with others, the command names them, because the same finding is reported under each id. `--status` is `trying`, `kept` or `reverted`; call it again for the same rule and piece to change the status. `--target <file>` limits the entry to one file the piece covers (one option of a folder goal), written relative to the project folder; a file outside the piece or a glob is refused; `record-decision` takes it too. The entry it writes looks like this:
|
|
172
|
+
```
|
|
173
|
+
- Rule: PA2
|
|
174
|
+
- Piece: checkout page
|
|
175
|
+
- Effect: the black block makes the payment button feel heavy and final
|
|
176
|
+
- Check: check-design on ./checkout.html, plus a short test with people from the audience
|
|
177
|
+
- Status: trying
|
|
178
|
+
```
|
|
179
|
+
7. Keep a break only after review-design (`procedures/review-design.md`): the separate reviewer judges the declared effect from a new capture, and `record-review` stores its verdict. Only then run `record-break --rule PA2 --piece "checkout page" --status kept`. It refuses `kept` until a review of the piece is recorded on a capture taken after the break was last set; never mark a break kept on your own reading. A check that is a test with people not yet run keeps the break `trying` (the gate stays open and says so). If the intended effect is not confirmed, revert the change and run `record-break` with `--status reverted`. Once the break is kept, log the broken decision with `record-decision ... --rule "PA2 broken"`. In delegate mode, list every kept break at the end of the answer.
|
|
180
|
+
8. A norm (a standard such as WCAG) cannot be waived by a break. Fix it, or tell the person it stays a fail. `check-design` lists breaks that were not applied, with the reason.
|
|
181
|
+
|
|
182
|
+
## Learned rules
|
|
183
|
+
A correction from the person becomes a rule of this project through remember-this (`procedures/remember-this.md`), which writes `.lazuli/rules/learned.yaml` and adds one line here. When a project shows an effect the rules did not predict, add it here with the evidence; it stays a hypothesis until it has been checked.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# create
|
|
2
|
+
|
|
3
|
+
Make the piece the person asked for, in any area, and leave a record of why each choice was made.
|
|
4
|
+
|
|
5
|
+
In this file `lazuli <command>` means `node "<KIT_PATH>/bin/lazuli.mjs" <command>` (see "Running the CLI" in `SKILL.md`). Run captures and checks one at a time, never in parallel.
|
|
6
|
+
|
|
7
|
+
## Mode
|
|
8
|
+
Read `## Mode` in `LAZULI.md`.
|
|
9
|
+
- `director`: offer options and wait for the person's choice at every fork named below.
|
|
10
|
+
- `delegate`: choose, say why, and keep going. Talk in plain language with no design terms: say "the heading is easier to read from far away", not "the type scale". The decisions and breaks still get written down, because the memo needs them.
|
|
11
|
+
|
|
12
|
+
## Steps
|
|
13
|
+
1. **Read `LAZULI.md`.** If it does not exist, run `lazuli start-project`. If `## Goals` is empty, run `set-goals` first: every effect is judged against a goal, so nothing is designed before one exists. Each goal that lives on a page needs a `Target:`, or the checks below cannot match it.
|
|
14
|
+
2. **Write the idea.** One sentence under `## Idea` that links something only this client has to a visual device every screen will carry. Director mode: offer two or three sentences and ask which one. Delegate mode: pick one and say why in a line.
|
|
15
|
+
3. **Propose directions with show-options before any code.** Run `procedures/show-options.md`: 6 to 9 measured compositions as thumbnails, each from the idea of step 2. Next to the chosen composition, say the palette intent and the type pairing in words, and the goal it serves best. Director mode: stop and wait for the choice. Delegate mode: choose one, explain the choice, and go on.
|
|
16
|
+
4. **Read only the rules of the moment.** Run `lazuli list-rules --moment create --area <the areas in play>`, then `lazuli list-rules --area project` for what this project learned. Areas in play are the ones the piece touches (for example `color,typography`; add `accessibility` when the piece has interaction). Do not read rules from other moments yet.
|
|
17
|
+
5. **Build.** Follow the area skills for the content. Mark the main action of each page with `data-primary`. Write the copy with the voice of `## Voice` before layout is final (`lazuli-content-voice`), so the layout is built around real words.
|
|
18
|
+
6. **Log each decision** that follows or breaks a rule, as you make it:
|
|
19
|
+
`lazuli record-decision --decision "<what you decided>" --piece "<goal piece>" --goal "<the goal it serves>" --rule "<id> followed|broken|accepted|none" --measure "<what you measured or will measure>"`
|
|
20
|
+
Use the rule ids from `list-rules`; an unknown id is refused. Log a break through break-a-rule (declared effect and check first, then `lazuli record-break --status trying`). A break becomes `kept` only after review-design (step 8) has a recorded review of the piece; then log its decision marked `broken`, which needs that kept break to exist. A hint you leave open on purpose is logged with `--rule "<id> accepted"`, its reason in `--decision` (a norm cannot be accepted; fix it). A decision tied to no rule, such as a project-level choice, uses `--rule none`. Never edit `## Decisions` or `## Breaks` by hand.
|
|
21
|
+
7. **Check at all three widths.** Run `lazuli check-design <target> --width 1440,768,390`. Quote its rule ids and measurements. A failed rule is fixed or declared as a break with its effect and check; it is never hidden.
|
|
22
|
+
8. **Review the piece.** Run the review-design procedure (`procedures/review-design.md`), then `lazuli check-goals`. A `redo` verdict returns to step 3. A `fix` verdict means acting on the fixes and reviewing again. When no fresh agent and no person can run the first look or the review, record the review as pending with the reason and say so in the hand-off; never answer as the reviewer. The gate stays closed on a pending review.
|
|
23
|
+
9. **Deliver with explain-decisions** (`procedures/explain-decisions.md`). In delegate mode, deliver only when `check-goals` passes, and list every break kept at the end of the answer.
|
|
24
|
+
|
|
25
|
+
## Optional
|
|
26
|
+
`lazuli install-hooks` adds opt-in Claude Code hooks (a check after each HTML or CSS edit, and an effect gate when a turn ends). It is the person's choice; offer it once, never run it unasked.
|
|
27
|
+
|
|
28
|
+
## What never to say
|
|
29
|
+
Never say an effect was achieved. A clean `check-design` report measures; a recorded review says what a reviewer judged from a capture. Say which of those you have.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# explain-decisions
|
|
2
|
+
|
|
3
|
+
Write the memo that explains each decision to the client, and keep `DESIGN.md` true to what was shipped.
|
|
4
|
+
|
|
5
|
+
In this file `lazuli <command>` means `node "<KIT_PATH>/bin/lazuli.mjs" <command>` (see "Running the CLI" in `SKILL.md`).
|
|
6
|
+
|
|
7
|
+
## Steps
|
|
8
|
+
1. **Gather the evidence.** Run `lazuli draft-memo` (or `lazuli draft-memo <target>` for one page). It writes `.lazuli/decisions-draft.md`, prints the path and lists the gaps. Exit 1 means there are gaps; that is information, not a failure to hide. Read the draft. It already quotes the first look for the capture the latest review used, so do not look the first look up again.
|
|
9
|
+
2. **Write `DECISIONS.md`** in the project folder, for the client. One paragraph per decision, in plain language, linking:
|
|
10
|
+
- the goal it serves,
|
|
11
|
+
- the rule followed or broken, named in words (the id in brackets); for a hint left open on purpose, say it was accepted and why; a decision with no rule line is a project-level choice,
|
|
12
|
+
- the measure: a number only when it comes from a `check-design` report or a recorded review, or what the reviewer or first look said (name who said it). A measure that is a plan ("will measure") is a gap, not a result.
|
|
13
|
+
Decisions and breaks are the builder's own log, and the draft labels them "Logged by the builder (not checked by the reviewer)". Keep that difference in the memo: say "we chose" or "we logged" for them, and name the reviewer only for what the reviewer judged. A broken rule is explained by the effect it was meant to cause and the check that was run. Use only what the draft contains. Do not add a reason the records do not hold.
|
|
14
|
+
3. **State each gap instead of hiding it.** End the file with a section for what is not backed up: a goal with no decision logged, an effect that is not met, a rule id that does not exist, a break with no check, a rule marked followed that the report fails. Say it as it is ("No check was run for the hero image").
|
|
15
|
+
4. **Update `DESIGN.md`** in the project folder, creating it when missing. Write the visual system actually shipped, read from the finished page and its styles, not from the plan: colors (values and roles), type (families, sizes, weights), grid (columns, spacing), and the idea from `## Idea` with where it shows on the page. If `DESIGN.md` already exists, change only the parts that no longer match what shipped.
|
|
16
|
+
5. **Offer the result** to the person: the two files, the gaps, and what is still open in `lazuli check-goals`.
|
|
17
|
+
|
|
18
|
+
## Delegate mode
|
|
19
|
+
Plain language, no design terms, and a closing list of every break kept.
|
|
20
|
+
|
|
21
|
+
## What never to say
|
|
22
|
+
Never write that an effect was achieved. Write what was declared, what was measured, and what a reviewer judged from the capture.
|