@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,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
+ }
@@ -13,9 +13,19 @@ import { S3_GATEWAY_IMAGE } from './pinned-images';
13
13
  import { binFiles } from './scaffold-bin';
14
14
  import { claudeFiles } from './scaffold-claude';
15
15
  import { containerFiles } from './scaffold-container';
16
+ import { designFiles } from './scaffold-design';
16
17
  import { mcpJsonFile } from './scaffold-mcp-json';
17
18
  import { testServicesFiles } from './scaffold-test-services';
18
19
 
20
+ /**
21
+ * The `agentsMdMaxBytes` a scaffold's `x.verify.json` declares: the manifest default (12,000 B)
22
+ * plus 1,120 B, measured — the motion-adapter, frame-loop and effects rows, the TS-scan guards on
23
+ * the timing and motion rows, the Visual quality section and the kit line (plan 101, slice 09) took
24
+ * the default scaffold from 11,723 B to 12,843 B and the largest shape (`saas`) from 11,998 B to
25
+ * 13,118 B. A raise, not a cut: each added row names a guard or a check the gate runs.
26
+ */
27
+ export const SCAFFOLD_AGENTS_MD_MAX_BYTES = 13_120;
28
+
19
29
  /**
20
30
  * The one convention file, under two names: `CLAUDE.md` holds it and `AGENTS.md` is a relative
21
31
  * symlink to it (the owner's ruling, 2026-11-03), so there is no second copy to drift. Every word
@@ -60,13 +70,16 @@ queries, jobs, MCP tools, published operations and tests it touches, each with p
60
70
  | Breakpoints | a viewport query names a breakpoint rung (\`respond-up\`, \`respond-down\`, \`respond-between\`), never a width | \`raw-breakpoint\` |
61
71
  | Layers | a \`z-index\` is a named layer, never a number | \`raw-z-index\` |
62
72
  | Shadows | a shadow comes off the shadow scale, never a hand-written offset and blur | \`raw-shadow\` |
63
- | Timing | a duration and an easing curve come off the motion scale, never a literal | \`raw-motion\` |
73
+ | Timing | a duration and an easing curve come off the motion scale — \`motionTiming()\` from \`@ultimat3/ui/motion\` in TypeScript — never a literal | \`raw-motion\`, \`raw-motion-script\` |
74
+ | Motion adapter | animation through \`@ultimat3/ui/motion\` and \`@ultimat3/effects\`, never an animation or shader library | \`motion-adapter\` |
75
+ | Frame loops | \`frameLoop(tick, { el })\` from \`@ultimat3/ui/motion\`, never a bare \`requestAnimationFrame(\`; a \`// why:\` admits one | \`raw-frame-loop\` |
76
+ | Effects | a \`<canvas>\` or WebGL context only inside \`EffectCanvas\` (\`@ultimat3/effects\`), whose \`fallback\` is required | \`effect-without-fallback\` |
64
77
  | Classes | a class a component reads off its stylesheet is one that sheet compiles | \`undefined-style-class\` |
65
78
  | Properties | a custom property a stylesheet reads is one the app declares | \`undeclared-custom-property\` |
66
79
  | Interaction | a click is answered by a control — never a \`<div onClick>\`, and never a \`role=\` where the native tag exists | \`semantic-interactive\` |
67
80
  | Focus | \`outline: none\` replaces the ring in the same rule or the one beside it, or it does not remove it | \`focus-visible\` |
68
81
  | Images | every image carries width + height or an aspect-ratio, and the priority one is never \`loading="lazy"\` | \`image-dimensions\` |
69
- | Motion | animate \`transform\` and \`opacity\` — never a layout property, never \`transition: all\` | \`animated-layout-property\` |
82
+ | Motion | animate \`transform\` and \`opacity\` — never a layout property, never \`transition: all\`; reorder with \`layout()\` from \`@ultimat3/ui/motion\` | \`animated-layout-property\`, \`animated-layout-script\` |
70
83
  | Islands | every \`*.island.tsx\` has a sibling \`*.island.states.ts\`, so \`bunx x shot --island\` can photograph its failures | \`island-without-states\` |
71
84
  | Island mounts | a \`mount\` replaces its server markup through \`mountOver\`, so a render that throws shows the server's HTML, not a blank box | \`island-mount-clears\` |
72
85
  | Size | one file, one job — ${LINE_CEILING} lines of reviewable logic, and split past it | \`X_FILE_TOO_LONG\` |
@@ -127,8 +140,19 @@ Commands: \`bun run setup\`, \`bun run dev\`, \`bun run verify\`, \`bunx x g <pr
127
140
  table: read it, never edit it. \`bunx x verify\` fails with \`X_SCHEMA_DUMP_DRIFT\` when it is not
128
141
  what the migrations produce, and \`bunx x db gen\` rewrites it.
129
142
  - \`bunx x doctor\` explains a broken environment and prints the fix for every finding.
130
- - \`.claude/\` holds a harness that reads this file: \`/feature\`, \`/planx\`, \`/verify\` and four
131
- boundary-scoped subagents. \`.claude/README.md\` says what each costs; every file is deletable.
143
+ - \`.claude/\` holds the agent kit that reads this file: five skills, five boundary-scoped agents.
144
+ Managed: \`bunx x kit\` rewrites them, an edit in place is \`X_KIT_DRIFT\`; yours go in \`app-*\`.
145
+
146
+ ## Visual quality
147
+
148
+ \`apps/web/DESIGN.md\` is this app's design — tokens, type, motion, sources — read before rendering.
149
+
150
+ | Rule | Refused by |
151
+ |---|---|
152
+ | every colour pair a theme changes meets WCAG 2.2 AA | \`defineTheme\`: \`X_UI_CONTRAST_INSUFFICIENT\` |
153
+ | motion is optional: loops and effects stop for reduced motion, a hidden tab and \`MotionToggle\` | \`raw-frame-loop\`, \`motion-adapter\` |
154
+ | an effect's static frame renders first, so \`site/\` stays 0kb JS | \`effect-without-fallback\`, the \`budgets\` step |
155
+ | a look is matched by measurement: \`bunx x shot <route> --against .x/design/<slug>\` | recorded, never gating |
132
156
 
133
157
  ## Agent tools
134
158
 
@@ -138,9 +162,7 @@ Commands: \`bun run setup\`, \`bun run dev\`, \`bun run verify\`, \`bunx x g <pr
138
162
  | \`bunx x impact <file|primitive> --json\` · \`bunx x graph --json\` | what an edit reaches, and the app as one graph (declared, import and observed edges) | rebuilt on every call |
139
163
  | \`.mcp.json\` | the dev tools over MCP: routes, schema, policies, the database, tests, the gate — \`bunx x mcp tools\` lists them | a client that reads \`.mcp.json\` starts it; from any other, run \`bunx @ultimat3/cli mcp serve --transport stdio\` here |
140
164
  | \`POST /mcp\` | this app's own tools — every action declaring \`mcp: { expose: true }\` — for a remote agent | \`apps/web/mcp.ts\`; under \`bun run dev\`, \`Authorization: Bearer dev-agent.admin\`, else an API key |
141
- | \`.claude/commands/feature.md\` | build or fix one thing end to end, done when \`bun run verify\` is green | plain markdown any agent can follow |
142
- | \`.claude/commands/planx.md\` | write a plan to \`docs/plans/\` | the same |
143
- | \`.claude/commands/verify.md\` | run the gate and fix what it reports | the same |
165
+ | \`.claude/skills/\` | \`feature\` (hive, one PR, done when merged), \`planx\`, \`verify\`, \`upgrade\`, \`design-research\` | plain markdown any agent can follow; \`bunx x kit\` keeps them current |
144
166
 
145
167
  Project notes for ${app.kebab}: replace this line with the conventions a newcomer could not guess.
146
168
  `;
@@ -260,6 +282,8 @@ export function docsFiles(app: NameSet, root?: string): readonly GeneratedFile[]
260
282
  // The harness half of the same job AGENTS.md does. It lands in the app's own repo rather than
261
283
  // in a global config, so it is visible in the scaffold's diff and deletable in one line.
262
284
  ...claudeFiles(app),
285
+ // The app's own design brief, never managed: the `web` agent reads it first.
286
+ ...designFiles(app),
263
287
  // The same two commands `README.md` opens with, run by a machine that has never seen this
264
288
  // repository. Registered here and not in `scaffold-repo.ts` because it is documentation of the
265
289
  // gate in executable form, which is the job this file has.
@@ -28,23 +28,32 @@
28
28
  // Two more are about the REPO: an `await` per turn of a loop, REPORT ONLY (`severity: 'warning'`)
29
29
  // until the apps are clean of it, and a `.all()` that says no bound — failing the gate in an app
30
30
  // scaffolded from 31.23 on, while an older app keeps the report-only copy it was given. One is
31
- // about the ENVIRONMENT: a variable is read only once `app.config.ts` declares it.
31
+ // about the ENVIRONMENT: a variable is read only once `app.config.ts` declares it. Five are about
32
+ // MOTION and EFFECTS (`motion-adapter`, `raw-frame-loop`, `effect-without-fallback`, and the SCRIPT
33
+ // halves of two stylesheet rules, `raw-motion-script` and `animated-layout-script`): report-only
34
+ // by their own declaration, since a stricter rule on `main` is a break; `x new` writes their
35
+ // `"error"` rows into `guards/shipped.json` (`STRICT_FROM_NEW`).
32
36
 
33
37
  import { SHIPPED_GUARD_NAMES as NAMES, type ShippedGuardName } from '../guards-shipped-names';
34
38
  import { animatedLayoutPropertyGuardFiles } from './guard-animated-layout-property';
39
+ import { animatedLayoutScriptGuardFiles } from './guard-animated-layout-script';
35
40
  import { bareErrorGuardFiles } from './guard-bare-error';
41
+ import { effectWithoutFallbackGuardFiles } from './guard-effect-without-fallback';
36
42
  import { errorDeclaredGuardFiles } from './guard-error-declared';
37
43
  import { focusVisibleGuardFiles } from './guard-focus-visible';
38
44
  import { imageDimensionsGuardFiles } from './guard-image-dimensions';
39
45
  import { islandMountClearsGuardFiles } from './guard-island-mount-clears';
40
46
  import { islandWithoutStatesGuardFiles } from './guard-island-without-states';
47
+ import { motionAdapterGuardFiles } from './guard-motion-adapter';
41
48
  import { nativeConfirmGuardFiles } from './guard-native-confirm';
42
49
  import { rawBreakpointGuardFiles } from './guard-raw-breakpoint';
43
50
  import { rawColourGuardFiles } from './guard-raw-colour';
44
51
  import { rawFetchGuardFiles } from './guard-raw-fetch';
52
+ import { rawFrameLoopGuardFiles } from './guard-raw-frame-loop';
45
53
  import { rawIntervalGuardFiles } from './guard-raw-interval';
46
54
  import { rawLengthGuardFiles } from './guard-raw-length';
47
55
  import { rawMotionGuardFiles } from './guard-raw-motion';
56
+ import { rawMotionScriptGuardFiles } from './guard-raw-motion-script';
48
57
  import { rawShadowGuardFiles } from './guard-raw-shadow';
49
58
  import { rawZIndexGuardFiles } from './guard-raw-z-index';
50
59
  import { repoAwaitInLoopGuardFiles } from './guard-repo-await-in-loop';
@@ -68,19 +77,24 @@ import type { GeneratedFile } from './naming';
68
77
  */
