@ultimat3/cli 31.52.0 → 31.53.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.
Files changed (111) hide show
  1. package/CLAUDE.md +1 -1
  2. package/package.json +29 -29
  3. package/src/app-kit-disk.ts +39 -0
  4. package/src/app-kit-forms.ts +27 -0
  5. package/src/app-kit.ts +146 -0
  6. package/src/budgets.ts +3 -1
  7. package/src/cdp-shot-driver-screen.ts +72 -0
  8. package/src/cdp-shot-driver.ts +17 -1
  9. package/src/cmd-design-capture.ts +210 -0
  10. package/src/cmd-design-errors.ts +50 -0
  11. package/src/cmd-design-paths.ts +47 -0
  12. package/src/cmd-design-publish.ts +64 -0
  13. package/src/cmd-design-run.ts +229 -0
  14. package/src/cmd-design-spec.ts +47 -0
  15. package/src/cmd-design-theme.ts +107 -0
  16. package/src/cmd-design-url.ts +201 -0
  17. package/src/cmd-design.ts +188 -0
  18. package/src/cmd-doctor.ts +3 -0
  19. package/src/cmd-generate-spec.ts +5 -0
  20. package/src/cmd-generate.ts +3 -1
  21. package/src/cmd-kit-spec.ts +13 -0
  22. package/src/cmd-kit.ts +133 -0
  23. package/src/cmd-shot-against.ts +275 -0
  24. package/src/cmd-shot-spec.ts +9 -1
  25. package/src/cmd-shot.ts +19 -0
  26. package/src/cmd-upgrade.ts +11 -0
  27. package/src/codemods/agent-kit.ts +130 -0
  28. package/src/codemods/agents-md-budget.ts +47 -0
  29. package/src/codemods/docs-visual-quality.ts +198 -0
  30. package/src/codemods/index.ts +8 -0
  31. package/src/codemods/settings-kit-allow.ts +49 -0
  32. package/src/design-extract-script.ts +187 -0
  33. package/src/design-extract.ts +311 -0
  34. package/src/design-map-colors.ts +180 -0
  35. package/src/design-map.ts +288 -0
  36. package/src/doctor-kit.ts +25 -0
  37. package/src/error-catalog.ts +4 -2
  38. package/src/error-codes-kit.ts +24 -0
  39. package/src/error-codes.ts +12 -10
  40. package/src/generate-files.ts +31 -1
  41. package/src/guards-shipped-names.ts +5 -0
  42. package/src/kit/agent-audit.ts +49 -0
  43. package/src/kit/agent-data.ts +32 -0
  44. package/src/kit/agent-server.ts +34 -0
  45. package/src/kit/agent-shape.ts +61 -0
  46. package/src/kit/agent-web.ts +49 -0
  47. package/src/kit/design-map.ts +106 -0
  48. package/src/kit/managed.ts +12 -0
  49. package/src/kit/registry.ts +89 -0
  50. package/src/kit/skill-design-research.ts +119 -0
  51. package/src/kit/skill-feature.ts +159 -0
  52. package/src/kit/skill-planx.ts +139 -0
  53. package/src/kit/skill-upgrade.ts +94 -0
  54. package/src/kit/skill-verify.ts +80 -0
  55. package/src/mcp-errors.ts +5 -0
  56. package/src/mcp-ui-diff.ts +13 -38
  57. package/src/mcp-ui.ts +30 -1
  58. package/src/messages-design.ts +104 -0
  59. package/src/messages-upgrade.ts +9 -0
  60. package/src/messages.ts +2 -0
  61. package/src/registry.ts +4 -0
  62. package/src/shot-diff.ts +96 -0
  63. package/src/shot-gpu.ts +17 -5
  64. package/src/templates/guard-animated-layout-script.ts +173 -0
  65. package/src/templates/guard-effect-without-fallback.ts +117 -0
  66. package/src/templates/guard-motion-adapter.ts +161 -0
  67. package/src/templates/guard-raw-frame-loop.ts +134 -0
  68. package/src/templates/guard-raw-motion-script.ts +132 -0
  69. package/src/templates/guard-raw-motion-ts-scan.ts +95 -0
  70. package/src/templates/guard-released-forms.ts +10 -0
  71. package/src/templates/index.ts +1 -2
  72. package/src/templates/island.ts +55 -8
  73. package/src/templates/kit-released-forms.ts +63 -0
  74. package/src/templates/motion-scale.ts +115 -0
  75. package/src/templates/scaffold-claude.ts +39 -26
  76. package/src/templates/scaffold-design.ts +41 -0
  77. package/src/templates/scaffold-docs.ts +31 -7
  78. package/src/templates/scaffold-guards.ts +31 -2
  79. package/src/templates/scaffold-verify-floor.ts +3 -0
  80. package/src/templates/shapes/blog-site.ts +15 -0
  81. package/src/templates/shapes/blog.ts +2 -0
  82. package/src/templates/shapes/content-site.ts +13 -0
  83. package/src/templates/shapes/content.ts +2 -0
  84. package/src/templates/shapes/dashboard-detail.ts +2 -0
  85. package/src/templates/shapes/dashboard-motion.ts +284 -0
  86. package/src/templates/shapes/dashboard.ts +19 -1
  87. package/src/templates/shapes/landing-motion.ts +67 -0
  88. package/src/templates/shapes/saas.ts +4 -0
  89. package/src/upgrade-gate.ts +14 -2
  90. package/src/upgrade-kit.ts +65 -0
  91. package/src/upgrade-report-kit.ts +28 -0
  92. package/src/upgrade-report.ts +3 -0
  93. package/src/verify-checks.ts +9 -1
  94. package/src/workspace-checks.ts +3 -3
  95. package/wiki/Agents.md +33 -1
  96. package/wiki/CLI-Reference-Tools.md +24 -3
  97. package/wiki/CLI-Reference.md +4 -2
  98. package/wiki/Design-Research.md +96 -0
  99. package/wiki/Effects.md +83 -0
  100. package/wiki/FAQ.md +1 -1
  101. package/wiki/Getting-Started.md +1 -1
  102. package/wiki/Home.md +2 -2
  103. package/wiki/Known-Gaps.md +3 -2
  104. package/wiki/MCP-And-AI.md +4 -0
  105. package/wiki/Motion.md +85 -0
  106. package/wiki/Project-Layout.md +1 -1
  107. package/wiki/Tutorial-02-First-Feature.md +1 -1
  108. package/wiki/UI-Components.md +2 -0
  109. package/wiki/Upgrading.md +4 -2
  110. package/src/templates/scaffold-claude-agents.ts +0 -161
  111. package/src/templates/scaffold-claude-commands.ts +0 -239
