@imfusion/web-ui 0.6.4-dev.57.g664ba66a → 0.6.4-dev.59.gbecd3620

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 (58) hide show
  1. package/README.md +19 -54
  2. package/dist/assets/vendors/base-ui.d.ts +2 -3
  3. package/dist/breakpoints/min-width.d.ts +3 -7
  4. package/dist/breakpoints/registry.d.ts +3 -9
  5. package/dist/codegen/gen-breakpoints-css.d.ts +0 -4
  6. package/dist/codegen/gen-token-css.d.ts +0 -2
  7. package/dist/components/button/button.d.ts +1 -1
  8. package/dist/components/callout/callout.d.ts +7 -10
  9. package/dist/components/card/card.d.ts +2 -4
  10. package/dist/components/chip/chip.cva.d.ts +2 -4
  11. package/dist/components/code/code.d.ts +1 -1
  12. package/dist/components/logo/imfusion/imfusion.d.ts +1 -4
  13. package/dist/components/logo/logo.d.ts +1 -1
  14. package/dist/components/navigation-menu/subs/flyout-link.d.ts +3 -5
  15. package/dist/components/navigation-menu/subs/inline-submenu.d.ts +2 -4
  16. package/dist/components/navigation-menu/subs/trigger.d.ts +5 -7
  17. package/dist/components/number-field/number-field.d.ts +2 -3
  18. package/dist/components/select/select.d.ts +3 -3
  19. package/dist/components/stack/stack.d.ts +2 -3
  20. package/dist/components/table/table.d.ts +3 -5
  21. package/dist/components/tabs/tabs.d.ts +5 -8
  22. package/dist/components/tooltip/tooltip.d.ts +5 -8
  23. package/dist/components/typo/typo.d.ts +1 -3
  24. package/dist/docgen/gen-docgen.utils.d.ts +3 -4
  25. package/dist/hooks/use-color-scheme.d.ts +5 -11
  26. package/dist/hooks/use-media-query.d.ts +2 -7
  27. package/dist/integrations/image-display-options/image-display-options-view.utils.d.ts +0 -1
  28. package/dist/style.css +1 -1
  29. package/dist/tokens/apply.d.ts +4 -9
  30. package/dist/tokens/control-registry.d.ts +3 -6
  31. package/dist/tokens/types.d.ts +7 -24
  32. package/dist/tokens/use-token-controls.d.ts +3 -12
  33. package/dist/types/meta.d.ts +15 -32
  34. package/dist/vite/readable-css-module-names.d.ts +3 -12
  35. package/dist/web-ui-cli.js +322 -0
  36. package/docs/user-guide/AgentTooling.mdx +127 -0
  37. package/docs/user-guide/BrandAssets.mdx +25 -28
  38. package/docs/user-guide/GettingStarted.mdx +34 -19
  39. package/docs/user-guide/HowItsBuilt.mdx +92 -12
  40. package/docs/user-guide/Tokens.mdx +12 -10
  41. package/docs/user-guide/UsagePatterns.mdx +64 -21
  42. package/package.json +6 -5
  43. package/src/docgen/doc.gen.json +20 -20
  44. package/src/llms/install-templates/AGENTS.md +4 -4
  45. package/src/llms/install-templates/hooks/baseline-staleness.sh +9 -2
  46. package/src/llms/skills/imf-web-ui/SKILL.md +8 -9
  47. package/src/llms/skills/imf-web-ui-audit/SKILL.md +4 -4
  48. package/src/llms/skills/imf-web-ui-components/SKILL.md +3 -0
  49. package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +0 -1
  50. package/src/llms/skills/imf-web-ui-conventions/topics/agent-tooling.md +15 -10
  51. package/src/llms/skills/imf-web-ui-conventions/topics/git.md +2 -1
  52. package/src/llms/skills/imf-web-ui-conventions/topics/styling.md +1 -1
  53. package/src/llms/skills/imf-web-ui-conventions/topics/tooling.md +1 -1
  54. package/src/llms/skills/imf-web-ui-setup/SKILL.md +1 -1
  55. package/src/llms/skills/imf-web-ui-update/SKILL.md +15 -13
  56. package/bin/install.js +0 -446
  57. package/docs/user-guide/AiAgents.mdx +0 -51
  58. package/docs/user-guide/Introduction.mdx +0 -21
