@reqvire-org/ads 0.3.52 → 0.4.0
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/README.md +10 -9
- package/dist/assets.mjs +16 -2
- package/dist/behaviors.mjs +6 -5
- package/dist/boundaries.mjs +5 -5
- package/dist/browser-audit/first-render.mjs +22 -0
- package/dist/browser-audit/image-shape.mjs +36 -0
- package/dist/browser-audit/render-states.mjs +61 -35
- package/dist/browser-audit/worker.mjs +47 -12
- package/dist/browser-audit.mjs +75 -12
- package/dist/bun-compiler.mjs +14 -7
- package/dist/check-service.mjs +83 -0
- package/dist/check.mjs +20 -18
- package/dist/cli.mjs +5 -3
- package/dist/config.mjs +20 -41
- package/dist/contracts.d.mts +9 -0
- package/dist/finding-rules.mjs +8 -1
- package/dist/font-rules.mjs +103 -0
- package/dist/fonts-generated.mjs +32 -12
- package/dist/generated-entries.mjs +131 -0
- package/dist/icons.mjs +1 -1
- package/dist/init.mjs +11 -32
- package/dist/layers.mjs +7 -3
- package/dist/lint-config.mjs +4 -2
- package/dist/mcp/catalog.mjs +2 -1
- package/dist/mcp/context.mjs +3 -3
- package/dist/mcp/drafts.mjs +136 -121
- package/dist/mcp/mutations.mjs +65 -19
- package/dist/mcp/preview-watch.mjs +31 -5
- package/dist/mcp/preview-widget.bundle.js +50 -47
- package/dist/mcp/project-widget.bundle.js +45 -42
- package/dist/mcp/prompts.mjs +1 -1
- package/dist/mcp/server.mjs +81 -40
- package/dist/mcp/showcase-host.mjs +20 -7
- package/dist/mcp/widget.bundle.js +49 -46
- package/dist/oxlint.mjs +3 -2
- package/dist/program-cache.mjs +36 -0
- package/dist/public-api.mjs +2 -1
- package/dist/scenarios-compiler.mjs +82 -14
- package/dist/scenarios-vite.mjs +1 -1
- package/dist/scenarios.mjs +4 -3
- package/dist/showcase/client.bundle.js +27 -27
- package/dist/showcase/index.html +2 -2
- package/dist/skills/ads-break-ui/SKILL.md +25 -28
- package/dist/skills/ads-break-ui/references/behaviors.md +7 -6
- package/dist/skills/ads-break-ui/references/captures.md +7 -32
- package/dist/skills/ads-break-ui/references/contracts.md +58 -25
- package/dist/skills/ads-break-ui/references/drafts.md +59 -43
- package/dist/skills/ads-break-ui/references/evidence.md +1 -1
- package/dist/skills/ads-break-ui/references/guarded-editing.md +58 -47
- package/dist/skills/ads-break-ui/references/review.md +9 -8
- package/dist/skills/ads-break-ui/references/scenarios.md +1 -1
- package/dist/skills/ads-break-ui/references/validation.md +8 -4
- package/dist/skills/ads-break-ui/references/workflows.md +15 -8
- package/dist/skills/ads-designer/SKILL.md +30 -31
- package/dist/skills/ads-designer/references/accessibility.md +9 -5
- package/dist/skills/ads-designer/references/behaviors.md +7 -6
- package/dist/skills/ads-designer/references/branding.md +2 -2
- package/dist/skills/ads-designer/references/captures.md +7 -32
- package/dist/skills/ads-designer/references/cli.md +5 -1
- package/dist/skills/ads-designer/references/contracts.md +58 -25
- package/dist/skills/ads-designer/references/drafts.md +59 -43
- package/dist/skills/ads-designer/references/evidence.md +1 -1
- package/dist/skills/ads-designer/references/guarded-editing.md +58 -47
- package/dist/skills/ads-designer/references/performance.md +57 -6
- package/dist/skills/ads-designer/references/review.md +9 -8
- package/dist/skills/ads-designer/references/scenarios.md +1 -1
- package/dist/skills/ads-designer/references/validation.md +8 -4
- package/dist/skills/ads-designer/references/workflows.md +15 -8
- package/dist/skills/ads-import/SKILL.md +25 -28
- package/dist/skills/ads-import/references/behaviors.md +7 -6
- package/dist/skills/ads-import/references/captures.md +7 -32
- package/dist/skills/ads-import/references/cli.md +5 -1
- package/dist/skills/ads-import/references/contracts.md +58 -25
- package/dist/skills/ads-import/references/drafts.md +59 -43
- package/dist/skills/ads-import/references/evidence.md +1 -1
- package/dist/skills/ads-import/references/guarded-editing.md +58 -47
- package/dist/skills/ads-import/references/review.md +9 -8
- package/dist/skills/ads-import/references/scenarios.md +1 -1
- package/dist/skills/ads-import/references/validation.md +8 -4
- package/dist/skills/ads-import/references/workflows.md +15 -8
- package/dist/skills/ads-motion/SKILL.md +25 -28
- package/dist/skills/ads-motion/references/behaviors.md +7 -6
- package/dist/skills/ads-motion/references/captures.md +7 -32
- package/dist/skills/ads-motion/references/contracts.md +58 -25
- package/dist/skills/ads-motion/references/drafts.md +59 -43
- package/dist/skills/ads-motion/references/evidence.md +1 -1
- package/dist/skills/ads-motion/references/guarded-editing.md +58 -47
- package/dist/skills/ads-motion/references/review.md +9 -8
- package/dist/skills/ads-motion/references/scenarios.md +1 -1
- package/dist/skills/ads-motion/references/validation.md +8 -4
- package/dist/skills/ads-motion/references/workflows.md +15 -8
- package/dist/skills/ads-port/SKILL.md +25 -28
- package/dist/skills/ads-port/references/behaviors.md +7 -6
- package/dist/skills/ads-port/references/captures.md +7 -32
- package/dist/skills/ads-port/references/cli.md +5 -1
- package/dist/skills/ads-port/references/contracts.md +58 -25
- package/dist/skills/ads-port/references/drafts.md +59 -43
- package/dist/skills/ads-port/references/evidence.md +1 -1
- package/dist/skills/ads-port/references/guarded-editing.md +58 -47
- package/dist/skills/ads-port/references/native-implementation.md +6 -6
- package/dist/skills/ads-port/references/review.md +9 -8
- package/dist/skills/ads-port/references/scenarios.md +1 -1
- package/dist/skills/ads-port/references/validation.md +8 -4
- package/dist/skills/ads-port/references/workflows.md +15 -8
- package/dist/starters/preact/design-system/components/Layout/Grid/Grid.ads.contract.ts +6 -0
- package/dist/starters/preact/design-system/review/token-preview/TokenPreview.ads.contract.ts +6 -0
- package/dist/starters/preact/ds.config.json +0 -14
- package/dist/starters/react/README.md +9 -5
- package/dist/starters/react/design-system/brand/Icons/AppIcon/AppIcon.ads.fixture.ts +1 -1
- package/dist/starters/react/design-system/brand/Identity/Logo/Logo.ads.fixture.ts +2 -2
- package/dist/starters/react/design-system/components/Actions/Button/Button.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Content/Logo/Logo.tsx +2 -2
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.contract.ts +6 -0
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/controllers/Palette/Palette.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/index.ts +3 -7
- package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/review/brand-preview/BrandPreview.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/review/grid-cell/GridCell.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/review/index.ts +4 -3
- package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/review/token-preview/TokenPreview.ads.contract.ts +6 -0
- package/dist/starters/react/design-system/review/token-preview/TokenPreview.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/styles.css +1 -0
- package/dist/starters/react/ds.config.json +0 -14
- package/dist/style-boundaries.mjs +7 -6
- package/dist/test-boundaries.mjs +2 -2
- package/dist/themes-watch.mjs +9 -3
- package/dist/token-fixtures.mjs +1 -1
- package/dist/unit-contracts.mjs +38 -4
- package/dist/units.mjs +16 -91
- package/dist/validation-checks.mjs +7 -1
- package/docs/ADS.md +10 -10
- package/docs/ARCHITECTURE.md +104 -44
- package/docs/BEHAVIORS.md +8 -7
- package/docs/CACHING.md +15 -6
- package/docs/CHANGELOG.md +107 -12
- package/docs/COMPARISON.md +1 -1
- package/docs/CONTRACTS.md +10 -25
- package/docs/GUIDE.md +98 -57
- package/docs/MCP.md +116 -151
- package/package.json +7 -7
- package/dist/contract-migration.mjs +0 -110
- package/dist/mcp/draft-exports.mjs +0 -40
- package/dist/mcp/edit-preparation.mjs +0 -115
|
@@ -18,10 +18,11 @@ inside the preview App with the project's framework, foundation, fonts and style
|
|
|
18
18
|
Nothing depends on particular helper names or an imported component library.
|
|
19
19
|
|
|
20
20
|
The development entry defaults to `review/index.ts` relative to `dsDir`; configure
|
|
21
|
-
`reviewEntry` for another script inside `review/`.
|
|
21
|
+
`reviewEntry` for another script inside `review/`. ADS generates it from the review
|
|
22
|
+
owners' `<Owner>.ads.exports.ts` files; never edit it by hand. Its import alias is the
|
|
22
23
|
configured `publicAlias` plus `/review`, normally `@ds/review`. Discover the actual
|
|
23
|
-
entry/alias through `ads_status.project.review`.
|
|
24
|
-
|
|
24
|
+
entry/alias through `ads_status.project.review`. Declare a review helper's exports in
|
|
25
|
+
its own exports file, never in a product owner's. Review implementations, types and styles must not
|
|
25
26
|
enter application, component, pattern or controller dependencies. Tests, fixtures,
|
|
26
27
|
scenarios and preview mounts can consume review code.
|
|
27
28
|
|
|
@@ -74,11 +75,11 @@ Production entrypoints never import the development entry. Inspect the product
|
|
|
74
75
|
bundle for review modules/CSS; passing static checks does not prove bundle parity.
|
|
75
76
|
|
|
76
77
|
Use `ads_units` for `review/<Owner>` units. Scenarios, local specs and helper files
|
|
77
|
-
follow ordinary flat/directory ownership. A review
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
follow ordinary flat/directory ownership. A review owner declares its public
|
|
79
|
+
names in its own `<Owner>.ads.exports.ts`, from which ADS generates the development
|
|
80
|
+
entry, and its own style permissions in its contract. Use drafts and acceptance dry
|
|
81
|
+
runs as described in [guarded-editing.md](guarded-editing.md); do not bypass a
|
|
82
|
+
rejected acceptance.
|
|
82
83
|
|
|
83
84
|
For an existing project, identify helpers by responsibility and actual consumers,
|
|
84
85
|
not names or the number of imported components. Preserve real application patterns.
|
|
@@ -95,7 +95,7 @@ export function Frame({ visible = true } = {}) {
|
|
|
95
95
|
return <section>{visible && <Part />}</section>;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
// Colocated
|
|
98
|
+
// Colocated Frame.ads.scenario.tsx
|
|
99
99
|
import { Frame } from "@ds";
|
|
100
100
|
export const scenario = { title: "Frame", covers: ["Frame", "Part"] };
|
|
101
101
|
export default function Scenario() { return <Frame />; }
|
|
@@ -41,9 +41,12 @@ implicitly requiring them at acceptance.
|
|
|
41
41
|
all registered behavior checks. Use before a release, after ownership/test/config
|
|
42
42
|
migrations and for an explicit complete audit. Changed scope narrows registered
|
|
43
43
|
owners while project scripts and core gates retain full scope.
|
|
44
|
-
-
|
|
45
|
-
and theme (`browser-accessibility-audit`);
|
|
46
|
-
|
|
44
|
+
- The validation policy runs the axe-core audit of every rendered UI scenario in
|
|
45
|
+
every brand and theme (`browser-accessibility-audit`); it is the stage check after a
|
|
46
|
+
series of accepted drafts (`scope:"changed"` audits what changed since the last
|
|
47
|
+
full audit). `validation.browserAudit: false` turns it off. Draft acceptance audits
|
|
48
|
+
per `acceptance.browserAudit`: `"owners"` (default, the draft owners' own scenarios),
|
|
49
|
+
`"affected"` (every scenario the change reaches) or `false`. An `a11y-incomplete` info item means axe could not decide that rule on those elements: check it by hand, using the reason it names (`bgGradient` is text over a gradient). Its `a11y-axe`, `a11y-non-text-contrast` and `layout-overflow` findings are errors that fail the policy, and an audit
|
|
47
50
|
that cannot run (no project Playwright or browser) fails it with a `browser-audit`
|
|
48
51
|
error naming what to install. Under the acceptance policy, draft
|
|
49
52
|
acceptance and guarded patches/transactions audit the candidate's affected UI
|
|
@@ -62,7 +65,8 @@ implicitly requiring them at acceptance.
|
|
|
62
65
|
disable tests or weaken configuration to make a failing change pass.
|
|
63
66
|
|
|
64
67
|
Defaults: both script lists are empty, acceptance `behaviorChecks:false`,
|
|
65
|
-
validation `behaviorChecks:true`,
|
|
68
|
+
validation `behaviorChecks:true`, acceptance `browserAudit:"owners"`, validation
|
|
69
|
+
`browserAudit:true`. No lint/test/build script names are inferred.
|
|
66
70
|
Every listed script must exist; commands are trusted project configuration, not
|
|
67
71
|
MCP arguments. `mcp.mutationChecks` is a configuration error: list those scripts in
|
|
68
72
|
`acceptance.checks` and set `acceptance.behaviorChecks`. `mcp.mutationCheckTimeoutMs`
|
|
@@ -55,14 +55,21 @@ When no authorized source editor/filesystem channel is available, use the
|
|
|
55
55
|
server's tools for source reads and changes. Do not assume returned server-local
|
|
56
56
|
paths can be opened by the client. Discover capabilities with `ads_status`.
|
|
57
57
|
|
|
58
|
-
With mutation tools enabled,
|
|
59
|
-
with `ads_units`, create a coherent proposal with `ads_create_draft`,
|
|
60
|
-
marked source through `ads_read_file` and `ads_update_draft
|
|
61
|
-
`ads_show_draft`, review the rendered result
|
|
58
|
+
With mutation tools enabled, every source change follows [tracked drafts](drafts.md):
|
|
59
|
+
discover owners with `ads_units`, create a coherent proposal with `ads_create_draft`,
|
|
60
|
+
read/edit its marked source through `ads_read_file` and `ads_update_draft` (file
|
|
61
|
+
contents or a Git diff), preview with `ads_show_draft`, review the rendered result,
|
|
62
|
+
optionally check with `ads_accept({dryRun:true})`, and accept its exact revision with
|
|
62
63
|
`ads_accept`. Accept dependencies first and review dependents again. The agent
|
|
63
|
-
performs auto-mode review; no additional human approval step is implied.
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
performs auto-mode review; no additional human approval step is implied. An owner is
|
|
65
|
+
in at most one open draft, so concurrent clients work on different owners.
|
|
66
|
+
|
|
67
|
+
After a series of accepted drafts, run the stage check before reporting the work
|
|
68
|
+
complete or committing: `ads_validate` with the validation policy and
|
|
69
|
+
`scope:"changed"`. It runs the full accessibility audit of everything the changes
|
|
70
|
+
reached and the registered behavior checks; acceptance itself audits only the draft
|
|
71
|
+
owners' own scenarios by default. See [guarded editing](guarded-editing.md) for
|
|
72
|
+
focused repairs and what acceptance checks.
|
|
66
73
|
Without mutation tools, an MCP-only client can inspect, preview and validate,
|
|
67
74
|
but cannot change source. Report that capability limit if editing is required.
|
|
68
75
|
|
|
@@ -72,7 +79,7 @@ Both routes preserve project ownership, framework, public APIs, shared tokens,
|
|
|
72
79
|
styling/geometry boundaries and configured checks. Compilation and HTML delivery
|
|
73
80
|
do not prove visual or behavioral correctness. Report the scope and revision of
|
|
74
81
|
actual passing checks; stale, failed or incomplete evidence remains unfinished.
|
|
75
|
-
Never change access routes to bypass a
|
|
82
|
+
Never change access routes to bypass a failed acceptance.
|
|
76
83
|
|
|
77
84
|
Direct editors may deliberately choose tracked drafts for isolation, comparison
|
|
78
85
|
or PR review. Once using a tracked proposal, finish a coherent design change by
|
|
@@ -82,28 +82,24 @@ inside a different or nested repository. Inspect the selected public API, owning
|
|
|
82
82
|
source/available guides and relevant tokens, then mount its discovered scenario.
|
|
83
83
|
Metadata and source reads do not prove rendered behavior.
|
|
84
84
|
|
|
85
|
-
For MCP-only guarded editing with `ads_status.mutations.enabled`,
|
|
86
|
-
owner with `ads_units`,
|
|
87
|
-
relevant ranges with `ads_read_file
|
|
88
|
-
`
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
`
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
`patchFile`; `ads_verify` checks current source and accepts no draft argument.
|
|
104
|
-
Applying re-runs the gates. Fix rejected patches in their
|
|
105
|
-
owner. Use `ads_apply_transaction` for genuinely coupled owner patches;
|
|
106
|
-
never bypass a rejection with direct source writes. Shared styles/helpers use `foundation`, root guides use
|
|
85
|
+
For MCP-only guarded editing with `ads_status.mutations.enabled`, every source change
|
|
86
|
+
goes through a draft: discover the owner with `ads_units`, create its draft with
|
|
87
|
+
`ads_create_draft`, read relevant ranges with `ads_read_file`, edit the draft's files
|
|
88
|
+
or send a Git unified diff with `ads_update_draft({id, revision, patch})`, review it
|
|
89
|
+
with `ads_show_draft`, then `ads_accept` its exact revision (`dryRun: true` checks
|
|
90
|
+
without writing). A unit includes its own implementation, scenarios and fixtures;
|
|
91
|
+
imported peers remain separate. `tokens` is the token foundation unit. Unit
|
|
92
|
+
discovery and file ownership are distinct from preview IDs. An owner is in at most
|
|
93
|
+
one open draft; coupled owners share one draft, and a draft can depend on another
|
|
94
|
+
owner's open draft. Every authored file has one owner: an owner declares its public
|
|
95
|
+
names in `<Owner>.ads.exports.ts` and its style permissions (`styles.writes`,
|
|
96
|
+
`styles.inline`, `customization`) in `<Owner>.ads.contract.ts`. The public barrel,
|
|
97
|
+
review entry and styles entry are generated, so no draft edits them. Unused
|
|
98
|
+
permissions fail the core checks; do not declare a permission without its
|
|
99
|
+
implementation. Acceptance runs the mandatory ADS gates and the project's acceptance
|
|
100
|
+
policy; registered tests run when `acceptance.behaviorChecks` is true. `ads_verify`
|
|
101
|
+
checks current source and accepts no draft argument. Fix a failed acceptance in the
|
|
102
|
+
draft; never bypass a rejection with direct source writes. Shared styles/helpers use `foundation`, root guides use
|
|
107
103
|
`documentation`, and branding/fonts use their discovered `assets/*` unit.
|
|
108
104
|
Intentional configuration, rule exceptions, registered guard code and compiler
|
|
109
105
|
changes use `configuration`; validate the proposed settings and keep mandatory
|
|
@@ -341,9 +337,11 @@ does not keep rule order: give queries on one property exclusive ranges, such as
|
|
|
341
337
|
|
|
342
338
|
Use the project's image component; give `priority` to the view's main visible image only, since
|
|
343
339
|
lazy loading above the fold hurts. Call `preloadFonts()` from `tokens/fonts.preload.generated.ts`
|
|
344
|
-
in the app entry when it exists
|
|
345
|
-
|
|
346
|
-
(`
|
|
340
|
+
in the app entry when it exists, or put its `fontPreloadTags()` in the page from a build step for an
|
|
341
|
+
earlier preload. `ads check` fails unsized or unchosen `<img>` (`img-attributes`), oversized assets
|
|
342
|
+
(`asset-image-budget`, `asset-font-budget`) and a weight no face covers (`font-weight-missing`);
|
|
343
|
+
`ads audit` fails layout shift above 0.1 (`layout-shift`) and an image at another shape than it
|
|
344
|
+
declares (`img-shape`). ADS does not cover page metadata, `noindex`, sitemaps or hosting: run Lighthouse
|
|
347
345
|
on a production build with real URLs. Read [performance.md](references/performance.md)
|
|
348
346
|
(`ads://guides/performance`).
|
|
349
347
|
|
|
@@ -484,7 +482,7 @@ may name its review renderer in `covers`; ordinary component/pattern scenarios
|
|
|
484
482
|
cover their production subjects. Keep review exports in the separate review entry.
|
|
485
483
|
Remove redundant helper catalogue scenarios during migration. Product UI retains
|
|
486
484
|
its real render-coverage requirement. Keep directory ownership anchored by its
|
|
487
|
-
implementation entry (`index` or a file matching the directory name)
|
|
485
|
+
implementation entry (`index` or a file matching the directory name).
|
|
488
486
|
Import colocated image/font fixtures so MCP serves them through asset resources.
|
|
489
487
|
For a broken-image case, use a local failing fixture, rather than an external
|
|
490
488
|
network failure or a domain-specific CSP exception. Production asset APIs remain
|
|
@@ -537,11 +535,12 @@ does not gate acceptance. Direct edits can run `ads validate --policy acceptance
|
|
|
537
535
|
or `ads_validate({policy:"acceptance"})`. Follow [validation](references/validation.md)
|
|
538
536
|
for triggers and evidence scopes; never weaken a policy to pass a failing change.
|
|
539
537
|
A project can use its own linter in those scripts when desired. Measured renderer properties and documented
|
|
540
|
-
non-state hooks
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
in the owner's
|
|
544
|
-
`
|
|
538
|
+
non-state hooks are declared in the owner's contract (`styles.writes`,
|
|
539
|
+
`styles.inline`, `customization`); shared token writes and primitive state overrides
|
|
540
|
+
cannot be allowed. When moving JSX inline geometry to imperative writes, change the
|
|
541
|
+
source and its contract permissions together in the owner's draft. Remove obsolete
|
|
542
|
+
`styles.inline` entries and unused `styles.writes` properties; do not broaden
|
|
543
|
+
permissions to keep a change passing.
|
|
545
544
|
Pointer-capture advisories call for review of cancellation, capture loss and
|
|
546
545
|
teardown, including cleanup delegated to hooks. Verify actual cleanup in a browser;
|
|
547
546
|
a locally present handler alone does not prove correctness.
|
|
@@ -42,7 +42,7 @@ Each finding is an `a11y-axe` error on the scenario file, naming the axe rule, t
|
|
|
42
42
|
criterion, the themes and brands it fails in, the failing elements and the rule's help link:
|
|
43
43
|
|
|
44
44
|
```text
|
|
45
|
-
design-system/components/Broken.scenario.tsx:1:1 [error:a11y-axe] axe button-name (critical), WCAG 4.1.2 in components/Broken [light, dark]: Buttons must have discernible text. 1 element: button. https://dequeuniversity.com/rules/axe/4.14/button-name?application=axeAPI
|
|
45
|
+
design-system/components/Broken.ads.scenario.tsx:1:1 [error:a11y-axe] axe button-name (critical), WCAG 4.1.2 in components/Broken [light, dark]: Buttons must have discernible text. 1 element: button. https://dequeuniversity.com/rules/axe/4.14/button-name?application=axeAPI
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
- Fix the finding in the component that renders the failing element, not in the scenario.
|
|
@@ -62,10 +62,14 @@ design-system/components/Broken.scenario.tsx:1:1 [error:a11y-axe] axe button-nam
|
|
|
62
62
|
`browser-audit` error names a scenario that still failed and its last cause.
|
|
63
63
|
- Token and brand scenarios are skipped; name one with `--scenario` to audit it.
|
|
64
64
|
- `ads validate`/`ads_validate` run the audit in both policies (`validation` and
|
|
65
|
-
`acceptance`); its findings fail the policy, as they fail `ads audit`. `ads_accept
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
`acceptance`); its findings fail the policy, as they fail `ads audit`. `ads_accept`
|
|
66
|
+
audits according to `acceptance.browserAudit`: `"owners"` (default) the draft owners'
|
|
67
|
+
own scenarios, `"affected"` every scenario the change reaches, `false` none. It
|
|
68
|
+
rejects the draft on any `a11y-axe` or `a11y-non-text-contrast` error; read the
|
|
69
|
+
findings with `ads_results` (`diagnostics`). Run the full audit of everything
|
|
70
|
+
affected as a stage with `ads_validate` (validation policy, `scope:"changed"`) after
|
|
71
|
+
a series of accepted drafts. `mcp.auditPages` (1–16, default 4) sets how many pages
|
|
72
|
+
render at once.
|
|
69
73
|
- It needs the project's Playwright and browser, as captures do: `npm install -D
|
|
70
74
|
@playwright/test` and `npx playwright install chromium` (`ads create` and
|
|
71
75
|
`ads init` declare `@playwright/test`). `mcp.capture` selects the browser or an installed Chrome channel.
|
|
@@ -19,7 +19,8 @@ or assume a renderer/library supplied by an MCP host. The framework field select
|
|
|
19
19
|
compilation/mounting; controller checks also validate runtime imports. Type-only
|
|
20
20
|
UI references are allowed, but shared controllers cannot import component/pattern
|
|
21
21
|
runtime implementations. Keep business data in application adapters. Measured
|
|
22
|
-
style writes retain exact
|
|
22
|
+
style writes retain the exact properties declared in the owner contract's
|
|
23
|
+
`styles.writes`; they do not allow
|
|
23
24
|
shared-token overrides or an extra styling layer.
|
|
24
25
|
Projects explicitly approve installed runtime packages through
|
|
25
26
|
`behaviorLibraries` in `ds.config.json`; each must also be a `package.json`
|
|
@@ -38,7 +39,7 @@ build and browser review; declaring a dependency does not prove it is headless.
|
|
|
38
39
|
Register owner behavior in `<Owner>.ads.contract.ts` with actual API and
|
|
39
40
|
implementation references. The
|
|
40
41
|
[contract reference](contracts.md) covers static authoring, `.ads.behavior.spec.ts`,
|
|
41
|
-
declarative `exercises
|
|
42
|
+
declarative `exercises` and required browser checks.
|
|
42
43
|
A contract declaration alone is not passing evidence. Use
|
|
43
44
|
`auditBehaviorPaints(frame)` after relevant binding updates to repeat the current
|
|
44
45
|
App's generic paint audit, in addition to assertions for the named guarantee.
|
|
@@ -46,7 +47,7 @@ App's generic paint audit, in addition to assertions for the named guarantee.
|
|
|
46
47
|
## Development boundary
|
|
47
48
|
|
|
48
49
|
Production includes real components, controllers, tokens and compiled styles.
|
|
49
|
-
Scenarios and fixtures are included only in previews.
|
|
50
|
+
Scenarios and fixtures are included only in previews. Owner contracts and test
|
|
50
51
|
files are development/tooling inputs. Runtime imports and public re-exports of
|
|
51
52
|
those inputs are rejected, including dynamic imports and aliases.
|
|
52
53
|
|
|
@@ -384,9 +385,9 @@ project policy; registration alone does not require execution at acceptance.
|
|
|
384
385
|
`ads_verify` always runs the requested checks. See [validation policies](validation.md). Imported shared
|
|
385
386
|
controller changes also select dependent contracts conservatively. Rejected and
|
|
386
387
|
dry-run patches publish no source changes. Verification output stays under `.ds/`.
|
|
387
|
-
To check a
|
|
388
|
-
|
|
389
|
-
|
|
388
|
+
To check a draft, call `ads_accept({id, revision, dryRun:true})`. This checks the
|
|
389
|
+
candidate using the acceptance policy, including affected behavior contracts and
|
|
390
|
+
their browser preview when enabled, rendered through the project's own compiler. Candidate evidence
|
|
390
391
|
is not persisted as passing evidence for live source. `ads_verify` selects checks
|
|
391
392
|
for current source and has no draft argument.
|
|
392
393
|
|
|
@@ -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
|
-
|
|
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
|
|
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
|
|
@@ -81,43 +81,18 @@ Screenshots hide the text caret and disable animations by default. Set
|
|
|
81
81
|
`animations:"allow"` when motion must remain active, and account for nondeterminism.
|
|
82
82
|
The same capture settings are used for both sides of a candidate comparison.
|
|
83
83
|
|
|
84
|
-
## Review a
|
|
84
|
+
## Review a draft without accepting it
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
Capture the draft's exact revision beside the accepted version, without acceptance
|
|
87
|
+
checks:
|
|
88
88
|
|
|
89
89
|
```js
|
|
90
|
-
|
|
91
|
-
unit: "components/Example",
|
|
92
|
-
patchFile: ".ds/patches/<returned-name>.patch",
|
|
93
|
-
dryRun: true,
|
|
94
|
-
screenshot: true,
|
|
95
|
-
captures: [{ scenario: "components/Example", target: "control", theme: "light" }]
|
|
96
|
-
})
|
|
90
|
+
ads_capture({ scenario: "components/Example", target: "control", theme: "light", draft: "<draft id>", revision: "<draft revision>" })
|
|
97
91
|
```
|
|
98
92
|
|
|
99
|
-
The placeholder
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
runs and patches create no screenshots. `screenshot:true` requires `dryRun:true`.
|
|
103
|
-
|
|
104
|
-
Core, registered lint/project and affected behavior gates pass first. ADS then
|
|
105
|
-
captures current source and the isolated candidate under matching theme, viewport,
|
|
106
|
-
animation and browser settings. Candidate screenshots survive candidate-directory
|
|
107
|
-
cleanup. Final source/conflict checks still run before the pair is published. A
|
|
108
|
-
failed/cancelled capture does not replace existing image slots or apply source.
|
|
109
|
-
If a scenario/target is newly introduced, `current` is null with an explicit
|
|
110
|
-
`currentAbsent` explanation; only the real candidate image exists.
|
|
111
|
-
|
|
112
|
-
The edit reply is a summary. Read `ads_results({resultId,section:"captures"})` for
|
|
113
|
-
the requested image resource URIs and `section:"diagnostics"` for relevant
|
|
114
|
-
messages; follow `nextCursor` when needed. Read image resources explicitly.
|
|
115
|
-
Standalone `ads_capture` continues returning its selected capture directly.
|
|
116
|
-
|
|
117
|
-
Review those images and diagnostics, fix the draft if necessary, then apply
|
|
118
|
-
with `dryRun:false`. Apply reruns all gates. An image is promoted only when the
|
|
119
|
-
accepted source revision matches the captured candidate; other proposals remain
|
|
120
|
-
stale. Images do not approve a patch or certify interaction/accessibility/parity.
|
|
93
|
+
The placeholder IDs come from discovery and `ads_drafts`. A capture is an explicit
|
|
94
|
+
call: acceptance and its dry run take no screenshots. A new scenario has only a
|
|
95
|
+
candidate image. Edits during capture prevent publication of its image slots.
|
|
121
96
|
|
|
122
97
|
## Two slots, no automatic history
|
|
123
98
|
|
|
@@ -9,7 +9,11 @@ Node/npm or Bun build pipeline. Use these commands alongside this skill's resear
|
|
|
9
9
|
implementation, documentation, and verification workflow. ADS must be a project
|
|
10
10
|
development dependency, and its checks must run before the project's build.
|
|
11
11
|
Routine builds use the local CLI. ADS manages its internal Turbo dependency and
|
|
12
|
-
local task cache automatically; no project Turbo configuration is required.
|
|
12
|
+
local task cache automatically; no project Turbo configuration is required. The MCP
|
|
13
|
+
server and its preview compiler instead run `ads check` in a warm in-process worker
|
|
14
|
+
that reuses parsed sources across edits and remembers passing reports for identical
|
|
15
|
+
inputs. `ads assets` also writes the generated entries: the styles entry and the
|
|
16
|
+
public/review barrels from the owners' `.ads.exports.ts` files.
|
|
13
17
|
In Hermit-managed projects, pin supported Bun (>=1.4.1); Turbo arrives through
|
|
14
18
|
ADS in devDependencies, so do not add a separate Hermit/global Turbo installation.
|
|
15
19
|
`ads check --fresh` and `ads validate --fresh` bypass task-cache reads. See
|
|
@@ -42,6 +42,54 @@ the runtime dependency closure. Review custom emitter configurations through
|
|
|
42
42
|
the configuration owner before migrating a consuming project. Guards remain tooling. Production prop types
|
|
43
43
|
belong in runtime files, never inferred from a development contract.
|
|
44
44
|
|
|
45
|
+
## Public names and generated entries
|
|
46
|
+
|
|
47
|
+
Each owner declares its public names in its own `<Owner>.ads.exports.ts`, beside its
|
|
48
|
+
source (`components/Button.ads.exports.ts` for a flat owner,
|
|
49
|
+
`components/Forms/Input/Input.ads.exports.ts` for a directory owner):
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
export { Button } from "./Button";
|
|
53
|
+
export type { ButtonProps } from "./Button";
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
An exports file holds only named re-exports of its own owner's modules by relative
|
|
57
|
+
path: no `export *`, no other code, no peers' files. Public names are unique across
|
|
58
|
+
owners. ADS generates the public barrel (`publicEntry`, normally `index.ts`) by copying
|
|
59
|
+
every exports file's re-exports with paths rebased onto the barrel, so it names each
|
|
60
|
+
public export directly from its source and a product build never includes an exports
|
|
61
|
+
file. The review entry is generated the same way from the exports files under `review/`. It also generates the styles entry (`stylesEntry`) with one `@import`
|
|
62
|
+
per canonical token sheet in foundation order; the public barrel imports it first.
|
|
63
|
+
Never edit a generated entry: `ads check` reports a stale or hand-edited one
|
|
64
|
+
(`generated-entry`), and the showcase, the MCP server, draft previews, acceptance
|
|
65
|
+
and `ads assets` rewrite them. An exports file belongs to its owner's layer:
|
|
66
|
+
production, or development under `review/`.
|
|
67
|
+
|
|
68
|
+
## Style permissions
|
|
69
|
+
|
|
70
|
+
An owner declares the style permissions its own code needs in its contract, with
|
|
71
|
+
paths relative to the contract:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
export default {
|
|
75
|
+
schemaVersion: 1,
|
|
76
|
+
styles: {
|
|
77
|
+
writes: { "./Menu.tsx": ["--ds-menu-x", "--ds-menu-y"] },
|
|
78
|
+
inline: ["./Menu.tsx"],
|
|
79
|
+
},
|
|
80
|
+
customization: ["--ds-menu-gap"],
|
|
81
|
+
} satisfies UnitContract;
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`styles.writes` lists the CSS properties or owned `--ds-`/`--ux-`/`--showcase-`
|
|
85
|
+
variables a file writes at runtime (never `cssText`, state variables or shared
|
|
86
|
+
tokens); `styles.inline` lists files that may use inline JSX/factory styles for
|
|
87
|
+
measured geometry; `customization` lists a component's non-state `--ds-*` variables
|
|
88
|
+
that patterns, the showcase and the application may set. Contracts are allowed for
|
|
89
|
+
component, pattern, controller, review and showcase owners; `customization` only for
|
|
90
|
+
components. An unused permission is reported as stale on the contract.
|
|
91
|
+
`ds.config.json` holds no per-owner entries.
|
|
92
|
+
|
|
45
93
|
## A contract uses actual implementation references
|
|
46
94
|
|
|
47
95
|
```ts
|
|
@@ -251,34 +299,19 @@ Shared token samples belong under the token directory. See
|
|
|
251
299
|
project-specific audits of shared alias relationships. It supplements mandatory
|
|
252
300
|
core source checks and does not enable independent local values.
|
|
253
301
|
|
|
254
|
-
##
|
|
302
|
+
## MCP editing
|
|
255
303
|
|
|
256
|
-
|
|
304
|
+
The static owner contract is the only token, paint, declarative-part and behavior
|
|
305
|
+
registration. Competing declarations fail.
|
|
257
306
|
Contracts participate in discovery, ownership, source revisions, affected-check
|
|
258
307
|
selection and candidate gates. `ads_units` exposes `contractFile`; `ads_catalog`
|
|
259
308
|
reports constrained paint paths and declarative parent/consumer/check references.
|
|
260
309
|
Use bounded file reads and paged detailed results, not repeated whole-project dumps.
|
|
261
310
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
5. Dry-run/apply with `ads_apply_patch`, or a genuinely coupled transaction.
|
|
270
|
-
|
|
271
|
-
Migration never edits live source or bypasses gates. It retains stable scenario
|
|
272
|
-
IDs, check case IDs and directory ownership. A canonical `<Owner>.ads.scenario.tsx` is the same
|
|
273
|
-
development entry as `Scenario.tsx`, even without a production entry or owner
|
|
274
|
-
contract. Explicit flat IDs and existing flat peer families remain separate.
|
|
275
|
-
An optional static `scenario.id` preserves a legacy
|
|
276
|
-
identity when a renamed filename would otherwise be ambiguous; it must stay
|
|
277
|
-
inside the owning unit and be unique. Whole-file or unimportable private behavior subjects stay
|
|
278
|
-
in legacy registration with a note until deliberately resolved. Unknown runner
|
|
279
|
-
globs, custom adapters and documentation references require review. Ambiguous
|
|
280
|
-
flat-to-directory renames stay in the legacy form with a migration note so file
|
|
281
|
-
ownership cannot silently change. Preserve
|
|
282
|
-
licenses, pending drafts and unrelated work; keep transactions within their limits.
|
|
283
|
-
There is no alternate JSON contract editor. Do not loosen a guard or make a valid
|
|
284
|
-
API private merely to complete a migration.
|
|
311
|
+
A canonical `<Dir>/<Dir>.ads.scenario.tsx` is the development entry of the
|
|
312
|
+
directory owner `<Dir>`, even without a production entry or owner contract. In a
|
|
313
|
+
folder without that entry, each `<Owner>.ads.scenario.tsx` belongs to its own flat
|
|
314
|
+
owner, and an explicit flat `scenario.id` (`<Dir>/<Dir>`) keeps the canonical file
|
|
315
|
+
a flat entry. An optional static `scenario.id` keeps an identity stable when a
|
|
316
|
+
renamed filename would otherwise be ambiguous; it must stay inside the owning unit
|
|
317
|
+
and be unique.
|