@imfusion/web-ui 0.6.1-dev.12.ge86ac0a1 → 0.6.1-dev.14.g8fac1dfb

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 (40) hide show
  1. package/README.md +102 -170
  2. package/dist/{code-Blo48PGr.js → code-C_56u-Vk.js} +2 -2
  3. package/dist/{icons-wBmF0U2x.js → icons-Cy1HAosO.js} +1 -1
  4. package/dist/icons.js +1 -1
  5. package/dist/index.js +31 -31
  6. package/dist/integrations/code-highlight.js +2 -2
  7. package/dist/integrations/image-display-options.js +1 -1
  8. package/package.json +1 -1
  9. package/src/llms/install-templates/AGENTS.md +15 -18
  10. package/src/llms/llms.gen.txt +33 -33
  11. package/src/llms/skills/imf-web-ui/SKILL.md +29 -39
  12. package/src/llms/skills/imf-web-ui-audit/SKILL.md +50 -102
  13. package/src/llms/skills/imf-web-ui-components/SKILL.md +47 -104
  14. package/src/llms/skills/imf-web-ui-conventions/SKILL.md +39 -52
  15. package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +1 -0
  16. package/src/llms/skills/imf-web-ui-conventions/topics/agent-tooling.md +40 -62
  17. package/src/llms/skills/imf-web-ui-conventions/topics/assets.md +11 -12
  18. package/src/llms/skills/imf-web-ui-conventions/topics/authentication.md +31 -46
  19. package/src/llms/skills/imf-web-ui-conventions/topics/class-names.md +18 -23
  20. package/src/llms/skills/imf-web-ui-conventions/topics/components.md +20 -69
  21. package/src/llms/skills/imf-web-ui-conventions/topics/data.md +50 -146
  22. package/src/llms/skills/imf-web-ui-conventions/topics/docs-structure.md +17 -23
  23. package/src/llms/skills/imf-web-ui-conventions/topics/git.md +15 -20
  24. package/src/llms/skills/imf-web-ui-conventions/topics/library-boundary.md +28 -19
  25. package/src/llms/skills/imf-web-ui-conventions/topics/library-setup.md +20 -16
  26. package/src/llms/skills/imf-web-ui-conventions/topics/npm-project.md +28 -42
  27. package/src/llms/skills/imf-web-ui-conventions/topics/project-structure.md +28 -30
  28. package/src/llms/skills/imf-web-ui-conventions/topics/react.md +28 -74
  29. package/src/llms/skills/imf-web-ui-conventions/topics/styling.md +65 -62
  30. package/src/llms/skills/imf-web-ui-conventions/topics/testing.md +12 -14
  31. package/src/llms/skills/imf-web-ui-conventions/topics/tokens.md +9 -4
  32. package/src/llms/skills/imf-web-ui-conventions/topics/tooling.md +40 -68
  33. package/src/llms/skills/imf-web-ui-conventions/topics/typescript.md +26 -50
  34. package/src/llms/skills/imf-web-ui-conventions/topics/validation.md +19 -25
  35. package/src/llms/skills/imf-web-ui-setup/SKILL.md +43 -64
  36. package/src/llms/skills/imf-web-ui-update/SKILL.md +48 -114
  37. package/src/llms/skills/imf-web-ui-ux/SKILL.md +64 -92
  38. package/src/llms/skills/imf-web-ui-ux/references/forms.md +16 -36
  39. package/src/llms/skills/imf-web-ui-ux/references/usability-heuristics.md +14 -27
  40. package/src/llms/skills/imf-web-ui-ux/references/visual-design.md +22 -38
@@ -1,56 +1,46 @@
1
1
  ---
2
2
  name: imf-web-ui
3
3
  description:
4
- "Entry point for UI work in a project that depends on @imfusion/web-ui. Decides whether guidance is needed at all, then
5
- routes to the right companion skill — component reference, UX guidance, or frontend conventions. Load when adding or
6
- editing UI in a consumer repo."
4
+ "Route UI work in a project that uses @imfusion/web-ui. Use this skill whenever a user adds, edits, styles, or reviews UI
5
+ in a consumer project, even if they do not mention the library. Decide whether guidance is needed, then open only the
6
+ companion skills that match the task."
7
7
  ---
8
8
 
9
- # imf-web-ui
9
+ # Route Web UI work
10
10
 
11
- `@imfusion/web-ui` ships a small family of skills. This one is the map — it costs almost nothing to load and tells you which
12
- companion to open, or that you need none at all. Don't load a companion speculatively: route first, zoom second.
11
+ Start here for UI work in a project that uses `@imfusion/web-ui`. This skill is a map, not a second copy of every convention.
13
12
 
14
- ## Row zero — is help needed at all?
13
+ ## 1. Decide whether guidance is needed
15
14
 
16
- Before routing, check whether this task needs guidance in the first place. It does **not** when:
15
+ Skip a companion when the task is explicit and small, an existing local pattern already solves it, and the library usage is
16
+ already correct. Do the work. Look up an API silently only when you are unsure.
17
17
 