69
78
  const SHIPPED: Readonly<Record<ShippedGuardName, () => readonly GeneratedFile[]>> = {
70
79
  'animated-layout-property': animatedLayoutPropertyGuardFiles,
80
+ 'animated-layout-script': animatedLayoutScriptGuardFiles,
71
81
  'bare-error': bareErrorGuardFiles,
82
+ 'effect-without-fallback': effectWithoutFallbackGuardFiles,
72
83
  'error-declared': errorDeclaredGuardFiles,
73
84
  'focus-visible': focusVisibleGuardFiles,
74
85
  'image-dimensions': imageDimensionsGuardFiles,
75
86
  'island-mount-clears': islandMountClearsGuardFiles,
76
87
  'island-without-states': islandWithoutStatesGuardFiles,
88
+ 'motion-adapter': motionAdapterGuardFiles,
77
89
  'native-confirm': nativeConfirmGuardFiles,
78
90
  'raw-breakpoint': rawBreakpointGuardFiles,
79
91
  'raw-colour': rawColourGuardFiles,
80
92
  'raw-fetch': rawFetchGuardFiles,
93
+ 'raw-frame-loop': rawFrameLoopGuardFiles,
81
94
  'raw-interval': rawIntervalGuardFiles,
82
95
  'raw-length': rawLengthGuardFiles,
83
96
  'raw-motion': rawMotionGuardFiles,
97
+ 'raw-motion-script': rawMotionScriptGuardFiles,
84
98
  'raw-shadow': rawShadowGuardFiles,
85
99
  'raw-z-index': rawZIndexGuardFiles,
86
100
  'repo-await-in-loop': repoAwaitInLoopGuardFiles,
@@ -96,6 +110,18 @@ const SHIPPED: Readonly<Record<ShippedGuardName, () => readonly GeneratedFile[]>
96
110
  'unzoned-date': unzonedDateGuardFiles,
97
111
  };