@@ -0,0 +1,284 @@
1
+ // `--shape dashboard`'s motion: one island on `/dashboard` that enter-animates what the server
2
+ // already painted. A tips panel opens and closes through `Presence`, the stat tiles and the table
3
+ // rows arrive in order through `stagger` once `inView` says they are on screen, and opening the
4
+ // panel slides what sits below it through `layout` (FLIP, transform only). Every timing is a rung
5
+ //
6
+ // of the motion scale; under reduced motion each call finishes at once (`motionTiming`).
7
+
8
+ import type { GeneratedFile } from '../naming';
9
+ import type { ShapeEdit } from './overlay';
10
+
11
+ const DIR = 'apps/web/app/dashboard';
12
+ const PAGE = `${DIR}/page.tsx`;
13
+ const ISLAND = 'dashboard-motion';
14
+
15
+ const THEME_ISLAND =
16
+ "const ThemeSwitch = island({ src: '../../shared/theme-toggle.island.tsx', props: ['locale'] });";
17
+ const HEADER =
18
+ " <PageHeader title={t('app.dashboard.title')} description={t('app.dashboard.subtitle')} />\n";
19
+
20
+ /** What the page hands the island: three strings, already translated — a `t` cannot travel. */
21
+ export const MOTION_KEYS = {
22
+ 'app.dashboard.motionOpen': 'Show tips',
23
+ 'app.dashboard.motionClose': 'Hide tips',
24
+ 'app.dashboard.motionNote': 'Tiles and rows arrive in order as they scroll into view.',
25
+ } as const;
26
+
27
+ /** The page's two edits: declare the island above `defineRoute`, and place it under the header. */
28
+ export const dashboardMotionEdits = (): readonly ShapeEdit[] => [
29
+ {
30
+ path: PAGE,
31
+ find: THEME_ISLAND,
32
+ replace: `${THEME_ISLAND}
33
+ // The motion island: named by specifier too. Its three props are the exact keys of
34
+ // \`DashboardMotionProps\`.
35
+ const MotionPanel = island({
36
+ src: './${ISLAND}.island.tsx',
37
+ props: ['open', 'close', 'note'],
38
+ });`,
39
+ },
40
+ {
41
+ path: PAGE,
42
+ find: HEADER,
43
+ replace: `${HEADER} <MotionPanel
44
+ open={t('app.dashboard.motionOpen')}
45
+ close={t('app.dashboard.motionClose')}
46
+ note={t('app.dashboard.motionNote')}
47
+ >
48
+ <Button variant="secondary" size="sm">
49
+ {t('app.dashboard.motionOpen')}
50
+ </Button>
51
+ </MotionPanel>
52
+ `,
53
+ },
54
+ // Measured, never guessed: the theme toggle's island is 35,964 B and this one 40,875 B under
55
+ // Bun 1.4.4 (Solid, the ui runtime slot, Button, Presence, stagger, inView and layout), and the
56
+ // two share no chunk, so the route loads 76,839 B. The base scaffold's 60kb held one island.
57
+ {
58
+ path: PAGE,
59
+ find: " budget: { js: '60kb' },",
60
+ replace: " budget: { js: '78kb' },",
61
+ },
62
+ {
63
+ path: `${DIR}/page.test.ts`,
64
+ find: "expect(page.config.budget.js).toBe('60kb');",
65
+ replace: "expect(page.config.budget.js).toBe('78kb');",
66
+ },
67
+ // The render emits the motion island beside the theme toggle: the test names both.
68
+ {
69
+ path: `${DIR}/page.test.ts`,
70
+ find: "hydrates one island', async () => {",
71
+ replace: "hydrates its two islands', async () => {",
72
+ },
73
+ {
74
+ path: `${DIR}/page.test.ts`,
75
+ find: ` // What the render emitted, beside what the config declares: the theme toggle, and only it.
76
+ expect(view.islands.map((island) => [island.moduleId, island.strategy])).toEqual([
77
+ ['shared-theme-toggle', 'visible'],
78
+ ]);`,
79
+ replace: ` // What the render emitted, beside what the config declares: the theme toggle and the motion.
80
+ expect(view.islands.map((island) => [island.moduleId, island.strategy])).toEqual([
81
+ ['shared-theme-toggle', 'visible'],
82
+ ['${ISLAND}', 'visible'],
83
+ ]);`,
84
+ },
85
+ {
86
+ path: PAGE,
87
+ find: ' AreaChart,\n',
88
+ replace: ' AreaChart,\n Button,\n',
89
+ },
90
+ ];
91
+
92
+ const source =
93
+ (): string => `// DashboardMotion: the dashboard's motion, and the second module of this route a browser
94
+ // downloads. The server painted everything; this reveals it, never builds it.
95
+ //
96
+ // Presence a tips panel enters and exits, the node held until its exit has played
97
+ // inView nothing starts until its list is on screen, one observer for the page
98
+ // stagger the tiles, then the rows, each a beat after the last
99
+ // layout opening the panel slides what sits below it (FLIP, transform only)
100
+ //
101
+ // Named by SPECIFIER from the page, never by import (axiom 6). Timing is the motion scale's:
102
+ // \`snappy\` and \`gentle\` are springs, and under reduced motion every call finishes at once.
103
+
104
+ import { mountOver } from '@ultimat3/render/client';
105
+ import { Button, setSolidRuntime } from '@ultimat3/ui';
106
+ import { inView, layout, type MotionFrame, Presence, stagger } from '@ultimat3/ui/motion';
107
+ import type { JSX } from 'solid-js';
108
+ import {
109
+ createContext,
110
+ createEffect,
111
+ createMemo,
112
+ createRoot,
113
+ createSignal,
114
+ onCleanup,
115
+ onMount,
116
+ useContext,
117
+ } from 'solid-js';
118
+ import { render } from 'solid-js/web';
119
+ import styles from './${ISLAND}.module.scss';
120
+
121
+ export interface DashboardMotionProps {
122
+ /** Already translated: this runs in the browser, where \`t()\`'s catalog is not. */
123
+ readonly open: string;
124
+ readonly close: string;
125
+ readonly note: string;
126
+ }
127
+
128
+ const ARRIVE: readonly MotionFrame[] = [
129
+ { opacity: 0, y: '0.75rem' },
130
+ { opacity: 1, y: 0 },
131
+ ];
132
+
133
+ /** The whole page, asked through its root element: that is what a test's DOM and a browser share. */
134
+ const page = (): Element => document.documentElement;
135
+
136
+ /** A stat tile is two levels above its figure: \`StatTile\` hands a test only the number's hook. */
137
+ const tileOf = (figure: Element): Element => figure.parentElement?.parentElement ?? figure;
138
+
139
+ /** What the server rendered that arrives in order: the tiles, then the table's rows. */
140
+ function lists(): readonly (readonly Element[])[] {
141
+ const tiles = [...page().querySelectorAll('[data-stat]')].map(tileOf);
142
+ const rows = [...page().querySelectorAll('tbody tr')];
143
+ return [tiles, rows].filter((items) => items.length > 0);
144
+ }
145
+
146
+ /** Each list waits until it is on screen, then staggers in. Returns the stop. */
147
+ function revealLists(): () => void {
148
+ const stops = lists().map((items) =>
149
+ inView(
150
+ items[0]?.parentElement ?? page(),
151
+ () => {
152
+ stagger(items, ARRIVE, { easing: 'gentle' });
153
+ },
154
+ { amount: 0.1 },
155
+ ),
156
+ );
157
+ return () => {
158
+ for (const stop of stops) stop();
159
+ };
160
+ }
161
+
162
+ /** Everything the panel pushes down: the tiles and the sections under it. */
163
+ const flowing = (): readonly Element[] => [
164
+ ...lists().flat(),
165
+ ...page().querySelectorAll('section'),
166
+ ];
167
+
168
+ function DashboardMotion(props: DashboardMotionProps): JSX.Element {
169
+ const [shown, setShown] = createSignal(false);
170
+ onMount(() => onCleanup(revealLists()));
171
+ const toggle = (): void => {
172
+ layout(flowing(), () => setShown(!shown()), { duration: 'fast', easing: 'snappy' });
173
+ };
174
+ return (
175
+ <div class={styles.panel}>
176
+ <Button variant="secondary" size="sm" aria-expanded={shown()} onClick={toggle}>
177
+ {shown() ? props.close : props.open}
178
+ </Button>
179
+ <Presence when={shown()} easing="snappy" class={styles.note}>
180
+ <p>{props.note}</p>
181
+ </Presence>
182
+ </div>
183
+ );
184
+ }
185
+
186
+ /**
187
+ * The one export the hydration runtime calls. \`setSolidRuntime\` first: \`@ultimat3/ui\` reaches the
188
+ * reactive graph through the runtime an entry registers. \`mountOver\` clears the server's button
189
+ * for the live render and puts it back if the render throws.
190
+ */
191
+ export function mount(el: HTMLElement, props: DashboardMotionProps): () => void {
192
+ setSolidRuntime({
193
+ createContext,
194
+ useContext,
195
+ createSignal,
196
+ createMemo,
197
+ createEffect,
198
+ onCleanup,
199
+ createRoot,
200
+ });
201
+ return mountOver(el, (root) => render(() => <DashboardMotion {...props} />, root));
202
+ }
203
+ `;
204
+
205
+ const style =
206
+ (): string => `// Semantic tokens only; the motion itself is script, so no keyframe or transition lives here.
207
+ @use '@ultimat3/ui/tokens' as tokens;
208
+
209
+ .panel {
210
+ display: grid;
211
+ gap: tokens.space(3);
212
+ justify-items: start;
213
+ }
214
+
215
+ .note {
216
+ padding: tokens.space(3) tokens.space(4);
217
+ border: 1px solid tokens.role('line');
218
+ border-radius: tokens.radius('md');
219
+ background: tokens.role('surface');
220
+ color: tokens.role('fg');
221
+ }
222
+ `;
223
+
224
+ const states =
225
+ (): string => `// The states \`${ISLAND}\` can be photographed in. PURE DATA: the one import is \`import type\`.
226
+ import { defineIslandStates } from '@ultimat3/testing';
227
+ import type { DashboardMotionProps } from './${ISLAND}.island';
228
+
229
+ export const dashboardMotionStates = defineIslandStates({
230
+ island: '${DIR}/${ISLAND}.island.tsx',
231
+ states: [
232
+ {
233
+ id: 'closed',
234
+ title: 'the first paint: the panel is shut and the page below it is where the server put it',
235
+ props: {
236
+ open: 'Show tips',
237
+ close: 'Hide tips',
238
+ note: 'Tiles and rows arrive in order as they scroll into view.',
239
+ } satisfies DashboardMotionProps,
240
+ },
241
+ ],
242
+ });
243
+ `;
244
+
245
+ const test =
246
+ (): string => `// The motion island the browser runs: built with \`buildIslands\`, mounted over the server's button,
247
+ // and driven. What it pins: the panel is Presence's (absent until opened, held through its exit),
248
+ // and the page's own tiles are read by the stagger without throwing under a DOM with no
249
+ // IntersectionObserver or WAAPI — where \`inView\` and \`animate\` finish at once.
250
+ import { join } from 'node:path';
251
+ import { buildIslands } from '@ultimat3/cli';
252
+ import { describeIslandState, expect, test } from '@ultimat3/testing';
253
+ import { dashboardMotionStates } from './${ISLAND}.island.states';
254
+
255
+ const island = {
256
+ build: buildIslands,
257
+ root: join(import.meta.dir, '..', '..', '..', '..'),
258
+ shell: '<button type="button">Show tips</button>',
259
+ };
260
+
261
+ describeIslandState(dashboardMotionStates, 'closed', island, (mounted) => {
262
+ test('mount replaces the shell with the live control, panel shut', () => {
263
+ expect(mounted().text('button')).toBe('Show tips');
264
+ expect(mounted().find('[data-presence]')).toBeNull();
265
+ expect(mounted().code).not.toMatch(/\\bReact\\b/);
266
+ });
267
+
268
+ test('a click opens the panel through Presence, and the label says what the next click does', () => {
269
+ expect(mounted().fire('button', 'click')).toBe(true);
270
+ expect(mounted().text('button')).toBe('Hide tips');
271
+ expect(mounted().text('[data-presence]')).toBe(
272
+ 'Tiles and rows arrive in order as they scroll into view.',
273
+ );
274
+ });
275
+ });
276
+ `;
277
+
278
+ /** The island, its stylesheet, its states and its test. */
279
+ export const dashboardMotionFiles = (): readonly GeneratedFile[] => [
280
+ { path: `${DIR}/${ISLAND}.island.tsx`, contents: source() },
281
+ { path: `${DIR}/${ISLAND}.module.scss`, contents: style() },
282
+ { path: `${DIR}/${ISLAND}.island.states.ts`, contents: states() },
283
+ { path: `${DIR}/${ISLAND}.island.test.ts`, contents: test() },
284
+ ];
@@ -6,6 +6,8 @@ import { catalogJson } from '../catalog-json';
6
6
  import { catalogPath } from '../locales';