18
- - The request is explicit and small ("make the button say Save", "add a column for email"), or
19
- - You're repeating a pattern that already exists nearby in the codebase — copy it, and
20
- - The components involved are already imported and used correctly.
18
+ Use a companion when the task involves a choice, a missing setup piece, a new file, or a library convention the project may
19
+ not already have.
21
20
 
22
- In that case: just do the work. At most, do a silent props lookup via `imf-web-ui-components` if you're unsure of an API.
23
- Guidance skills exist to fill gaps, not to add ceremony to clear tasks.
21
+ ## 2. Route the task
24
22
 
25
- ## Routing
23
+ | Task | Open |
24
+ | ----------------------------------------------------------------- | ------------------------ |
25
+ | Look up a component, part, prop, default, or icon | `imf-web-ui-components` |
26
+ | Choose components or shape a screen or flow | `imf-web-ui-ux` |
27
+ | Write a wrapper, custom UI, CSS, data layer, validation, or tests | `imf-web-ui-conventions` |
28
+ | Install the library or bootstrap project tooling | `imf-web-ui-setup` |
29
+ | Inspect an existing project without changing it | `imf-web-ui-audit` |
30
+ | Update the package, skills, or hooks | `imf-web-ui-update` |
26
31
 
27
- | The task at hand | Open |
28
- | ----------------------------------------------------------------------------------------------------- | --------------------------------------- |
29
- | Using a specific component; checking props, sub-components, or defaults | `imf-web-ui-components` |
30
- | First-time setup, adding a library dependency, or components rendering unstyled/broken | `imf-web-ui-setup` (`library-setup`) |
31
- | Building/reshaping a screen or flow; choosing between components; layout, density, hierarchy, states | `imf-web-ui-ux` |
32
- | Writing wrappers or custom UI; styling beyond defaults; adding files; TypeScript, naming, testing | `imf-web-ui-conventions` |
33
- | Setting up or auditing an **ImFusion** repo's tooling: formatting, linting, hooks, scripts, structure | `imf-web-ui-setup` / `imf-web-ui-audit` |
34
- | Installing or checking agent tooling: vendored skills, lifecycle hooks, registrations, and staleness | `imf-web-ui-setup` / `imf-web-ui-audit` |
32
+ A screen often needs both `imf-web-ui-ux` and `imf-web-ui-components`, in that order. Setup and audit are for project-wide
33
+ questions, not every one-file edit.
35
34
 
36
- The two setup rows are narrow on purpose. They're for "what is this project missing?" — a question about the repo as a whole.
37
- Being asked to add one config file is just that edit; make it, and don't open a skill to do so.
35
+ ## 3. Keep project choices
38
36
 
39
- Tasks routinely span two: building a screen usually means `imf-web-ui-ux` for the shape and `imf-web-ui-components` for the
40
- APIs. That's normal — open both, in that order.
37
+ The host project's existing conventions win. The companion skills fill gaps; they do not justify refactoring a working
38
+ styling system, state library, or folder structure.
41
39
 
42
- ## The stack
40
+ When a task needs TanStack Router, Query, Form, Table, or Store and the project has no incumbent, propose the matching
41
+ library and read its current documentation with `npx @tanstack/cli` before using it.
43
42
 
44
- TanStack is the recommended tooling library — routing, server state, forms, tables. When a task needs one of those and the
45
- project has no incumbent, propose it, and read the library's own docs (`npx @tanstack/cli`) rather than working from memory.
43
+ ## 4. Ask only when the choice depends on missing context
46
44
 
47
- ## When to interview the human
48
-
49
- `imf-web-ui-ux` contains a short per-feature interview. Run it **only** when both hold:
50
-
51
- 1. The request is foggy — you couldn't say what the primary action of the screen is, who uses it, or what data it shows.
52
- 2. A human is available to answer.
53
-
54
- Never interview when a spec, mockup, or clear instruction exists — asking questions the conversation already answered is
55
- worse than not asking at all. When in doubt and no human is around, make the conservative choice, and say which assumptions
56
- you made.
45
+ For a vague screen or flow, use the short interview in `imf-web-ui-ux`. Do not ask questions the prompt, a spec, or the
46
+ repository already answers.
@@ -1,119 +1,67 @@
1
1
  ---
2
2
  name: imf-web-ui-audit
3
3
  description:
4
- "Read-only health check for an ImFusion frontend against the conventions baseline. Audit the full project or any topic,
5
- including library-setup, tooling, git, npm-project, authentication, project-structure, docs-structure, data, testing,
6
- React, TypeScript, class names, validation, components, styling, assets, library-boundary, and tokens. Reports broken
7
- pieces, missing pieces, working deviations, present evidence, and unverified state, then turns them into an actionable
8
- plan."
4
+ "Audit an existing ImFusion frontend against the @imfusion/web-ui conventions without changing files. Use this for a
5
+ project health check, a pre-setup review, or one named topic. Report broken and missing pieces, working deviations,
6
+ evidence, and an ordered plan."
9
7
  argument-hint: "[full|<topic>]"
