@reqvire-org/ads 0.3.51 → 0.3.53

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 (41) hide show
  1. package/README.md +1 -1
  2. package/dist/assets.mjs +15 -1
  3. package/dist/browser-audit/axe-run.mjs +17 -0
  4. package/dist/browser-audit/first-render.mjs +22 -0
  5. package/dist/browser-audit/image-shape.mjs +36 -0
  6. package/dist/browser-audit/layout-overflow.mjs +11 -5
  7. package/dist/browser-audit/non-text-contrast.mjs +12 -7
  8. package/dist/browser-audit/render-states.mjs +208 -0
  9. package/dist/browser-audit/worker.mjs +60 -22
  10. package/dist/browser-audit.mjs +72 -12
  11. package/dist/bun-compiler.mjs +9 -1
  12. package/dist/check.mjs +4 -1
  13. package/dist/cli.mjs +9 -4
  14. package/dist/config.mjs +3 -1
  15. package/dist/finding-rules.mjs +14 -1
  16. package/dist/font-rules.mjs +103 -0
  17. package/dist/fonts-generated.mjs +30 -12
  18. package/dist/layout-widths.mjs +17 -8
  19. package/dist/mcp/preview-watch.mjs +2 -2
  20. package/dist/mcp/preview-widget.bundle.js +50 -47
  21. package/dist/mcp/project-widget.bundle.js +45 -42
  22. package/dist/mcp/server.mjs +4 -4
  23. package/dist/mcp/widget.bundle.js +49 -46
  24. package/dist/preview-resources.mjs +4 -1
  25. package/dist/scenarios-compiler.mjs +2 -2
  26. package/dist/showcase/client.bundle.js +27 -27
  27. package/dist/skills/ads-break-ui/references/design-data.md +8 -1
  28. package/dist/skills/ads-designer/SKILL.md +5 -3
  29. package/dist/skills/ads-designer/references/branding.md +2 -2
  30. package/dist/skills/ads-designer/references/design-data.md +8 -1
  31. package/dist/skills/ads-designer/references/performance.md +54 -4
  32. package/dist/skills/ads-import/references/design-data.md +8 -1
  33. package/dist/skills/ads-motion/references/design-data.md +8 -1
  34. package/dist/skills/ads-port/references/design-data.md +8 -1
  35. package/dist/starters/react/design-system/brand/Icons/AppIcon/AppIcon.ads.fixture.ts +1 -1
  36. package/dist/starters/react/design-system/brand/Identity/Logo/Logo.ads.fixture.ts +2 -2
  37. package/dist/starters/react/design-system/components/Content/Logo/Logo.tsx +2 -2
  38. package/docs/ARCHITECTURE.md +26 -2
  39. package/docs/CHANGELOG.md +92 -12
  40. package/docs/GUIDE.md +65 -9
  41. package/package.json +7 -7
@@ -167,19 +167,26 @@ When it fires, pick the fix by what the element is:
167
167
  | A small part: an icon, control, handle or thumbnail | Size it at 96 px or less, plainly: `width: 64px`, `width: var(--control-height-lg)` |
168
168
  | A panel, column or anything that can give way | `width: min(100%, 280px)`, `flex: 1 1 280px` or a `minmax(0, 280px)` track |
169
169
  | A part that truly stays that wide | A token listed in `layout.widthTokens` in `ds.config.json`, used plainly: `width: var(--side-pane-width)` |
170
+ | A resizable part | A `clamp()` of three such tokens; a runtime variable needs a declared fallback: `clamp(var(--pane-min), var(--ux-pane, var(--pane)), var(--pane-max))` |
170
171
  | An overlay: dialog, menu, popover, tooltip | Its owner in `layout.fixedWidthUnits`, by unit id or file glob |
171
172
 
172
173
  These do not fix it:
173
174
 
174
175
  - Another unit. `32.5ch`, `20em` and `20rem` are as fixed as `280px`, and depend on the font too.
176
+ `ch` and `em` are measured at the rule's `font-size`, or 16 px.
175
177
  - `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)`: they cannot shrink below
176
178
  their fixed part.
177
- - `min(100%, 64px)` around a small part: `layout-width-noop` asks for the plain size.
179
+ - `min(100%, 64px)` around a small part. `layout-width-noop` asks for the plain size; in a flex or
180
+ grid parent the percentage can affect wrapping, so compare the scenario after changing it.
178
181
  - A token name. `--control-*`, `--side-pane-*` and every other name are read for their value.
179
182
 
180
183
  `ads check` lists every declared fixed width for review (`layout-declared-width`). There is no
181
184
  per-declaration exception.
182
185
 
186
+ `ads audit` opens each control with `aria-haspopup` and measures what opens, hovers and focuses
187
+ controls for contrast, and checks a control with `aria-busy="true"`. So give overlay triggers
188
+ `aria-haspopup`, or render the overlay open in its scenario, and render a busy example.
189
+
183
190
  `layout-overflow` (`ads audit`) renders every UI scenario at 390, 768 and 1280 px and fails on
184
191
  horizontal page overflow, elements past the viewport and clipped content. `overflow-x: auto`
185
192
  scrollers and `text-overflow: ellipsis` are exempt. It also renders components and patterns in a
@@ -341,9 +341,11 @@ does not keep rule order: give queries on one property exclusive ranges, such as
341
341
 
342
342
  Use the project's image component; give `priority` to the view's main visible image only, since
343
343
  lazy loading above the fold hurts. Call `preloadFonts()` from `tokens/fonts.preload.generated.ts`
344
- in the app entry when it exists. `ads check` fails unsized or unchosen `<img>` (`img-attributes`)
345
- and oversized assets (`asset-image-budget`); `ads audit` fails layout shift above 0.1
346
- (`layout-shift`). ADS does not cover page metadata, `noindex`, sitemaps or hosting: run Lighthouse
344
+ in the app entry when it exists, or put its `fontPreloadTags()` in the page from a build step for an
345
+ earlier preload. `ads check` fails unsized or unchosen `<img>` (`img-attributes`), oversized assets
346
+ (`asset-image-budget`, `asset-font-budget`) and a weight no face covers (`font-weight-missing`);
347
+ `ads audit` fails layout shift above 0.1 (`layout-shift`) and an image at another shape than it
348
+ declares (`img-shape`). ADS does not cover page metadata, `noindex`, sitemaps or hosting: run Lighthouse
347
349
  on a production build with real URLs. Read [performance.md](references/performance.md)
