@ultimat3/cli 31.51.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 (169) hide show
  1. package/CLAUDE.md +1 -1
  2. package/README.md +9 -9
  3. package/package.json +29 -29
  4. package/src/app-kit-disk.ts +39 -0
  5. package/src/app-kit-forms.ts +27 -0
  6. package/src/app-kit.ts +146 -0
  7. package/src/budgets.ts +3 -1
  8. package/src/catalog-layout.ts +194 -0
  9. package/src/cdp-shot-driver-screen.ts +72 -0
  10. package/src/cdp-shot-driver.ts +17 -1
  11. package/src/cmd-design-capture.ts +210 -0
  12. package/src/cmd-design-errors.ts +50 -0
  13. package/src/cmd-design-paths.ts +47 -0
  14. package/src/cmd-design-publish.ts +64 -0
  15. package/src/cmd-design-run.ts +229 -0
  16. package/src/cmd-design-spec.ts +47 -0
  17. package/src/cmd-design-theme.ts +107 -0
  18. package/src/cmd-design-url.ts +201 -0
  19. package/src/cmd-design.ts +188 -0
  20. package/src/cmd-doctor.ts +3 -0
  21. package/src/cmd-generate-spec.ts +5 -0
  22. package/src/cmd-generate.ts +3 -1
  23. package/src/cmd-i18n-spec.ts +4 -4
  24. package/src/cmd-i18n-split.ts +133 -0
  25. package/src/cmd-i18n.ts +46 -66
  26. package/src/cmd-kit-spec.ts +13 -0
  27. package/src/cmd-kit.ts +133 -0
  28. package/src/cmd-shot-against.ts +275 -0
  29. package/src/cmd-shot-spec.ts +9 -1
  30. package/src/cmd-shot.ts +19 -0
  31. package/src/cmd-upgrade.ts +11 -0
  32. package/src/codemods/agent-kit.ts +130 -0
  33. package/src/codemods/agents-md-budget.ts +47 -0
  34. package/src/codemods/docs-visual-quality.ts +198 -0
  35. package/src/codemods/index.ts +8 -0
  36. package/src/codemods/settings-kit-allow.ts +49 -0
  37. package/src/config-redact.ts +20 -4
  38. package/src/db-rollback-pass.ts +4 -1
  39. package/src/design-extract-script.ts +187 -0
  40. package/src/design-extract.ts +311 -0
  41. package/src/design-map-colors.ts +180 -0
  42. package/src/design-map.ts +288 -0
  43. package/src/dev-child-watch.ts +16 -0
  44. package/src/dev-db-migrate.ts +27 -46
  45. package/src/dev-db-migrator-hold.ts +131 -0
  46. package/src/dev-db-rollback.ts +11 -2
  47. package/src/dev-rebuild-schema.ts +7 -24
  48. package/src/doctor-kit.ts +25 -0
  49. package/src/error-catalog.ts +4 -2
  50. package/src/error-codes-kit.ts +24 -0
  51. package/src/error-codes.ts +12 -10
  52. package/src/generate-catalog-locales.ts +25 -2
  53. package/src/generate-files.ts +31 -1
  54. package/src/generate-follow-ups.ts +8 -3
  55. package/src/guards-shipped-names.ts +5 -0
  56. package/src/i18n-audit.ts +17 -33
  57. package/src/i18n-index.ts +108 -31
  58. package/src/i18n-locale-parity.ts +14 -6
  59. package/src/i18n-new-locale.ts +75 -0
  60. package/src/i18n-registration.ts +52 -27
  61. package/src/island-capture.ts +36 -7
  62. package/src/kit/agent-audit.ts +49 -0
  63. package/src/kit/agent-data.ts +32 -0
  64. package/src/kit/agent-server.ts +34 -0
  65. package/src/kit/agent-shape.ts +61 -0
  66. package/src/kit/agent-web.ts +49 -0
  67. package/src/kit/design-map.ts +106 -0
  68. package/src/kit/managed.ts +12 -0
  69. package/src/kit/registry.ts +89 -0
  70. package/src/kit/skill-design-research.ts +119 -0
  71. package/src/kit/skill-feature.ts +159 -0
  72. package/src/kit/skill-planx.ts +139 -0
  73. package/src/kit/skill-upgrade.ts +94 -0
  74. package/src/kit/skill-verify.ts +80 -0
  75. package/src/mcp-errors.ts +5 -0
  76. package/src/mcp-ui-diff.ts +13 -38
  77. package/src/mcp-ui.ts +30 -1
  78. package/src/merge-state.ts +3 -2
  79. package/src/messages-design.ts +104 -0
  80. package/src/messages-floor.ts +2 -0
  81. package/src/messages-upgrade.ts +9 -0
  82. package/src/messages.ts +4 -0
  83. package/src/registry.ts +4 -0
  84. package/src/serve-boot-telemetry.ts +106 -0
  85. package/src/serve-boot.ts +23 -4
  86. package/src/shot-blank.ts +70 -0
  87. package/src/shot-diff.ts +96 -0
  88. package/src/shot-gpu.ts +17 -5
  89. package/src/templates/catalog-barrel.ts +84 -0
  90. package/src/templates/guard-animated-layout-script.ts +173 -0
  91. package/src/templates/guard-effect-without-fallback.ts +117 -0
  92. package/src/templates/guard-motion-adapter.ts +161 -0
  93. package/src/templates/guard-raw-frame-loop.ts +134 -0
  94. package/src/templates/guard-raw-motion-script.ts +132 -0
  95. package/src/templates/guard-raw-motion-ts-scan.ts +95 -0
  96. package/src/templates/guard-released-forms.ts +12 -1
  97. package/src/templates/guard-untranslated-string.ts +27 -6
  98. package/src/templates/index.ts +1 -2
  99. package/src/templates/island.ts +55 -8
  100. package/src/templates/kit-released-forms.ts +63 -0
  101. package/src/templates/locales.ts +6 -0
  102. package/src/templates/motion-scale.ts +115 -0
  103. package/src/templates/scaffold-claude.ts +39 -26
  104. package/src/templates/scaffold-design.ts +41 -0
  105. package/src/templates/scaffold-docs.ts +31 -7
  106. package/src/templates/scaffold-gitattributes.ts +9 -2
  107. package/src/templates/scaffold-guards.ts +31 -2
  108. package/src/templates/scaffold-i18n.ts +10 -6
  109. package/src/templates/scaffold-verify-floor.ts +3 -0
  110. package/src/templates/shapes/blog-site.ts +15 -0
  111. package/src/templates/shapes/blog.ts +2 -0
  112. package/src/templates/shapes/content-site.ts +13 -0
  113. package/src/templates/shapes/content.ts +2 -0
  114. package/src/templates/shapes/dashboard-detail.ts +2 -0
  115. package/src/templates/shapes/dashboard-motion.ts +284 -0
  116. package/src/templates/shapes/dashboard.ts +19 -1
  117. package/src/templates/shapes/landing-motion.ts +67 -0
  118. package/src/templates/shapes/offline.ts +5 -2
  119. package/src/templates/shapes/saas.ts +4 -0
  120. package/src/test-ignores.ts +3 -2
  121. package/src/upgrade-gate.ts +14 -2
  122. package/src/upgrade-kit.ts +65 -0
  123. package/src/upgrade-report-kit.ts +28 -0
  124. package/src/upgrade-report.ts +3 -0
  125. package/src/verify-checks.ts +9 -1
  126. package/src/verify-floor.ts +9 -1
  127. package/src/verify-local-only.ts +66 -0
  128. package/src/verify-run.ts +17 -2
  129. package/src/workspace-checks.ts +3 -3
  130. package/wiki/Actions.md +1 -1
  131. package/wiki/Agents.md +33 -1
  132. package/wiki/Auth.md +3 -3
  133. package/wiki/Batching-And-Preloading.md +1 -0
  134. package/wiki/CLI-Reference-Data.md +241 -0
  135. package/wiki/CLI-Reference-Gate.md +572 -0
  136. package/wiki/CLI-Reference-Project.md +414 -0
  137. package/wiki/CLI-Reference-Ship.md +348 -0
  138. package/wiki/CLI-Reference-Tools.md +687 -0
  139. package/wiki/CLI-Reference.md +18 -2227
  140. package/wiki/Compared.md +8 -8
  141. package/wiki/Configuration.md +26 -2
  142. package/wiki/Deployment.md +1 -1
  143. package/wiki/Design-Research.md +96 -0
  144. package/wiki/Effects.md +83 -0
  145. package/wiki/Entities-And-Migrations.md +3 -2
  146. package/wiki/FAQ.md +1 -1
  147. package/wiki/Getting-Started.md +1 -1
  148. package/wiki/Home.md +2 -2
  149. package/wiki/I18n.md +39 -5
  150. package/wiki/Installation.md +1 -1
  151. package/wiki/Jobs-And-Workflows.md +29 -1
  152. package/wiki/Known-Gaps.md +6 -2
  153. package/wiki/MCP-And-AI.md +4 -0
  154. package/wiki/Motion.md +85 -0
  155. package/wiki/Observability.md +15 -1
  156. package/wiki/Outbound-HTTP.md +62 -2
  157. package/wiki/PWA-And-Offline.md +1 -1
  158. package/wiki/Policies-And-Authz.md +10 -0
  159. package/wiki/Project-Layout.md +1 -1
  160. package/wiki/Realtime.md +29 -2
  161. package/wiki/Static-Assets.md +1 -1
  162. package/wiki/Testing.md +33 -0
  163. package/wiki/Theming.md +31 -8
  164. package/wiki/Troubleshooting.md +1 -1
  165. package/wiki/Tutorial-02-First-Feature.md +1 -1
  166. package/wiki/UI-Components.md +2 -0
  167. package/wiki/Upgrading.md +9 -3
  168. package/src/templates/scaffold-claude-agents.ts +0 -161
  169. package/src/templates/scaffold-claude-commands.ts +0 -239
