@reqvire-org/ads 0.3.36 → 0.3.38

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 (86) hide show
  1. package/README.md +12 -8
  2. package/dist/bootstrap-ds/README.md +8 -9
  3. package/dist/bootstrap-ds/ds.config.json +1 -8
  4. package/dist/bootstrap-ds/package.json +4 -3
  5. package/dist/bootstrap-ds/scripts/build-mcp-previews.mjs +2 -32
  6. package/dist/bun-compiler.mjs +13 -0
  7. package/dist/bun-worker.mjs +9 -0
  8. package/dist/check.mjs +7 -4
  9. package/dist/cli.mjs +20 -8
  10. package/dist/config.mjs +24 -4
  11. package/dist/development-runtime.mjs +3 -1
  12. package/dist/init.mjs +16 -18
  13. package/dist/mcp/build-status.mjs +6 -4
  14. package/dist/mcp/context.mjs +9 -4
  15. package/dist/mcp/drafts.mjs +4 -2
  16. package/dist/mcp/mutations.mjs +4 -14
  17. package/dist/mcp/preview-owner-guard.mjs +7 -4
  18. package/dist/mcp/preview-watch.mjs +21 -9
  19. package/dist/mcp/preview-widget.bundle.js +57 -63
  20. package/dist/mcp/preview-work.mjs +1 -15
  21. package/dist/mcp/project-widget.bundle.js +55 -61
  22. package/dist/mcp/prompts.mjs +2 -2
  23. package/dist/mcp/resource-loader.js +32 -10
  24. package/dist/mcp/server.mjs +94 -34
  25. package/dist/mcp/widget.bundle.js +58 -64
  26. package/dist/preview-builder.mjs +17 -5
  27. package/dist/preview-bun.mjs +269 -0
  28. package/dist/preview-imports.mjs +73 -0
  29. package/dist/preview-resources.mjs +26 -14
  30. package/dist/resource-limits.mjs +146 -0
  31. package/dist/runtime-requirements.mjs +21 -0
  32. package/dist/scenario-inspector.mjs +11 -4
  33. package/dist/scenarios-compiler.mjs +51 -9
  34. package/dist/showcase/client.bundle.js +66 -71
  35. package/dist/showcase/index.html +2 -2
  36. package/dist/showcase/sandbox.bundle.js +1 -1
  37. package/dist/showcase/style.css +4 -0
  38. package/dist/skills/ads-break-ui/SKILL.md +42 -42
  39. package/dist/skills/ads-break-ui/references/drafts.md +6 -3
  40. package/dist/skills/ads-break-ui/references/guarded-editing.md +4 -3
  41. package/dist/skills/ads-break-ui/references/runtimes.md +175 -140
  42. package/dist/skills/ads-break-ui/references/validation.md +13 -3
  43. package/dist/skills/ads-break-ui/references/workflows.md +82 -0
  44. package/dist/skills/ads-designer/SKILL.md +41 -41
  45. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +8 -9
  46. package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +1 -8
  47. package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +4 -3
  48. package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +2 -32
  49. package/dist/skills/ads-designer/references/cli.md +25 -21
  50. package/dist/skills/ads-designer/references/drafts.md +6 -3
  51. package/dist/skills/ads-designer/references/guarded-editing.md +4 -3
  52. package/dist/skills/ads-designer/references/runtimes.md +175 -140
  53. package/dist/skills/ads-designer/references/validation.md +13 -3
  54. package/dist/skills/ads-designer/references/workflows.md +82 -0
  55. package/dist/skills/ads-import/SKILL.md +43 -44
  56. package/dist/skills/ads-import/references/cli.md +25 -21
  57. package/dist/skills/ads-import/references/drafts.md +6 -3
  58. package/dist/skills/ads-import/references/guarded-editing.md +4 -3
  59. package/dist/skills/ads-import/references/runtimes.md +175 -140
  60. package/dist/skills/ads-import/references/validation.md +13 -3
  61. package/dist/skills/ads-import/references/workflows.md +82 -0
  62. package/dist/skills/ads-motion/SKILL.md +40 -40
  63. package/dist/skills/ads-motion/references/drafts.md +6 -3
  64. package/dist/skills/ads-motion/references/guarded-editing.md +4 -3
  65. package/dist/skills/ads-motion/references/runtimes.md +175 -140
  66. package/dist/skills/ads-motion/references/validation.md +13 -3
  67. package/dist/skills/ads-motion/references/workflows.md +82 -0
  68. package/dist/skills/ads-port/SKILL.md +40 -40
  69. package/dist/skills/ads-port/references/cli.md +25 -21
  70. package/dist/skills/ads-port/references/drafts.md +6 -3
  71. package/dist/skills/ads-port/references/guarded-editing.md +4 -3
  72. package/dist/skills/ads-port/references/runtimes.md +175 -140
  73. package/dist/skills/ads-port/references/validation.md +13 -3
  74. package/dist/skills/ads-port/references/workflows.md +82 -0
  75. package/dist/usage.mjs +84 -0
  76. package/dist/validation.mjs +0 -12
  77. package/dist/verification/browser.mjs +77 -48
  78. package/docs/ADS.md +17 -11
  79. package/docs/ARCHITECTURE.md +43 -29
  80. package/docs/BEHAVIORS.md +3 -3
  81. package/docs/CHANGELOG.md +81 -13
  82. package/docs/GUIDE.md +96 -53
  83. package/docs/MCP.md +117 -123
  84. package/docs/benchmarks/bun-previews.md +91 -0
  85. package/docs/benchmarks/gidi-preview-memory.md +4 -0
  86. package/package.json +16 -14