10
8
  allowed-tools: Read Glob Grep
11
9
  ---
12
10
 
13
- # imf-web-ui-audit
11
+ # Audit a consumer project
14
12
 
15
- You are the frontend health-check auditor, and you run as an orchestrator: one investigator per topic gathers the evidence,
16
- you merge their findings and turn them into an actionable plan. Follow the applicable `imf-web-ui-conventions` topics, cite
17
- repository evidence, distinguish defects from working deviations, and never present the baseline as universal best practice.
18
-
19
- An audit belongs in plan mode: it ends in work to approve, not in files to write.
13
+ This is a read-only audit. Compare the project with the selected `imf-web-ui-conventions` topics, report evidence, and end
14
+ with work the human can approve. The baseline is an ImFusion default, not a universal law; a deliberate project choice is a
15
+ deviation, not a defect.
20
16
 
21
17
  ## Workflow
22
18
 
23
- 1. Resolve the argument. Bare means `full`; a topic selects one row below. If no topic matches, list every available topic
24
- instead of guessing or widening the scope.
25
- 2. Enter the host's plan mode, unless one of the exceptions after step 5 applies. If plan mode is not already active, use the
26
- host plan-mode control before dispatching anything.
27
- 3. Dispatch one investigator per in-scope topic, using the host's subagent mechanism, as concurrently as the host allows.
28
- Investigators are cheap and narrow: each one gets a single topic and reports back. A host with no subagent mechanism is
29
- not a blocker — work the topics inline in this session, in the same order, to the same contract.
30
- 4. Merge what comes back. Findings you did not gather yourself are the report; do not re-inspect files an investigator
31
- covered. Reconcile conflicts by reading the cited evidence, and drop any finding whose citation does not hold.
32
- 5. Deliver the merged report and the plan in the host plan, from the shared report contract at
33
- [`../imf-web-ui-conventions/templates/REPORT.md`](../imf-web-ui-conventions/templates/REPORT.md), with the mode label
34
- `audit`. The plan's ordered steps are the `Next action` lines of the findings, grouped by topic and cheapest-first;
35
- `Present` findings produce no steps.
36
-
37
- Some runs take the report somewhere other than a plan. When the human asks for the durable file, or the host has no plan
38
- mode, write the same content to `AUDIT_REPORT.md` and preserve everything under `## Reviewer notes` verbatim. When another
39
- skill invokes the audit as its verification step, report the findings to that caller and stay out of plan mode — the caller
40
- owns the flow, and the human has usually just left plan mode to let its work happen.
41
-
42
- ## Dispatching an investigator
43
-
44
- Each investigator prompt carries, in full:
45
-
46
- - the topic name and the path of its convention topic file;
47
- - the topic's block from the shared [convention audit checklist](../imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md), and
48
- the instruction to check every box in it;
49
- - the safety constraint below, verbatim — an investigator that reaches for a shell breaks the audit's only guarantee;
50
- - the report contract's entry format, so findings arrive mergeable: severity, reference, short title, `path:line` evidence,
51
- impact, next action;
52
- - the instruction to report findings back as its result and write no files.
53
-
54
- An investigator reports on its topic alone. Anything it notices outside that topic goes back as a note for the orchestrator
55
- to route, not as a finding it rules on.
56
-
57
- ## Checklist
58
-
59
- The shared [convention audit checklist](../imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md) is the working checklist: a
60
- full audit covers every block, a scoped audit covers the requested block plus its dependencies. The audit is not complete
61
- until every in-scope box has been checked by the investigator that owns it and its evidence appears in the report. The
62
- checklist itself is not edited during an audit.
19
+ 1. Resolve the argument. Bare means `full`; an unknown topic is an error, not a reason to widen the scope.
20
+ 2. Enter plan mode unless this audit is being called as verification by another skill or the host has no plan mode.
21
+ 3. Assign one investigator to each in-scope topic. An investigator checks every section in that topic and writes nothing. If
22
+ the host cannot dispatch agents, inspect the topics inline in the same order.
23
+ 4. Merge the evidence into the shared report format in
24
+ [`templates/REPORT.md`](../imf-web-ui-conventions/templates/REPORT.md).
25
+ 5. Put each finding's `Next action` into an ordered plan, grouped by topic and cheapest first. Present the report and wait
26
+ for approval; an audit does not edit the project.
63
27
 
64
- ## Safety
28
+ If the caller needs a durable report, write `AUDIT_REPORT.md` and preserve everything under `## Reviewer notes` verbatim.
29
+
30
+ ## Finding format
65
31
 
66
- Use only static inspection: Read, Glob, Grep, and equivalent non-executing search tools. Do not use a shell or invoke Node,
67
- npm, npx, package scripts, hooks, config imports, linters, tests, builds, Git commands, or project binaries. Read config as
68
- text and report runtime or machine-local state that cannot be established statically as unverified. This binds every
69
- investigator too — a dispatched agent inherits the audit's constraint, not the host's default freedom, so the prompt that
70
- dispatches it repeats this paragraph verbatim.
32
+ Classify every result as one of these:
71
33
 
