Rules
Every screen is checked against five rules. The linter decides R1–R3 by measuring the node list, and the LLM critic decides R4 and R5 and gives a second opinion on R1–R3 without seeing the linter's result. The score is the share of rules passed, and a screen passes at 80 or above with no R1 or R2 failure.
The recorded run on the demo page was scored on rubric v2.2. The evals page shows how the rules changed since.
R1 Carbon components used as documented
Decided by the linter. The critic gives a second opinion, and where they disagree the score follows the linter.
What the critic is given · rubric v3Carbon components used as documented: every component name must appear in the catalog below, and each component is used the way its catalog entry describes, including what its children and slots may hold. `p` is allowed for body text.What the linter checks
- Every component must be one of the 30 Carbon Web Components in the project's catalog, or
pfor body text. Anything else, like a made-upCreditCardWidget, fails. - For the 11 components whose catalog entry says what they can hold (
cds-inline-notification,cds-select,cds-radio-button-group,cds-contained-list,cds-contained-list-item,cds-table,cds-table-head,cds-table-header-row,cds-table-body,cds-table-rowandcds-table-cell), each child must be a documented kind. A child placed in a slot must use a slot the parent has, be a component that slot accepts, and stay within the slot's limit. - It doesn't check attribute values, or the rest of each catalog entry's usage notes. The critic reads those.
R2 Carbon tokens only (no hardcoded color/spacing)
Decided by the linter. The critic gives a second opinion, and where they disagree the score follows the linter.
What the critic is given · rubric v3Carbon tokens only: every style value, and every styling attribute that isn't one of the component's documented options, uses `var(--token)` with a name from the token list. Hex, rgb, px, or rem literals, or invented token names, fail. Border widths follow the same rule with one exception. On `border`, `border-top`, `border-right`, `border-bottom`, `border-left` and their `-width` forms, a literal `1px` passes, because Carbon has no border-width token. Any other px value fails there, and a token value (`var(--token)` from the list) passes like any other token, whatever size it resolves to. Documented attribute options (cds-tag type=green, cds-stack gap=5) pass.What the linter checks
- Every style value is checked. A
var(--…)must name a real Carbon token, one of the 226 White-theme tokens generated from@carbon/styles. Hex,rgb(),hsl()andoklch()colors, common color names likered, and lengths in px, rem, em, pt, vh or vw fail. - One exception: exactly
1pxpasses onborder,border-top,border-right,border-bottom,border-leftand their-widthforms, because Carbon has no border-width token. - Attributes get the same check, except text attributes like labels, titles, placeholders and links, and values that are one of the component's documented options, like
cds-tag type=green.
R3 Contrast & accessible labels
Decided by the linter. The critic gives a second opinion, and where they disagree the score follows the linter.
What the critic is given · rubric v3Contrast and accessibility: text and background pairs meet WCAG AA (4.5:1); every input has its label attribute (label or label-text) or an aria-label; every cds-button has text or tooltip-text.What the linter checks
- Contrast is checked for every node that sets its own text color or background. Colours are resolved through the tokens and inherited from parent nodes, with Carbon's primary text on its background as the default, and the pair must reach 4.5:1 (WCAG AA). Nodes that set neither are assumed to use Carbon's own colors, and colors it can't resolve are skipped.
- Labels:
cds-text-inputandcds-textareaneedlabel.cds-select,cds-checkbox,cds-radio-buttonandcds-toggleneedlabel-text. Anaria-labelalso counts. Acds-buttonneeds text, anaria-labelortooltip-text. - It reads the node list, not the rendered page, so a problem that only appears once the screen is drawn can pass.
R4 Consistent spacing
Decided by the critic. The linter doesn't check this rule.
What the critic is given · rubric v3Consistent spacing: sibling sections use the same gap; padding is consistent at each level; no arbitrary one-off spacing.
R5 Clear primary action; destructive action separated
Decided by the critic. The linter doesn't check this rule.
What the critic is given · rubric v3Clear primary action: at most one kind=primary cds-button per section and one obvious main action on the page; destructive actions use kind=danger and sit in a separated section, not beside the primary action. Judge button kinds as Carbon renders them, not as written: inside a cds-button-set, Carbon makes the first button secondary and every later button primary, whatever kind they were given. A set with a single button therefore shows no primary, and a set with three or more buttons shows more than one.