98
112
 
113
+ /**
114
+ * Guards that ship report-only (`severity: 'warning'`) to every app that predates them and fail
115
+ * a new one: `x new` writes their `"error"` row. A guard that is strict for everyone needs no row.
116
+ */
117
+ const STRICT_FROM_NEW: readonly ShippedGuardName[] = [
118
+ 'animated-layout-script',
119
+ 'effect-without-fallback',
120
+ 'motion-adapter',
121
+ 'raw-frame-loop',
122
+ 'raw-motion-script',
123
+ ];
124
+
99
125
  /** The names, in the order every list of them is shown. */
100
126
  export const SHIPPED_GUARD_NAMES: readonly string[] = NAMES;
101
127
 
@@ -176,5 +202,8 @@ export const shippedGuardTest = (name: string): string | undefined => {
176
202
  * that and whose rows are its severities. The app's own guards join it from `x g guard <name>`.
177
203
  */
178
204
  export const scaffoldGuardFiles = (): readonly GeneratedFile[] => [
179
- { path: 'guards/shipped.json', contents: '{\n "severity": {}\n}\n' },
205
+ {
206
+ path: 'guards/shipped.json',
207
+ contents: `${JSON.stringify({ severity: Object.fromEntries(STRICT_FROM_NEW.map((name) => [name, 'error'])) }, null, 2)}\n`,
208
+ },
180
209
  ];
@@ -5,6 +5,7 @@ import { STATEMENTS_MAX } from '@ultimat3/testing';
5
5
  import type { CoverageExclude } from '../coverage-floor';
6
6
  import { COVERAGE_BAR } from '../coverage-floor';
7
7
  import type { VerifyStepName } from '../verify-step';
8
+ import { SCAFFOLD_AGENTS_MD_MAX_BYTES } from './scaffold-docs';
8
9
 
9
10
  /**
10
11
  * The suite ratchet, committed on day one, naming ALL of the gate: every step is either required in
@@ -107,6 +108,8 @@ export const verifyFloor = (suites: FloorSuites): string =>
107
108
  {
108
109
  ...floorSteps(suites),
109
110
  strict: true,
111
+ // The brief this scaffold writes is over the manifest default: its own measured budget.
112
+ agentsMdMaxBytes: SCAFFOLD_AGENTS_MD_MAX_BYTES,
110
113
  coverage: {
111
114
  lines: COVERAGE_BAR,
112
115
  funcs: COVERAGE_BAR,
@@ -79,6 +79,7 @@ const indexPage = (
79
79
  ): string => `// The blog index: every published post, newest first. Zero JavaScript.
80
80
 
81
81
  import { useT } from '@${app.kebab}/i18n';
82
+ import { Aurora } from '@ultimat3/effects';
82
83
  import { defineRoute } from '@ultimat3/render';
83
84
  import { DateTime } from '@ultimat3/ui';
84
85
  import type { JSX } from 'solid-js';
@@ -98,6 +99,7 @@ export function Page(props: { readonly data: BlogIndex }): JSX.Element {
98
99
  const t = useT();
99
100
  return (
100
101
  <main class={styles.page}>
102
+ <Aurora class={styles.aurora} />
101
103
  <h1>{t('site.blog.title')}</h1>
102
104
  <Show when={props.data.length > 0} fallback={<p>{t('site.blog.empty')}</p>}>
103
105
  <ul class={styles.list}>
@@ -269,6 +271,10 @@ unitTest('a slug no published post has is X_NOT_FOUND', async () => {
269
271
  const style = (): string => `@use '@ultimat3/ui/tokens' as tokens;
270
272
 
271
273
  .page {
274
+ @include tokens.view-transition-name(blog-main);
275
+
276
+ position: relative;
277
+ isolation: isolate;
272
278
  display: grid;
273
279
  gap: tokens.space(4);
274
280
  padding: tokens.space(8);
@@ -276,6 +282,13 @@ const style = (): string => `@use '@ultimat3/ui/tokens' as tokens;
276
282
  color: tokens.role('fg');
277
283
  }
278
284
 
285
+ // The backdrop is CSS alone (\`data-effect-backend="css"\`): zero JavaScript, behind the content.
286
+ .aurora {
287
+ position: absolute;
288
+ inset: 0;
289
+ z-index: calc(-1 * #{tokens.z(raised)});
290
+ }
291
+
279
292
  .list {
280
293
  display: grid;
281
294
  gap: tokens.space(3);
@@ -293,6 +306,8 @@ const style = (): string => `@use '@ultimat3/ui/tokens' as tokens;
293
306
  const postStyle = (): string => `@use '@ultimat3/ui/tokens' as tokens;
294
307
 
295
308
  .page {
309
+ @include tokens.view-transition-name(blog-main);
310
+
296
311
  display: grid;
297
312
  gap: tokens.space(4);
298
313
  padding: tokens.space(8);
@@ -5,6 +5,7 @@
5
5
  import type { GeneratedFile, NameSet } from '../naming';
6
6
  import { blogSiteFiles } from './blog-site';
7
7
  import { blogSliceFiles } from './blog-slice';
8
+ import { effectsDependency } from './landing-motion';
8
9
  import type { ShapeEdit, ShapeOverlay } from './overlay';
9
10
  import { claudeRows, shapeLines } from './shared-edits';
10
11
 
@@ -40,6 +41,7 @@ unitTest('health and both public reads are registered under their export names',
40
41
  `;
41
42
 
42
43
  const edits = (app: NameSet): readonly ShapeEdit[] => [
44
+ effectsDependency(),
43
45
  {
44
46
  path: 'packages/db/src/client.ts',
45
47
  find: 'const entities = {};',
@@ -85,6 +85,10 @@ const frameStyle = (): string => `@use '@ultimat3/ui/tokens' as tokens;
85
85
  }
86
86
 
87
87
  .main {
88
+ @include tokens.view-transition-name(site-main);
89
+
90
+ position: relative;
91
+ isolation: isolate;
88
92
  display: grid;
89
93
  gap: tokens.space(4);
90
94
  padding: tokens.space(8);
@@ -101,6 +105,7 @@ const indexPage = (
101
105
  ): string => `// The front page: what the site is, and every page it holds in this locale. Zero JavaScript.
102
106
 
103
107
  import { useT } from '@${app.kebab}/i18n';
108
+ import { Aurora } from '@ultimat3/effects';
104
109
  import { currentLocale, localizedPath } from '@ultimat3/i18n';
105
110
  import { defineRoute } from '@ultimat3/render';
106
111
  import { ld } from '@ultimat3/seo';
@@ -136,6 +141,7 @@ export function Page(props: { readonly data: FrontPage }): JSX.Element {
136
141
  const t = useT();
137
142
  return (
138
143
  <SiteFrame locale={props.data.locale} home={props.data.home} path="/">
144
+ <Aurora class={styles.aurora} />
139
145
  <h1>{t('site.content.headline')}</h1>
140
146
  <p class={styles.lede}>{t('site.content.lede')}</p>
141
147
  <h2>{t('site.content.pages')}</h2>
@@ -197,6 +203,13 @@ unitTest('it is static, ships zero JavaScript, and says what the site is', async
197
203
 
198
204
  const indexStyle = (): string => `@use '@ultimat3/ui/tokens' as tokens;
199
205
 
206
+ // The backdrop is CSS alone (\`data-effect-backend="css"\`): zero JavaScript, behind the frame's main.
207
+ .aurora {
208
+ position: absolute;
209
+ inset: 0;
210
+ z-index: calc(-1 * #{tokens.z(raised)});
211
+ }
212
+
200
213
  .lede {
201
214
  color: tokens.role('fg-muted');
202
215
  }
@@ -10,10 +10,12 @@ import { i18nIndex } from '../scaffold-i18n';
10
10
  import { ADMIN_SPANISH } from './content-admin-es';
11
11
  import { CONTENT_LOCALES, contentPageFiles } from './content-pages';
12
12
  import { contentSiteFiles } from './content-site';
13
+ import { effectsDependency } from './landing-motion';
13
14
  import type { ShapeEdit, ShapeOverlay } from './overlay';
14
15
  import { claudeRows, shapeLines } from './shared-edits';
15
16
 
16
17
  const edits = (): readonly ShapeEdit[] => [
18
+ effectsDependency(),
17
19
  ...claudeRows({
18
20
  page: '`apps/web/site/page.test.ts`',
19
21
  island: 'none in this shape: `bunx x g island <name>` writes one with its states',
@@ -224,6 +224,8 @@ const pageStyles =
224
224
  @use '@ultimat3/ui/tokens' as tokens;
225
225
 
226
226
  .page {
227
+ @include tokens.view-transition-name(post-main);
228
+
227
229
  display: grid;
228
230
  gap: tokens.space(4);
229
231
  padding: tokens.space(6);