72
- An audit writes at most one file: `AUDIT_REPORT.md`, in the two cases named in the workflow. Investigators write nothing.
73
- Neither Write nor the host's dispatch tool is pre-approved in `allowed-tools` — `allowed-tools` names what an audit needs on
74
- every run, and both of these follow the host's ordinary approval when a run needs them. Host-managed hooks may run after that
75
- write; the skill neither invokes nor suppresses them, but it does report broken or unexpected hook behavior found during
76
- static inspection.
34
+ - **Broken**: the project violates a rule in a way that blocks or risks the work.
35
+ - **Missing**: a required piece is absent.
36
+ - **Deviation**: the project works differently from the baseline.
37
+ - **Present**: the rule is met, with evidence.
38
+ - **Unverified**: static inspection cannot establish it.
39
+
40
+ Use the report contract's severity, `path:line` evidence, concrete impact, and smallest next action. Do not promote an
41
+ optional tool or a working alternative to a missing finding.
77
42
 
78
43
  ## Topics
79
44
 
80
- | Topic | Assess |
81
- | ------------------- | ------------------------------------------------------------------------------ |
82
- | `library-setup` | styles import, `WebUIProvider`, and library package wiring |
83
- | `library-boundary` | imports, wrappers, type derivation, and peer boundaries |
84
- | `react` | component roles, state ownership, and effects discipline |
85
- | `components` | component folders, anatomy, and colocation |
86
- | `typescript` | functional style, types, and naming |
87
- | `styling` | CSS Modules, tokens, and prohibited styling systems |
88
- | `tokens` | names, authored default values, and families from the shipped token index |
89
- | `class-names` | CVA variants, `cx`, and incoming `className` handling |
90
- | `validation` | runtime schemas, boundary parsing, and derived types |
91
- | `data` | transport, schemas, query/mutation options, keys, and invalidation |
92
- | `authentication` | current-user query, public/app guards, login, and logout |
93
- | `project-structure` | source tree, route groups, optional app shell, naming, and imports |
94
- | `testing` | test boundaries and verification coverage |
95
- | `npm-project` | package metadata, scripts, pins, npm, and Node configuration |
96
- | `tooling` | dependency selection, devtools, Prettier, ESLint, TypeScript, and verification |
97
- | `git` | tracked hooks, verification scopes, and staleness wiring |
98
- | `assets` | image formats and static asset handling |
99
- | `docs-structure` | README, AGENTS, docs index, and content boundaries |
100
- | `agent-tooling` | installed skills, AGENTS fence, lifecycle hooks, registrations, staleness |
101
-
102
- Report everything within the selected topic: defects and working deviations alike, with no severity-based filtering.
103
-
104
- ## Agent-tooling assessment reference
105
-
106
- The baseline is the conventions [agent-tooling topic](../imf-web-ui-conventions/topics/agent-tooling.md): the complete bundle
107
- with matching version markers, the AGENTS fence, and the lifecycle hooks installed and registered for both hosts
108
- (`.claude/settings.json` and `.codex/hooks.json`) or consciously adapted. Hooks or registrations beyond the shipped set — the
109
- three injection hooks, the stop gate, plus `baseline-staleness.sh` — are drift, and the tracked pre-commit path calls
110
- `baseline-staleness.sh`. Read files and settings as text—do not run installers, hooks, or local config queries during
111
- assessment.
112
-
113
- Version drift is part of this topic: compare the declared version in `package.json`, the installed
114
- `node_modules/@imfusion/web-ui/package.json`, and every `.imf-web-ui-skill-version.json` marker, then report the drift and
115
- point at `imf-web-ui-update`. The registry is unreachable from a static audit, so a line saying that a newer version may
116
- exist is unverified.
117
-
118
- Use the shared report template as the report contract. It defines the headings, ordering, empty-section marker, evidence
119
- format, and reviewer-note preservation rules; do not duplicate that contract here.
45
+ `full` covers all of these; a named argument covers one:
46
+
47
+ `library-setup`, `library-boundary`, `react`, `components`, `typescript`, `styling`, `tokens`, `class-names`, `validation`,
48
+ `data`, `authentication`, `project-structure`, `testing`, `npm-project`, `tooling`, `git`, `assets`, `docs-structure`, and
49
+ `agent-tooling`.
50
+
51
+ Read the corresponding topic and the matching block in
52
+ [`templates/AUDIT_CHECKLIST.md`](../imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md). The audit is incomplete until every
53
+ in-scope box has evidence.
54
+
55
+ ## Agent tooling checks
56
+
57
+ For `agent-tooling`, compare the declared version in `package.json`, the installed
58
+ `node_modules/@imfusion/web-ui/package.json`, every `.imf-web-ui-skill-version.json` marker, the `AGENTS.md` fence, hook
59
+ scripts, and both host registrations with the shipped topic. Version drift, extra hooks, stale markers, and missing
60
+ registrations are findings; point version drift to `imf-web-ui-update`. Registry availability is unverified. Read files as
61
+ text; do not run installers or hooks.
62
+
63
+ ## Safety
64
+
65
+ Use only `Read`, `Glob`, `Grep`, and equivalent static inspection. Do not run Git, shells, Node, npm, npx, package scripts,
66
+ linters, tests, builds, hooks, or imported config. Report runtime state as unverified. Investigators inherit this
67
+ restriction.
@@ -1,113 +1,62 @@
1
1
  ---