package/bin/install.js DELETED
@@ -1,446 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // Installs this package's agent tooling into the consumer project: the
4
- // skill family (../src/llms/skills/imf-web-ui*/) and the agent lifecycle
5
- // hooks in the installer-owned template home. Runs in the
6
- // CONSUMER's environment, so it may only use this package's real runtime
7
- // dependencies (@clack/prompts). Never wire this into a postinstall hook:
8
- // ambient script execution on `npm install` is a live supply-chain attack
9
- // vector — install stays an explicit, user-run command.
10
- //
11
- // The skills cross-reference each other, so they install as one bundle.
12
- // When both targets are selected, .agents/skills/ holds the real copy and
13
- // .claude/skills/ symlinks it (this repo's own convention) so the two
14
- // can't drift apart.
15
- //
16
- // Flags: bare = help; --hooks adds the agent lifecycle hooks after the consumer
17
- // checks the repo's existing hooks and still installs the skills.
18
- // --target claude|agents|all (repeatable) selects scripted install targets,
19
- // --reconfigure to re-open the target prompt on an existing install.
20
-
21
- import {
22
- chmodSync,
23
- cpSync,
24
- existsSync,
25
- lstatSync,
26
- mkdirSync,
27
- readdirSync,
28
- readFileSync,
29
- rmSync,
30
- symlinkSync,
31
- writeFileSync
32
- } from "node:fs";
33
- import { spawnSync } from "node:child_process";
34
- import { dirname, relative, resolve } from "node:path";
35
- import { fileURLToPath } from "node:url";
36
- import * as p from "@clack/prompts";
37
-
38
- const SKILL_PREFIX = "imf-web-ui";
39
- const VERSION_MARKER = ".imf-web-ui-skill-version.json";
40
-
41
- const here = dirname(fileURLToPath(import.meta.url));
42
- // Source is relative to THIS SCRIPT's location (inside node_modules), not
43
- // the consumer's cwd — the script is invoked from the consumer's project
44
- // root, but the skills it copies ship alongside this file in the package.
45
- const skillsRoot = resolve(here, "..", "src", "llms", "skills");
46
- const packageJson = JSON.parse(readFileSync(resolve(here, "..", "package.json"), "utf-8"));
47
- const currentVersion = packageJson.version;
48
-
49
- // Destination is relative to the consumer's project root (cwd), since
50
- // that's where their `.claude/` or `.agents/` directory lives.
51
- const projectRoot = process.cwd();
52
-
53
- const TARGETS = {
54
- claude: { label: "Claude Code", root: resolve(projectRoot, ".claude", "skills") },
55
- agents: { label: "Vendor-neutral (.agents/)", root: resolve(projectRoot, ".agents", "skills") }
56
- };
57
-
58
- function discoverSkills() {
59
- if (!existsSync(skillsRoot)) return [];
60
- return readdirSync(skillsRoot, { withFileTypes: true })
61
- .filter(entry => entry.isDirectory() && entry.name.startsWith(SKILL_PREFIX))
62
- .map(entry => entry.name)
63
- .sort();
64
- }
65
-
66
- function displayPath(absPath) {
67
- return `./${relative(projectRoot, absPath)}`;
68
- }
69
-
70
- function readInstalledVersion(dir) {
71
- const markerPath = resolve(dir, VERSION_MARKER);
72
- if (!existsSync(markerPath)) return null;
73
- try {
74
- return JSON.parse(readFileSync(markerPath, "utf-8")).version ?? null;
75
- } catch {
76
- return null;
77
- }
78
- }
79
-
80
- function writeRealCopy(sourceDir, destDir) {
81
- mkdirSync(dirname(destDir), { recursive: true });
82
- // force: true makes re-running after a version bump overwrite cleanly.
83
- cpSync(sourceDir, destDir, { recursive: true, force: true });
84
- writeFileSync(resolve(destDir, VERSION_MARKER), JSON.stringify({ version: currentVersion }, null, 2) + "\n");
85
- }
86
-
87
- function writeSymlink(linkPath, targetPath) {
88
- mkdirSync(dirname(linkPath), { recursive: true });
89
- // lstat (not existsSync, which follows symlinks) catches a broken/stale
90
- // symlink left over from a prior run, not just a real file or directory.
91
- if (lstatSync(linkPath, { throwIfNoEntry: false })) {
92
- rmSync(linkPath, { recursive: true, force: true });
93
- }
94
- symlinkSync(relative(dirname(linkPath), targetPath), linkPath);
95
- }
96
-
97
- function removeOrphanedSkills(selected, skills, both) {
98
- const bundledSkills = new Set(skills);
99
- const selectedTargets = both ? ["agents", "claude"] : selected;
100
-
101
- for (const key of selectedTargets) {
102
- const { root } = TARGETS[key];
103
- if (!existsSync(root)) continue;
104
-
105
- const orphanedSkills = readdirSync(root).filter(name => name.startsWith(`${SKILL_PREFIX}-`) && !bundledSkills.has(name));
106
- for (const name of orphanedSkills) {
107
- rmSync(resolve(root, name), { recursive: true, force: true });
108
- // In the two-target layout, .claude/ is a symlinked view of the
109
- // canonical .agents/ copy. Remove its matching link along with the
110
- // orphaned canonical skill.
111
- if (both && key === "agents") {
112
- rmSync(resolve(TARGETS.claude.root, name), { recursive: true, force: true });
113
- }
114
- p.log.info(`Removed orphaned skill: ${name} (no longer in this bundle)`);
115
- }
116
- }
117
- }
118
-
119
- // A prior install is recoverable from the filesystem, so a re-run doesn't
120
- // re-ask: a target counts as chosen when any bundled skill is present under
121
- // it. Symlinks count — they're how the both-targets layout represents
122
- // .claude/, and lstat avoids following them into the real copy.
123
- function detectInstalledTargets(skills) {
124
- return Object.keys(TARGETS).filter(key =>
125
- skills.some(name => lstatSync(resolve(TARGETS[key].root, name), { throwIfNoEntry: false }))
126
- );
127
- }
128
-
129
- // Hook templates are installer-owned; the installer copies the scripts into the
130
- // consumer's .agents/hooks/ and merges the registrations into the host
131
- // registration files: .claude/settings.json from settings.json, .codex/hooks.json
132
- // from codex-hooks.json. One pristine template per host, merged verbatim.
133
- const installTemplatesRoot = resolve(here, "..", "src", "llms", "install-templates");
134
- const hooksSourceDir = resolve(installTemplatesRoot, "hooks");
135
- const hooksSettingsTemplate = resolve(installTemplatesRoot, "settings.json");
136
- const codexHooksTemplate = resolve(installTemplatesRoot, "codex-hooks.json");
137
- // Installer-owned subdirectory: refreshed wholesale on every run, so a repo's
138
- // own hooks in .agents/hooks/ are never touched.
139
- const hooksDestDir = resolve(projectRoot, ".agents", "hooks", "imf-web-ui");
140
- const settingsPath = resolve(projectRoot, ".claude", "settings.json");
141
- const codexHooksPath = resolve(projectRoot, ".codex", "hooks.json");
142
-
143
- // Serializing the file reflows entries this installer doesn't own; the
144
- // consumer's own Prettier puts them back. Best-effort: absent, or the path is
145
- // .prettierignore'd, nothing happens.
146
- function formatSettings(path) {
147
- let toolRoot = projectRoot;
148
- while (toolRoot !== dirname(toolRoot) && !existsSync(resolve(toolRoot, "node_modules", ".bin"))) {
149
- toolRoot = dirname(toolRoot);
150
- }
151
- const prettier = resolve(toolRoot, "node_modules", ".bin", "prettier");
152
- if (!existsSync(prettier)) return;
153
- spawnSync(prettier, ["--write", path], { cwd: projectRoot, stdio: "ignore" });
154
- }
155
-
156
- function installHookScripts() {
157
- const scripts = readdirSync(hooksSourceDir).filter(name => name.endsWith(".sh"));
158
- mkdirSync(hooksDestDir, { recursive: true });
159
- for (const name of scripts) {
160
- const dest = resolve(hooksDestDir, name);
161
- cpSync(resolve(hooksSourceDir, name), dest, { force: true });
162
- chmodSync(dest, 0o755);
163
- }
164
- // The directory is installer-owned: a script dropped from the template is
165
- // removed on refresh, so a stale hook can't keep running after an upgrade.
166
- const removed = readdirSync(hooksDestDir).filter(name => name.endsWith(".sh") && !scripts.includes(name));
167
- for (const name of removed) {
168
- rmSync(resolve(hooksDestDir, name), { force: true });
169
- }
170
- return { installed: scripts, removed };
171
- }
172
-
173
- // A registration is identified by the script it runs, not the command string:
174
- // "$VAR/..." and "${VAR}/..." are the same hook.
175
- const HOOKS_DIR_SEGMENT = ".agents/hooks/imf-web-ui/";
176
-
177
- function hookScriptId(command) {
178
- if (typeof command !== "string") return null;
179
- const at = command.lastIndexOf(HOOKS_DIR_SEGMENT);
180
- if (at === -1) return null;
181
- // Only a bare script name (plus an optional closing quote) identifies a
182
- // registration as installer-owned. Trailing arguments or redirection mean
183
- // the consumer customized the command; that counts as foreign, so the
184
- // stale-prune below can never delete it.
185
- const match = command.slice(at + HOOKS_DIR_SEGMENT.length).match(/^([\w.-]+)["']?$/);
186
- return match ? match[1] : null;
187
- }
188
-
189
- function entryScriptIds(entry) {
190
- return (entry.hooks ?? []).map(hook => hookScriptId(hook.command)).filter(Boolean);
191
- }
192
-
193
- // Merge, never clobber: a registration is added only when no existing entry
194
- // for that event already runs the same script, so re-runs are idempotent and
195
- // hand-written settings survive. The one exception is entries that only run
196
- // scripts from the installer-owned directory that are no longer shipped —
197
- // those are pruned, or they would point at a script the refresh just removed.
198
- // A run that changes nothing writes nothing.
199
- function mergeHookRegistrations(targetPath, templateHooks, shippedScripts) {
200
- let settings = {};
201
- if (existsSync(targetPath)) {
202
- try {
203
- settings = JSON.parse(readFileSync(targetPath, "utf-8"));
204
- } catch {
205
- return null;
206
- }
207
- }
208
- settings.hooks ??= {};
209
- let added = 0;
210
- let removed = 0;
211
- // Pruning is per hook, not per entry: only an individual hook that
212
- // unambiguously runs a no-longer-shipped installer-owned script goes;
213
- // consumer hooks sharing the same entry stay.
214
- const emptiedEvents = [];
215
- for (const [event, entries] of Object.entries(settings.hooks)) {
216
- if (!Array.isArray(entries)) continue;
217
- let pruned = 0;
218
- const kept = entries
219
- .map(entry => {
220
- if (!Array.isArray(entry.hooks)) return entry;
221
- const hooks = entry.hooks.filter(hook => {
222
- const script = hookScriptId(hook.command);
223
- return script === null || shippedScripts.includes(script);
224
- });
225
- pruned += entry.hooks.length - hooks.length;
226
- return hooks.length === entry.hooks.length ? entry : { ...entry, hooks };
227
- })
228
- .filter(entry => !Array.isArray(entry.hooks) || entry.hooks.length > 0);
229
- if (pruned === 0) continue;
230
- removed += pruned;
231
- if (kept.length === 0 && !(event in templateHooks)) emptiedEvents.push(event);
232
- else settings.hooks[event] = kept;
233
- }
234
- // An event whose entries were all pruned disappears instead of lingering as [].
235
- if (emptiedEvents.length > 0) {
236
- settings.hooks = Object.fromEntries(Object.entries(settings.hooks).filter(([event]) => !emptiedEvents.includes(event)));
237
- }
238
- for (const [event, entries] of Object.entries(templateHooks)) {
239
- settings.hooks[event] ??= [];
240
- for (const entry of entries) {
241
- const scripts = entryScriptIds(entry);
242
- const present = settings.hooks[event].some(existing =>
243
- entryScriptIds(existing).some(script => scripts.includes(script))
244
- );
245
- if (!present) {
246
- settings.hooks[event].push(entry);
247
- added++;
248
- }
249
- }
250
- }
251
- if (added === 0 && removed === 0) return { added, removed };
252
- mkdirSync(dirname(targetPath), { recursive: true });
253
- writeFileSync(targetPath, JSON.stringify(settings, null, 2) + "\n");
254
- formatSettings(targetPath);
255
- return { added, removed };
256
- }
257
-
258
- // The AGENTS.md baseline note lives inside a fenced block owned by this
259
- // installer. The template between the markers is the source of truth; an
260
- // existing AGENTS.md gets the block replaced in place (or appended when
261
- // absent), everything outside the fence is untouched. No AGENTS.md at all
262
- // is left alone — scaffolding one is the setup skill's job.
263
- const AGENTS_BLOCK_BEGIN = "<!-- imf-web-ui:begin";
264
- const AGENTS_BLOCK_END = "<!-- imf-web-ui:end -->";
265
- const agentsTemplatePath = resolve(installTemplatesRoot, "AGENTS.md");
266
- const agentsPath = resolve(projectRoot, "AGENTS.md");
267
-
268
- function extractAgentsBlock(content) {
269
- const begin = content.indexOf(AGENTS_BLOCK_BEGIN);
270
- const end = content.indexOf(AGENTS_BLOCK_END);
271
- if (begin === -1 || end === -1) return null;
272
- return content.slice(begin, end + AGENTS_BLOCK_END.length);
273
- }
274
-
275
- function upsertAgentsBlock() {
276
- if (!existsSync(agentsPath)) return "absent";
277
- const block = extractAgentsBlock(readFileSync(agentsTemplatePath, "utf-8"));
278
- if (!block) return "absent";
279
- const current = readFileSync(agentsPath, "utf-8");
280
- const existing = extractAgentsBlock(current);
281
- const next = existing ? current.replace(existing, block) : `${current.trimEnd()}\n\n${block}\n`;
282
- if (next === current) return "unchanged";
283
- writeFileSync(agentsPath, next);
284
- return existing ? "updated" : "added";
285
- }
286
-
287
- // --target claude|agents|all (repeatable) selects targets without the
288
- // interactive prompt — for CI and scripted installs.
289
- function parseTargetFlags(argv) {
290
- const targets = [];
291
- for (let i = 0; i < argv.length; i++) {
292
- if (argv[i] !== "--target") continue;
293
- const value = argv[i + 1];
294
- if (!value || (value !== "all" && !(value in TARGETS))) {
295
- console.error(`--target expects one of: ${Object.keys(TARGETS).join(", ")}, all`);
296
- process.exit(1);
297
- }
298
- targets.push(...(value === "all" ? ["agents", "claude"] : [value]));
299
- i++;
300
- }
301
- return [...new Set(targets)];
302
- }
303
-
304
- function printHelp() {
305
- console.log(`Usage: web-ui-install [options]
306
-
307
- Install @imfusion/web-ui agent skills into a consumer project.
308
-
309
- Options:
310
- --target agents|claude|all Install into selected skill target(s).
311
- Repeat --target to select multiple targets.
312
- --hooks Install agent lifecycle hooks.
313
- --reconfigure Re-open target selection prompt.
314
- -h, --help Show this help.
315
- `);
316
- }
317
-
318
- async function main() {
319
- const argv = process.argv.slice(2);
320
- if (argv.length === 0 || argv.includes("-h") || argv.includes("--help")) {
321
- printHelp();
322
- return;
323
- }
324
-
325
- const skills = discoverSkills();
326
- const flagTargets = parseTargetFlags(argv);
327
- const reconfigure = argv.includes("--reconfigure");
328
- // Every install includes the skill bundle. Hooks are opt-in via --hooks —
329
- // the consumer's setup workflow drives that after checking what the repo
330
- // already registers, but hooks without their companion skills are invalid.
331
- const wantHooks = argv.includes("--hooks");
332
- const wantSkills = true;
333
-
334
- const components = [wantSkills && `${skills.length} skills`, wantHooks && "agent hooks"].filter(Boolean);
335
- p.intro(`@imfusion/web-ui install — ${components.join(" + ")}`);
336
-
337
- if (wantSkills && skills.length === 0) {
338
- p.log.error(`No skills found at ${skillsRoot}. Reinstall @imfusion/web-ui and try again.`);
339
- p.outro("Nothing installed.");
340
- process.exitCode = 1;
341
- return;
342
- }
343
-
344
- if (wantHooks) {
345
- const { installed, removed } = installHookScripts();
346
- p.log.success(`Agent hooks -> ${displayPath(hooksDestDir)} (${installed.length} scripts)`);
347
- if (removed.length > 0) {
348
- p.log.info(`Removed stale hook script(s): ${removed.join(", ")} (no longer shipped)`);
349
- }
350
- const registrations = [
351
- [settingsPath, JSON.parse(readFileSync(hooksSettingsTemplate, "utf-8")).hooks],
352
- [codexHooksPath, JSON.parse(readFileSync(codexHooksTemplate, "utf-8")).hooks]
353
- ];
354
- for (const [path, hooks] of registrations) {
355
- const result = mergeHookRegistrations(path, hooks, installed);
356
- if (result === null) {
357
- p.log.warn(`${displayPath(path)} is not valid JSON — registrations not merged, fix it and re-run.`);
358
- } else if (result.added > 0 || result.removed > 0) {
359
- const changes = [
360
- result.added > 0 && `registered ${result.added}`,
361
- result.removed > 0 && `removed ${result.removed} stale`
362
- ].filter(Boolean);
363
- p.log.success(`${changes.join(", ")} hook registration(s) in ${displayPath(path)}`);
364
- } else {
365
- p.log.info(`Hook registrations already present in ${displayPath(path)}`);
366
- }
367
- }
368
- }
369
-
370
- const installedTargets = detectInstalledTargets(skills);
371
-
372
- const existingVersions = Object.values(TARGETS)
373
- .flatMap(({ root }) => skills.map(name => readInstalledVersion(resolve(root, name))))
374
- .filter(Boolean);
375
- if (existingVersions.length > 0 && existingVersions.every(v => v === currentVersion)) {
376
- p.log.info(`Already up to date (v${currentVersion}). Re-running will overwrite with the same content.`);
377
- } else if (existingVersions.some(v => v !== currentVersion)) {
378
- const from = existingVersions.find(v => v !== currentVersion);
379
- p.log.info(`Updating installed skills from v${from} to v${currentVersion}.`);
380
- }
381
-
382
- p.log.message(`Skills in this bundle:\n${skills.map(name => ` - ${name}`).join("\n")}`);
383
-
384
- let selected;
385
- if (flagTargets.length > 0) {
386
- selected = flagTargets;
387
- p.log.info(`Targets from --target flags: ${selected.join(", ")}`);
388
- } else if (installedTargets.length > 0 && !reconfigure) {
389
- selected = installedTargets;
390
- p.log.info(
391
- `Refreshing the existing install: ${selected.map(key => displayPath(TARGETS[key].root)).join(", ")}` +
392
- ` — pass --reconfigure to choose different targets.`
393
- );
394
- } else {
395
- selected = await p.multiselect({
396
- message: "Install into which skill directory (or directories)?",
397
- options: Object.entries(TARGETS).map(([key, { label, root }]) => ({
398
- value: key,
399
- label,
400
- hint: displayPath(root)
401
- })),
402
- required: true
403
- });
404
-
405
- if (p.isCancel(selected)) {
406
- p.cancel("Cancelled — nothing installed.");
407
- return;
408
- }
409
- }
410
-
411
- const both = selected.includes("claude") && selected.includes("agents");
412
-
413
- for (const name of skills) {
414
- const sourceDir = resolve(skillsRoot, name);
415
- if (both) {
416
- // .agents/ is the canonical real copy; .claude/ aliases it via symlink.
417
- const realDir = resolve(TARGETS.agents.root, name);
418
- writeRealCopy(sourceDir, realDir);
419
- writeSymlink(resolve(TARGETS.claude.root, name), realDir);
420
- } else {
421
- for (const key of selected) {
422
- writeRealCopy(sourceDir, resolve(TARGETS[key].root, name));
423
- }
424
- }
425
- }
426
-
427
- removeOrphanedSkills(selected, skills, both);
428
-
429
- if (both) {
430
- p.log.success(`Vendor-neutral (.agents/) -> ${displayPath(TARGETS.agents.root)}/${SKILL_PREFIX}*`);
431
- p.log.success(`Claude Code -> ${displayPath(TARGETS.claude.root)}/${SKILL_PREFIX}* (symlinks -> .agents/)`);
432
- } else {
433
- for (const key of selected) {
434
- p.log.success(`${TARGETS[key].label} -> ${displayPath(TARGETS[key].root)}/${SKILL_PREFIX}*`);
435
- }
436
- }
437
-
438
- const agentsResult = upsertAgentsBlock();
439
- if (agentsResult === "updated" || agentsResult === "added") {
440
- p.log.success(`Refreshed the imf-web-ui block in ${displayPath(agentsPath)}`);
441
- }
442
-
443
- p.outro(`Done — ${skills.length} skills installed${wantHooks ? " + agent hooks" : ""}.`);
444
- }
445
-
446
- await main();
@@ -1,51 +0,0 @@
1
- import { Meta } from "@storybook/addon-docs/blocks";
2
- import { Typo } from "#/components/typo";
3
-
4
- <Meta title="User Guide/AI Agents" />
5
-
6
- # AI agents
7
-
8
- The package includes optional skills for agents working in a project that uses `@imfusion/web-ui`.
9
-
10
- ## Install the skills
11
-
12
- Install the package first, then run this in the consumer project:
13
-
14
- ```sh
15
- npx web-ui-install
16
- ```
17
-
18
- The installer asks whether to use Claude Code's `.claude/skills/`, the shared `.agents/skills/` directory, or both. Use
19
- `--target claude` or `--target agents` to choose without the prompt. Run it again after a package update; use
20
- `--reconfigure` to choose again.
21
-
22
- Add `--hooks` when the project should install the optional lifecycle hooks for Claude Code and Codex:
23
-
24
- ```sh
25
- npx web-ui-install --hooks
26
- ```
27
-
28
- Read the [agent-tooling topic](../../src/llms/skills/imf-web-ui-conventions/topics/agent-tooling.md) before adapting hook
29
- registrations. Codex also requires project trust and a review of `/hooks`.
30
-
31
- ## Start with the router
32
-
33
- Use <Typo.InlineCode>/imf-web-ui</Typo.InlineCode> for UI work and library questions. It routes usage questions to the
34
- packaged user guides and development tasks to the matching companions:
35
-
36
- | Skill | Use it for |
37
- | --- | --- |
38
- | `/imf-web-ui-components` | Component props, parts, defaults, and icons. |
39
- | `/imf-web-ui-ux` | Choosing components and shaping screens or flows. |
40
- | `/imf-web-ui-conventions` | Code, styling, data, validation, and project conventions. |
41
- | `/imf-web-ui-setup` | First-time wiring and approved project setup. |
42
- | `/imf-web-ui-audit` | A read-only check of an existing project. |
43
- | `/imf-web-ui-update` | Updating the package and its installed tooling. |
44
-
45
- The router keeps small tasks small. It does not load every reference just because the package is installed.
46
-
47
- ## Where the files come from
48
-
49
- The skills are shipped inside the package under `src/llms/skills/`. `web-ui-install` copies them into the consumer project.
50
- The package also exposes generated component, token, and icon indexes for the lookup skill. User guides ship as readable
51
- MDX under `docs/user-guide/`; agents read them from the installed package without a running Storybook.
@@ -1,21 +0,0 @@
1
- import { Meta } from "@storybook/addon-docs/blocks";
2
-
3
- <Meta title="User Guide/Introduction" />
4
-
5
- # ImFusion Web UI
6
-
7
- `@imfusion/web-ui` is the shared React UI library for ImFusion web apps. It provides accessible primitives, ImFusion tokens,
8
- and one public import surface.
9
-
10
- ## Find your way
11
-
12
- - **Getting Started** installs the package and mounts it in an app.
13
- - **Usage Patterns** covers composition, overrides, state, and color schemes.
14
- - **Tokens** explains the theming surface.
15
- - **AI Agents** explains the optional skills shipped with the package.
16
- - **How It's Built** explains the boundary between Web UI and its implementation libraries.
17
- - **Primitives** lists the components in the main package entry.
18
- - **Integrations** lists components that need an optional package.
19
- - **Development** is for contributors to this repository.
20
-
21
- The [repository README](https://bitbucket.imfusion.com/projects/WEBSDK/repos/web-ui) covers local development and releases.