@@ -10,6 +10,7 @@ export const RELEASED_GUARD_FORMS: Readonly<
10
10
  ['2hqr04589t23q', 'error'],
11
11
  ['2z9j3sd8e7lgl', 'error'],
12
12
  ],
13
+ 'animated-layout-script': [['imwzfn6wtwa6', 'warning']],
13
14
  'bare-error': [
14
15
  ['1m3eimglwzrdq', 'error'],
15
16
  ['1njzso3r6drnd', 'error'],
@@ -18,6 +19,7 @@ export const RELEASED_GUARD_FORMS: Readonly<
18
19
  ['2s43pcjqyhmfi', 'error'],
19
20
  ['n9w3ww2famyi', 'error'],
20
21
  ],
22
+ 'effect-without-fallback': [['1klsn88horset', 'warning']],
21
23
  'error-declared': [
22
24
  ['1rlzex7nalpiw', 'error'],
23
25
  ['2tfw2hq80msju', 'error'],
@@ -43,6 +45,7 @@ export const RELEASED_GUARD_FORMS: Readonly<
43
45
  ['2os1f5fb6aass', 'error'],
44
46
  ['31gjhz3nyf0gz', 'error'],
45
47
  ],
48
+ 'motion-adapter': [['1xwu8j0vup1kd', 'warning']],
46
49
  'native-confirm': [
47
50
  ['1f7eh34hj085a', 'error'],
48
51
  ['2b134wpkoaqso', 'error'],
@@ -66,6 +69,7 @@ export const RELEASED_GUARD_FORMS: Readonly<
66
69
  ['21v2jbczhqz8k', 'error'],
67
70
  ['mazudnz7t6iy', 'error'],
68
71
  ],
72
+ 'raw-frame-loop': [['k41idqxhbwp6', 'warning']],
69
73
  'raw-interval': [
70
74
  ['1o6p0fmjhzdhw', 'error'],
71
75
  ['2xrqszz066coc', 'error'],
@@ -85,6 +89,7 @@ export const RELEASED_GUARD_FORMS: Readonly<
85
89
  ['u6julhh0et2k', 'error'],
86
90
  ['w8aw0q20tfsz', 'error'],
87
91
  ],
92
+ 'raw-motion-script': [['1af8jx69uczx0', 'warning']],
88
93
  'raw-shadow': [
89
94
  ['13t0n8kesciv6', 'error'],
90
95
  ['1vhy6xulc5cs5', 'error'],
@@ -147,6 +152,7 @@ export const RELEASED_GUARD_FORMS: Readonly<
147
152
  ['w7as1ib1ido8', 'error'],
148
153
  ],
