@auis/cli 0.2.1 → 0.2.2

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 CHANGED
@@ -8,7 +8,7 @@ npx @auis/cli@latest my-product
8
8
  ```
9
9
 
10
10
  ```
11
- auis 0.2.1
11
+ auis 0.2.2
12
12
  code-native design builder
13
13
 
14
14
  ✓ Template main · tarball
@@ -37,7 +37,21 @@ codebase, and AI agents build against them under enforced rules:
37
37
  - **Edit Mode** — non-destructive visual edits that agents materialize into code.
38
38
  - **UX Flows as code** (`/auis/ux-flow`) — navigable flow diagrams that are React pages.
39
39
  - **State Mode** (`/auis/states`) — every registered screen in every state, side by side.
40
- - **37 agent skills** — execution contracts for Claude Code, Codex and Cursor.
40
+ - **31 agent skills** — execution contracts for Claude Code, Codex and Cursor.
41
+
42
+ ## Existing repository?
43
+
44
+ ```bash
45
+ npx @auis/cli@latest doctor
46
+ ```
47
+
48
+ `doctor` reads the repository and reports what Auis could do in it — each
49
+ capability with a reason, and an alternative when the answer is no. It writes
50
+ nothing. Installing into an existing repository (`auis init`) is not shipped yet.
51
+
52
+ The builder UI (Review, Edit, State Mode, the flow driver) needs **React 18+** in
53
+ the host today. A mount that runs beside Vue, Svelte, Angular and others is
54
+ planned; it does not exist yet.
41
55
 
42
56
  ## Options
43
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auis/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Scaffold Auis — the code-native design builder for Next.js + Tailwind + shadcn/ui, with agent skills built in.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/detect.mjs CHANGED
@@ -338,6 +338,26 @@ function detectDevServer(root, pkg, framework, router) {
338
338
  };
339
339
  }
340
340
 
341
+ // The component library the app renders with, which is what a person calls their
342
+ // stack ("a Vue app") — the build tool in FRAMEWORKS is not.
343
+ const UI_LIBS = [
344
+ ["React", ["react"]],
345
+ ["Vue", ["vue"]],
346
+ ["Svelte", ["svelte"]],
347
+ ["Angular", ["@angular/core"]],
348
+ ["Solid", ["solid-js"]],
349
+ ["Preact", ["preact"]],
350
+ ["Lit", ["lit"]],
351
+ ];
352
+
353
+ function detectUi(pkg) {
354
+ for (const [name, deps] of UI_LIBS) {
355
+ const hit = dependency(pkg, deps);
356
+ if (hit) return { name, evidence: [`package.json#${hit.name}`] };
357
+ }
358
+ return { name: null, evidence: [] };
359
+ }
360
+
341
361
  /** Everything `auis doctor` knows about a repository. Reads only. */