2
2
  name: imf-web-ui-components
3
3
  description:
4
- "Look up @imfusion/web-ui component APIs and icon glyphs without reading source. Load when you need a component's props,
5
- sub-components, defaults, or a supplied icon — not for choosing between components (imf-web-ui-ux) or first-time setup
6
- (imf-web-ui-setup library-setup)."
4
+ "Look up @imfusion/web-ui component APIs, compound parts, defaults, and icon glyphs without reading source. Use this
5
+ whenever a consumer task names a Web UI component or icon and you need to choose a prop, part, default, or glyph. Do not
6
+ use it to choose between components or bootstrap a project."
7
7
  allowed-tools: Bash
8
8
  ---
9
9
 
10
- # imf-web-ui-components
10
+ # Look up components
11
11
 
12
- `@imfusion/web-ui` ships two generated files inside `node_modules` so an agent can discover and use its components without
13
- reading source or checking out the library's repo:
12
+ Use the generated package indexes. They are smaller and more reliable than reading the library source.
14
13
 
15
- - **`node_modules/@imfusion/web-ui/src/llms/llms.gen.txt`** — an identity index: every component's name, category, status,
16
- and a one-sentence description of what it's for and what else it's called.
17
- - **`node_modules/@imfusion/web-ui/src/docgen/doc.gen.json`** — full prop tables (name, type, default, description) for every
18
- component, keyed by kebab-case folder name.
19
- - **`node_modules/@imfusion/web-ui/src/llms/icon-catalog.gen.json`** — searchable icon names, styles, categories, and tags.
20
- Read it only when the task needs an icon.
14
+ ## Component lookup
21
15
 
22
- Neither file is reachable through the package's pretty import paths (`@imfusion/web-ui/llms.txt`,
23
- `@imfusion/web-ui/docgen.json`) — those are Node module-resolution aliases, meaningless to `cat`/`jq`/`grep` reading files
24
- off disk. Use the `node_modules/...` paths above directly.
16
+ 1. Read the identity index:
25
17
 
26
- ## The lookup, in two hops
18
+ ```sh
19
+ cat node_modules/@imfusion/web-ui/src/llms/llms.gen.txt
20
+ ```
27
21
 
28
- **Hop 1 — find the component.** Read the whole index; it's small (~13KB for the full library) and safe to load in full:
22
+ It lists each component's name, category, status, purpose, and docgen entry.
29
23
 
30
- ```sh
31
- cat node_modules/@imfusion/web-ui/src/llms/llms.gen.txt
32
- ```
24
+ 2. Read only the matching entry from docgen:
33
25
 
34
- Each entry looks like this:
26
+ ```sh
27
+ jq '.button' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json
28
+ ```
35
29
 
36
- ```
37
- ## Button
38
- - category: Buttons, status: stable
39
- Triggers an action — submit, confirm, cancel, navigate, or destructive operations. Six semantic variants ...
40
- - props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .button (jq: jq '.button' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
41
- - further reading (usage/anatomy, not props): https://base-ui.com/react/components/button.md
42
- ```
30
+ Replace `.button` with the kebab-case key from the identity index. The result contains `root` and `subComponents`, with
31
+ each prop's type, default, and description.
43
32
 
44
- **Hop 2 — pull that component's props.** Don't read the whole docgen file (~500KB across all components) — slice out just the
45
- one entry with the exact command the index gave you:
33
+ If `jq` is unavailable, use Node without loading the whole file into the conversation:
46
34
 
47
- ```sh
48
- jq '.button' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json
49
- ```
50
-
51
- That returns `{ root: { name, description, props: [...] }, subComponents: [...] }`. `root` is the primary export (`Button`);
52
- `subComponents` holds compound parts (e.g. `Drawer.Root`, `Drawer.Trigger`, `Drawer.Content` all live under the `drawer`
53
- key). Match the sub-component you need by its dotted `name`.
54
-
55
- **`jq` may not be installed.** Check with `which jq` before relying on it. If it's missing, do **not** fall back to reading
56
- the whole `doc.gen.json` file — that defeats the entire point of the two-hop design (~500KB across all components vs. one
57
- ~9KB entry) and will burn your context budget for no reason. Use whatever's actually available instead:
58
-
59
- ```sh
60
- node -e "console.log(JSON.stringify(JSON.parse(require('fs').readFileSync('node_modules/@imfusion/web-ui/src/docgen/doc.gen.json','utf8')).button, null, 2))"
61
- ```
35
+ ```sh
36
+ node -e "console.log(JSON.stringify(JSON.parse(require('fs').readFileSync('node_modules/@imfusion/web-ui/src/docgen/doc.gen.json','utf8')).button, null, 2))"
37
+ ```
62
38
 