@@ -0,0 +1,82 @@
1
+ # Direct editing and MCP-only editing
2
+
3
+ Choose the route from the user's instructions and the editor/filesystem access
4
+ actually available to the agent. `ads_status.mutations.enabled` describes MCP
5
+ capabilities; it does not require a local editor to use MCP mutation tools.
6
+ Compiler ownership is a separate choice from editing access.
7
+
8
+ ## Direct design-system code access
9
+
10
+ An agent or human edits the project's owned source with their normal editor.
11
+ MCP provides discovery, rendered previews, captures and validation; it need not
12
+ write source. A read-only MCP connection is sufficient for this workflow.
13
+
14
+ 1. Use `ads_status` to establish the connected project root, commands, compiler
15
+ state and public API. Inspect relevant source, tokens, guides and real scenarios.
16
+ 2. Edit the implementation, its scenarios/fixtures and required public exports
17
+ directly. Ordinary working-tree edits do not require `ads_create_draft` or
18
+ `ads_accept`; they change project source immediately, without isolated rollback.
19
+ 3. With the default ADS-managed compiler, let the existing watcher rebuild. Open
20
+ the scenario through `ads_show_scenario` or Explorer and inspect the rendered
21
+ result. Do not launch a second compiler beside the managed one.
22
+ 4. Inspect `ads_status.build` or `ads://project/build`. Run native ADS gates and
23
+ appropriate project/registered behavior checks, using MCP or the equivalent
24
+ CLI/project commands. Review the final current view before finishing. See
25
+ [validation scope](validation.md).
26
+
27
+ ### External builder: `mcp.previewWatch: false`
28
+
29
+ This is the direct-editing workflow with compilation managed outside the MCP
30
+ process. An agent or human edits code and runs a builder; MCP is used to preview
31
+ and inspect the published output rather than to edit or compile it.
32
+
33
+ ```json
34
+ {"framework":"react","mcp":{"previewManifest":".ds/preview/manifest.json","previewWatch":false}}
35
+ ```
36
+
37
+ ADS does not start a compiler in this mode. Run `ads compile .` after edits, or
38
+ manage `ads compile . --watch` externally. A custom compatible builder must publish
39
+ the ADS resource graph, manifest and build evidence; an ordinary application
40
+ bundle alone is insufficient. Keep only one builder responsible for these outputs.
41
+ MCP serves the published resources and reports their freshness. Existing views
42
+ can remain visible during the build, but source changes make their evidence stale
43
+ until a verified update is published. Inspect build state explicitly; resource
44
+ notifications help supported clients refresh but do not establish passing checks.
45
+
46
+ Omitting `previewWatch` or setting it to `null` selects ADS's native compiler when
47
+ the framework and preview manifest are configured. Direct editing does not imply
48
+ `false`: the managed compiler is the usual direct-editing setup. See
49
+ [runtimes](runtimes.md) for compilation and publication details.
50
+
51
+ ## MCP-only design-system access
52
+
53
+ When no authorized source editor/filesystem channel is available, use the
54
+ server's tools for source reads and changes. Do not assume returned server-local
55
+ paths can be opened by the client. Discover capabilities with `ads_status`.
56
+
57
+ With mutation tools enabled, follow [tracked drafts](drafts.md): discover owners
58
+ with `ads_units`, create a coherent proposal with `ads_create_draft`, read/edit its
59
+ marked source through `ads_read_file` and `ads_update_draft`, preview with
60
+ `ads_show_draft`, review the rendered result and accept its exact revision with
61
+ `ads_accept`. Accept dependencies first and review dependents again. The agent
62
+ performs auto-mode review; no additional human approval step is implied.
63
+
64
+ Use [guarded patches](guarded-editing.md) for focused repairs and migrations.
65
+ Without mutation tools, an MCP-only client can inspect, preview and validate,
66
+ but cannot change source. Report that capability limit if editing is required.
67
+
68
+ ## Completion and shared rules
69
+
70
+ Both routes preserve project ownership, framework, public APIs, shared tokens,
71
+ styling/geometry boundaries and configured checks. Compilation and HTML delivery
72
+ do not prove visual or behavioral correctness. Report the scope and revision of
73
+ actual passing checks; stale, failed or incomplete evidence remains unfinished.
74
+ Never change access routes to bypass a rejected patch or failed acceptance.
75
+
76
+ Direct editors may deliberately choose tracked drafts for isolation, comparison
77
+ or PR review. Once using a tracked proposal, finish a coherent design change by
78
+ reviewing and accepting its required drafts, unless the user asks to retain the
79
+ proposal. Do not silently leave requested work only in drafts. This completion
80
+ rule also applies to MCP-only drafts; it does not impose draft acceptance on
81
+ ordinary direct source edits. Never import marked `.ads` draft source into
82
+ application or accepted ADS runtime code.
@@ -3,37 +3,35 @@ name: ads-designer
3
3
  description: Bootstrap an empty local React design system from bundled scaffolding, or build UI using a project's existing design system. Covers shared token contracts, local ownership, public APIs, external source integration, showcase inspection, and validation.