342
362
  export function detect(root) {
343
363
  const pkg = readJson(root, "package.json");
@@ -352,6 +372,7 @@ export function detect(root) {
352
372
  name: pkg?.name ?? path.basename(root),
353
373
  packageManager: detectPackageManager(root),
354
374
  framework,
375
+ ui: detectUi(pkg),
355
376
  react: { version: react?.range ?? null, major: react ? major(react.range) : null, evidence: react ? ["package.json#react"] : [] },
356
377
  router,
357
378
  rootLayout: detectRootLayout(root, router),
package/src/doctor.mjs CHANGED
@@ -33,20 +33,11 @@ const unsupported = (id, because, remedy) => ({ id, verdict: "unsupported", beca
33
33
  */
34
34
  export function capabilities(d) {
35
35
  const out = [];
36
- const reactOk = d.react.major !== null && d.react.major >= 18;
37
36
  const serverBacked = d.devServer.fileWriting;
38
37
 
39
38
  // --- Review -------------------------------------------------------------
40
- if (reactOk) {
41
- out.push(supported("review.pins", "Pins anchor through plain DOM — no markup, no wrapper, no provider in your components."));
42
- out.push(supported("review.draw", "Freehand marks use the same DOM anchoring as pins."));
43
- } else {
44
- const why = d.react.major === null
45
- ? "No React dependency found; the builder chrome is a React tree today."
46
- : `React ${d.react.major} is below the 18 the chrome needs.`;
47
- out.push(unsupported("review.pins", why, "A framework-agnostic mount that carries its own React is planned; it does not exist yet."));
48
- out.push(unsupported("review.draw", why, "Same mount work as review.pins."));
49
- }
39
+ out.push(supported("review.pins", "Pins anchor through plain DOM — no markup, no wrapper, no provider in your components."));
40
+ out.push(supported("review.draw", "Freehand marks use the same DOM anchoring as pins."));
50
41
 
51
42
  if (d.webComponents.present) {
52
43
  out.push(degraded(
@@ -72,7 +63,7 @@ export function capabilities(d) {
72
63
  }
73
64
 
74
65
  // --- Edit ---------------------------------------------------------------
75
- out.push(supported("edit.text", "Text edits are contenteditable on the live DOM — they work regardless of stack."));
66
+ out.push(supported("edit.text", "Text edits are contenteditable on the live DOM — nothing to add to your components."));
76
67
  out.push(supported("edit.reorder", "Reordering moves DOM siblings; no knowledge of your components is needed."));
77
68
 
78
69
  const props = d.tokens.customProperties;
@@ -118,7 +109,7 @@ export function capabilities(d) {
118
109
  }
119
110
 
120
111
  // --- Flows, states, rulebook -------------------------------------------
121
- out.push(supported("flow.driver", "Deep links replay clicks by visible text or selector, which needs nothing from your stack."));
112
+ out.push(supported("flow.driver", "Deep links replay clicks by visible text or selector — no hooks or markup in your pages."));
122
113
  out.push(degraded(
123
114
  "states.mode",
124
115
  "State Mode needs a hand-written registry of your screens and a hook call inside each page.",
@@ -126,7 +117,27 @@ export function capabilities(d) {
126
117
  ));
127
118
  out.push(supported("skills.rulebook", "The skills and conventions are plain files with no runtime — they work in any repository."));
128
119
 
129
- return out;
120
+ return gateOnChrome(out, d);
121
+ }
122
+
123
+ /**
124
+ * Review, Edit, the flow driver and State Mode all run inside the builder
125
+ * chrome, and the chrome is a React tree mounted in the host's own React. A
126
+ * host without React 18+ gets none of them, however well its DOM or its tokens
127
+ * would suit them — so every chrome-bound verdict gives way to that one reason
128
+ * instead of promising a feature nobody could open.
129
+ */
130
+ const CHROME_BOUND = /^(review|edit|flow|states)\./;
131
+
132
+ function gateOnChrome(caps, d) {
133
+ if (d.react.major !== null && d.react.major >= 18) return caps;
134
+ const why = d.react.major !== null
135
+ ? `React ${d.react.major} is below the 18 the builder chrome needs.`
136
+ : d.ui.name
137
+ ? `This is a ${d.ui.name} app; the builder chrome is a React tree today and needs React 18+ to mount in.`
138
+ : "No React dependency found; the builder chrome is a React tree today.";
139
+ const remedy = "A mount that carries its own runtime, so the chrome runs beside Vue, Svelte, Angular or no framework at all, is planned; it does not exist yet.";
140
+ return caps.map((c) => (CHROME_BOUND.test(c.id) ? unsupported(c.id, why, remedy) : c));
130
141
  }
131
142
 
132
143
  /** Paths Auis may want, that the host may already own. */
@@ -230,7 +241,17 @@ export function report(doc) {
230
241
  write();
231
242
  write(` ${color.bold("Capabilities")} ${color.dim(`${doc.summary.supported} supported · ${doc.summary.degraded} degraded · ${doc.summary.unsupported} unsupported`)}`);
232
243
  write();
244
+ // A reason shared by many rows (no React blocks the whole chrome) is printed
245
+ // once; the rows after it point back instead of repeating two long lines.
246
+ const firstWith = new Map();
233
247
  for (const c of doc.capabilities) {
248
+ const key = `${c.verdict}\n${c.because}\n${c.remedy ?? ""}`;
249
+ const first = firstWith.get(key);
250
+ if (first) {
251
+ write(` ${MARK[c.verdict]()} ${color.bold(c.id.padEnd(20))}${color.dim(`same as ${first}`)}`);
252
+ continue;
253
+ }
254
+ firstWith.set(key, c.id);
234
255
  write(` ${MARK[c.verdict]()} ${color.bold(c.id.padEnd(20))}${c.because}`);
235
256
  if (c.remedy) write(` ${color.dim(" ".repeat(20) + c.remedy)}`);
236
257
  }