348
350
  (`ads://guides/performance`).
349
351
 
@@ -30,7 +30,7 @@ artwork; component styles still use tokens.
30
30
  `--display-brand-<brand>` the same way.
31
31
  - **Show it in a component.** A logo appears in the UI through a project
32
32
  component (the starter's `components/Content/Logo`) that imports the SVG with
33
- `?url`. Artwork that nothing uses is reported (`brand-unused`).
33
+ a plain import, which gives its URL. Artwork that nothing uses is reported (`brand-unused`).
34
34
  - **Preview it.** Brand previews are the showcase's first section, **Brand**. They
35
35
  live in `brand/`, grouped by folder like components: the starter has
36
36
  `brand/Identity/Logo` and `brand/Icons/AppIcon`, rendered by the review
@@ -147,7 +147,7 @@ the rule it is used under. Their owners' trademark and usage guidelines
147
147
  apply: use the official artwork, keep its colors and proportions, and do not change
148
148
  it to match the project's look.
149
149
 
150
- Show them as images: import the file with `?url` and render an `<img>` with an
150
+ Show them as images: import the file, which gives its URL, and render an `<img>` with an
151
151
  `alt` that names the product, or `alt=""` beside text that already names it.
152
152
 
153
153
  Never mute, tint or recolor another product's logo. Use a one-color version only where
@@ -167,19 +167,26 @@ When it fires, pick the fix by what the element is:
167
167
  | A small part: an icon, control, handle or thumbnail | Size it at 96 px or less, plainly: `width: 64px`, `width: var(--control-height-lg)` |
168
168
  | A panel, column or anything that can give way | `width: min(100%, 280px)`, `flex: 1 1 280px` or a `minmax(0, 280px)` track |
169
169
  | A part that truly stays that wide | A token listed in `layout.widthTokens` in `ds.config.json`, used plainly: `width: var(--side-pane-width)` |
170
+ | A resizable part | A `clamp()` of three such tokens; a runtime variable needs a declared fallback: `clamp(var(--pane-min), var(--ux-pane, var(--pane)), var(--pane-max))` |
170
171
  | An overlay: dialog, menu, popover, tooltip | Its owner in `layout.fixedWidthUnits`, by unit id or file glob |
171
172
 
172
173
  These do not fix it:
173
174
 
174
175
  - Another unit. `32.5ch`, `20em` and `20rem` are as fixed as `280px`, and depend on the font too.
176
+ `ch` and `em` are measured at the rule's `font-size`, or 16 px.
175
177
  - `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)`: they cannot shrink below
176
178
  their fixed part.
177
- - `min(100%, 64px)` around a small part: `layout-width-noop` asks for the plain size.
179
+ - `min(100%, 64px)` around a small part. `layout-width-noop` asks for the plain size; in a flex or
180
+ grid parent the percentage can affect wrapping, so compare the scenario after changing it.
178
181
  - A token name. `--control-*`, `--side-pane-*` and every other name are read for their value.
179
182
 
180
183
  `ads check` lists every declared fixed width for review (`layout-declared-width`). There is no
181
184
  per-declaration exception.
182
185
 
186
+ `ads audit` opens each control with `aria-haspopup` and measures what opens, hovers and focuses
187
+ controls for contrast, and checks a control with `aria-busy="true"`. So give overlay triggers
188
+ `aria-haspopup`, or render the overlay open in its scenario, and render a busy example.
189
+
183
190
  `layout-overflow` (`ads audit`) renders every UI scenario at 390, 768 and 1280 px and fails on
184
191
  horizontal page overflow, elements past the viewport and clipped content. `overflow-x: auto`
185
192
  scrollers and `text-overflow: ellipsis` are exempt. It also renders components and patterns in a
@@ -40,6 +40,18 @@ Suggestions for large content images:
40
40
  network panel. The file should be the smallest candidate at least as wide as the image at that
41
41
  device's pixel ratio.
42
42
 
43
+ `img-shape` (`ads audit`) fails a visible image whose box differs from its CSS `aspect-ratio`, or,
44
+ with none and `object-fit: fill`, from its `width` and `height`. `aspect-ratio` with both attributes
45
+ needs `height: auto`, or the height attribute wins and the image crops: it still reserves its space
46
+ and passes `layout-shift`. A deliberate crop sets `object-fit` in a box of its own, with no
47
+ `aspect-ratio`.
48
+
49
+ Other choices that are the project's, since ADS owns no image pipeline:
50
+
51
+ - Load lazily below the fold, and never the main image.
52
+ - A light and a dark eager `<img>` download both. Where only the system theme applies, use one `<img>`
53
+ with a dark `<source>` and one preload per scheme. `<picture>` cannot see a page's `data-theme`.
54
+
43
55
  Preloading the main image, as a suggestion:
44
56
 
45
57
  - `priority` makes the browser fetch the image once it sees the `<img>`. In a client-rendered app
@@ -55,13 +67,47 @@ Preloading the main image, as a suggestion:
55
67
 
56
68
  ## Fonts
57
69
 
58
- - Serve WOFF2 from `assets/fonts`, declared in `tokens/fonts.css`, with `font-display: swap`.
70
+ `ads check` holds what `tokens/fonts.css` declares against the CSS:
71
+
72
+ | Rule | Fails or flags | Do |
73
+ |---|---|---|
74
+ | `font-weight-missing` (error) | A weight no face covers, which the browser fakes or replaces | Add the file, use a variable font with a weight range, or use a declared weight |
75
+ | `asset-font-budget` (error) | A file above 150 KB, or `assets.fontBudgetKb` | Use WOFF2 and subset it |
76
+ | `font-file-unused` (review) | A face no CSS uses | Remove it and the file |
77
+ | `font-display` (review) | None, or `optional` | Use `swap`: `optional` decides per file, and can leave some weights in the fallback on one page |
78
+ | `font-format` (review) | Not WOFF2 | Convert it |
79
+
80
+ Choosing fonts:
81
+
82
+ - Prefer one variable font to a file per weight: one request covers every weight.
83
+ - Serve a Latin subset as WOFF2, with other scripts as separate `unicode-range` files, so a page only
84
+ downloads what it draws.
85
+ - Give files hashed names and long-lived caching.
86
+ - Size a fallback to match the font to reduce shift. A word can still rewrap.
87
+
88
+ Preloading:
89
+
59
90
  - When body or heading text uses a declared font, `ads assets` writes
60
91
  `tokens/fonts.preload.generated.ts` naming only those files. `ads check` fails it when stale
61
92
  (`themes-generated`). Without such a font it is not generated.
62
- - Call `preloadFonts()` from it in the app entry, before the first render. It imports each file
63
- through the bundler, so the preload and the stylesheet request one URL. A hand-written preload
64
- URL that differs downloads the font twice.
93
+ - Preload one file per typeface the first screen uses. More compete with what matters.
94
+ - If headings get their font per component, `ads assets` cannot read it from `base.css`: list the files
95
+ in `assets.preloadFonts` in `ds.config.json`, as `{ "family": "Heading", "weight": 700 }` entries. A
96
+ family or weight `tokens/fonts.css` does not have is an error (`font-preload-config`).
97
+ - `preloadFonts()` runs from JavaScript, so it starts late. For an early preload, have the build step
98
+ or prerender put `fontPreloadTags()` in the HTML. Send `fontPreloadHeader()` as a `Link` header too:
99
+ that works on any host, and a CDN can turn it into `103 Early Hints` where supported.
100
+ - Use these rather than hand-written tags. A URL or `crossorigin` that differs from the stylesheet's
101
+ request downloads the file twice. Set the bundler's public path, so the URL works from any page.
102
+ - Use `preconnect` only when fonts are on another host.
103
+
104
+ Measure first paint on a slow connection and read which face is actually drawn, in the browser's
105
+ rendered-fonts panel. `document.fonts` reports loaded faces, which may not be in use.
106
+
107
+ ## Width
108
+
109
+ `max-width` caps stay fluid and are fine; a fixed `width` is the problem. A very wide window needs caps
110
+ on text and screenshots, or they grow without limit.
65
111
 
66
112
  ## CSS delivery
67
113
 
@@ -81,6 +127,10 @@ late content, and preloading first-text fonts. It runs where the browser reports
81
127
  Run Lighthouse on a production build and real URLs before tuning. Once Largest Contentful Paint is
82
128
  under 2.5 s, preloads and delivery changes bring modest gains.
83
129
 
130
+ Find which metric is red first. Insights such as the network dependency tree do not score by
131
+ themselves. Compare screenshots against a baseline taken before the change: a broken baseline hides
132
+ regressions.
133
+
84
134
  ## What ADS does not cover
85
135
 
86
136
  - Page metadata, `noindex`, `robots.txt` and sitemaps belong to the application.
@@ -167,19 +167,26 @@ When it fires, pick the fix by what the element is:
167
167
  | A small part: an icon, control, handle or thumbnail | Size it at 96 px or less, plainly: `width: 64px`, `width: var(--control-height-lg)` |
168
168
  | A panel, column or anything that can give way | `width: min(100%, 280px)`, `flex: 1 1 280px` or a `minmax(0, 280px)` track |
169
169
  | A part that truly stays that wide | A token listed in `layout.widthTokens` in `ds.config.json`, used plainly: `width: var(--side-pane-width)` |
170
+ | A resizable part | A `clamp()` of three such tokens; a runtime variable needs a declared fallback: `clamp(var(--pane-min), var(--ux-pane, var(--pane)), var(--pane-max))` |
170
171
  | An overlay: dialog, menu, popover, tooltip | Its owner in `layout.fixedWidthUnits`, by unit id or file glob |
171
172
 
172
173
  These do not fix it:
173
174
 
174
175
  - Another unit. `32.5ch`, `20em` and `20rem` are as fixed as `280px`, and depend on the font too.
176
+ `ch` and `em` are measured at the rule's `font-size`, or 16 px.
175
177
  - `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)`: they cannot shrink below
176
178
  their fixed part.
177
- - `min(100%, 64px)` around a small part: `layout-width-noop` asks for the plain size.
179
+ - `min(100%, 64px)` around a small part. `layout-width-noop` asks for the plain size; in a flex or
180
+ grid parent the percentage can affect wrapping, so compare the scenario after changing it.
178
181
  - A token name. `--control-*`, `--side-pane-*` and every other name are read for their value.
179
182
 
180
183
  `ads check` lists every declared fixed width for review (`layout-declared-width`). There is no
181
184
  per-declaration exception.
182
185
 
186
+ `ads audit` opens each control with `aria-haspopup` and measures what opens, hovers and focuses
187
+ controls for contrast, and checks a control with `aria-busy="true"`. So give overlay triggers
188
+ `aria-haspopup`, or render the overlay open in its scenario, and render a busy example.
189
+
183
190
  `layout-overflow` (`ads audit`) renders every UI scenario at 390, 768 and 1280 px and fails on
184
191
  horizontal page overflow, elements past the viewport and clipped content. `overflow-x: auto`
185
192
  scrollers and `text-overflow: ellipsis` are exempt. It also renders components and patterns in a
@@ -167,19 +167,26 @@ When it fires, pick the fix by what the element is:
167
167
  | A small part: an icon, control, handle or thumbnail | Size it at 96 px or less, plainly: `width: 64px`, `width: var(--control-height-lg)` |
168
168
  | A panel, column or anything that can give way | `width: min(100%, 280px)`, `flex: 1 1 280px` or a `minmax(0, 280px)` track |
169
169
  | A part that truly stays that wide | A token listed in `layout.widthTokens` in `ds.config.json`, used plainly: `width: var(--side-pane-width)` |
170
+ | A resizable part | A `clamp()` of three such tokens; a runtime variable needs a declared fallback: `clamp(var(--pane-min), var(--ux-pane, var(--pane)), var(--pane-max))` |
170
171
  | An overlay: dialog, menu, popover, tooltip | Its owner in `layout.fixedWidthUnits`, by unit id or file glob |
171
172
 
172
173
  These do not fix it:
173
174
 
174
175
  - Another unit. `32.5ch`, `20em` and `20rem` are as fixed as `280px`, and depend on the font too.
176
+ `ch` and `em` are measured at the rule's `font-size`, or 16 px.
175
177
  - `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)`: they cannot shrink below
176
178
  their fixed part.
177
- - `min(100%, 64px)` around a small part: `layout-width-noop` asks for the plain size.
179
+ - `min(100%, 64px)` around a small part. `layout-width-noop` asks for the plain size; in a flex or
180
+ grid parent the percentage can affect wrapping, so compare the scenario after changing it.
178
181
  - A token name. `--control-*`, `--side-pane-*` and every other name are read for their value.
179
182
 
180
183
  `ads check` lists every declared fixed width for review (`layout-declared-width`). There is no
181
184
  per-declaration exception.
182
185
 
186
+ `ads audit` opens each control with `aria-haspopup` and measures what opens, hovers and focuses
187
+ controls for contrast, and checks a control with `aria-busy="true"`. So give overlay triggers
188
+ `aria-haspopup`, or render the overlay open in its scenario, and render a busy example.
189
+
183
190
  `layout-overflow` (`ads audit`) renders every UI scenario at 390, 768 and 1280 px and fails on
184
191
  horizontal page overflow, elements past the viewport and clipped content. `overflow-x: auto`
185
192
  scrollers and `text-overflow: ellipsis` are exempt. It also renders components and patterns in a
@@ -167,19 +167,26 @@ When it fires, pick the fix by what the element is:
167
167
  | A small part: an icon, control, handle or thumbnail | Size it at 96 px or less, plainly: `width: 64px`, `width: var(--control-height-lg)` |
168
168
  | A panel, column or anything that can give way | `width: min(100%, 280px)`, `flex: 1 1 280px` or a `minmax(0, 280px)` track |
169
169
  | A part that truly stays that wide | A token listed in `layout.widthTokens` in `ds.config.json`, used plainly: `width: var(--side-pane-width)` |
170
+ | A resizable part | A `clamp()` of three such tokens; a runtime variable needs a declared fallback: `clamp(var(--pane-min), var(--ux-pane, var(--pane)), var(--pane-max))` |
170
171
  | An overlay: dialog, menu, popover, tooltip | Its owner in `layout.fixedWidthUnits`, by unit id or file glob |
171
172
 
172
173
  These do not fix it:
173
174
 
174
175
  - Another unit. `32.5ch`, `20em` and `20rem` are as fixed as `280px`, and depend on the font too.
176
+ `ch` and `em` are measured at the rule's `font-size`, or 16 px.
175
177
  - `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)`: they cannot shrink below
176
178
  their fixed part.
177
- - `min(100%, 64px)` around a small part: `layout-width-noop` asks for the plain size.
179
+ - `min(100%, 64px)` around a small part. `layout-width-noop` asks for the plain size; in a flex or
180
+ grid parent the percentage can affect wrapping, so compare the scenario after changing it.
178
181
  - A token name. `--control-*`, `--side-pane-*` and every other name are read for their value.
179
182
 
180
183
  `ads check` lists every declared fixed width for review (`layout-declared-width`). There is no
181
184
  per-declaration exception.
182
185
 
186
+ `ads audit` opens each control with `aria-haspopup` and measures what opens, hovers and focuses
187
+ controls for contrast, and checks a control with `aria-busy="true"`. So give overlay triggers
188
+ `aria-haspopup`, or render the overlay open in its scenario, and render a busy example.
189
+
183
190
  `layout-overflow` (`ads audit`) renders every UI scenario at 390, 768 and 1280 px and fails on
184
191
  horizontal page overflow, elements past the viewport and clipped content. `overflow-x: auto`
185
192
  scrollers and `text-overflow: ellipsis` are exempt. It also renders components and patterns in a
@@ -1,4 +1,4 @@
1
- import appIcon from "../../../assets/brand/app-icon.svg?url";
1
+ import appIcon from "../../../assets/brand/app-icon.svg";
2
2
 
3
3
  export const fixture = {
4
4
  title: "App icon",
@@ -1,5 +1,5 @@
1
- import logo from "../../../assets/brand/logo.svg?url";
2
- import logoDark from "../../../assets/brand/logo.dark.svg?url";
1
+ import logo from "../../../assets/brand/logo.svg";
2
+ import logoDark from "../../../assets/brand/logo.dark.svg";
3
3
 
4
4
  export const fixture = {
5
5
  title: "Logo",
@@ -1,6 +1,6 @@
1
1
  import { css, cx } from "@linaria/atomic";
2
- import logo from "../../../assets/brand/logo.svg?url";
3
- import logoDark from "../../../assets/brand/logo.dark.svg?url";
2
+ import logo from "../../../assets/brand/logo.svg";
3
+ import logoDark from "../../../assets/brand/logo.dark.svg";
4
4
 
5
5
  export interface LogoProps {
6
6
  /** The product name, read by assistive technology. */
@@ -18,6 +18,12 @@ the enforceable contract, [GUIDE.md](GUIDE.md) covers tool integration, and the
18
18
 
19
19
  ## Shared tooling, project-owned design
20
20
 
21
+ Skills ship in the package and are served as an immutable snapshot, each file under
22
+ `skill://ads/<name>/`. Connections on protocol `2026-07-28` get the skills extension: entries with
23
+ verbatim frontmatter and complete manifests, each digest computed from the bytes served, and directory
24
+ reads. Earlier connections get the same files as ordinary resources and through tools. ADS serves
25
+ content; verification, approval and activation belong to the host.
26
+
21
27
  The shared layer supplies architectural rules, token definitions, checks,
22
28
  skills, and setup. Components, patterns, themes, and examples are authored in
23
29
  the project or brought in through explicit imports and adaptations.
@@ -802,8 +808,26 @@ that float above the layout (`layout.fixedWidthUnits`) in `ds.config.json`, and
802
808
  both for review; ADS knows a unit's layer, not whether it is an overlay, and there is no
803
809
  per-declaration exception. The browser
804
810
  audit adds what source cannot show: axe-core, non-text contrast of control borders and icons,
805
- and horizontal overflow at 390, 768 and 1280 px, by resizing each rendered scenario, and in a
806
- 240 px container for components and patterns, where a set width above the small-part limit must fit.
811
+ image shape and horizontal overflow at 390, 768 and 1280 px, by resizing each rendered scenario. It
812
+ also narrows components and patterns to a 240 px container: a set width above the small-part limit
813
+ that overflows it is a review item, since whether a part ever sits in a pane takes judgement.
814
+
815
+ Each render waits, bounded, for its content to settle before anything is measured, and says so when it
816
+ did not. The audit also renders what a scenario shows only after someone acts on it. It opens what
817
+ `aria-haspopup` controls open, and hovers and focuses controls for contrast. Each worker lists what
818
+ every render could measure, then assigns targets in request order, so which render measures a shared
819
+ control does not depend on page speed. Its result states what it covered, and what it skipped is an
820
+ info item per reason.
821
+
822
+ Static errors split by what they stop. A preview session the audit starts renders despite policy
823
+ errors, records no pass, and reports them with the audit's findings; the audit still exits non-zero.
824
+ Only errors that stop rendering block it (source and CSS syntax, project structure, the styles entry,
825
+ scenario contracts). `ads check`, `ads compile`, validation and acceptance stop on every error.
826
+
827
+ Fonts are read from `tokens/fonts.css` and `base.css`. `ads assets` generates a module naming the files
828
+ the first text uses, importing each plainly so that Vite, Bun and the preview compiler give the
829
+ stylesheet's URL. `ads check` holds declared faces against the weights CSS uses. ADS writes no HTML and
830
+ touches no hosting: the module's list, tags and header value are for the project to place.
807
831
 
808
832
  Static checks establish the policies and source formats they cover. Behavior
809
833
  tests and browser review verify the resulting accessibility, layout, themes,
package/docs/CHANGELOG.md CHANGED
@@ -1,34 +1,114 @@
1
1
  # Changelog
2
2
 
3
- ## 0.3.51
3
+ ## 0.3.53
4
4
 
5
5
  <!-- ads-local-tests:start -->
6
- Local verification: **761/761 passed** with `ADS_TEST_BUN=1 npm test`.
7
- Tested commit: `cae074c849f112f2fdc8990f8c031ad8f78f9067`; Node v24.13.0, Bun 1.4.1.
8
- Completed 2026-11-02T11:24:28.751Z (1176 seconds).
6
+ Local verification: **783/783 passed** with `ADS_TEST_BUN=1 npm test`.
7
+ Tested commit: `8f3a806ac725a95486d5a607e67b6ec4e534c8f4`; Node v24.13.0, Bun 1.4.1.
8
+ Completed 2026-11-03T00:48:45.537Z (1159 seconds).
9
9
 
10
10
  <!-- ads-local-test-proof
11
11
  {
12
12
  "schema": 1,
13
- "version": "0.3.51",
14
- "commit": "cae074c849f112f2fdc8990f8c031ad8f78f9067",
15
- "sourceSha256": "c849cba78c92ca5eb0383308ff7f15f012a5f8dad6ddd49e2e9ce644041e85b6",
13
+ "version": "0.3.53",
14
+ "commit": "8f3a806ac725a95486d5a607e67b6ec4e534c8f4",
15
+ "sourceSha256": "45f075cbced8c463385133739ed676adc4cd15954e507c946ecec8f73f71c545",
16
16
  "command": "ADS_TEST_BUN=1 npm test",
17
17
  "result": "pass",
18
- "tests": 761,
19
- "pass": 761,
18
+ "tests": 783,
19
+ "pass": 783,
20
20
  "fail": 0,
21
21
  "cancelled": 0,
22
22
  "skipped": 0,
23
23
  "node": "v24.13.0",
24
24
  "bun": "1.4.1",
25
- "completedAt": "2026-11-02T11:24:28.751Z",
26
- "durationMs": 1175664,
27
- "logSha256": "5042dab0442851693b09d13d7068acaaa84d62ddff3f169ecbda29af3df988f2"
25
+ "completedAt": "2026-11-03T00:48:45.537Z",
26
+ "durationMs": 1158876,
27
+ "logSha256": "43e59421b92a927e4319b81a0aab98cb51e0f38d227ffc7f8be166d68d0b368c"
28
28
  }
29
29
  -->
30
30
  <!-- ads-local-tests:end -->
31
31
 
32
+ - **Run `ads assets` once after upgrading.** The generated font module changed, so `ads check` fails it as
33
+ stale (`themes-generated`) until then.
34
+ - **`assets.preloadFonts` names the fonts to preload.** An array of `{ family, weight }` replaces the
35
+ reading of `base.css`; a variable range counts as a match. An entry `tokens/fonts.css` does not have
36
+ is a `font-preload-config` error. Without it, nothing changes.
37
+ - **`npm run build` syncs skill references** before it continues, so editing
38
+ `skills/ads-designer/references/` and building leaves every skill current. `lint:tool` run alone and
39
+ `release:verify` still fail on copies that differ, and the proof refuses a sync left uncommitted.
40
+ - **MCP SDKs updated, and skills checked against the final extension.** `@modelcontextprotocol/server` and
41
+ `client` 2.4.0, `ext-apps` 2.0.4, `sdk` 1.32.2. `skills/list` now returns all skills at once instead of
42
+ two per page, and `resources/directory/read` now carries `ttlMs` and `cacheScope`.
43
+ - **The audit measures settled content.** It waits, up to 5 s, for no change in the scenario for 500 ms,
44
+ no finite animation and nothing loading, so colours that land after first render are measured every
45
+ run. A page that never settles is a `content-still-changing` info item.
46
+ - **Font rules.** New errors: `font-weight-missing` for a weight no face in `tokens/fonts.css` covers, and
47
+ `asset-font-budget` for a file above 150 KB (`assets.fontBudgetKb`). New review items: `font-file-unused`,
48
+ `font-display` (none or `optional`), `font-format` (not WOFF2). Weight ranges and faces with no
49
+ `font-weight` cover what they span. System-font projects get none of this. Run `ads assets` to
50
+ regenerate the preload module.
51
+ - **Plain `bun build` works with generated fonts and the starter Logo.** The generated module and the
52
+ starter import files plainly, not with `?url`, which Bun cannot resolve. Vite and the preview compiler
53
+ read both.
54
+ - **Early font preloads.** The generated module adds `fontPreloadTags()` and `fontPreloadHeader()`, for a
55
+ build step or prerender to put the exact URLs in HTML or a `Link` header. It still selects the same
56
+ files.
57
+ - **The performance guide** covers font choices and preloading, image shape and theme pairs, width caps,
58
+ and how to read Lighthouse.
59
+ - **The audit says what it covers.** A new line reports renders, overlays opened and controls measured,
60
+ and the result gains `coverage`. What was skipped is an info item per reason (`browser-audit-skipped`):
61
+ an overlay that did not open, a trigger or control that left the page or timed out, a cap reached
62
+ with no other scenario holding those targets. A render that could measure none of its targets is
63
+ a `browser-audit-nothing-measured` review item. A page that fails to render stays a `browser-audit` error.
64
+ - **Coverage is the same each run.** A shared control or trigger is now measured by the first scenario in
65
+ request order, not the first page to load, which also fixes which scenario a shared finding names.
66
+ Brands no longer share that bookkeeping. Controls that failed no longer count as measured. An overlay
67
+ whose element a closed one left behind now counts as opening, a trigger gets a second click, and a
68
+ focus outline is read after its transition.
69
+ - **The focus check skips what a keyboard cannot reach:** `aria-hidden` on it or an ancestor, `inert`, and
70
+ `tabindex="-1"` outside a composite widget that holds a `tabindex="0"`. Hover is still measured.
71
+ - **New `img-shape` error.** The audit fails a visible image whose box differs from its CSS `aspect-ratio`,
72
+ or, with none and `object-fit: fill`, from its `width` and `height`. A height attribute beats
73
+ `aspect-ratio` unless the CSS says `height: auto`, so such an image reserves its space and passes
74
+ `layout-shift` while cropped.
75
+
76
+ ## 0.3.52
77
+
78
+ - **The audit opens overlays.** It clicks each distinct `aria-haspopup` control, up to 3 per render,
79
+ and runs axe, non-text contrast and a phone-width check on what opens, in every theme. An overlay a
80
+ scenario renders open is measured the same way. Results name the state, such as
81
+ `open overlay "Edit": button`. New `overlaysOpened` in the audit result.
82
+ - **The audit measures hover, keyboard focus and busy.** Up to 6 distinct controls per render are
83
+ hovered and focused: axe `color-contrast` and non-text contrast under hover, and a focus outline at
84
+ 3:1 against what is around it (`a11y-non-text-contrast`, kind `focus`). What already fails at rest
85
+ is not repeated. A control with `aria-busy="true"` is checked even when disabled, and its spinner
86
+ even when it has text, if the scenario renders it busy. New `controlsMeasured` in the result.
87
+ - **Nothing is hovered at rest.** The audit parks the mouse first: an element at the page's corner
88
+ was measured in its hover state.
89
+ - **A font preloaded in a preview is one download.** The Bun preview compiler named one file twice
90
+ when a stylesheet and a `?url` import both reached it. Files with nothing rewritten in them are now
91
+ named by their bytes.
92
+ - **`layout-overflow-narrow` leaves out what folds on a viewport query.** A finding that clears at the
93
+ phone viewport, still in the 240 px container, is site chrome that responds to the window.
94
+ - **The viewport overflow check sees inside a preview frame.** The outermost box as tall as the window no
95
+ longer counts as an intended scroller or clip, so `overflow-y: auto` on a project's frame stops
96
+ exempting everything in it. This can surface new `layout-overflow` errors on upgrade.
97
+ - **`ch` and `em` follow the rule's font size.** `layout-fixed-width` measures them at a `font-size`
98
+ set in the same rule, through its token. Otherwise it stays at 16 px.
99
+ - **A resizable part has a route.** `layout-fixed-width` accepts a `clamp()` whose three values are
100
+ all `layout.widthTokens` tokens, also through a local variable, and each stays listed for review. A
101
+ runtime variable there needs a declared fallback. With no fallback, the clamp's floor is measured.
102
+ - **`layout-width-noop` is more careful.** It says the value does not protect against overflow and a
103
+ plain size is clearer, and to compare the scenario after changing it, since the percentage can
104
+ affect wrapping in a flex or grid parent.
105
+ - **Policy errors no longer stop `ads audit`.** It renders every scenario and reports them with its
106
+ own findings, and exits 1. Only errors that stop rendering block it: `source-syntax`, `css-syntax`,
107
+ `project-structure`, `styles-entry`, `scenario-contract`. `ads check`, `ads compile` and
108
+ `ads validate` are unchanged, and the audit's result gains `staticErrors`.
109
+
110
+ ## 0.3.51
111
+
32
112
  - **The audit lists what axe could not decide.** New `a11y-incomplete` info item, one per scenario,
33
113
  axe rule and element set, with the elements and axe's reason, such as `bgGradient`: check it by
34
114
  hand. It fails nothing. `incomplete` in the audit result now counts these items, and the text
package/docs/GUIDE.md CHANGED
@@ -70,6 +70,16 @@ changes mark images stale. There is no previous slot, history or TTL.
70
70
  updates when supported, and explicitly reread otherwise. Screenshots provide visual
71
71
  evidence for one state; they do not replace behavior checks.
72
72
 
73
+ ADS serves its skills over MCP, by what the client speaks:
74
+
75
+ | Client | How it gets skills |
76
+ |---|---|
77
+ | Protocol `2026-07-28` | The `io.modelcontextprotocol/skills` extension: `skills/list` and `skills/get` give each skill's frontmatter and its complete file list with digests and sizes, `resources/directory/read` lists a folder, and `resources/read` gets a file |
78
+ | Earlier protocols | `skill://` resources through `resources/list` and `resources/read`, and the `ads_skills` and `ads_read_skill` tools |
79
+
80
+ Whether a skill is loaded into an agent's context is up to the host. `npx skills` installs them locally
81
+ for a host that does not read them over MCP.
82
+
73
83
  The [MCP guide](MCP.md) details tool/resource schemas, prompts, skills and
74
84
  notifications. The portable [capture guide](../skills/ads-designer/references/captures.md)
75
85
  explains screenshot setup, named targets, limits and comparison usage; MCP serves
@@ -596,14 +606,14 @@ so what counts is whether it can shrink.
596
606
  | Value | Result |
597
607
  |---|---|
598
608
  | 96 px or less, in any unit, raw, through a token or by arithmetic: `64px`, `12ch`, `var(--control-height-lg)` | Pass: a small part may use a plain size |
599
- | Fixed above 96 px, in any unit: `280px`, `32.5ch`, `20rem`, `var(--space-80)`, `calc(var(--space-32) * 10)` | Error. `ch`, `em`, `ex`, `lh` and `rem` are fixed lengths, estimated at a 16 px font |
609
+ | Fixed above 96 px, in any unit: `280px`, `32.5ch`, `20rem`, `var(--space-80)`, `calc(var(--space-32) * 10)` | Error. `ch`, `em`, `ex`, `lh` and `rem` are fixed lengths, estimated at the same rule's `font-size`, or 16 px |
600
610
  | Unable to shrink below 96 px: `max(100%, 280px)`, `clamp(200px, 50%, 400px)`, `calc(100% + 200px)`, a `minmax(200px, 1fr)` track | Error |
601
611
  | Able to shrink: `min(100%, 280px)`, `calc(100% - 200px)`, `50cqi`, a `minmax(0, 280px)` track, `width: 280px` with `max-width: 100%` in the same rule | Pass |
602
612
  | A flex item that grows and shrinks: `flex: 1 1 280px` | Pass |
603
613
  | A track repeated with `auto-fill` or `auto-fit`: `repeat(auto-fit, minmax(200px, 1fr))` | Pass: it wraps |
604
614
  | `%`, `fr`, viewport and container units, `auto`, `min-content`, `max-content`, `fit-content` | Pass |
605
615
  | `max-width`, `max-inline-size`, in any unit: `max-width: 1400px` | Not read: a maximum cannot force overflow |
606
- | A token named by `layout.widthTokens`, used plainly | Pass, and listed for review when it is fixed |
616
+ | A token named by `layout.widthTokens`, used plainly, or a `clamp()` whose three values all are, such as a resizable pane: `clamp(var(--pane-min), var(--ux-pane, var(--pane)), var(--pane-max))` | Pass, and each is listed for review when it is fixed. A runtime variable there needs a declared fallback |
607
617
  | A variable with no definition ADS can read: `var(--set-at-runtime)` | Pass: `layout-overflow` renders it |
608
618
 
609
619
  No token name is exempt: `var(--side-pane-width)` is 280 px whatever it is called.
@@ -631,8 +641,9 @@ The fix depends on the part:
631
641
 
632
642
  `layout-declared-width` is a review item for each fixed `widthTokens` token, with how many widths
633
643
  use it, and for each `fixedWidthUnits` file that sets a fixed width. `layout-width-noop` is a
634
- review item for a `min()` or `clamp()` that never exceeds 96 px, such as `min(100%, 64px)`: write
635
- the plain size. An entry that matches no token, unit or file is a `layout-config` error, and an
644
+ review item for a `min()` or `clamp()` that never exceeds 96 px, such as `min(100%, 64px)`. It does
645
+ not protect against overflow and a plain size is clearer, but in a flex or grid parent the percentage
646
+ can affect wrapping, so compare the scenario after changing it. An entry that matches no token, unit or file is a `layout-config` error, and an
636
647
  entry cannot name every token or unit.
637
648
 
638
649
  `layout-overflow` (browser audit) resizes each rendered scenario, in every theme and brand, to
@@ -642,11 +653,35 @@ entry cannot name every token or unit.
642
653
  - An element reaches past the viewport's edge; the outermost such element is named.
643
654
  - An element with `overflow-x: hidden` or `clip` cuts off content more than 4 px wider.
644
655
 
645
- Exempt: `overflow-x: auto` or `scroll` scrollers and their content, `text-overflow: ellipsis`,
646
- carousels (`aria-roledescription="carousel"`), native text fields, fixed-position layers and visually hidden content.
656
+ Exempt: `overflow-x: auto` or `scroll` scrollers and their content, except the outermost one as tall as the window, which is the page or a preview frame; `text-overflow: ellipsis`,
657
+ carousels (`aria-roledescription="carousel"`), pannable widgets (`role="application"`), native text fields, fixed-position layers and visually hidden content.
647
658
 
648
659
  Each measurement waits for layout to stop moving, so a component that refits after a resize is
649
- measured after it refits.
660
+ measured after it refits. Before measuring anything, the audit waits up to 5 s for the page to settle:
661
+ no change in the scenario for 500 ms, no finite animation running, and nothing still loading. Content
662
+ that arrives late, such as syntax colours, is then measured every run. A page that never settles is
663
+ measured anyway and reported as `content-still-changing`.
664
+
665
+ The audit also renders what a scenario shows after someone acts on it, in every theme and brand.
666
+ Findings name the state in the selector, such as `open overlay "Edit": button` or `hover: button`.
667
+ The result's `coverage`, also printed as a `Covered:` line, gives what was measured. What was skipped is
668
+ a `browser-audit-skipped` info item per reason, with up to 5 examples. A render that could measure none
669
+ of its targets is a `browser-audit-nothing-measured` review item.
670
+
671
+ - **Overlays.** It clicks each distinct control with `aria-haspopup`, up to 3 per render, once per
672
+ theme and brand across the audit. What opens
673
+ (`dialog`, `alertdialog`, `menu`, `listbox` roles, an open `<dialog>` or popover) gets axe, non-text
674
+ contrast, and must fit the 390 px viewport. Give a trigger `aria-haspopup`, or render the overlay
675
+ open in its scenario. Tooltips are not opened.
676
+ - **Hover and focus.** Up to 6 controls per render, in document order, each distinct control once per
677
+ theme and brand on the same surface, measured by the first scenario in request order. Focus skips a
678
+ control a keyboard cannot reach: `aria-hidden` on it or an ancestor, `inert`, or `tabindex="-1"`
679
+ outside a `group`, `tablist`, `menu`, `menubar`, `radiogroup`, `toolbar`, `listbox`, `tree` or `grid` that
680
+ holds a `tabindex="0"`. Under hover it runs axe
681
+ `color-contrast` and the non-text check. A `:focus-visible` outline needs 3:1 against what is around
682
+ it. A focus ring drawn with `box-shadow` is not read, and an outline beside one is left alone.
683
+ - **Busy.** A control with `aria-busy="true"` is checked even when disabled, and its icon even when it
684
+ has text. Render the busy state in the scenario: the audit does not press buttons to reach it.
650
685
 
651
686
  It also renders each component and pattern scenario with its container narrowed to 240 px, inside
652
687
  the 1280 px viewport, once per brand, to show what would not fit a side pane. These are
@@ -658,6 +693,8 @@ demo frame to a maximum.
658
693
  by its content, or by parts of 96 px or less, is not reported.
659
694
  - Not rendered this way: compositions, scenarios with a `main` landmark, which are pages, and owners
660
695
  in `layout.fixedWidthUnits`, which float above the layout.
696
+ - A finding that clears at the 390 px viewport, still in the 240 px container, is left out: it folds
697
+ on a viewport media query, such as a full-width site header.
661
698
 
662
699
  **Web performance.** MCP serves this as `ads://guides/performance`.
663
700
 
@@ -665,13 +702,26 @@ demo frame to a maximum.
665
702
  |---|---|---|
666
703
  | `img-attributes` | `ads check` | A raw `<img>` in components, patterns or compositions without `loading`, or without `width` and `height`, a visible `aspect-ratio`, a width and height in its style, or out-of-flow positioning. A `srcset` with width descriptors and no `sizes`, on `<img>` or the project's `Image`. A spread or a class from elsewhere is an `img-attributes-unresolved` info item |
667
704
  | `asset-image-budget` | `ads check` | An image in `assets/` over its limit: SVG 100 KB, WebP and AVIF 300 KB, JPEG 400 KB, PNG and GIF 500 KB. `assets.imageBudgetKb` is one limit for every format |
705
+ | `img-shape` | `ads audit` | A visible image whose box differs from its CSS `aspect-ratio`, or, with none and `object-fit: fill`, from its `width` and `height`. A height attribute beats `aspect-ratio`: add `height: auto`. `object-fit: cover` in a box of its own with no `aspect-ratio` is a deliberate crop |
668
706
  | `layout-shift` | `ads audit` | A scenario with Cumulative Layout Shift above 0.1 on first render, where the browser reports it (Chromium) |
669
707
  | `themes-generated` | `ads check` | A stale `tokens/fonts.preload.generated.ts` |
708
+ | `font-weight-missing` | `ads check` | CSS uses a weight of a family `tokens/fonts.css` declares and no face covers it. A range such as `100 900`, or a face with no `font-weight`, covers what it spans. A weight in a rule with no `font-family` counts against the body's family |
709
+ | `asset-font-budget` | `ads check` | A font file in `assets/` above 150 KB. `assets.fontBudgetKb` changes the limit |
710
+
711
+ Review items, which fail nothing: `font-file-unused` (a declared face no CSS uses; weights 400 and 700
712
+ count as used, since browsers apply them by default), `font-display` (none, or `optional`, which decides
713
+ per file and can leave some weights in the fallback on one page) and `font-format` (not WOFF2). A
714
+ project with no `@font-face` gets none of these.
670
715
 
671
716
  The starters' `Image` lazily loads and reserves space; `priority` marks the view's main visible
672
717
  image. When body or heading text uses a font from `tokens/fonts.css`, `ads assets` writes
673
718
  `tokens/fonts.preload.generated.ts`: call its `preloadFonts()` in the app entry before the first
674
- render. It imports the files through the bundler, so the preload and the stylesheet share one URL.
719
+ render. It imports the files through the bundler, Vite or Bun, so the preload and the stylesheet share
720
+ one URL. For a preload earlier than JavaScript, a build step or prerender can call `fontPreloadTags()`
721
+ for `<link>` tags or `fontPreloadHeader()` for a `Link` header value; `fontPreloads` is the same list.
722
+ A project that sets heading fonts per component names what to preload in `assets.preloadFonts`:
723
+ `[{ "family": "Body", "weight": 400 }, { "family": "Heading", "weight": 700 }]`. That list replaces the
724
+ reading of `base.css`, and an entry `tokens/fonts.css` cannot satisfy is a `font-preload-config` error.
675
725
  ADS does not cover page metadata, `noindex`, sitemaps or hosting; run Lighthouse on a production
676
726
  build with real URLs.
677
727
 
@@ -967,7 +1017,13 @@ preview, and its **Icons** tab shows the glyph set: every glyph at the size used
967
1017
  text, each one on its grid at every `--icon-*` size with its aliases and glyph errors, and
968
1018
  each file in `assets/logos/` as it is, on a white and a black tile.
969
1019
 
970
- `ads audit` adds a rendered check: axe-core (WCAG A/AA rules) in every component, pattern
1020
+ `ads audit` runs `ads check` first. A policy error such as `layout-fixed-width` or `img-attributes`
1021
+ does not stop it: it renders every scenario and reports those errors with its own, and exits 1. Only
1022
+ an error that stops rendering blocks it (`source-syntax`, `css-syntax`, `project-structure`,
1023
+ `styles-entry`, `scenario-contract`); a broken import fails the scenarios that reach it. `ads check`,
1024
+ `ads compile` and `ads validate` stop on every error, as before.
1025
+
1026
+ It adds a rendered check: axe-core (WCAG A/AA rules) in every component, pattern
971
1027
  and composition scenario, once per declared brand and theme (`--scenario`, `--theme` and
972
1028
  `--brand` narrow it). Each violation is an `a11y-axe` error naming the axe rule, WCAG
973
1029
  criterion, themes and brands, failing elements and help link, and `ads audit` exits 1. It