4
4
  ---
5
5
 
6
- ## Auto-mode tracked drafts
7
-
8
- For iterative design work, read [tracked drafts](references/drafts.md) and use
9
- `ads_create_draft` → ordinary edits → `ads_show_draft` → rendered review →
10
- `ads_accept({id,revision})`. Use `ads_drafts` to find pending proposals and their
11
- current revisions; catalogue entries mark owners with drafts. Enable mutations
12
- for acceptance. The low-level guarded patch workflow below remains available for
13
- focused repairs/migrations; it does not replace the draft preview loop.
14
-
15
- A coherent design change may span multiple components, patterns or an entire
16
- view. **Do not report that change complete while its intended work exists only
17
- in drafts.** Validate and accept its required drafts, accepting dependencies
18
- first and reviewing dependents again after promotion. If acceptance is blocked,
19
- continue fixing it or report the exact unfinished draft/blocker. Retain a
20
- proposal for later only when the user requests that outcome; never silently drop
21
- requested work or bypass failed checks. Auto mode requires agent review, not a
22
- new human confirmation step.
23
-
24
- Drafts live in tracked `ads-drafts/` with `.ads` source. Pattern and
25
- composition previews may depend on component/pattern/token drafts through normal
26
- `@ds` imports in an isolated overlay. Accepting a dependency automatically switches
27
- dependent drafts to its final implementation. Never import `.ads` draft files
28
- into application or accepted ADS code. Shared token drafts support discovered
29
- groups from `ads_tokens.tokenGroups`; they remain owned by `tokens`.
6
+ ## Choose the editing workflow
7
+
8
+ Read [direct editing and MCP-only editing](references/workflows.md) and use the
9
+ route matching the user's instructions and your actual source access:
10
+
11
+ - **Direct code access:** edit owned files with the normal editor; use MCP for
12
+ discovery, preview, captures and validation. Ordinary source edits do not
13
+ require a tracked draft or `ads_accept`, even when MCP mutations are enabled.
14
+ - **MCP-only access:** use source/draft mutation tools, rendered review and
15
+ exact-revision acceptance. Follow [tracked drafts](references/drafts.md).
16
+ Without mutation tools or another source channel, editing is unavailable.
17
+
18
+ Direct editors can also choose tracked drafts for isolation and comparison.
19
+ When using drafts, do not report coherent design work complete before reviewing
20
+ and accepting its required proposals. If blocked, report the exact unfinished
21
+ draft/blocker; retain a proposal intentionally only when the user requests it.
22
+ Auto mode means agent review, without an extra human approval step.
23
+
24
+ Compiler ownership is independent: direct edits normally use ADS's managed
25
+ compiler. `mcp.previewWatch: false` is the externally managed builder variant;
26
+ MCP serves published previews and evidence without starting a compiler.
30
27
 
