@reqvire-org/ads 0.0.0-stage → 0.2.9
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/LICENSE +21 -0
- package/README.md +284 -2
- package/dist/assets.mjs +52 -0
- package/dist/bootstrap-ds/ADS.md +203 -0
- package/dist/bootstrap-ds/README.md +98 -0
- package/dist/bootstrap-ds/biome.css.json +21 -0
- package/dist/bootstrap-ds/design-system/assets/brand/README.md +28 -0
- package/dist/bootstrap-ds/design-system/assets/fonts/.gitkeep +0 -0
- package/dist/bootstrap-ds/design-system/components/.gitkeep +0 -0
- package/dist/bootstrap-ds/design-system/composition/.gitkeep +0 -0
- package/dist/bootstrap-ds/design-system/index.ts +5 -0
- package/dist/bootstrap-ds/design-system/patterns/.gitkeep +0 -0
- package/dist/bootstrap-ds/design-system/showcase/mcp/index.html +1 -0
- package/dist/bootstrap-ds/design-system/showcase/mcp/main.tsx +8 -0
- package/dist/bootstrap-ds/design-system/styles.css +5 -0
- package/dist/bootstrap-ds/design-system/tokens/Foundation.fixture.ts +47 -0
- package/dist/bootstrap-ds/design-system/tokens/Foundation.scenario.tsx +14 -0
- package/dist/bootstrap-ds/design-system/tokens/base.css +27 -0
- package/dist/bootstrap-ds/design-system/tokens/colors.css +29 -0
- package/dist/bootstrap-ds/design-system/tokens/elevation.css +15 -0
- package/dist/bootstrap-ds/design-system/tokens/spacing.css +15 -0
- package/dist/bootstrap-ds/design-system/tokens/typography.css +13 -0
- package/dist/bootstrap-ds/ds.config.json +13 -0
- package/dist/bootstrap-ds/gitignore.template +8 -0
- package/dist/bootstrap-ds/package-lock.json +4660 -0
- package/dist/bootstrap-ds/package.json +41 -0
- package/dist/bootstrap-ds/scripts/build-mcp-previews.mjs +33 -0
- package/dist/bootstrap-ds/src/vite-env.d.ts +7 -0
- package/dist/bootstrap-ds/tsconfig.build.json +12 -0
- package/dist/bootstrap-ds/tsconfig.json +20 -0
- package/dist/bootstrap-ds/vite.config.ts +21 -0
- package/dist/boundaries.mjs +130 -0
- package/dist/brand-assets.mjs +82 -0
- package/dist/check.mjs +222 -0
- package/dist/cli.mjs +106 -0
- package/dist/config.mjs +181 -0
- package/dist/contracts/tokens.json +52 -0
- package/dist/html.mjs +30 -0
- package/dist/index.mjs +9 -0
- package/dist/init.mjs +194 -0
- package/dist/lint-config.mjs +40 -0
- package/dist/mcp/THIRD_PARTY_NOTICES.md +786 -0
- package/dist/mcp/apps.mjs +53 -0
- package/dist/mcp/build-status.mjs +164 -0
- package/dist/mcp/catalog.mjs +65 -0
- package/dist/mcp/context.mjs +69 -0
- package/dist/mcp/mutations.mjs +301 -0
- package/dist/mcp/patch.mjs +114 -0
- package/dist/mcp/preview-watch.mjs +169 -0
- package/dist/mcp/preview-widget.bundle.js +113 -0
- package/dist/mcp/project-widget.bundle.js +113 -0
- package/dist/mcp/prompts.mjs +28 -0
- package/dist/mcp/resource-loader.js +138 -0
- package/dist/mcp/sandbox-host.mjs +22 -0
- package/dist/mcp/server.mjs +377 -0
- package/dist/mcp/showcase-host.mjs +68 -0
- package/dist/mcp/skills.mjs +77 -0
- package/dist/mcp/widget.bundle.js +150 -0
- package/dist/oxlint.mjs +81 -0
- package/dist/preview-resources.mjs +198 -0
- package/dist/project-documents.mjs +27 -0
- package/dist/public-props.mjs +74 -0
- package/dist/scenarios-compiler.mjs +287 -0
- package/dist/scenarios-vite.d.mts +3 -0
- package/dist/scenarios-vite.mjs +71 -0
- package/dist/scenarios.mjs +212 -0
- package/dist/showcase/client.bundle.js +127 -0
- package/dist/showcase/index.html +17 -0
- package/dist/showcase/sandbox.js +30 -0
- package/dist/showcase/style.css +7 -0
- package/dist/showcase-coverage.mjs +118 -0
- package/dist/showcase.mjs +77 -0
- package/dist/skills/README.md +68 -0
- package/dist/skills/ads-assimilate/SKILL.md +292 -0
- package/dist/skills/ads-assimilate/agents/openai.yaml +4 -0
- package/dist/skills/ads-assimilate/references/cli.md +111 -0
- package/dist/skills/ads-assimilate/references/lint-and-docs.md +87 -0
- package/dist/skills/ads-assimilate/references/native-implementation.md +98 -0
- package/dist/skills/ads-assimilate/references/testing.md +107 -0
- package/dist/skills/ads-break-ui/LICENSE.upstream +21 -0
- package/dist/skills/ads-break-ui/README.md +16 -0
- package/dist/skills/ads-break-ui/SKILL.md +235 -0
- package/dist/skills/ads-break-ui/agents/openai.yaml +4 -0
- package/dist/skills/ads-break-ui/references/catalog.md +135 -0
- package/dist/skills/ads-break-ui/references/verification.md +48 -0
- package/dist/skills/ads-designer/LICENSE.upstream +21 -0
- package/dist/skills/ads-designer/README.md +19 -0
- package/dist/skills/ads-designer/SKILL.md +400 -0
- package/dist/skills/ads-designer/agents/openai.yaml +4 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +203 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +98 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/biome.css.json +21 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/README.md +28 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/fonts/.gitkeep +0 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/.gitkeep +0 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/.gitkeep +0 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/index.ts +5 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/.gitkeep +0 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/showcase/mcp/index.html +1 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/showcase/mcp/main.tsx +8 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/styles.css +5 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.fixture.ts +47 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.scenario.tsx +14 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/base.css +27 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/colors.css +29 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/elevation.css +15 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/spacing.css +15 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/typography.css +13 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +13 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/gitignore.template +8 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/package-lock.json +4660 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +41 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +33 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/src/vite-env.d.ts +7 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/tsconfig.build.json +12 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/tsconfig.json +20 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/vite.config.ts +21 -0
- package/dist/skills/ads-designer/references/cli.md +111 -0
- package/dist/skills/ads-designer/references/design-craft.md +65 -0
- package/dist/skills/ads-designer/references/mobile.md +73 -0
- package/dist/skills/ads-import/SKILL.md +335 -0
- package/dist/skills/ads-import/agents/openai.yaml +4 -0
- package/dist/skills/ads-import/references/branding.md +44 -0
- package/dist/skills/ads-import/references/cli.md +111 -0
- package/dist/skills/ads-import/references/implementation.md +111 -0
- package/dist/skills/ads-import/references/tokens.md +96 -0
- package/dist/skills/ads-motion/LICENSE.upstream +21 -0
- package/dist/skills/ads-motion/README.md +22 -0
- package/dist/skills/ads-motion/SKILL.md +217 -0
- package/dist/skills/ads-motion/agents/openai.yaml +4 -0
- package/dist/skills/ads-motion/references/audit.md +44 -0
- package/dist/skills/ads-motion/references/build.md +81 -0
- package/dist/skills/ads-motion/references/performance.md +55 -0
- package/dist/skills/ads-motion/references/review.md +35 -0
- package/dist/skills/ads-motion/references/verification.md +39 -0
- package/dist/token-policy.mjs +10 -0
- package/dist/tokens.mjs +142 -0
- package/dist/ui-framework.mjs +59 -0
- package/dist/units.mjs +168 -0
- package/docs/ADS.md +310 -0
- package/docs/ARCHITECTURE.md +311 -0
- package/docs/CHANGELOG.md +106 -0
- package/docs/GUIDE.md +722 -0
- package/docs/MCP.md +690 -0
- package/package.json +107 -4
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Run ADS tooling through npx
|
|
2
|
+
|
|
3
|
+
Use npx for setup or ad hoc checks alongside this skill's research,
|
|
4
|
+
implementation, documentation, and verification workflow. ADS must be a project
|
|
5
|
+
development dependency, and its checks must run before the project's build.
|
|
6
|
+
Routine builds use the local CLI.
|
|
7
|
+
|
|
8
|
+
Select an actual published package/version or a real local tarball supplied by
|
|
9
|
+
the user or built from the tool checkout. Respect the project's installed
|
|
10
|
+
version. Confirm the selected published version supports the required features; use a
|
|
11
|
+
local tarball for unreleased changes. Never resolve an unrelated package with
|
|
12
|
+
bare `npx ds`. Read the actual version/help and use only supported commands.
|
|
13
|
+
|
|
14
|
+
## Published setup
|
|
15
|
+
|
|
16
|
+
Run **inside the receiving project**, where
|
|
17
|
+
`package.json` lives:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npx @reqvire-org/ads init --framework react
|
|
21
|
+
npm install
|
|
22
|
+
npm run build
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Use `--framework preact` for native Preact. A saved `framework` in
|
|
26
|
+
`ds.config.json` lets later init runs omit the flag; otherwise the choice is
|
|
27
|
+
required, including for an older config. Init preserves existing framework
|
|
28
|
+
tooling and rejects conflicting saved/JSX settings instead of converting it.
|
|
29
|
+
|
|
30
|
+
Use the confirmed package name/version if different. For an existing Bun
|
|
31
|
+
project, the same init command detects `packageManager` or `bun.lock`/`bun.lockb`;
|
|
32
|
+
then use `bun install` and `bun run build`. Node 22.12 or newer remains required.
|
|
33
|
+
Only use `--package-manager bun` when the project has no Bun marker yet or needs
|
|
34
|
+
an explicit override. Preserve its existing package-manager policy and lockfile.
|
|
35
|
+
|
|
36
|
+
`init` accepts no directory argument and requires an existing `package.json`.
|
|
37
|
+
For starting from zero, copy the bundled `ads-designer` application scaffold
|
|
38
|
+
first, then run init inside it. For an existing app, init preserves app files,
|
|
39
|
+
framework configuration, lockfiles, and build scripts. It adds only missing ADS
|
|
40
|
+
foundation files, config, development dependencies, and build checks. Existing
|
|
41
|
+
ADS values are reused; incomplete contracts need an explicit migration.
|
|
42
|
+
|
|
43
|
+
Init adds `lint:ds` and `assets:ds`, and runs checks then brand generation before
|
|
44
|
+
the existing `prebuild` hook without replacing the actual build command or
|
|
45
|
+
unrelated checks. It rejects conflicting custom scripts before writing.
|
|
46
|
+
It does not configure framework aliases, style
|
|
47
|
+
extraction, or application entry points; integrate these using the target's
|
|
48
|
+
framework and ADS contracts. Install dependencies, review the changes, and
|
|
49
|
+
commit the updated lockfile.
|
|
50
|
+
|
|
51
|
+
## Local checkout testing
|
|
52
|
+
|
|
53
|
+
If no published distribution exists, build and pack the tooling checkout with
|
|
54
|
+
`npm run build` and `npm run pack:tool`. Resolve its tarball to an absolute path.
|
|
55
|
+
From inside an existing test project:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
ads_tool_package="/absolute/path/to/reqvire-org-ads-0.3.0.tgz"
|
|
59
|
+
npx --yes --package "$ads_tool_package" ads --help
|
|
60
|
+
npx --yes --package "$ads_tool_package" ads init --framework react --tool-package "$ads_tool_package"
|
|
61
|
+
npm install
|
|
62
|
+
npm run build
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Use Bun's install/build commands for Bun projects. Keep npx options before
|
|
66
|
+
`ds`. `--tool-package` is optional local-testing/version-override support;
|
|
67
|
+
registry users do not need an archive. A `file:` dependency must remain
|
|
68
|
+
available wherever dependencies are installed. A published pinned version is
|
|
69
|
+
portable between machines.
|
|
70
|
+
|
|
71
|
+
## Checks and rules
|
|
72
|
+
|
|
73
|
+
For an initialized project, from its root:
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
npx @reqvire-org/ads check
|
|
77
|
+
npx @reqvire-org/ads tokens --json
|
|
78
|
+
npx @reqvire-org/ads assets
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Use the selected real distribution; for a local tarball, invoke
|
|
82
|
+
`npx --yes --package "$ads_tool_package" ads check` instead. Other inspection
|
|
83
|
+
commands accept a directory; init deliberately does not.
|
|
84
|
+
|
|
85
|
+
Every normal build refreshes `.ds/oxlintrc.json`, runs `ads check`, executes
|
|
86
|
+
core/project Oxlint rules, then generates configured standard brand icons in
|
|
87
|
+
`.ds/assets/`. Set `assets.iconSource` to an SVG inside the ADS's `assets/brand/`,
|
|
88
|
+
relative to the ADS folder; no source means generation is a no-op. Integrate that
|
|
89
|
+
directory through the app's existing asset mount. Fixed token names and prefixes
|
|
90
|
+
are required; project values and artwork remain project-owned. Its paths reference the project and local tool;
|
|
91
|
+
builds do not depend on the initializing npx cache. Ignore `.ds/`. Register
|
|
92
|
+
component rules through the project's plugin adapter and `ds.config.json`, then
|
|
93
|
+
run its actual build. Use `lint-config` directly for custom pipeline integration
|
|
94
|
+
or debugging, not as a separate routine setup step.
|
|
95
|
+
|
|
96
|
+
Use ADS 0.3 or later for the shared-resource preview compiler. `mcp` starts stdio
|
|
97
|
+
plus its local website; `showcase` starts the browser-only MCP runtime. Open the existing runtime URL from `ads_status` when
|
|
98
|
+
connected; otherwise use `npm run dev:showcase` or the installed `ads showcase`.
|
|
99
|
+
The tool client discovers entries and renders MCP Apps. Init adds the launch
|
|
100
|
+
script but does not install the project preview compiler. Integrate its graph
|
|
101
|
+
compiler/mount adapter and configure `mcp.previewManifest` plus `mcp.previewWatch`;
|
|
102
|
+
then use the same foundation and Linaria extraction as the application. Source discovery,
|
|
103
|
+
selected component/pattern/style/brand imports, explicit theme-value imports, and
|
|
104
|
+
assimilation are agent workflows. There is no CLI `import` command. Core checks
|
|
105
|
+
do not copy source, import values, or establish behavior/motion parity; continue
|
|
106
|
+
project type checking, meaningful tests, and browser comparisons.
|
|
107
|
+
|
|
108
|
+
If no CLI distribution is available, continue with the target's existing
|
|
109
|
+
checks. `ads-designer` includes an empty scaffold for offline bootstrapping.
|
|
110
|
+
Install skills separately with `npx skills`; the tool does not install skills
|
|
111
|
+
or fetch an external UI catalogue.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Component-local documentation and lint rules
|
|
2
|
+
|
|
3
|
+
## Documentation ownership
|
|
4
|
+
|
|
5
|
+
Make a README in the component's existing feature directory the detailed guide.
|
|
6
|
+
An existing native Toast project may use
|
|
7
|
+
`design-system/components/core/toast/README.md`, beside its state/geometry
|
|
8
|
+
helpers and usage rules; `Toast.tsx` and `Toaster.tsx` remain in the parent directory.
|
|
9
|
+
Follow the target's existing structure rather than moving runtime files solely
|
|
10
|
+
for colocation. This path is a project layout example, not a bundled component;
|
|
11
|
+
discover the actual implementation and guide in the destination.
|
|
12
|
+
|
|
13
|
+
The local guide should explain the public entry, a working quick start, props/API,
|
|
14
|
+
supported states, lifecycle, interactions, focus, motion, responsive behavior,
|
|
15
|
+
token hooks, and any agreed differences from the identified reference. Include
|
|
16
|
+
how to run relevant tests and browser comparisons, migration guidance when needed,
|
|
17
|
+
and the limits of any lint enforcement. Keep examples on the public API.
|
|
18
|
+
|
|
19
|
+
Include a References and credits section in that local README. Link the original
|
|
20
|
+
library, relevant implementation/CSS, official usage guidance, and influential
|
|
21
|
+
articles actually used. State the reference version or commit, name the original
|
|
22
|
+
authors, and identify the influenced behavior, layout, or motion. Explain agreed
|
|
23
|
+
differences so the result's closeness to the reference can be assessed. Preserve
|
|
24
|
+
applicable license notices when implementation or assets are copied/adapted.
|
|
25
|
+
|
|
26
|
+
The receiving project's main README owns discovery/quick start and a short
|
|
27
|
+
upstream inspiration credit. Its project ADS guide (often `ADS.md`) owns shared
|
|
28
|
+
architecture, token and CSS ownership, central enforcement, and links to component
|
|
29
|
+
guides. Keep those implementation details out of core tooling docs. Avoid copying
|
|
30
|
+
the complete component contract into both. Update a project usage skill to route
|
|
31
|
+
to the local guide if one exists.
|
|
32
|
+
Validate relative file links and anchors after moving documentation.
|
|
33
|
+
|
|
34
|
+
## Decide whether a rule is useful
|
|
35
|
+
|
|
36
|
+
Add a rule only when there is a concrete misuse, a stable policy, and an AST or
|
|
37
|
+
other deterministic check that can establish the violation. Prefer existing
|
|
38
|
+
TypeScript, import restrictions, token/CSS guards, or documented review guidance
|
|
39
|
+
when they already cover it. A component does not automatically require custom lint.
|
|
40
|
+
|
|
41
|
+
Examples from Toast are direct calls during React rendering or in server modules,
|
|
42
|
+
effects that create notifications without inspectable stable IDs, and repeated
|
|
43
|
+
or conditional host mounts within an approved root file. These are examples;
|
|
44
|
+
do not apply host/ID policies to components that do not need them.
|
|
45
|
+
|
|
46
|
+
Do not encode subjective copy, useful duration, placement preference, inferred
|
|
47
|
+
data flow, or application-wide singleton claims in a syntactic rule. Where spreads,
|
|
48
|
+
dynamic values, wrappers, or cross-module behavior defeat proof, document the
|
|
49
|
+
limit rather than reporting an invented conclusion.
|
|
50
|
+
|
|
51
|
+
## Colocate ownership, register centrally
|
|
52
|
+
|
|
53
|
+
For an Oxlint-based target, use a tooling-only file such as
|
|
54
|
+
`<component>/<component>.oxlint.mjs`. Export its rule map and let the central
|
|
55
|
+
plugin import it. Register the adapter's namespace/path and rule settings under
|
|
56
|
+
`oxlint.plugins` and `oxlint.rules` in `ds.config.json`. `lint:ds` generates ignored
|
|
57
|
+
`.ds/oxlintrc.json` before running core and registered usage rules. Do not maintain
|
|
58
|
+
another adherence generator or edit generated configuration. Use scoped
|
|
59
|
+
`oxlint.overrides` for justified file-specific settings; they do not disable
|
|
60
|
+
independent architecture checks. Renderer properties and documented non-state
|
|
61
|
+
hooks use explicit `boundaries`, with accepted/rejected cases and local guidance.
|
|
62
|
+
|
|
63
|
+
Keep tooling modules out of the runtime public barrel and application bundles.
|
|
64
|
+
Core tooling must work without a particular external component. Register its
|
|
65
|
+
local rules through project configuration or an adapter; do not add a hardcoded
|
|
66
|
+
catalogue import to the ADS tool itself.
|
|
67
|
+
Namespace rules consistently and give diagnostics that explain the correction.
|
|
68
|
+
Expose real app-specific configuration, such as root file paths or public import
|
|
69
|
+
sources, without weakening the checks for the intended target.
|
|
70
|
+
|
|
71
|
+
Recognize imported aliases and namespace imports with scope resolution. Respect
|
|
72
|
+
shadowed local names and unrelated libraries; matching identifier text alone is
|
|
73
|
+
not sufficient. Inspect available AST information before deciding what a rule
|
|
74
|
+
can prove. Handle valid dynamic patterns conservatively.
|
|
75
|
+
|
|
76
|
+
## Test and document enforcement
|
|
77
|
+
|
|
78
|
+
Test accepted and rejected consumer snippets through the lint framework, covering
|
|
79
|
+
the real violation and false-positive boundaries: import aliases/namespaces,
|
|
80
|
+
shadowing, unrelated imports, event handlers/effects, relevant nesting, dynamic
|
|
81
|
+
options, and configuration. Choose cases that exercise the rule's actual policy.
|
|
82
|
+
|
|
83
|
+
Run the normal generated configuration on the source tree as well as isolated
|
|
84
|
+
rule tests; registration errors can pass unit tests. Update package scripts only
|
|
85
|
+
when needed to run the new checks. Document rule names, remediation, configuration,
|
|
86
|
+
and statically unprovable cases in the component README. Keep shared import/token
|
|
87
|
+
ownership rules in shared docs and tooling.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Research and native implementation
|
|
2
|
+
|
|
3
|
+
## Inspect the reference before designing the replacement
|
|
4
|
+
|
|
5
|
+
Follow the supplied link to the component implementation and its official docs.
|
|
6
|
+
Find the state store/hooks, markup, CSS, motion constants, geometry measurement,
|
|
7
|
+
input handlers, accessibility semantics, examples, and tests. Read an upstream
|
|
8
|
+
usage skill when available as component guidance; installation of that skill is
|
|
9
|
+
not required to read it. Identify the exact package version or source revision
|
|
10
|
+
used for the running reference.
|
|
11
|
+
|
|
12
|
+
Trace behavior through both code and the browser. CSS duration does not prove
|
|
13
|
+
how long an element stays mounted. A visibility limit may hide records without
|
|
14
|
+
pausing their timers. Focus and hover may drive different states. Separate these
|
|
15
|
+
observations from the behavior you would prefer to implement.
|
|
16
|
+
|
|
17
|
+
Use a small contract table during work:
|
|
18
|
+
|
|
19
|
+
| Concern | Original observation | Native requirement | Verification |
|
|
20
|
+
|---------|----------------------|--------------------|--------------|
|
|
21
|
+
| States | Defaults, active/loading/error, disabled | Supported states and transitions | Trigger each public path |
|
|
22
|
+
| Layout | Dimensions, gap, natural height, overflow | Measured/token mapping | Computed styles and rectangles |
|
|
23
|
+
| Lifecycle | Updates, expiry, removal, route teardown | Observable timing and callbacks | Timed state assertions |
|
|
24
|
+
| Input | Pointer/touch, keys, focus targets | Same behavior or user-agreed change | Real input plus active-element checks |
|
|
25
|
+
| Motion | Entry/exit, interruption, transform origin | Duration, easing, trajectory | Transition events and sampled frames |
|
|
26
|
+
|
|
27
|
+
This is a working aid, not a required standalone report. Keep settled public
|
|
28
|
+
contracts in the component guide and executable evidence in appropriate tests.
|
|
29
|
+
|
|
30
|
+
## Map into the target system
|
|
31
|
+
|
|
32
|
+
Use existing primitives for icons, buttons, spinners, surfaces, and typography.
|
|
33
|
+
Map dimensions, colors, radii, shadows, durations, easing, and layering to tokens.
|
|
34
|
+
Add a narrowly named token only when the existing vocabulary cannot express the
|
|
35
|
+
required behavior; preserve unrelated token contracts.
|
|
36
|
+
|
|
37
|
+
Keep the result close to the reference's function, layout, interaction, and
|
|
38
|
+
motion. Native integration should not become a redesign. Account for each
|
|
39
|
+
material difference with a user requirement or an agreed target-system tradeoff;
|
|
40
|
+
compare again after token/primitive substitutions to detect accidental drift.
|
|
41
|
+
|
|
42
|
+
Keep the reference's state machine and motion choreography distinct from the
|
|
43
|
+
native skin. Typography and controls can change wrapping and natural height,
|
|
44
|
+
which changes expanded geometry. Placement of a close control and its focus or
|
|
45
|
+
click behavior are UX decisions, even when the control uses a native button.
|
|
46
|
+
|
|
47
|
+
Use required Linaria extraction for component/pattern styles and preserve the
|
|
48
|
+
target framework. With the default root ADS layout:
|
|
49
|
+
|
|
50
|
+
- Component markup and Linaria styles live under `design-system/components/`.
|
|
51
|
+
- Public exports belong in `design-system/index.ts`; consumers use the barrel.
|
|
52
|
+
- Shared layout patterns belong under `patterns/`, not in app containers.
|
|
53
|
+
- Appearance uses semantic tokens; consumers do not target `.ads-*` internals.
|
|
54
|
+
- A needed measured-geometry boundary may write only allowlisted computed
|
|
55
|
+
dimensions, positions, or transforms. Document and constrain the exception in
|
|
56
|
+
the shared architecture guard; never broaden it to arbitrary visual styles.
|
|
57
|
+
|
|
58
|
+
Use current repository conventions in another target rather than assuming the
|
|
59
|
+
same framework, directory structure, or lint tooling.
|
|
60
|
+
|
|
61
|
+
## Implement lifecycle and motion together
|
|
62
|
+
|
|
63
|
+
Keep model/store state independent of the rendered list where practical. For
|
|
64
|
+
stateful components, consider stable subscriptions, SSR snapshots, scope teardown,
|
|
65
|
+
same-ID updates, stale async results, and callbacks that fire once. Only implement
|
|
66
|
+
the mechanisms the component actually requires.
|
|
67
|
+
|
|
68
|
+
Measure natural dimensions before applying constrained or collapsed layouts.
|
|
69
|
+
Observe relevant content/font/size changes. Give CSS transitions a rendered
|
|
70
|
+
initial state; otherwise the browser may skip entry. Let interrupted transitions
|
|
71
|
+
retarget from the current visual state. During direct dragging, suppress easing
|
|
72
|
+
and use the correct pointer-capture and cancellation lifecycle.
|
|
73
|
+
|
|
74
|
+
Match threshold, velocity, axis locking, wrong-direction resistance, dismissal,
|
|
75
|
+
and cleanup behavior independently. Do not assume a matching final transform
|
|
76
|
+
proves a matching gesture. Verify hover gaps, expanded hit areas, focus changes,
|
|
77
|
+
and interactions with buttons or selectable text when applicable.
|
|
78
|
+
|
|
79
|
+
For async status changes, compare both incoming and outgoing visual layers.
|
|
80
|
+
In the Toast example, the status icon enters over 300 ms while the loader fades
|
|
81
|
+
and shrinks over 200 ms. Replacing the loader immediately loses half the motion.
|
|
82
|
+
These values are reference-specific examples, not defaults for every component.
|
|
83
|
+
|
|
84
|
+
## Integration and provenance
|
|
85
|
+
|
|
86
|
+
Use the real native component in showcase/playground pages. Export changes before
|
|
87
|
+
migrating consumers. Replace only the surfaces covered by the request: transient
|
|
88
|
+
notifications and persistent inline feedback can have different purposes.
|
|
89
|
+
|
|
90
|
+
Keep a reference package in a temporary comparison project when needed. Preserve
|
|
91
|
+
its license files and identify its version. Record whether production code was
|
|
92
|
+
independently authored or copied/adapted. Preserve notices required by the actual
|
|
93
|
+
license for copied/adapted code or assets; tokenizing or changing frameworks does
|
|
94
|
+
not by itself establish independent authorship. Credit inspiration in the main
|
|
95
|
+
README and in a References and credits section in the component-local README.
|
|
96
|
+
Link the library and the actual source/docs/articles studied, identify the
|
|
97
|
+
version or commit, name the authors, and explain the concrete influences.
|
|
98
|
+
Document material adaptations and agreed deviations beside the public contract.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Testing and reference comparison
|
|
2
|
+
|
|
3
|
+
## Use the real reference
|
|
4
|
+
|
|
5
|
+
Run the published upstream component or an identified upstream source revision
|
|
6
|
+
in its own page. Label it with library/version. Keep its component CSS intact for
|
|
7
|
+
the baseline. The page frame may use native controls, but those controls must
|
|
8
|
+
trigger the original component and store. Two pages importing the native component
|
|
9
|
+
cannot establish upstream parity.
|
|
10
|
+
|
|
11
|
+
Use identical messages, options, counts, async delays/outcomes, action payloads,
|
|
12
|
+
and viewport/input settings. Align configuration explicitly rather than relying
|
|
13
|
+
on two different defaults. Compare brand/token differences separately from UX
|
|
14
|
+
requirements. For geometric motion, normalize trajectory by actual card size
|
|
15
|
+
where native typography intentionally changes height.
|
|
16
|
+
|
|
17
|
+
A playground built from `dist` is a snapshot. Rebuild the local ADS and playground
|
|
18
|
+
after changes, verify its asset/version inputs, and reload before comparing.
|
|
19
|
+
Check the main showcase too so a working isolated fixture does not conceal a
|
|
20
|
+
mounting, routing, CSS-entry, or scope integration problem.
|
|
21
|
+
|
|
22
|
+
## Select tests by observable risk
|
|
23
|
+
|
|
24
|
+
Use the cases relevant to the component, not a universal checklist:
|
|
25
|
+
|
|
26
|
+
| Area | Useful observations |
|
|
27
|
+
|------|---------------------|
|
|
28
|
+
| Model/lifecycle | Stable snapshots, updates, expiry, callback counts, stale async results, unmount cleanup |
|
|
29
|
+
| Layout | Natural and constrained dimensions, variable content, overflow, resize, font loading, position changes |
|
|
30
|
+
| Input | Mouse and touch separately, outward/inward drag, cancellation, threshold/flick boundary, controls inside the surface |
|
|
31
|
+
| Keyboard | Actual focused element before/after hotkeys, Escape, Tab order, focus loss or route changes |
|
|
32
|
+
| Motion | Entry/exit paths, easing, duration, scale/opacity, rapid interruption, status crossfade, DOM removal time |
|
|
33
|
+
| Environment | Supported mobile widths, light/dark, reduced motion, document visibility, supported SSR behavior |
|
|
34
|
+
| Consumer integration | Public imports, one-time CSS setup, mounted provider/host, route persistence, scoped instances |
|
|
35
|
+
|
|
36
|
+
Toast-specific high-value cases include hidden overflow cards' lifetime, compact
|
|
37
|
+
versus hover-expanded geometry, promise settlement using the same ID, close/action
|
|
38
|
+
clicks, `preventDefault()` actions, and loader-to-status motion. Timer expiry,
|
|
39
|
+
exit animation, and DOM removal are distinct observations.
|
|
40
|
+
|
|
41
|
+
For deterministic stores and async races, unit tests can validate behavior without
|
|
42
|
+
a browser. Use browser tests for geometry, transitions, pointer capture, focus,
|
|
43
|
+
and real control activation. Test a reproduced failure or lifecycle invariant;
|
|
44
|
+
avoid tests that merely mirror JSX, CSS strings, or documentation wording.
|
|
45
|
+
|
|
46
|
+
## Browser isolation and measurements
|
|
47
|
+
|
|
48
|
+
Use an independent browser context for comparisons. Do not resize, emulate,
|
|
49
|
+
navigate, or close the user's existing tabs. With a public Playwright browser
|
|
50
|
+
object, a typical ownership pattern is:
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
const comparison = await browser.newContext({
|
|
54
|
+
viewport: { width: 1440, height: 1000 },
|
|
55
|
+
colorScheme: "light",
|
|
56
|
+
reducedMotion: "no-preference",
|
|
57
|
+
});
|
|
58
|
+
try {
|
|
59
|
+
const nativePage = await comparison.newPage();
|
|
60
|
+
const referencePage = await comparison.newPage();
|
|
61
|
+
// Navigate, exercise real controls, and collect matching observations.
|
|
62
|
+
} finally {
|
|
63
|
+
await comparison.close();
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Use the browser automation tools available in the environment and follow their
|
|
68
|
+
interaction/snapshot requirements. Use the same isolation principle with other
|
|
69
|
+
browser tooling. Bring the page under test to the foreground for visibility-
|
|
70
|
+
sensitive timers; an inactive page may deliberately pause. Wait for fonts before
|
|
71
|
+
measuring text or dimensions. Use mobile/touch contexts for touch gestures;
|
|
72
|
+
mouse drags alone do not validate touch behavior.
|
|
73
|
+
|
|
74
|
+
Collect `getBoundingClientRect()` and computed styles for size, padding, gap,
|
|
75
|
+
radius, shadow, font metrics, placement, transform, opacity, transition duration,
|
|
76
|
+
and easing. Observe `transitionrun`/`transitionend` or animation events and sample
|
|
77
|
+
`requestAnimationFrame` around the trigger. Align traces to the actual animation
|
|
78
|
+
start, not tool-call start. Use a mutation observer or lifecycle callback to
|
|
79
|
+
measure exit-state and removal timestamps. Timing assertions should allow normal
|
|
80
|
+
browser scheduling tolerance.
|
|
81
|
+
|
|
82
|
+
Inspect screenshots of settled states and intermediate/problem states. Pixel
|
|
83
|
+
equality is not expected when the native skin intentionally differs. A computed
|
|
84
|
+
duration of 400 ms does not prove a 400 ms visible exit if the DOM disappears at
|
|
85
|
+
200 ms. Reduced motion can set animation names to `none` while a reset still
|
|
86
|
+
reports a tiny nonzero duration; assert effective motion behavior.
|
|
87
|
+
|
|
88
|
+
## Required checks and evidence
|
|
89
|
+
|
|
90
|
+
Run the target's existing lint/typecheck/build pipeline plus meaningful component
|
|
91
|
+
and rule tests. A native Toast project might provide:
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
npm run test:toast # Toast store/promise and usage-rule checks
|
|
95
|
+
npm run build # Lint, type checking, public-entry and showcase builds
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Discover the target's actual scripts; the commands above are not guaranteed by
|
|
99
|
+
the empty scaffold or ADS tool. For another component, use its actual test entry;
|
|
100
|
+
do not run Toast tests as a substitute. Once checks pass, rerun only when changes
|
|
101
|
+
or unresolved observations justify it. Save browser artifacts in the repository's existing ignored location
|
|
102
|
+
(for example `output/playwright/`) or an isolated temporary directory.
|
|
103
|
+
|
|
104
|
+
Report matches and differences with their evidence and reference version. Distinguish
|
|
105
|
+
observed behavior, source inference, and untested cases. Give full native/reference
|
|
106
|
+
playground URLs when they exist. Do not report a static server as running without
|
|
107
|
+
checking it, or call screenshots proof of full animation/behavior parity.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Emil Kowalski
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Credits
|
|
2
|
+
|
|
3
|
+
Adapted from Emil Kowalski's
|
|
4
|
+
[break-ui skill](https://github.com/emilkowalski/skills/tree/2d228630ba1446365f614a108cb8252f1feda202/skills/break-ui),
|
|
5
|
+
revision `2d228630ba1446365f614a108cb8252f1feda202`.
|
|
6
|
+
|
|
7
|
+
The fixture catalogue in [references/catalog.md](references/catalog.md) copies
|
|
8
|
+
upstream `CATALOG.md`, with its opening instruction adapted to local field discovery.
|
|
9
|
+
The workflow retains its worst-case
|
|
10
|
+
data, reproducible fixtures, severity reporting, and optional fix approach,
|
|
11
|
+
adapted for local ADS public APIs, token ownership, and project checks.
|
|
12
|
+
|
|
13
|
+
[LICENSE.upstream](LICENSE.upstream) preserves the full upstream MIT license
|
|
14
|
+
and Copyright (c) 2026 Emil Kowalski. Retain it when redistributing this skill
|
|
15
|
+
or its copied/adapted material. These terms identify upstream material; they
|
|
16
|
+
do not declare a license for unrelated project source.
|