63
- (Node ships everywhere this package can be installed, so this always works as a fallback.) Or ask the user to install `jq` if
64
- you expect to look up several components in one session.
39
+ Use `doc.gen.json` for Web UI props. A linked upstream page is useful for behavior, composition, and accessibility, but its
40
+ prop table is not authoritative for this package.
65
41
 
66
- **"Further reading" links, if present, are not a props source.** They point at the upstream library's (usually Base UI's) own
67
- documentation for composition, anatomy, keyboard/focus behavior, and accessibility notes docgen can't express. Props always
68
- come from `doc.gen.json` — never treat the linked page's prop table as authoritative for a web-ui component; web-ui may add,
69
- remove, or default differently.
42
+ ## If the component is missing
70
43
 
71
- ## A component not found in the index?
72
-
73
- The index is regenerated on every `@imfusion/web-ui` release; it should be exhaustive. If a component you expect is missing,
74
- don't guess at an API — that's a real gap to report, not something to work around by inventing props. Tell the web-ui
75
- maintainer, or file it in the [WEBSDK Jira project](https://imfusion.atlassian.net/browse/WEBSDK) if you have access. If the
76
- gap is about _which_ component to use rather than a missing one, that's a design question: open `imf-web-ui-ux`.
44
+ Treat a missing identity-index entry as a real gap. Do not invent an API or silently import the upstream component. Report
45
+ the gap to the Web UI maintainer. If the question is which existing component fits, use `imf-web-ui-ux` instead.
77
46
 
78
47
  ## Icons
79
48
 
80
- When the task mentions an icon, glyph, symbol, or `@imfusion/web-ui/icons`, query the icon catalog before choosing a name. Do
81
- not load it for ordinary component work.
82
-
83
- Search one relevant term at a time, then read only the matching records:
49
+ When the task needs an icon, search the generated catalog before choosing a name:
84
50
 
85
51
  ```sh
86
52
  node -e '
87
53
  const q = process.argv[1].toLowerCase();
88
- const icons = JSON.parse(
89
- require("fs").readFileSync(
90
- "node_modules/@imfusion/web-ui/src/llms/icon-catalog.gen.json",
91
- "utf8"
92
- )
93
- );
94
- console.log(
95
- JSON.stringify(
96
- icons
97
- .filter(icon => [icon.name, icon.category, ...icon.tags]
98
- .join(" ")
99
- .toLowerCase()
100
- .includes(q))
101
- .slice(0, 20),
102
- null,
103
- 2
104
- )
105
- );
54
+ const icons = JSON.parse(require("fs").readFileSync("node_modules/@imfusion/web-ui/src/llms/icon-catalog.gen.json", "utf8"));
55
+ console.log(JSON.stringify(icons.filter(icon => [icon.name, icon.category, ...icon.tags].join(" ").toLowerCase().includes(q)).slice(0, 20), null, 2));
106
56
  ' "add"
107
57
  ```
108
58
 
109
- Import the chosen glyph and `Icon` from `@imfusion/web-ui/icons`. Render it through `Icon`, including when it inherits the
110
- surrounding color:
59
+ Import the glyph and `Icon` from the Web UI icons entry. Always render the glyph through `Icon`:
111
60
 
112
61
  ```tsx
113
62
  import { ArrowRight, Icon } from "@imfusion/web-ui/icons";
@@ -115,39 +64,33 @@ import { ArrowRight, Icon } from "@imfusion/web-ui/icons";
115
64
  <Icon glyph={ArrowRight} aria-hidden />;
116
65
  ```
117
66
 
118
- Use `Icon` for every rendered icon. Pass the component reference, not a rendered element:
67
+ Do not import `iconoir-react` or another icon package directly.
119
68
 
120
- ```tsx
121
- import { ArrowRight, Icon } from "@imfusion/web-ui/icons";
69
+ ## Compound components
122
70
 
123
- <Icon glyph={ArrowRight} size={16} variant="primary" aria-label="Continue" role="img" />;
124
- ```
71
+ A non-empty `subComponents` array means the component is a namespace:
125
72
 
126
- Never import `iconoir-react` or another icon package directly.
73
+ ```tsx
74
+ import { Drawer } from "@imfusion/web-ui";
127
75
 
128
- ## Compound components
76
+ <Drawer.Root>
77
+ <Drawer.Trigger>Open</Drawer.Trigger>
78
+ <Drawer.Content>…</Drawer.Content>
79
+ </Drawer.Root>;
80
+ ```
129
81
 
130
- A component whose docgen entry has a non-empty `subComponents` array is used as a namespace, not a single import — e.g.
131
- `import { Drawer } from "@imfusion/web-ui"` then `<Drawer.Root>`, `<Drawer.Trigger>`, `<Drawer.Content>`. The index's
132
- category/description covers the whole family; look at `subComponents` in the docgen entry to see which parts exist and what
133
- each one's own props are.
82
+ Use the identity index for the family description and the docgen entry for each part's props.
134
83
 
135
- ## Integrations (own-entry components)
84
+ ## Integrations
136
85
 
137
- A description mentioning "Imported from `@imfusion/web-ui/integrations/<name>`" is a signal this component isn't in the
138
- default import — e.g.:
86
+ A component whose identity entry says it comes from `@imfusion/web-ui/integrations/*` is not in the main import. Install the
87
+ listed optional peer explicitly, then import from that path:
139
88
 
140
89
  ```tsx
141
90
  import { Code } from "@imfusion/web-ui/integrations/code-highlight";
142
91
  ```
143
92
 
144
- These exist because their behavior depends on an optional peer dependency (e.g. `@tanstack/highlight` for `CodeHighlight`)
145
- that most consumers shouldn't be forced to install. Check the component's description for which peer to add, and add it
146
- explicitly to your own `package.json` — web-ui does not install it for you.
147
-
148
- ## Data grids (Table + a headless library)
93
+ ## Data grids
149
94
 
150
- For a data grid, drive the styled `Table` parts with a headless table library you install yourself. **TanStack Table**
151
- (`@tanstack/react-table`) is recommended. Map your `useReactTable` instance onto `Table.Root` / `Table.Header` / `Table.Row`
152
- / `Table.Cell`, and use `Table.SortableHeaderCell` for sortable columns — it carries the `aria-sort` state and the sort
153
- indicator. See the Table primitive's Storybook docs for the pairing.
95
+ `Table` supplies styled table parts, not sorting or pagination. Pair them with a headless table library installed by the
96
+ consumer. TanStack Table is the recommended choice. Use `Table.SortableHeaderCell` for sortable columns.
@@ -1,57 +1,44 @@
1
1
  ---
2
2
  name: imf-web-ui-conventions
3
3
  description:
4
- "The ImFusion frontend conventions baseline — in-house conventions, valid in every ImFusion frontend and usable by anyone
5
- who likes them. A router over topic references: library setup, library boundary, React, components, TypeScript, styling,
6
- tokens, validation, data layer, authentication, project structure, testing, tooling, npm project, git, agent tooling,
7
- assets, and docs structure. Load when writing wrapper components, custom UI, styling beyond the defaults, validating
8
- external data, adding new files to a consumer app, writing repo docs, touching tool config, choosing any dependency, or
9
- installing the vendored skills and lifecycle hooks."
4
+ "Apply the ImFusion frontend conventions to consumer code. Use this whenever a task writes a wrapper or custom UI, CSS,
5
+ TypeScript, data fetching, validation, tests, project files, configuration, documentation, dependencies, or agent tooling
6
+ in a project that uses @imfusion/web-ui. Read only the topic references that match the task."
10
7
  ---
11
8
 
12
- # imf-web-ui-conventions
13
-
14
- The ImFusion frontend baseline. In-house conventions, not industry claims — they encode how ImFusion frontends are built, and
15
- anyone else is welcome to them.
16
-
17
- **The project wins.** These defaults fill vacuums: if the host project already has a convention — a styling system, a state
18
- library, a folder shape — that stands. They are not a license to refactor a consumer codebase toward this document.
19
-
20
- When a project has an established convention, it wins. The audit skill records a working difference as a deviation; the setup
21
- skill proposes only the changes the project asks it to make.
22
-
23
- ## The topics
24
-
25
- Each topic lives in one reference. Read the one whose moment you're in; starting a new feature usually wants several.
26
-
27
- | Reference | Covers | Read when |
28
- | --------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------- |
29
- | [library-setup.md](topics/library-setup.md) | styles import, `WebUIProvider`, and broken library wiring | installing or repairing library wiring |
30
- | [library-boundary.md](topics/library-boundary.md) | staying behind `@imfusion/web-ui`, wrappers, type derivation, peers | touching anything that renders library components |
31
- | [authentication.md](topics/authentication.md) | current-user source, public/app guards, login and logout | setting up or reviewing route protection |
32
- | [react.md](topics/react.md) | component roles, state kinds and owners, effects discipline | writing new screens, components, or wrappers |
33
- | [components.md](topics/components.md) | component anatomy on disk: grouping, folders, colocation | adding a component file |
34
- | [typescript.md](topics/typescript.md) | functional style, types, naming | writing any code |
35
- | [styling.md](topics/styling.md) | native CSS Modules, tokens, the override contract | writing CSS or styling beyond the defaults |
36
- | [tokens.md](topics/tokens.md) | shipped CSS-variable names grouped by family | choosing a design token |
37
- | [class-names.md](topics/class-names.md) | CVA variants, `cx`, merging the incoming `className` | writing a component with variants or a `className` prop |
38
- | [validation.md](topics/validation.md) | runtime schemas, boundary parsing, schema-derived types | accepting data the frontend does not own |
39
- | [data.md](topics/data.md) | `api/`+`http/` shape, query/mutation patterns and invalidation | adding an API topic, a fetch, or a mutation |
40
- | [project-structure.md](topics/project-structure.md) | the `src/` tree, route groups, file naming, imports | adding files rather than editing existing ones |
41
- | [testing.md](topics/testing.md) | what's worth testing and what isn't | writing or reviewing tests |
42
- | [tooling.md](topics/tooling.md) | the topic→tool map, tool configuration, and verification | choosing a dependency or touching tool config |
43
- | [npm-project.md](topics/npm-project.md) | `package.json`, the `verify:*` script set, dependency pinning | running or adding a script, adding a dependency |
44
- | [git.md](topics/git.md) | `git:config`, verify scopes, staleness at commit time | wiring hooks or the commit path |
45
- | [agent-tooling.md](topics/agent-tooling.md) | vendored skills, lifecycle hooks, registrations, Codex trust | installing or reviewing the shipped agent tooling |
46
- | [assets.md](topics/assets.md) | image formats, the WebP recipe | adding images or other static assets |
47
- | [docs-structure.md](topics/docs-structure.md) | what a repo documents, where, how it's written | writing or restructuring repo docs |
48
-
49
- ## Topic format
50
-
51
- Topics are manifests, not essays: `##` sections group rule bullets, and each section is one auditable unit. A rule is one
52
- imperative bullet; only a pushback-prone rule carries a one-line why. Snippets illustrate rules, prose never replaces them.
53
- Each topic's `##` sections map 1:1 to its block in [templates/AUDIT_CHECKLIST.md](templates/AUDIT_CHECKLIST.md) — add,
54
- remove, or rename a section and the checklist follows in the same change.
55
-
56
- `imf-web-ui-setup` proposes approved bootstrap changes, while `imf-web-ui-audit` reports the current state against this
57
- baseline.
9
+ # Frontend conventions
10
+
11
+ These are ImFusion defaults, not claims about every frontend. A host project's working choice wins. Use these topics to fill
12
+ a gap or to make a deliberate deviation visible; do not refactor a project just to match the baseline.
13
+
14
+ ## Choose a topic
15
+
16
+ | Topic | Read when |
17
+ | ------------------------------------------------ | --------------------------------------------------------------- |
18
+ | [library-setup](topics/library-setup.md) | Installing or repairing stylesheet and provider wiring. |
19
+ | [library-boundary](topics/library-boundary.md) | Rendering Web UI components, wrapping them, or choosing a peer. |
20
+ | [authentication](topics/authentication.md) | Protecting routes or defining login and logout. |
21
+ | [react](topics/react.md) | Designing component roles, state ownership, or effects. |
22
+ | [components](topics/components.md) | Adding files or deciding component anatomy. |
23
+ | [typescript](topics/typescript.md) | Writing TypeScript or naming values. |
24
+ | [styling](topics/styling.md) | Writing CSS or customizing Web UI. |
25
+ | [tokens](topics/tokens.md) | Choosing an exact token name. |
26
+ | [class-names](topics/class-names.md) | Mapping variants and `className` to CSS. |
27
+ | [validation](topics/validation.md) | Accepting data from outside the frontend. |
28
+ | [data](topics/data.md) | Adding API queries, mutations, or invalidation. |
29
+ | [project-structure](topics/project-structure.md) | Adding files or routes. |
30
+ | [testing](topics/testing.md) | Deciding what to test. |
31
+ | [tooling](topics/tooling.md) | Adding a dependency or configuring a tool. |
32
+ | [npm-project](topics/npm-project.md) | Changing `package.json`, scripts, pins, or Node. |
33
+ | [git](topics/git.md) | Configuring hooks or choosing verification scope. |
34
+ | [agent-tooling](topics/agent-tooling.md) | Installing skills or lifecycle hooks. |
35
+ | [assets](topics/assets.md) | Adding images, icons, or other static files. |
36
+ | [docs-structure](topics/docs-structure.md) | Writing or reorganizing repository docs. |
37
+
38
+ ## How to use the topics
39
+
40
+ Read the relevant file instead of loading the whole set. Each topic is a short checklist: follow its rules, use its examples
41
+ as patterns, and keep any exception explicit in the host project.
42
+
43
+ `imf-web-ui-setup` uses these topics to plan approved project changes. `imf-web-ui-audit` uses them to report the current
44
+ state without changing files.
@@ -58,6 +58,7 @@ sections one to one — change a topic's sections and this file follows in the s
58
58
  - [ ] Build custom UI from tokens
59
59
  - [ ] Override through the sanctioned seams
60
60
  - [ ] The color system
61
+ - [ ] Browser floor
61
62
  - [ ] Responsive styling
62
63
 
63
64
  ## Tokens — `tokens`