31
28
 
32
29
  For validation scope, full audits, and CLI/MCP parity, read
33
30
  [validation.md](references/validation.md).
34
31
 
35
- For Node/Bun setup, MCP launch and compiler workers, read
36
- [runtimes.md](references/runtimes.md).
32
+ For Node/Bun setup, MCP launch, compiler workers and project resource budgets,
33
+ read [runtimes.md](references/runtimes.md). Keep runtime choices, worker counts
34
+ and memory limits in project configuration; verify real workloads under them.
37
35
 
38
36
  Inspect the target before editing. Read its `README.md`, `docs/ARCHITECTURE.md`
39
37
  and `docs/ADS.md` when present (or existing project guides), public exports, and relevant
@@ -84,7 +82,8 @@ inside a different or nested repository. Inspect the selected public API, owning
84
82
  source/available guides and relevant tokens, then mount its discovered scenario.
85
83
  Metadata and source reads do not prove rendered behavior.
86
84
 
87
- When `ads_status.mutations.enabled`, discover the owner with `ads_units`, read
85
+ For MCP-only guarded editing with `ads_status.mutations.enabled`, discover the
86
+ owner with `ads_units`, read
88
87
  relevant ranges with `ads_read_file` and send only a Git unified diff through
89
88
  `ads_apply_patch({ unit, patch, dryRun })`. A unit includes its own implementation,
90
89
  scenarios and fixtures; imported peers remain separate. `tokens` is the token
@@ -110,8 +109,9 @@ Intentional configuration, rule exceptions, registered guard code and compiler
110
109
  changes use `configuration`; validate the proposed settings and keep mandatory
111
110
  ADS gates. For binary/large assets, generate `git diff --binary --full-index` into
112
111
  `.ds/patches/<name>.patch` and send `patchFile` instead of inline `patch`, so bytes
113
- stay out of model context. Binary changes require Git. When editing is disabled,
114
- use the client's normal source-editing tools.
112
+ stay out of model context. Binary changes require Git. These tool instructions
113
+ apply to the MCP editing route; direct editors use the workflow above and run
114
+ the same required gates/checks.
115
115
  For owner drafts, token-sample reconciliation, coupled transactions and local
116
116
  shared Data ownership, read [guarded-editing.md](references/guarded-editing.md).
117
117
  For on-demand current/candidate screenshots and visual dry-run review, read
@@ -305,7 +305,7 @@ spacing, elevation, base. Artwork can have fixed SVG colors; UI styles must
305
305
  still use tokens and must not override primitive state.
306
306
 
307
307
  For standard web icons, set `assets.iconSource` to an SVG under `assets/brand/`,
308
- relative to the ADS folder. After init, the normal build runs ADS/Oxlint checks,
308
+ relative to the ADS folder. After init, the normal build runs native ADS checks,
309
309
  then `ads assets`, then existing prebuild/build steps. Mount ignored `.ds/assets/`
310
310
  through the application's own bundler without public asset collisions. Keep
311
311
  manifest metadata and other platform exports project-owned. Verify the actual
@@ -380,13 +380,13 @@ initialize the entry. Several contextual public parts may share one scenario.
380
380
  IDs derive from ADS-relative filenames: both `components/core/Button/Button.ads.scenario.tsx`