7
7
  import type { GeneratedFile, NameSet } from '../naming';
8
8
  import { dashboardDetailFiles } from './dashboard-detail';
9
+ import { dashboardMotionEdits, dashboardMotionFiles, MOTION_KEYS } from './dashboard-motion';
10
+ import { baseLandingAurora, effectsDependency, landingMotionTest } from './landing-motion';
9
11
  import type { ShapeEdit, ShapeOverlay } from './overlay';
10
12
  import { shapeLines } from './shared-edits';
11
13
 
@@ -25,6 +27,16 @@ const edits = (): readonly ShapeEdit[] => [
25
27
  find: 'cell: (row) => row.title,',
26
28
  replace: `cell: (row) => <a href={\`/posts/\${row.id}\`}>{row.title}</a>,`,
27
29
  },
30
+ // list → detail: the content region of both pages shares one name, so the client router morphs
31
+ // it while the shell around it stays put.
32
+ {
33
+ path: 'apps/web/app/posts/page.module.scss',
34
+ find: '.page {\n',
35
+ replace: '.page {\n @include tokens.view-transition-name(post-main);\n\n',
36
+ },
37
+ ...dashboardMotionEdits(),
38
+ ...baseLandingAurora(),
39
+ effectsDependency(),
28
40
  ...shapeLines(
29
41
  'dashboard',
30
42
  'an internal tool — the `post` table at `/posts` links each row to `apps/web/app/posts/[id]/page.tsx`, and `x g sign-in --password` wrote the sign-in',
@@ -36,6 +48,7 @@ const catalog = (): GeneratedFile => ({
36
48
  path: catalogPath('en'),
37
49
  merge: 'json',
38
50
  contents: catalogJson({
51
+ ...MOTION_KEYS,
39
52
  'app.post.back': 'All posts',
40
53
  'app.post.created': 'Created',
41
54
  'app.post.detail': 'Post',
@@ -48,6 +61,11 @@ export const dashboardShape: ShapeOverlay = {
48
61
  drop: [],
49
62
  dropKeys: [],
50
63
  edits,
51
- files: (app: NameSet): readonly GeneratedFile[] => [...dashboardDetailFiles(app), catalog()],
64
+ files: (app: NameSet): readonly GeneratedFile[] => [
65
+ ...dashboardDetailFiles(app),
66
+ ...dashboardMotionFiles(),
67
+ landingMotionTest(),
68
+ catalog(),
69
+ ],
52
70
  generate: [['sign-in', '--password']],
53
71
  };
@@ -0,0 +1,67 @@
1
+ // What every shape's `site/` landing shares: the `@ultimat3/effects` dependency (pinned EXACT, like
2
+ // every `@ultimat3/*`), a CSS-tier Aurora behind the hero — 0 B of JavaScript, so the landing's
3
+ // `0kb` budget is untouched — and the one view-transition name the shell's content takes so the
4
+ // client router morphs list → detail while the chrome stays put.
5
+
6
+ import { loadVersion } from '../../version-loader';
7
+ import type { GeneratedFile } from '../naming';
8
+ import type { ShapeEdit } from './overlay';
9
+
10
+ const SITE = 'apps/web/site';
11
+
12
+ /** `@ultimat3/effects` joins the app's dependencies, in the sorted place the scaffold keeps. */
13
+ export const effectsDependency = (): ShapeEdit => ({
14
+ path: 'package.json',
15
+ find: ` "@ultimat3/entity": "${loadVersion()}",`,
16
+ replace: ` "@ultimat3/effects": "${loadVersion()}",\n "@ultimat3/entity": "${loadVersion()}",`,
17
+ });
18
+
19
+ /** The base landing: an Aurora as the hero's first child, laid under the hero's own content. */
20
+ export const baseLandingAurora = (): readonly ShapeEdit[] => [
21
+ {
22
+ path: `${SITE}/page.tsx`,
23
+ find: "import { defineRoute } from '@ultimat3/render';\n",
24
+ replace:
25
+ "import { Aurora } from '@ultimat3/effects';\nimport { defineRoute } from '@ultimat3/render';\n",
26
+ },
27
+ {
28
+ path: `${SITE}/page.tsx`,
29
+ find: ' <header class={styles.hero}>\n',
30
+ replace: ' <header class={styles.hero}>\n <Aurora class={styles.aurora} />\n',
31
+ },
32
+ {
33
+ path: `${SITE}/page.module.scss`,
34
+ find: '.eyebrow {',
35
+ replace: `// The backdrop is CSS alone (\`data-effect-backend="css"\`): the hero's content sits above it.
36
+ .hero > .aurora {
37
+ position: absolute;
38
+ inset: 0;
39
+ z-index: tokens.z(base);
40
+ }
41
+
42
+ .hero > :not(.aurora) {
43
+ position: relative;
44
+ z-index: tokens.z(raised);
45
+ }
46
+
47
+ .eyebrow {`,
48
+ },
49
+ ];
50
+
51
+ /** Its test: the backdrop is the css tier and the landing still ships no island. */
52
+ export const landingMotionTest = (): GeneratedFile => ({
53
+ path: `${SITE}/landing-motion.test.ts`,
54
+ contents: `// The landing's backdrop is Aurora's CSS tier: it costs no JavaScript, so the page stays 0kb with
55
+ // no island, and the server's frame is what a reader under reduced motion keeps.
56
+ import { expect, renderRoute, unitTest } from '@ultimat3/testing';
57
+ import * as page from './page';
58
+
59
+ unitTest('the hero sits on a css-tier Aurora and the landing still hydrates nothing', async () => {
60
+ const view = await renderRoute(page, { url: 'https://example.test/' });
61
+ expect(view.html).toContain('data-effect-backend="css"');
62
+ expect(page.config.hydrate).toBe('never');
63
+ expect(page.config.budget.js).toBe('0kb');
64
+ expect(view.islands).toEqual([]);
65
+ });
66
+ `,
67
+ });
@@ -7,6 +7,7 @@ import { loadVersion } from '../../version-loader';
7
7
  import { catalogJson } from '../catalog-json';
8
8
  import { catalogPath } from '../locales';
9
9
  import type { GeneratedFile, NameSet } from '../naming';
10
+ import { baseLandingAurora, effectsDependency, landingMotionTest } from './landing-motion';
10
11
  import type { ShapeEdit, ShapeOverlay } from './overlay';
11
12
  import { BILLING_DIR, billingFiles } from './saas-billing';
12
13
  import { billingReceiverFiles, RECEIVER_NAME } from './saas-receiver';
@@ -18,6 +19,8 @@ const ROLES = 'apps/web/shared/roles.ts';
18
19
  const RECEIVER_MODULE = `../app/billing/jobs/${RECEIVER_NAME}`;
19
20
 
20
21
  const edits = (app: NameSet): readonly ShapeEdit[] => [
22
+ effectsDependency(),
23
+ ...baseLandingAurora(),
21
24
  // The receiver is a job: listed, so the boot registers it under its name and mounts its route.
22
25
  {
23
26
  path: API,
@@ -107,6 +110,7 @@ export const saasShape: ShapeOverlay = {
107
110
  files: (app: NameSet): readonly GeneratedFile[] => [
108
111
  ...billingFiles(app),
109
112
  ...billingReceiverFiles(),
113
+ landingMotionTest(),
110
114
  catalog(),
111
115
  ],
112
116
  generate: [['sign-in', '--password'], ['invite']],
@@ -26,6 +26,8 @@ import { ratchetExerciseFloor } from './upgrade-exercise-floor';
26
26
  import { applyHopCodemods } from './upgrade-gate-codemods';
27
27
  import type { BaselinedGuard, WithheldGuard } from './upgrade-guards';
28
28
  import { installMissingGuards } from './upgrade-guards';
29
+ import type { HopKit } from './upgrade-kit';
30
+ import { readKit } from './upgrade-kit';
29
31
  import { parseJson } from './upgrade-registry';
30
32
  import type { HopCodemods } from './upgrade-report-codemods';
31
33
  import { installedNotRun } from './upgrade-scope';
@@ -142,6 +144,8 @@ export interface HopGate {
142
144
  */
143
145
  readonly doctorWarnings: readonly GateFinding[];
144
146
  readonly guards: HopGuards;
147
+ /** The managed agent kit the installed CLI wrote (`upgrade-kit.ts`); absent on a gate that ran none. */
148
+ readonly kit?: HopKit;
145
149
  /** The coverage floor a Bun-floor hop moved to what it measured; null when none moved. */
146
150
  readonly coverage: HopCoverage | null;
147
151
  readonly exercise: HopExercise;
@@ -251,6 +255,7 @@ const readGuards = (doctor: DoctorDocument['data']): HopGuards => {
251
255
 
252
256
  export type HopStage =
253
257
  | 'codemods'
258
+ | 'kit'
254
259
  | 'manifest'
255
260
  | 'doctor'
256
261
  | 'guards'
@@ -260,8 +265,9 @@ export type HopStage =
260
265
 
261
266
  /**
262
267
  * The gate, in order, each stage told apart by `onStage` so a long gate is not a long silence.
263
- * `guards` runs only when the doctor lists a missing one; `coverage` only on a hop that moved the
264
- * Bun floor — both before `verify`, so the verdict is the one on the tree the hop leaves.
268
+ * `kit` writes the managed agent files right after the codemods, before the manifest and the doctor
269
+ * that read them; `guards` runs only when the doctor lists a missing one; `coverage` only on a hop
270
+ * that moved the Bun floor — both before `verify`, so the verdict is the one on the tree the hop leaves.
265
271
  */
266
272
  export async function runHopGate(input: {
267
273
  readonly runner: Runner;
@@ -282,6 +288,11 @@ export async function runHopGate(input: {
282
288
  onStage('codemods');
283
289
  codemods = await applyHopCodemods({ runner, root, ...input.codemods });
284
290
  }
291
+ // After the codemods deleted the old commands, and BEFORE the doctor: its `.claude/kit.json` check
292
+ // reads the tree this writes, and a doctor asked first reports the kit absent on a hop that
293
+ // installs it — a hand step the upgrade had already taken.
294
+ onStage('kit');
295
+ const kit = readKit(await installed(['kit', '--json']));
285
296
  const superseded = (await supersededFindings(root)).map(pick);
286
297
  onStage('manifest');
287
298
  const manifest = readManifest(await installed(['manifest', '--json']));
@@ -338,6 +349,7 @@ export async function runHopGate(input: {
338
349
  manifest,
339
350
  doctorWarnings,
340
351
  guards,
352
+ kit,
341
353
  coverage,
342
354
  exercise,
343
355
  exerciseFloor,
@@ -0,0 +1,65 @@
1
+ // The agent kit a hop refreshes, after the codemods and before the manifest and the doctor: the
2
+ // INSTALLED CLI's `x kit --json` writes the release it just installed — never this process's, which
3
+ // may be majors older. No `kit` command answers no `data.written`: `reported: false`, unknown.
4
+
5
+ import { t } from '@ultimat3/schema';
6
+ import type { ExecResult } from './exec';
7
+ import { documentIn } from './upgrade-document';
8
+
9
+ const FINDING = t.object({
10
+ code: t.string,
11
+ cause: t.string,
12
+ fix: t.string,
13
+ at: t.optional(t.string),
14
+ });
15
+ const KIT = t.object({
16
+ findings: t.optional(t.array(FINDING)),
17
+ data: t.optional(
18
+ t.object({
19
+ written: t.optional(t.array(t.object({ path: t.string, action: t.string }))),
20
+ unchanged: t.optional(t.number),
21
+ off: t.optional(t.array(t.string)),
22
+ }),
23
+ ),
24
+ });
25
+
26
+ export interface HopKit {
27
+ /** False when the installed CLI answered no kit document: it predates `x kit`. */
28
+ readonly reported: boolean;
29
+ /** Files the installed CLI wrote: `created` or `updated`, app-root relative. */
30
+ readonly written: readonly { readonly path: string; readonly action: string }[];
31
+ readonly unchanged: number;
32
+ /** The entries `.claude/kit.json` leaves alone. */
33
+ readonly off: readonly string[];
34
+ /** What `x kit` could not decide for the author (a shadowed command), with the fix. */
35
+ readonly findings: readonly {
36
+ readonly code: string;
37
+ readonly cause: string;
38
+ readonly fix: string;
39
+ readonly at?: string;
40
+ }[];
41
+ }
42
+
43
+ export const NO_KIT: HopKit = { reported: false, written: [], unchanged: 0, off: [], findings: [] };
44
+
45
+ /** The installed `x kit --json`, read as the foreign document it is. */
46
+ export function readKit(result: ExecResult): HopKit {
47
+ const parsed = KIT.safeParse(documentIn(result.stdout));
48
+ if (parsed.issues !== undefined) return NO_KIT;
49
+ const document = parsed.value as {
50
+ readonly findings?: HopKit['findings'];
51
+ readonly data?: {
52
+ readonly written?: HopKit['written'];
53
+ readonly unchanged?: number;
54
+ readonly off?: readonly string[];
55
+ };
56
+ };
57
+ if (document.data?.written === undefined) return NO_KIT;
58
+ return {
59
+ reported: true,
60
+ written: document.data.written,
61
+ unchanged: document.data.unchanged ?? 0,
62
+ off: document.data.off ?? [],
63
+ findings: document.findings ?? [],
64
+ };
65
+ }
@@ -0,0 +1,28 @@
1
+ // The agent-kit half of what `x upgrade` says: the count the installed `x kit` wrote, each file it
2
+ // touched, and the finding it left for the author — the report names what was refreshed.
3
+
4
+ import { msg } from './messages';
5
+ import type { HopKit } from './upgrade-kit';
6
+
7
+ export function kitLines(kit: HopKit | undefined): readonly string[] {
8
+ if (kit === undefined) return [];
9
+ if (!kit.reported) return [msg('cli.upgrade.kit.unreported')];
10
+ const created = kit.written.filter((file) => file.action === 'created').length;
11
+ return [
12
+ msg('cli.upgrade.kit', {
13
+ created,
14
+ updated: kit.written.length - created,
15
+ unchanged: kit.unchanged,
16
+ }),
17
+ ...kit.written.map((file) =>
18
+ msg('cli.upgrade.kit.file', { action: file.action, path: file.path }),
19
+ ),
20
+ ...kit.findings.map((finding) =>
21
+ msg('cli.upgrade.kit.finding', {
22
+ code: finding.code,
23
+ at: finding.at ?? '',
24
+ fix: finding.fix,
25
+ }),
26
+ ),
27
+ ];
28
+ }
@@ -11,6 +11,7 @@ import type { UpgradeHop, UpgradePin } from './upgrade-plan';
11
11
  import { pinMoves } from './upgrade-plan';
12
12
  import type { HopCodemods } from './upgrade-report-codemods';
13
13
  import { codemodLines } from './upgrade-report-codemods';
14
+ import { kitLines } from './upgrade-report-kit';
14
15
 
15
16
  /** A dry run's codemod preview and superseded scan; a hop's come from its gate. */
16
17
  interface Previewed {
@@ -120,6 +121,7 @@ export const humanLines = (
120
121
  : []),
121
122
  ...codemodLines(input.codemods ?? gate?.codemods ?? null),
122
123
  ...supersededLines(input.superseded ?? gate?.superseded ?? []),
124
+ ...kitLines(gate?.kit),
123
125
  ...(gate?.guards.installed ?? []).map((name) => msg('cli.upgrade.guardInstalled', { name })),
124
126
  ...(gate?.guards.baselined ?? []).map((guard) =>
125
127
  msg('cli.upgrade.guardBaselined', { name: guard.name, count: guard.findings }),
@@ -228,6 +230,7 @@ export const report = (
228
230
  codemods: input.codemods ?? gate?.codemods ?? null,
229
231
  superseded: input.superseded ?? gate?.superseded ?? [],
230
232
  guards: gate?.guards ?? null,
233
+ kit: gate?.kit ?? null,
231
234
  coverage: gate?.coverage ?? null,
232
235
  manifest: gate?.manifest ?? null,
233
236
  doctorWarnings: gate?.doctorWarnings ?? [],
@@ -12,6 +12,7 @@ import { checkAgentsMd } from './app-agents-md';
12
12
  import { readAppSources } from './app-boundaries';
13
13
  import { devImportWarnings } from './app-dev-imports';
14
14
  import { envExampleFindings } from './app-env';
15
+ import { kitVerdict } from './app-kit-disk';
15
16
  import { loadApp } from './app-load';
16
17
  import { appManifest } from './app-manifest';
17
18
  import { policyFindings } from './app-permissions';
@@ -412,6 +413,9 @@ export const VERIFY_STEPS: readonly VerifyStep[] = [
412
413
  // Started first and awaited last: it is a child process, and it runs beside the rest.
413
414
  const roleLoad = app ? roleLoadFindings(ctx.root, ctx.runner) : Promise.resolve([]);
414
415
  const drift = await driftFindings(ctx.root);
416
+ // The agent kit, beside `AGENTS.md`: errors once `.claude/kit.json` opts the app in, else one
417
+ // warning (`app-kit.ts`). An app only — the framework monorepo ships the kit, it holds none.
418
+ const kit = app ? await kitVerdict(ctx.root) : undefined;
415
419
  // Every `mcpTools()` against `tools.lock.json`: the `x mcp lock --check` of each, at once.
416
420
  const remote = app ? await mcpLockFindings(ctx.root) : { findings: [], warnings: [] };
417
421
  const findings = [
@@ -434,6 +438,7 @@ export const VERIFY_STEPS: readonly VerifyStep[] = [
434
438
  ...(await envExampleFindings(ctx.root)),
435
439
  ...floorProblemFindings(floor),
436
440
  ...agents.findings,
441
+ ...(kit?.findings ?? []),
437
442
  ...(await hostFindings(ctx, 'manifest')),
438
443
  ];
439
444
  // Warnings are not findings: `AGENTS.md` tabulating a route table is a smell a human
@@ -444,7 +449,10 @@ export const VERIFY_STEPS: readonly VerifyStep[] = [
444
449
  ];
445
450
  // A page's `<form method="post">` to an action with no `native`: a JSON dead end. Advice on
446
451
  // `main` — refusing it would redden an app that passed yesterday (X_BREAKING_ON_MAIN).
447
- const warnings = app ? await nativeFormWarnings(ctx.root) : [];
452
+ const warnings = [
453
+ ...(app ? await nativeFormWarnings(ctx.root) : []),
454
+ ...(kit?.warnings ?? []),
455
+ ];
448
456
  return {
449
457
  ok: findings.length === 0,
450
458
  findings,
@@ -259,13 +259,13 @@ export const ARTIFACT_ALLOWLIST: readonly string[] = ['packages/ui/src/scss.d.ts
259
259
 
260
260
  /** `-name` matches the same suffixes the check globs; `! -path` spares each allowlisted file. */
261
261
  const SWEEP_PREDICATE = [
262
- `\\( -name '*.d.ts' -o -name '*.js' -o -name '*.map' \\)`,
262
+ `\\( -name '*.d.ts' -o -name '*.js' -o -name '*.jsx' -o -name '*.map' \\)`,
263
263
  ...ARTIFACT_ALLOWLIST.map((path) => `! -path '${path}'`),
264
264
  ].join(' ');
265
265
 
266
266
  export const buildArtifactsFinding = (dir: string, count: number): Finding => ({
267
267
  code: 'X_PACKAGE_SHAPE',
268
- cause: `packages/${dir}/src/ contains ${count} build artifacts (.d.ts, .js, .map files)`,
268
+ cause: `packages/${dir}/src/ contains ${count} build artifacts (.d.ts, .js, .jsx, .map files)`,
269
269
  fix: `find packages/${dir}/src ${SWEEP_PREDICATE} -delete`,
270
270
  docs: ERROR_DOCS_URL,
271
271
  at: `packages/${dir}/src/`,
@@ -420,7 +420,7 @@ export async function checkPackageShape(
420
420
  }
421
421
  // `src/` is authored source only; anything a build emitted there ships in the tarball too.
422
422
  const artifacts: string[] = [];
423
- for await (const path of new Bun.Glob('src/**/*.{d.ts,js,map}').scan({
423
+ for await (const path of new Bun.Glob('src/**/*.{d.ts,js,jsx,map}').scan({
424
424
  cwd: join(root, 'packages', dir),
425
425
  absolute: false,
426
426
  })) {