149
154
  'untranslated-string': [
155
+ ['14xfnj5h9tq91', 'error'],
150
156
  ['211cleyx8cmgn', 'error'],
151
157
  ['2tmea7cmz7rvr', 'error'],
152
158
  ['2x85ib5eqdxzi', 'error'],
@@ -167,19 +173,24 @@ export const RELEASED_GUARD_FORMS: Readonly<
167
173
  /** Every hash each shipped guard's TEST file was released as: an unedited test goes without a note. */
168
174
  export const RELEASED_GUARD_TEST_FORMS: Readonly<Record<string, readonly string[]>> = {
169
175
  'animated-layout-property': ['191zjn08f13h4'],
176
+ 'animated-layout-script': ['dw348y39b0ve'],
170
177
  'bare-error': ['17uv4zrzcuwbk', '1epwa72g9sk4u', '1w7vwbtypxdwe'],
178
+ 'effect-without-fallback': ['1yjzzgpg03gey'],
171
179
  'error-declared': ['2hj2bs2czhxnw', 'qe8afpq7pzf1'],
172
180
  'focus-visible': ['12c0rk3ljkx6q'],
173
181
  'image-dimensions': ['3p4hkambgpb4j'],
174
182
  'island-mount-clears': ['2jkeu60fnvtdg'],
175
183
  'island-without-states': ['vls0ujdd16gw'],
184
+ 'motion-adapter': ['2y1k1zjt99ndz'],
176
185
  'native-confirm': ['1c7vps5wn37uv', 'qwyn1mzn9ace'],
177
186
  'raw-breakpoint': ['w356i8dreh7j'],
178
187
  'raw-colour': ['1nhoblzxa9kp1', '1tc7cambk8byr', '319l3wictp9lf'],
179
188
  'raw-fetch': ['2lips924uo00f'],
189
+ 'raw-frame-loop': ['1feko87is1n1i'],
180
190
  'raw-interval': ['1z55givy4sst0'],
181
191
  'raw-length': ['1hpgz9jowk5qu'],
182
192
  'raw-motion': ['2kg7ezhf8u7a9', '6420344uhv97', 'g6cs0de9jmr7', 'xes72msaf3a3'],
193
+ 'raw-motion-script': ['2bmyfrg3hwi7r'],
183
194
  'raw-shadow': ['3kg8ft6y3ia0y'],
184
195
  'raw-z-index': ['3fb40f6bwp8kq'],
185
196
  'repo-await-in-loop': ['2axgbb82wldt4'],
@@ -191,6 +202,6 @@ export const RELEASED_GUARD_TEST_FORMS: Readonly<Record<string, readonly string[
191
202
  'undeclared-custom-property': ['30bi2v92swukf', 'svuf8sm14fm8'],
192
203
  'undeclared-env': ['38run3rew6y0c', '8xdp7gp7hol7'],
193
204
  'undefined-style-class': ['1uy88gpk5k8p8', '2sy8me3i3bmzw'],
194
- 'untranslated-string': ['30q3u45cey2eq', 'cgvfv231gnvg', 'kdo3fxwgix3j'],
205
+ 'untranslated-string': ['30q3u45cey2eq', '3bocce437rxn7', 'cgvfv231gnvg', 'kdo3fxwgix3j'],
195
206
  'unzoned-date': ['1m46q3h8t4v7v', '1siep3fqscks4', '20x6l238r09jk', '3jzdaqcytkgil'],
196
207
  };
@@ -91,8 +91,19 @@ const withoutExpressions = (children: string): string => {
91
91
  return out;
92
92
  };
93
93
 
94
- /** Pure — the caller does the I/O — so the rule is testable without a filesystem. */
95
- export function untranslatedStrings(files: readonly SourceFile[]): readonly Finding[] {
94
+ /** Where the default locale's strings are written: the one file, or a split locale's directory. */
95
+ const FLAT_CATALOG = 'packages/i18n/catalogs/en.json';
96
+ const SPLIT_CATALOG =
97
+ "its namespace's file in packages/i18n/catalogs/en/ (app.billing.title goes in en/app.json)";
98
+
99
+ /**
100
+ * Pure — the caller does the I/O — so the rule is testable without a filesystem. \`catalog\` is
101
+ * where the fix sends the new key: the flat file, unless the app splits its catalogs.
102
+ */
103
+ export function untranslatedStrings(
104
+ files: readonly SourceFile[],
105
+ catalog = FLAT_CATALOG,
106
+ ): readonly Finding[] {
96
107
  const findings: Finding[] = [];
97
108
  for (const file of files) {
98
109
  const text = blank(file.source);
@@ -102,7 +113,7 @@ export function untranslatedStrings(files: readonly SourceFile[]): readonly Find
102
113
  findings.push({
103
114
  code: CODE,
104
115
  cause: \`\${file.path}:\${lineOf(text, match.index)} renders the typed string "\${typed}" inside <\${match[1] ?? 'element'}> — it is in no catalog, so every locale but the one it was typed in reads it verbatim\`,
105
- fix: \`add a key for "\${typed}" to packages/i18n/catalogs/en.json, render it as {t('…')} in \${file.path}, then: x verify --only boundaries\`,
116
+ fix: \`add a key for "\${typed}" to \${catalog}, render it as {t('…')} in \${file.path}, then: x verify --only boundaries\`,
106
117
  at: file.path,
107
118
  });
108
119
  }
@@ -113,7 +124,7 @@ export function untranslatedStrings(files: readonly SourceFile[]): readonly Find
113
124
  findings.push({
114
125
  code: CODE,
115
126
  cause: \`\${file.path}:\${lineOf(text, match.index)} renders the typed string "\${typed}" as its \${name} — it is in no catalog, so every locale but the one it was typed in reads it verbatim\`,
116
- fix: \`add a key for "\${typed}" to packages/i18n/catalogs/en.json, write it as \${name}={t('…')} in \${file.path}, then: x verify --only boundaries\`,
127
+ fix: \`add a key for "\${typed}" to \${catalog}, write it as \${name}={t('…')} in \${file.path}, then: x verify --only boundaries\`,
117
128
  at: file.path,
118
129
  });
119
130
  }
@@ -123,7 +134,7 @@ export function untranslatedStrings(files: readonly SourceFile[]): readonly Find
123
134
 
124
135
  export const guard: Guard = {
125
136
  summary: 'a rendered string comes from t(), never typed into the page',
126
- async check(_root, sources) {
137
+ async check(root, sources) {
127
138
  const files: SourceFile[] = [];
128
139
  // Every rendered surface: an app's \`site/\` and \`app/\`, and the shared components under
129
140
  // \`packages/*/src\` — \`x new\` scaffolds a \`packages/ui\` whose components render to a user, so
@@ -144,7 +155,9 @@ export const guard: Guard = {
144
155
  files.push({ path: file.path, source: file.text });
145
156
  }
146
157
  }
147
- return untranslatedStrings(files);
158
+ // A split app's \`en/\` holds the barrel \`x i18n split\` writes; a flat app has no such file.
159
+ const split = await Bun.file(\`\${root}/packages/i18n/catalogs/en/index.ts\`).exists();
160
+ return untranslatedStrings(files, split ? SPLIT_CATALOG : FLAT_CATALOG);
148
161
  },
149
162
  };
150
163
  `;
@@ -206,6 +219,14 @@ unitTest('a typed aria-label is refused, and a t() call in one is not', () => {
206
219
  unitTest('one word character is a symbol, not a sentence', () => {
207
220
  expect(untranslatedStrings(file('<span>&</span>'))).toEqual([]);
208
221
  });
222
+
223
+ unitTest('the fix names the file the key goes in, flat or split', () => {
224
+ expect(untranslatedStrings(file('<h1>Welcome back</h1>'))[0]?.fix).toContain(
225
+ 'packages/i18n/catalogs/en.json',
226
+ );
227
+ const split = untranslatedStrings(file('<h1>Welcome back</h1>'), 'en/app.json');
228
+ expect(split[0]?.fix).toContain('en/app.json');
229
+ });
209
230
  `;
210
231
 
211
232
  /** `guards/untranslated-string.ts` and its test. The directory is the registration. */
@@ -36,10 +36,9 @@ export type { RouteOptions, Surface } from './route';
36
36
  export { routeFiles } from './route';
37
37
  export { appFiles } from './scaffold-app';
38
38
  export { claudeFiles } from './scaffold-claude';
39
- export { claudeAgentFiles } from './scaffold-claude-agents';
40
- export { claudeCommandFiles } from './scaffold-claude-commands';
41
39
  export { containerFiles } from './scaffold-container';
42
40
  export { dashboardFiles } from './scaffold-dashboard';
41
+ export { DESIGN_PATH, designFiles } from './scaffold-design';
43
42
  export { docsFiles } from './scaffold-docs';
44
43
  export { entryFiles } from './scaffold-entries';
45
44
  export { errorPageFiles, PWA_COLORS } from './scaffold-errors';
@@ -7,12 +7,37 @@
7
7
  // and mounts it.
8
8
 
9
9
  import { trimTrailingSlashes } from '@ultimat3/core';
10
+ import { BadFlagError } from '../errors';
11
+ import { loadVersion } from '../version-loader';
10
12
  import type { GeneratedFile } from './naming';
11
13
  import { camel, kebab, pascal } from './naming';
12
14
 
15
+ /**
16
+ * The `@ultimat3/effects` entries `--effect` wraps the island's panel in: each takes children and
17
+ * nothing else it must be given, so the scaffold is the smallest honest use. The rest (`EffectCanvas`
18
+ * wants a `draw` and a `fallback`; `Marquee`, `TextReveal` and `CountUp` take no children) are
19
+ * written by hand against `wiki/Effects.md`.
20
+ */
21
+ export const EFFECT_ENTRIES = {
22
+ aurora: 'Aurora',
23
+ 'gradient-orbs': 'GradientOrbs',
24
+ 'mosaic-grid': 'MosaicGrid',
25
+ 'grid-glow': 'GridGlow',
26
+ noise: 'Noise',
27
+ 'shader-background': 'ShaderBackground',
28
+ 'spotlight-card': 'SpotlightCard',
29
+ tilt: 'Tilt',
30
+ 'glass-surface': 'GlassSurface',
31
+ shimmer: 'Shimmer',
32
+ } as const;
33
+
34
+ export type EffectEntry = keyof typeof EFFECT_ENTRIES;
35
+
13
36
  export interface IslandOptions {
14
37
  /** Directory the entry lands in, app-root-relative and POSIX — normally a route's own folder. */
15
38
  readonly dir: string;
39
+ /** Wrap the panel in this `@ultimat3/effects` entry (`x g island <name> --effect aurora`). */
40
+ readonly effect?: EffectEntry | undefined;
16
41
  }
17
42
 
18
43
  /**
@@ -27,8 +52,9 @@ export const upToAppRoot = (dir: string): string =>
27
52
  .map(() => "'..'")
28
53
  .join(', ');
29
54
 
30
- const islandSource = (name: string): string => {
55
+ const islandSource = (name: string, effect?: EffectEntry): string => {
31
56
  const Name = pascal(name);
57
+ const Effect = effect === undefined ? undefined : EFFECT_ENTRIES[effect];
32
58
  return `// ${Name}: the interactive half of an otherwise static page, and the only module on this
33
59
  // route the browser downloads.
34
60
  //
@@ -37,9 +63,9 @@ const islandSource = (name: string): string => {
37
63
  // A string has no import edge, so nothing follows one into this file and the page's bundle graph
38
64
  // stays the page's (axiom 6). WHEN it wakes is the route's \`hydrate\`, never a declaration here.
39
65
 
40
- import { mountOver } from '@ultimat3/render/client';
41
- import type { JSX } from 'solid-js';
42
- import { createSignal } from 'solid-js';
66
+ ${Effect === undefined ? '' : 'import { ' + Effect + " } from '@ultimat3/effects';\n"}import { mountOver } from '@ultimat3/render/client';
67
+ ${Effect === undefined ? '' : "import { setSolidRuntime } from '@ultimat3/ui';\n"}import type { JSX } from 'solid-js';
68
+ ${Effect === undefined ? "import { createSignal } from 'solid-js';" : "import {\n createContext,\n createEffect,\n createMemo,\n createRoot,\n createSignal,\n onCleanup,\n useContext,\n} from 'solid-js';"}
43
69
  import { render } from 'solid-js/web';
44
70
  import styles from './${name}.module.scss';
45
71
 
@@ -57,14 +83,14 @@ export interface ${Name}Props {
57
83
  */
58
84
  function ${Name}(props: ${Name}Props): JSX.Element {
59
85
  const [count, setCount] = createSignal(0);
60
- return (
86
+ ${Effect === undefined ? 'return (' : 'const panel = ('}
61
87
  <p class={styles.panel}>
62
88
  <button type="button" class={styles.trigger} onClick={() => setCount(count() + 1)}>
63
89
  {props.label}
64
90
  </button>
65
91
  <output data-role="count">{count()}</output>
66
92
  </p>
67
- );
93
+ );${Effect === undefined ? '' : '\n return <' + Effect + '>{panel}</' + Effect + '>;'}
68
94
  }
69
95
 
70
96
  /**
@@ -77,7 +103,7 @@ function ${Name}(props: ${Name}Props): JSX.Element {
77
103
  * which marks the root \`data-x-failed\` for the error reporter.
78
104
  */
79
105
  export function mount(el: HTMLElement, props: ${Name}Props): () => void {
80
- // Solid's \`render\` answers its disposer; returning it is what lets the client router and
106
+ ${Effect === undefined ? '' : ' // The effect reaches the reactive graph through the runtime an entry registers.\n setSolidRuntime({\n createContext,\n useContext,\n createSignal,\n createMemo,\n createEffect,\n onCleanup,\n createRoot,\n });\n'} // Solid's \`render\` answers its disposer; returning it is what lets the client router and
81
107
  // \`@ultimat3/testing\` stop this island — its timers included — when they are done with it.
82
108
  return mountOver(el, (root) => render(() => <${Name} {...props} />, root));
83
109
  }
@@ -199,13 +225,34 @@ export const ${camel(name)}States = defineIslandStates({
199
225
  `;
200
226
  };
201
227
 
228
+ /**
229
+ * The island imports `@ultimat3/effects`, so the app declares it: a `merge: 'json'` entry on the
230
+ * root manifest, which adds the one key where the file keeps it sorted and leaves a held one alone.
231
+ * Exact-pinned like every `@ultimat3/*` (`shapes/landing-motion.ts`'s `effectsDependency`).
232
+ */
233
+ const effectsDependency = (): GeneratedFile => ({
234
+ path: 'package.json',
235
+ contents: `${JSON.stringify({ dependencies: { '@ultimat3/effects': loadVersion() } })}\n`,
236
+ merge: 'json',
237
+ });
238
+
202
239
  export function islandFiles(rawName: string, options: IslandOptions): readonly GeneratedFile[] {
203
240
  const name = kebab(rawName);
241
+ if (options.effect !== undefined && !Object.hasOwn(EFFECT_ENTRIES, options.effect)) {
242
+ const entries = Object.keys(EFFECT_ENTRIES);
243
+ throw new BadFlagError({
244
+ flag: 'effect',
245
+ command: 'g island',
246
+ reason: `"${options.effect}" is no entry that wraps a panel — one of: ${entries.join(', ')}`,
247
+ fix: `x g island ${name} --effect ${entries[0]}`,
248
+ });
249
+ }
204
250
  const dir = trimTrailingSlashes(options.dir);
205
251
  return [
206
- { path: `${dir}/${name}.island.tsx`, contents: islandSource(name) },
252
+ { path: `${dir}/${name}.island.tsx`, contents: islandSource(name, options.effect) },
207
253
  { path: `${dir}/${name}.module.scss`, contents: islandStyle() },
208
254
  { path: `${dir}/${name}.island.states.ts`, contents: islandStates(name, dir) },
209
255
  { path: `${dir}/${name}.island.test.ts`, contents: islandTest(name, dir) },
256
+ ...(options.effect === undefined ? [] : [effectsDependency()]),
210
257
  ];
211
258
  }
@@ -0,0 +1,63 @@
1
+ // GENERATED by `bun run scripts/lib/kit-refresh-forms.ts --write` — never hand-edited. Every
2
+ // text a release wrote as a `.claude/commands/<n>.md`, `.claude/agents/<n>.md` or `.claude/README.md` (`kitFormHash`,
3
+ // the app's name normalised), so the `agent-kit` codemod deletes an unedited old file and renames an edit.
4
+
5
+ export const RELEASED_KIT_FORMS: Readonly<Record<string, readonly string[]>> = {
6
+ '.claude/README.md': [
7
+ '1c60k0bshnd6h',
8
+ '1qjotyc5zkgqa',
9
+ '20tbhhd696nuw',
10
+ '2sg7x0nniu0e3',
11
+ '3t27j7bgulyqt',
12
+ '3vot7ec2foty5',
13
+ ],
14
+ '.claude/agents/data.md': [
15
+ '1dpmsd1vbs3w4',
16
+ '2ir9i17wzghiy',
17
+ '3af5df936nhuv',
18
+ '3oqzm22izyqwd',
19
+ 'nyqgvkbotzrd',
20
+ 'pg0jsys8bjkk',
21
+ ],
22
+ '.claude/agents/server.md': [
23
+ '20mlgm4a2cajp',
24
+ '27v0hra7d3wo4',
25
+ '2qvsibnoo2r6g',
26
+ '2zfwiqpxi546g',
27
+ '323ea7npeasxj',
28
+ '35adffpru7gua',
29
+ '38izgk5ptj0n7',
30
+ ],
31
+ '.claude/agents/shape.md': ['21aw2weazaao1', '2697inatyxh7c', '2mowwmm2ac000', '3scf1q8xlh0qp'],
32
+ '.claude/agents/web.md': [
33
+ '22kd9gswfezn5',
34
+ '26mtk30b3o3s',
35
+ '2dhsf8q730uad',
36
+ '2tahjadro1w7r',
37
+ '36tuv2b6fcunt',
38
+ '3jotce8905nc7',
39
+ 'eyqeccnhzspg',
40
+ ],
41
+ '.claude/commands/feature.md': [
42
+ '1b92xxvogr854',
43
+ '1dbaptf36chnu',
44
+ '1he2ofadchh1i',
45
+ '1nv6gm0begmj7',
46
+ '272b3fwsxawg1',
47
+ '3aruwh67fa6ai',
48
+ '3ec07orq6vz31',
49
+ '7832w47vagla',
50
+ 'c2w1bscmzvx0',
51
+ 'o6os4hxczr1e',
52
+ 'zbase8etm9db',
53
+ ],
54
+ '.claude/commands/planx.md': ['104o4alspr8ih', '10o9aqzvxma1f', '323tosiodhcra', '33mre289jxf7k'],
55
+ '.claude/commands/verify.md': [
56
+ '11qa15dl0l1ek',
57
+ '1jojfb2g7byfe',
58
+ '1ucwusmp7iwh0',
59
+ '2a3yh5w10v6pb',
60
+ '2m41ibudxzui8',
61
+ '3hxs7gmjh41hy',
62
+ ],
63
+ };
@@ -13,6 +13,12 @@ export const CATALOG_ROOT = 'packages/i18n/catalogs';
13
13
  /** The catalog layout, written down once: `x g route` and `x g resource` both merge into it. */
14
14
  export const catalogPath = (locale: string): string => `${CATALOG_ROOT}/${locale}.json`;
15
15
 
16
+ /** A split locale's directory: one `<namespace>.json` per namespace (`catalog-layout.ts`). */
17
+ export const catalogDir = (locale: string): string => `${CATALOG_ROOT}/${locale}`;
18
+
19
+ /** The generated module in a split locale's directory that joins its files into one catalog. */
20
+ export const CATALOG_BARREL = 'index.ts';
21
+
16
22
  /** The runnable form of the flag, used as the fix on every rejection below. */
17
23
  const LOCALES_FIX = 'x g resource <name> --locales=en,es';
18
24
 
@@ -0,0 +1,115 @@
1
+ // The motion scale a guard (and `x design research`) snaps a literal onto: `@ultimat3/ui/tokens`'
2
+ // durations in ms and easings as control points, and the two functions that answer "which token is
3
+ // this closest to". One module, two readers: the `raw-motion-script` guard embeds
4
+ // `MOTION_SCALE_SOURCE` into the file it emits (a guard imports nothing but types), and D1 imports
5
+ //
6
+ // the typed API directly. `raw-motion` keeps its own copy of the scale, byte-identical to 31.51.
7
+ // `motion-scale.test.ts` runs the embedded text against the typed functions, so they cannot drift,
8
+ // and `scaffold-guards-style.test.ts` holds both to the token package's own SCSS.
9
+
10
+ /** `@ultimat3/ui/tokens`' duration scale, in ms. `instant` is no motion at all and is never a snap. */
11
+ export const MOTION_DURATIONS = [
12
+ ['instant', 0],
13
+ ['fast', 120],
14
+ ['base', 220],
15
+ ['slow', 400],
16
+ ['slower', 640],
17
+ ] as const;
18
+
19
+ /** `@ultimat3/ui/tokens`' easing curves: the control points, comma-joined, to the token's name. */
20
+ export const MOTION_EASINGS = {
21
+ '0.16,1,0.3,1': 'out',
22
+ '0.5,0,0.75,0': 'in',
23
+ '0.65,0,0.35,1': 'in-out',
24
+ '0.34,1.56,0.64,1': 'spring',
25
+ } as const;
26
+
27
+ export type DurationToken = (typeof MOTION_DURATIONS)[number][0];
28
+ export type EasingToken = (typeof MOTION_EASINGS)[keyof typeof MOTION_EASINGS];
29
+
30
+ /** The step a duration means: exact where it is one, the nearest where it is not. */
31
+ export function snapDuration(ms: number): Exclude<DurationToken, 'instant'> {
32
+ let best: Exclude<DurationToken, 'instant'> = 'base';
33
+ let gap = Number.POSITIVE_INFINITY;
34
+ for (const [name, at] of MOTION_DURATIONS) {
35
+ // A time someone wrote is never repaired to nothing.
36
+ if (name === 'instant') continue;
37
+ if (Math.abs(at - ms) < gap) {
38
+ best = name;
39
+ gap = Math.abs(at - ms);
40
+ }
41
+ }
42
+ return best;
43
+ }
44
+
45
+ /** The curve a `cubic-bezier(…)` means: exact where it is one, the nearest control points where not. */
46
+ export function snapEasing(points: string | readonly number[]): EasingToken {
47
+ const given =
48
+ typeof points === 'string' ? points.split(',').map((part) => Number(part.trim())) : [...points];
49
+ let best: EasingToken = 'out';
50
+ let gap = Number.POSITIVE_INFINITY;
51
+ for (const [curve, name] of Object.entries(MOTION_EASINGS)) {
52
+ const distance = curve
53
+ .split(',')
54
+ .reduce((sum, value, index) => sum + (Number(value) - (given[index] ?? Number.NaN)) ** 2, 0);
55
+ if (distance < gap) {
56
+ best = name;
57
+ gap = distance;
58
+ }
59
+ }
60
+ return best;
61
+ }
62
+
63
+ /**
64
+ * The same scale and functions as TypeScript text for a guard file to carry, types and all. It is
65
+ * written out and not derived from the functions above (`motion-scale.test.ts` holds the two
66
+ * equal): a function's `toString()` is erased JavaScript, which an app's strict `tsc` would refuse.
67
+ */
68
+ export const MOTION_SCALE_SOURCE = `/** \`@ultimat3/ui/tokens\`' duration scale, in ms. */
69
+ export const DURATIONS: readonly (readonly [string, number])[] = [
70
+ ['instant', 0],
71
+ ['fast', 120],
72
+ ['base', 220],
73
+ ['slow', 400],
74
+ ['slower', 640],
75
+ ];
76
+ /** \`@ultimat3/ui/tokens\`' easing curves, as the control points each one is. */
77
+ export const EASINGS: Readonly<Record<string, string>> = {
78
+ '0.16,1,0.3,1': 'out',
79
+ '0.5,0,0.75,0': 'in',
80
+ '0.65,0,0.35,1': 'in-out',
81
+ '0.34,1.56,0.64,1': 'spring',
82
+ };
83
+
84
+ /** The step a duration means: exact where it is one, the nearest where it is not. */
85
+ const durationFor = (ms: number): string => {
86
+ let best = 'base';
87
+ let gap = Number.POSITIVE_INFINITY;
88
+ for (const [name, at] of DURATIONS) {
89
+ // \`instant\` is no motion at all; a time someone wrote is never repaired to nothing.
90
+ if (name === 'instant') continue;
91
+ if (Math.abs(at - ms) < gap) {
92
+ best = name;
93
+ gap = Math.abs(at - ms);
94
+ }
95
+ }
96
+ return best;
97
+ };
98
+
99
+ /** The curve a \`cubic-bezier(…)\` means: exact where it is one, the nearest control points where not. */
100
+ const easingFor = (curve: string): string => {
101
+ const given = curve.split(',').map((part) => Number(part.trim()));
102
+ let best = 'out';
103
+ let gap = Number.POSITIVE_INFINITY;
104
+ for (const [points, name] of Object.entries(EASINGS)) {
105
+ const distance = points
106
+ .split(',')
107
+ .reduce((sum, value, index) => sum + (Number(value) - (given[index] ?? Number.NaN)) ** 2, 0);
108
+ if (distance < gap) {
109
+ best = name;
110
+ gap = distance;
111
+ }
112
+ }
113
+ return best;
114
+ };
115
+ `;
@@ -1,11 +1,10 @@
1
1
  // The `.claude/` directory `x new` writes: the harness half of what an agent reads, next to the
2
- // `AGENTS.md`/`CLAUDE.md` half that already shipped. Every file lands in the app's own repo, shows
3
- // up in the scaffold's diff and is deletable in one line — the framework ships the mechanism, the
4
- // app keeps or replaces the convention. Nothing here reaches outside the project directory.
2
+ // `AGENTS.md`/`CLAUDE.md` half. The skills and agents are the managed kit (`../kit/registry.ts`):
3
+ // `x kit` re-renders them and the gate refuses an edit in place, so an app's own variant lives
4
+ // under `app-*`. Settings, the hook and this README are the app's from the moment they land.
5
5
 
6
+ import { KIT_MARKER, kitFiles, kitMarkerFile } from '../kit/registry';
6
7
  import type { GeneratedFile, NameSet } from './naming';
7
- import { claudeAgentFiles } from './scaffold-claude-agents';
8
- import { claudeCommandFiles } from './scaffold-claude-commands';
9
8
  import { claudeHookFile, HOOK_COMMAND, HOOK_PATH } from './scaffold-claude-hook';
10
9
 
11
10
  /**
@@ -16,6 +15,9 @@ import { claudeHookFile, HOOK_COMMAND, HOOK_PATH } from './scaffold-claude-hook'
16
15
  *
17
16
  * The read-only commands the app's own docs tell an agent to run (`x impact` before every edit,
18
17
  * `x graph`, `x affected`, `x exercise`, `x mcp tools`) are here too: a prompt on one is a stall.
18
+ * So are the ones the kit's skills run: `x shot` (the `web` agent and `design-research`), `x kit`
19
+ * (writes only managed `.claude/` files) and `x upgrade --dry-run` (writes nothing) — never the hop
20
+ * itself, which moves pins and installs.
19
21
  *
20
22
  * The hook is the one part of the bundle that ACTS: `--write` rewrites the file just edited, in
21
23
  * place. JSON takes no comment (the lesson `scaffold-repo.ts`'s `biome.json` already paid for), so
@@ -57,6 +59,9 @@ const settings = (): string => `{
57
59
  "Bash(bunx x db gen:*)",
58
60
  "Bash(bunx x db migrate:*)",
59
61
  "Bash(bunx x db branch:*)",
62
+ "Bash(bunx x shot:*)",
63
+ "Bash(bunx x kit:*)",
64
+ "Bash(bunx x upgrade --dry-run:*)",
60
65
  "Bash(git status)",
61
66
  "Bash(git diff:*)",
62
67
  "Bash(git log:*)"
@@ -81,46 +86,54 @@ const settings = (): string => `{
81
86
 
82
87
  const readme = (app: NameSet): string => `# .claude/
83
88
 
84
- What Claude Code reads when it works on ${app.kebab}. Written by \`x new\`, owned by you from the
85
- moment it lands: edit any file, or delete any file, and nothing in the app breaks. Nothing here is
86
- enforced by \`bunx x verify\`, and nothing here reaches outside this repository.
89
+ What Claude Code reads when it works on ${app.kebab}. Two kinds of file live here:
87
90
 
88
- One thing in it does *write*: the \`PostToolUse\` hook in \`settings.json\` reformats each file an agent
89
- edits, in place, the moment it is saved. That is the only thing here that touches your code on its
90
- own — see [The hook](#the-hook), and delete the \`hooks\` block if you would rather format by hand.
91
+ | Kind | Paths | Who owns it |
92
+ |---|---|---|
93
+ | **managed** | \`skills/{feature,planx,verify,upgrade,design-research}/SKILL.md\`, \`agents/{shape,data,server,web,audit}.md\` | the framework: \`bunx x kit\` writes them, \`bunx x upgrade\` refreshes them |
94
+ | **yours** | \`settings.json\`, \`hooks/\`, \`kit.json\`, this README, anything named \`app-*\` | you, from the moment it lands |
95
+
96
+ **The managed kit is enforced by \`bunx x verify\`.** Edit a managed file in place and the gate
97
+ fails with \`X_KIT_DRIFT\`; its fix, \`bunx x kit\`, puts the shipped text back. To change one, copy
98
+ it to \`skills/app-<name>/SKILL.md\` or \`agents/app-<name>.md\`, then add the managed name to
99
+ \`"off"\` in \`${KIT_MARKER}\`. A file of yours that takes a managed name is \`X_KIT_SHADOWED\`.
100
+ \`${KIT_MARKER}\` is the opt-in: with it, kit findings are errors; without it, one warning.
101
+
102
+ One thing here *writes*: the \`PostToolUse\` hook in \`settings.json\` reformats each file an agent
103
+ edits, in place, the moment it is saved — see [The hook](#the-hook).
91
104
 
92
105
  | Path | What it costs | When you pay it |
93
106
  |---|---|---|
94
107
  | \`settings.json\` | nothing in context | read once per session; the hook runs per edit |
95
108
  | \`hooks/format-edited.ts\` | nothing in context | runs after each edit, on that one file |
96
- | \`commands/*.md\` | nothing until invoked | the file is read when you type \`/<name>\` |
109
+ | \`skills/*/SKILL.md\` | one \`description\` line each | the body is read when the skill is invoked |
97
110
  | \`agents/*.md\` | one \`description\` line each | the body is read only when that agent is dispatched |
98
111
 
99
- So the whole bundle is three description lines of standing cost. The rest is paid on use.
100
-
101
112
  ## What is here
102
113
 
103
114
  | File | For |
104
115
  |---|---|
105
- | \`commands/feature.md\` | \`/feature\` — build or fix one thing end to end, gated on \`bun run verify\` |
106
- | \`commands/planx.md\` | \`/planx\` — write a plan to \`docs/plans/\` for another agent to execute |
107
- | \`commands/verify.md\` | \`/verify\` — run the gate and fix what it reports |
116
+ | \`skills/feature\` | \`/feature\` — a hive in this one checkout: path-disjoint slices, one gate, one PR, done when merged |
117
+ | \`skills/planx\` | \`/planx\` — a plan directory under \`docs/plans/\`: overview, slices, \`status.yml\` |
118
+ | \`skills/verify\` | \`/verify\` — run the gate; check each \`fix:\` line's source, scope and effect before running it |
119
+ | \`skills/upgrade\` | \`/upgrade\` — one major per hop, the report read, the kit refreshed, the gate |
120
+ | \`skills/design-research\` | \`/design-research\` — measure a reference, write \`apps/web/DESIGN.md\`, build, compare |
108
121
  | \`agents/shape.md\` | the idea-stage pass: which primitive, which slice, or "do not build this" |
109
122
  | \`agents/data.md\` | \`packages/db/\`, \`entity.ts\`, \`repo.ts\` |
110
123
  | \`agents/server.md\` | actions, mutators, queries, jobs, tasks, policies, \`apps/web/api/\` |
111
- | \`agents/web.md\` | \`apps/web/site/\`, pages, \`packages/ui/\`, tokens, i18n |
124
+ | \`agents/web.md\` | \`apps/web/site/\`, pages, \`packages/ui/\`, tokens, i18n — reads \`apps/web/DESIGN.md\` first |
125
+ | \`agents/audit.md\` | read-only review of the paths it is given: \`file:line\` and the scenario that fails |
112
126
 
113
127
  The agents are scoped by **boundary**, not by role — each one's brief is a file set it may write and
114
128
  a line it may not cross. That is what makes two of them safe to run at once.
115
129
 
116
130
  ## What is deliberately not here
117
131
 
118
- **No command that wraps \`bunx x g\`.** \`bunx x g <kind> <name>\` already is that command, and \`bunx x g --help\` is
119
- the only list of kinds — a slash command restating it is a second copy that drifts the first time a
120
- kind is added.
132
+ **No \`commands/\`.** A skill of the same name silently shadows a command, so there is one way:
133
+ skills.
121
134
 
122
- **No size budget on this directory.** How much your app writes down is your convention, not the
123
- framework's.
135
+ **No skill that wraps \`bunx x g\`.** \`bunx x g <kind> <name>\` already is that command, and
136
+ \`bunx x g --help\` is the only list of kinds.
124
137
 
125
138
  ## The hook
126
139
 
@@ -141,13 +154,13 @@ queues for the machine's memory, which \`bun run typecheck\` does not.
141
154
  \`AGENTS.md\` at the repo root — the conventions. \`.claude/\` is only the harness that reads them.
142
155
  `;
143
156
 
144
- /** The agent harness for a new app: three commands, four boundary agents, settings, and a map. */
157
+ /** The agent harness for a new app: settings, the hook, a map, the kit marker and the managed kit. */
145
158
  export function claudeFiles(app: NameSet): readonly GeneratedFile[] {
146
159
  return [
147
160
  { path: '.claude/README.md', contents: readme(app) },
148
161
  { path: '.claude/settings.json', contents: settings() },
149
162
  claudeHookFile(),
150
- ...claudeCommandFiles(app),
151
- ...claudeAgentFiles(app),
163
+ kitMarkerFile(),
164
+ ...kitFiles(app),
152
165
  ];
153
166
  }
@@ -0,0 +1,41 @@
1
+ // `apps/web/DESIGN.md`, the app's own design brief: tokens as front matter, then type, space,
2
+ // shape, motion and the sources each was measured from. Written once by `x new` and never managed —
3
+ // the `design-research` skill fills it, the `web` agent reads it first.
4
+
5
+ import type { GeneratedFile, NameSet } from './naming';
6
+
7
+ export const DESIGN_PATH = 'apps/web/DESIGN.md';
8
+
9
+ const design = (app: NameSet): string => `---
10
+ # The theme this design asks for: the argument apps/web/shared/theme.ts passes to defineTheme().
11
+ # Empty until the design-research skill (or you) fills it; defineTheme's contrast checks are the floor.
12
+ tokens: {}
13
+ ---
14
+
15
+ # ${app.pascal} — design
16
+
17
+ Owned by this app. No command rewrites it. The \`web\` agent reads it before it renders anything.
18
+
19
+ ## Type
20
+
21
+ Families, the scale in use, and where each size appears.
22
+
23
+ ## Space and shape
24
+
25
+ The spacing rungs and radii this app leans on.
26
+
27
+ ## Motion
28
+
29
+ Which \`@ultimat3/ui/motion\` call or \`@ultimat3/effects\` entry each moving thing uses, and why it
30
+ moves at all.
31
+
32
+ ## Sources
33
+
34
+ | URL | Licence posture | Taken (numbers only) |
35
+ |---|---|---|
36
+ `;
37
+
38
+ /** The stub: the app's file from the moment it lands. */
39
+ export function designFiles(app: NameSet): readonly GeneratedFile[] {
40
+ return [{ path: DESIGN_PATH, contents: design(app) }];
41
+ }