381
381
  and `components/core/Button.ads.scenario.tsx` identify `components/core/Button`.
382
382
  Use one form, no duplicate IDs or hand-maintained registry. Renames change IDs.
383
- The showcase and external hosts mount the same discovered entry. The Vite
384
- adapter uses `previewEntriesPlugin` and `createPreviewResources` with
385
- `runScenarioCompiler` to publish the shared graph. Its framework mount adapter
386
- returns cleanup; the project owns rendering and Linaria extraction. The older
387
- `scenarioRegistryPlugin` is only for retained legacy browsers. MCP discovers
388
- metadata without importing executable TSX. Existing apps need an explicitly
389
- integrated compiler; init alone adds no compiler or extraction setup.
383
+ The showcase and external hosts mount the same discovered entry. ADS owns Bun
384
+ preview compilation and Linaria extraction independently of the application's
385
+ bundler. Configure the ADS framework and preview manifest; keep the project-owned
386
+ framework mount adapter and its cleanup. Use `ads compile` for standalone/CI
387
+ preview builds. MCP discovers metadata without importing executable TSX. Read
388
+ [Runtime and compiler setup](references/runtimes.md) when setting up or migrating
389
+ the compiler.
390
390
  Use `ads_scenarios` (query/kind/limit) and `ads_show_scenario({id})` to open an exact
391
391
  entry. Check its build freshness; HTML delivery is not browser verification.
392
392
  If Apps or resource forwarding are unavailable, open that scenario in the real
@@ -486,10 +486,10 @@ the ADS server package itself. Persistent SSE/notification streams make
486
486
 
487
487
 
488
488
 
489
- Register component/project Oxlint plugins and rules in `ds.config.json`. Use
490
- scoped `oxlint.overrides` for justified file-specific settings; never edit
491
- `.ds/oxlintrc.json`. These overrides configure Oxlint, not the independent
492
- architecture checks in `ads check`. Measured renderer properties and documented
489
+ Run ADS's own gates directly with `ads check`; acceptance and validation do not
490
+ require Oxlint. Register project-specific checks as explicit package scripts in
491
+ `mcp.mutationChecks` / `validation.checks`, and behavior tests through ADS contracts.
492
+ A project can use its own linter in those scripts when desired. Measured renderer properties and documented
493
493
  non-state hooks use explicit `boundaries`; shared token writes and primitive
494
494
  state overrides cannot be allowlisted. When migrating JSX inline geometry to
495
495
  imperative writes, port the source and replace its own boundary entries together
@@ -12,8 +12,8 @@ Read the local [contract](ADS.md) and the
12
12
 
13
13
  Copy the contents of `bootstrap-ds/`, including dotfiles, into a new project.
14
14
  The installed `ads-designer` skill contains the same files in
15
- `assets/bootstrap-ds/`. Set the project name in `package.json`. Use Node 22.12+
16
- or Bun 1.3.13+ with a current ADS release.
15
+ `assets/bootstrap-ds/`. Set the project name in `package.json`. Install Bun 1.4.1+ for ADS tooling and previews. The application can keep its
16
+ Node/npm build pipeline. Use a current ADS release.
17
17
 
18
18
  ```sh
19
19
  npx @reqvire-org/ads init --framework react
@@ -33,11 +33,10 @@ npm run build
33
33
 
34
34
  For a new Bun workspace, declare Bun in `packageManager`, omit the copied npm
35
35
  lockfile and translate nested npm scripts to `bun --bun run`. Initialize with
36
- `bunx --bun @reqvire-org/ads init`. Init detects existing
36
+ `bunx @reqvire-org/ads init`. Init detects existing
37
37
  Bun projects and preserves their scripts/lockfiles. Use `bun install` and
38
38
  `bun --bun run build`/`bun --bun run dev:showcase`. Node is unnecessary with Bun
39
- 1.3.13+. The supplied preview watcher's `command: "runtime"` inherits the
40
- interpreter that launched ADS and runs the project's installed checks.
39
+ 1.4.1+. ADS supplies its Bun preview compiler independently of the project build.
41
40
 
42
41
  For an existing application, merge only the ADS source and required extraction,
43
42
  aliases and preview adapter. Preserve its framework, entry points and build.
@@ -76,13 +75,13 @@ scenarios live under `composition/`. Each entry mounts independently with its
76
75
  fixture inputs and state/callback adapter. Use public ADS APIs and owned Linaria
77
76
  styles, keeping business data/services in the application.
78
77
 
79
- `ds.config.json` configures the supplied Vite watcher. It builds all discovered
80
- scenarios into one shared resource graph on first demand and watches owner code,
78
+ `ds.config.json` selects ADS's native Bun compiler. MCP prewarms discovered
79
+ views sequentially, prioritizes foreground selections, and watches owner code,
81
80
  styles, fixtures and assets. The App loads the selected dependency closure and
82
81
  reuses unchanged runtime/CSS/font resources across selections. The MCP client
83
82
  refreshes successful revisions inside that App; failures show diagnostics and
84
- stale retained output. Switching or rebuilding a scenario unmounts its previous
85
- state. `showcase/mcp/main.tsx` exports `mountScenario(Scenario, container)` and
83
+ stale retained output. Changing a selected view's dependency closure unmounts its previous state;
84
+ background warming retains unchanged mounted views. `showcase/mcp/main.tsx` exports `mountScenario(Scenario, container)` and
86
85
  returns an unmount callback; it is not the shell. Keep the saved `framework`,
87
86
  compiler and mount adapter consistent.
88
87
  Managed sessions own their graph output; standalone prebuilds cannot replace it.
@@ -2,14 +2,7 @@
2
2
  "framework": "react",
3
3
  "behaviorLibraries": [],
4
4
  "mcp": {
5
- "previewManifest": ".ds/preview/manifest.json",
6
- "previewWatch": {
7
- "command": "runtime",
8
- "args": [
9
- "scripts/build-mcp-previews.mjs",
10
- "--watch"
11
- ]
12
- }
5
+ "previewManifest": ".ds/preview/manifest.json"
13
6
  },
14
7
  "boundaries": {
15
8
  "styleWrites": [
@@ -5,7 +5,8 @@
5
5
  "type": "module",
6
6
  "description": "Private starter workspace for a project's local React design system.",
7
7
  "engines": {
8
- "node": ">=22.12.0"
8
+ "node": ">=22.12.0",
9
+ "bun": ">=1.4.1"
9
10
  },
10
11
  "sideEffects": [
11
12
  "**/*.css"
@@ -17,10 +18,10 @@
17
18
  "typecheck": "tsc --noEmit",
18
19
  "build": "npm run lint && npm run typecheck && npm run build:lib",
19
20
  "build:lib": "vite build && tsc --project tsconfig.build.json",
20
- "build:showcase": "node scripts/build-mcp-previews.mjs",
21
+ "build:showcase": "ads compile .",
21
22
  "preview": "ads showcase",
22
23
  "preview:showcase": "ads showcase",
23
- "build:mcp-previews": "node scripts/build-mcp-previews.mjs"
24
+ "build:mcp-previews": "ads compile ."
24
25
  },
25
26
  "devDependencies": {
26
27
  "@biomejs/biome": "2.5.15",
@@ -1,33 +1,3 @@
1
- import path from "node:path";
2
- import { existsSync, readFileSync } from "node:fs";
3
- import { execFile } from "node:child_process";
4
- import { promisify } from "node:util";
5
- import { build } from "vite";
6
- import wyw from "@wyw-in-js/vite";
7
- import { linariaTagResolver } from "@reqvire-org/ads/linaria";
8
- import react from "@vitejs/plugin-react";
9
- import { runScenarioCompiler } from "@reqvire-org/ads/scenarios/compiler";
10
- import { createVitePreviewBuilder, previewEntriesPlugin } from "@reqvire-org/ads/scenarios/vite";
1
+ import { compilePreviews } from "@reqvire-org/ads/scenarios/compile";
11
2
 
12
- const root = path.resolve(import.meta.dirname, "..");
13
- const runScript = promisify(execFile);
14
- const projectPackage = JSON.parse(readFileSync(path.join(root, "package.json"), "utf8"));
15
- const manager = projectPackage.packageManager?.split("@")[0] ?? (existsSync(path.join(root, "bun.lock")) || existsSync(path.join(root, "bun.lockb")) ? "bun" : "npm");
16
- await runScenarioCompiler(root, {
17
- watched: process.argv.includes("--watch"),
18
- compilerFiles: [import.meta.filename],
19
- async validate() {
20
- try { await runScript(manager, [...(manager === "bun" ? ["--bun"] : []), "run", "lint"], { cwd: root }); }
21
- catch (error) { throw new Error([error.stdout, error.stderr].map(value => value?.toString() ?? "").join("\n") || error.message); }
22
- },
23
- buildGraph: createVitePreviewBuilder({ build, configure(entries, options) {
24
- const mount = path.join(options.dsRoot, "showcase/mcp/main.tsx");
25
- return { configFile: false, root, base: "./", publicDir: false,
26
- plugins: [previewEntriesPlugin(entries.map(entry => ({ ...entry, root })), mount), wyw({ tagResolver: linariaTagResolver, include: ["**/*.{ts,tsx}"], exclude: ["**/node_modules/**"] }), react()],
27
- resolve: { alias: { "@ds": path.join(options.dsRoot, options.config.publicEntry) } },
28
- worker: { format: "iife" },
29
- build: { write: false, cssCodeSplit: true, assetsInlineLimit: 0, modulePreload: false,
30
- rollupOptions: { preserveEntrySignatures: "strict", input: Object.fromEntries(entries.map((_entry, index) => [`scenario-${index}`, `ads-preview-entry:${index}`])) } },
31
- };
32
- } }),
33
- });
3
+ await compilePreviews(process.cwd(), {watched:process.argv.includes("--watch")});
@@ -1,6 +1,11 @@
1
- # Run ADS tooling with Node or Bun
1
+ # Run ADS tooling
2
2
 
3
- Use the project's runtime for setup or ad hoc checks alongside this skill's research,
3
+ Choose [direct source editing or MCP-only editing](workflows.md). CLI commands
4
+ are available to direct editors; MCP-only clients use exposed tools instead of
5
+ assuming shell access. The compiler can be managed by MCP or externally.
6
+
7
+ Install Bun 1.4.1+ for ADS tooling and previews. The application keeps its own
8
+ Node/npm or Bun build pipeline. Use these commands alongside this skill's research,
4
9
  implementation, documentation, and verification workflow. ADS must be a project
5
10
  development dependency, and its checks must run before the project's build.
6
11
  Routine builds use the local CLI.
@@ -29,7 +34,7 @@ tooling and rejects conflicting saved/JSX settings instead of converting it.
29
34
 
30
35
  Use the confirmed package name/version if different. For a Bun project, use
31
36
  `bunx --bun @reqvire-org/ads init --framework react`, `bun install` and
32
- `bun --bun run build`. Bun 1.3.13+ suffices; Node is unnecessary. Init detects
37
+ `bun --bun run build`. Bun 1.4.1+ suffices; Node is unnecessary. Init detects
33
38
  `packageManager` or `bun.lock`/`bun.lockb`, then defaults to Bun when launched
34
39
  with Bun. See [runtimes.md](runtimes.md)
35
40
  for MCP configuration and portable compiler/behavior commands.
@@ -85,24 +90,23 @@ Use the selected real distribution; for a local tarball, invoke
85
90
  `npx --yes --package "$ads_tool_package" ads check` instead. Other inspection
86
91
  commands accept a directory; init deliberately does not.
87
92
 
88
- Every normal build refreshes `.ds/oxlintrc.json`, runs `ads check`, executes
89
- core/project Oxlint rules, then generates configured standard brand icons in
90
- `.ds/assets/`. Set `assets.iconSource` to an SVG inside the ADS's `assets/brand/`,
91
- relative to the ADS folder; no source means generation is a no-op. Integrate that
92
- directory through the app's existing asset mount. Fixed token names and prefixes
93
- are required; project values and artwork remain project-owned. Its paths reference the project and local tool;
94
- builds do not depend on the initializing npx cache. Ignore `.ds/`. Register
95
- component rules through the project's plugin adapter and `ds.config.json`, then
96
- run its actual build. Use `lint-config` directly for custom pipeline integration
97
- or debugging, not as a separate routine setup step.
98
-
99
- Use ADS 0.3.2 or later for the closed foundation contract and recoverable
100
- shared-resource preview compiler. `mcp` starts stdio
101
- plus its local website; `showcase` starts the browser-only MCP runtime. Open the existing runtime URL from `ads_status` when
102
- connected; otherwise use `npm run dev:showcase` or the installed `ads showcase`.
103
- The tool client discovers entries and renders MCP Apps. Init adds the launch
104
- script but does not install the project preview compiler. Integrate its graph
105
- compiler/mount adapter and configure `mcp.previewManifest` plus `mcp.previewWatch`;
93
+ Normal builds run native `ads check`, then generate configured standard brand
94
+ icons in `.ds/assets/`. Set `assets.iconSource` to an SVG inside the ADS's
95
+ `assets/brand/`, relative to the ADS folder; no source means generation is a no-op.
96
+ Integrate that directory through the app's existing asset mount. Fixed token
97
+ names and prefixes are required; project values and artwork remain project-owned.
98
+ Builds use the installed local tool, not the initializing npx cache. Ignore `.ds/`.
99
+ Register component-specific guards as explicit project scripts and include them
100
+ in the project build and, when needed, `mcp.mutationChecks`. `lint-config` is an
101
+ optional adapter for projects that explicitly choose Oxlint; ADS gates do not
102
+ require or invoke it.
103
+
104
+ `mcp` starts stdio plus its local website; `showcase` starts the browser-only MCP
105
+ runtime. Open the existing URL from `ads_status` when connected; otherwise use
106
+ `npm run dev:showcase` or the installed `ads showcase`. With the saved framework
107
+ and `mcp.previewManifest`, ADS supplies the Bun compiler and prewarms views
108
+ sequentially. Init supplies a framework mount adapter; existing projects can keep
109
+ their own compatible adapter. Remove old project `mcp.previewWatch` build commands;
106
110
  then use the same foundation and Linaria extraction as the application. Source discovery,
107
111
  selected component/pattern/style/brand imports, explicit theme-value imports, and
108
112
  migration are agent workflows. There is no CLI `import` command. Core checks
@@ -1,7 +1,10 @@
1
1
  # Tracked drafts and auto-mode acceptance
2
2
 
3
- Use this workflow for iterative design changes. Auto mode means the agent reviews
4
- the rendered result and accepts it; it does not introduce a human approval gate.
3
+ Use this workflow for MCP-only iterative design, or when a direct editor chooses
4
+ tracked proposals for isolation and comparison. Ordinary direct source edits use
5
+ the separate [direct editing workflow](workflows.md#direct-design-system-code-access)
6
+ and do not require draft acceptance. Auto mode means the agent reviews the
7
+ rendered result and accepts it; it does not introduce a human approval gate.
5
8
  Human acceptance controls are not part of this version.
6
9
 
7
10
  ## Complete a coherent design change
@@ -126,7 +129,7 @@ current rendered revision and complete acceptance before finishing the change.
126
129
  ## Accept or drop
127
130
 
128
131
  After rendered review, call `ads_accept({id,revision})` once. It checks that exact
129
- revision, runs mandatory ADS/registered Oxlint/project checks and affected
132
+ revision, runs mandatory ADS/configured project checks and affected
130
133
  behavior checks against an isolated candidate, and applies passing changes at
131
134
  their normal paths. Changes during checking or baseline conflicts prevent
132
135
  application. Successful acceptance removes the proposal and records an event.
@@ -1,8 +1,9 @@
1
1
  # Advanced guarded editing
2
2
 
3
- For iterative design, prefer the [tracked auto-mode draft workflow](drafts.md):
4
- ordinary edits and fast previews, then exact-revision acceptance. Complete a
5
- coherent change by accepting its required drafts, or report it as unfinished.
3
+ Choose [direct editing or MCP-only editing](workflows.md) first. This reference
4
+ covers MCP's guarded patch tools, not a requirement to route direct source edits
5
+ through MCP. For MCP-only iterative design, prefer [tracked drafts](drafts.md):
6
+ edit and preview the proposal, then review and accept its exact revision.
6
7
  The disposable `.ds/patch-drafts/` copies described below are low-level patch
7
8
  staging for focused repairs and migrations, not tracked review proposals.
8
9