@imfusion/web-ui 0.8.0 → 0.8.1-dev.17.gcbf0282e

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 (32) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +17 -17
  3. package/dist/components/account-card/account-card.d.ts +83 -0
  4. package/dist/components/account-card/account-card.meta.d.ts +2 -0
  5. package/dist/components/account-card/index.d.ts +2 -0
  6. package/dist/components/avatar/avatar.d.ts +40 -0
  7. package/dist/components/avatar/avatar.meta.d.ts +2 -0
  8. package/dist/components/avatar/index.d.ts +2 -0
  9. package/dist/components/card/card.d.ts +15 -1
  10. package/dist/components/field/field.d.ts +5 -2
  11. package/dist/components/typo/typo.d.ts +5 -0
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.js +1251 -998
  14. package/dist/llms/evals/runner/config.d.ts +1 -0
  15. package/dist/style.css +1 -1
  16. package/dist/utils/break-hints.d.ts +3 -0
  17. package/dist/utils/status-glyphs.d.ts +4 -0
  18. package/docs/user-guide/AgentTooling.mdx +8 -3
  19. package/package.json +1 -1
  20. package/src/docgen/doc.gen.json +262 -1
  21. package/src/llms/llms.gen.txt +12 -1
  22. package/src/llms/skills/imf-web-ui/SKILL.md +2 -0
  23. package/src/llms/skills/imf-web-ui-audit/SKILL.md +5 -3
  24. package/src/llms/skills/imf-web-ui-components/SKILL.md +3 -1
  25. package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +1 -0
  26. package/src/llms/skills/imf-web-ui-conventions/topics/authentication.md +2 -1
  27. package/src/llms/skills/imf-web-ui-conventions/topics/data.md +5 -3
  28. package/src/llms/skills/imf-web-ui-conventions/topics/typescript.md +14 -0
  29. package/src/llms/skills/imf-web-ui-setup/SKILL.md +2 -0
  30. package/src/llms/skills/imf-web-ui-update/SKILL.md +37 -6
  31. package/src/llms/skills/imf-web-ui-user-profile/SKILL.md +95 -0
  32. package/src/llms/skills/imf-web-ui-ux/SKILL.md +2 -0
@@ -0,0 +1,3 @@
1
+ import { ReactNode } from 'react';
2
+ /** Inserts `<wbr>` before each `@` and after each `.` of string children, so an email wraps at its seams. */
3
+ export declare function withBreakHints(children: ReactNode): ReactNode;
@@ -0,0 +1,4 @@
1
+ import { IconComponent } from '../icons';
2
+ export type Status = "info" | "positive" | "warning" | "negative";
3
+ /** The glyph each status shows wherever a component marks it with an icon. */
4
+ export declare const statusGlyphs: Record<Status, IconComponent>;
@@ -55,8 +55,12 @@ With the hooks installed, the agent is pointed at the router at the start of eve
55
55
  picks it up from the skill's description; invoke it by name when it does not.
56
56
 
57
57
  The router answers library questions from the packaged user guides and hands other tasks to a skill. Setup, audit, and UX
58
- work from `imf-web-ui-conventions`, a knowledge skill that holds the ImFusion frontend conventions. Solid outlines are the
59
- skills you run; dashed boxes are knowledge the agent reads:
58
+ work from `imf-web-ui-conventions`, a knowledge skill that holds the ImFusion frontend conventions. Every skill
59
+ you run first reads `imf-web-ui-user-profile`. On the first run it asks a few questions about your name, your
60
+ background, your experience, how much explanation you want, and how you like to work, then saves the answers to
61
+ `~/.config/imfusion/web-ui/consumer-profile.md` if you agree. Say "change my profile" to answer again.
62
+
63
+ Solid outlines are the skills you run; dashed boxes are knowledge the agent reads:
60
64
 
61
65
  <ConsumerLlmFrameworkDiagram />
62
66
 
@@ -83,7 +87,8 @@ The hooks put the agent on the right skill at the right moment and ask it to ver
83
87
  ## Keeping it current
84
88
 
85
89
  Ask the agent to update the library, for example "Update @imfusion/web-ui". That runs `/imf-web-ui-update`, which installs
86
- the newer package and refreshes the skills, hook scripts, and registrations to match it.
90
+ the newer package and refreshes the skills, hook scripts, and registrations to match it. It then reports what the new
91
+ releases change for your code and offers `/imf-web-ui-audit full` as a wider check of the project.
87
92
 
88
93
  To do the same by hand, update the package, then run:
89
94
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imfusion/web-ui",
3
- "version": "0.8.0",
3
+ "version": "0.8.1-dev.17.gcbf0282e",
4
4
  "description": "The official Web UI component library for ImFusion web apps",
5
5
  "author": "ImFusion GmbH",
6
6
  "homepage": "https://imfusion.com",
@@ -1,4 +1,91 @@
1
1
  {
2
+ "account-card": {
3
+ "root": {
4
+ "name": "AccountCard.Root",
5
+ "description": "AccountCard.Root — the signed-in person's card: `AccountCard.Link` and, in its top row, `AccountCard.Action`. The\naction sits beside the link, not inside it, since a link cannot contain a button.",
6
+ "props": [
7
+ {
8
+ "name": "context",
9
+ "required": false,
10
+ "type": "\"default\" | \"oncolor\" | null",
11
+ "defaultValue": "default",
12
+ "description": ""
13
+ }
14
+ ]
15
+ },
16
+ "subComponents": [
17
+ {
18
+ "name": "AccountCard.Action",
19
+ "description": "AccountCard.Action — a slot in the card's top row, beside the link, such as a ghost icon `Button` that logs out. The\nbutton carries its own `aria-label` and its own `context`.",
20
+ "props": []
21
+ },
22
+ {
23
+ "name": "AccountCard.Avatar",
24
+ "description": "AccountCard.Avatar — a decorative `Avatar` in the card's context. Its children are the initials; without them it shows\na person glyph.",
25
+ "props": [
26
+ {
27
+ "name": "size",
28
+ "required": false,
29
+ "type": "\"sm\" | \"md\" | \"lg\" | null",
30
+ "defaultValue": "md",
31
+ "description": "The avatar size."
32
+ },
33
+ {
34
+ "name": "src",
35
+ "required": false,
36
+ "type": "string",
37
+ "defaultValue": null,
38
+ "description": "The person's photo. Until it loads, and when it fails, the initials or the person glyph show instead."
39
+ }
40
+ ]
41
+ },
42
+ {
43
+ "name": "AccountCard.Description",
44
+ "description": "AccountCard.Description — the organization, under a rule at the foot of the card.",
45
+ "props": []
46
+ },
47
+ {
48
+ "name": "AccountCard.Group",
49
+ "description": "AccountCard.Group — a list of cards, such as accounts to switch between. Inside it a link with `aria-current=\"page\"`\nshows as current; a standalone card is always the signed-in account and shows no current state.",
50
+ "props": []
51
+ },
52
+ {
53
+ "name": "AccountCard.Link",
54
+ "description": "AccountCard.Link — the link to the account, holding `AccountCard.Avatar`, `AccountCard.Title`,\n`AccountCard.Subtitle`, `AccountCard.Description`, and `AccountCard.Role`. Pass a router link through `render`. Its\naccessible name is its text; the avatar stays decorative.",
55
+ "props": [
56
+ {
57
+ "name": "ref",
58
+ "required": false,
59
+ "type": "Ref<HTMLAnchorElement>",
60
+ "defaultValue": null,
61
+ "description": "Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}"
62
+ },
63
+ {
64
+ "name": "render",
65
+ "required": false,
66
+ "type": "| ReactElement<\n unknown,\n string | JSXElementConstructor<any>\n >\n| ComponentRenderFn<HTMLProps, {}>",
67
+ "defaultValue": null,
68
+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
69
+ }
70
+ ]
71
+ },
72
+ {
73
+ "name": "AccountCard.Role",
74
+ "description": "AccountCard.Role — a mono uppercase label beside the description, such as the person's role.",
75
+ "props": []
76
+ },
77
+ {
78
+ "name": "AccountCard.Subtitle",
79
+ "description": "AccountCard.Subtitle — the quiet line under the title: the email's domain, or the whole email once the title is a\nname. Text wraps before an `@` and after a dot.",
80
+ "props": []
81
+ },
82
+ {
83
+ "name": "AccountCard.Title",
84
+ "description": "AccountCard.Title — the account's name, or the email's local part until a name exists. Set large; text wraps before\nan `@` and after a dot.",
85
+ "props": []
86
+ }
87
+ ]
88
+ },
2
89
  "app-shell": {
3
90
  "root": {
4
91
  "name": "AppShell.Root",
@@ -62,6 +149,140 @@
62
149
  }
63
150
  ]
64
151
  },
152
+ "avatar": {
153
+ "root": {
154
+ "name": "Avatar.Root",
155
+ "description": "Avatar.Root — a round badge that stands for a person. Also called a profile picture or user badge.\n\nWithout `aria-label` or `aria-labelledby` it is decorative and hidden from assistive tech, for use next to a visible\nname. With a label it is announced as an image with that name.",
156
+ "props": [
157
+ {
158
+ "name": "className",
159
+ "required": false,
160
+ "type": "string | ((state: AvatarRootState) => string)",
161
+ "defaultValue": null,
162
+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."
163
+ },
164
+ {
165
+ "name": "context",
166
+ "required": false,
167
+ "type": "\"default\" | \"oncolor\" | null",
168
+ "defaultValue": "default",
169
+ "description": ""
170
+ },
171
+ {
172
+ "name": "ref",
173
+ "required": false,
174
+ "type": "Ref<HTMLSpanElement>",
175
+ "defaultValue": null,
176
+ "description": "Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}"
177
+ },
178
+ {
179
+ "name": "render",
180
+ "required": false,
181
+ "type": "| ReactElement<\n unknown,\n string | JSXElementConstructor<any>\n >\n| ComponentRenderFn<HTMLProps, AvatarRootState>",
182
+ "defaultValue": null,
183
+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
184
+ },
185
+ {
186
+ "name": "size",
187
+ "required": false,
188
+ "type": "\"sm\" | \"md\" | \"lg\" | null",
189
+ "defaultValue": "md",
190
+ "description": ""
191
+ },
192
+ {
193
+ "name": "style",
194
+ "required": false,
195
+ "type": "| CSSProperties\n| ((state: AvatarRootState) => CSSProperties)",
196
+ "defaultValue": null,
197
+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."
198
+ }
199
+ ]
200
+ },
201
+ "subComponents": [
202
+ {
203
+ "name": "Avatar.Fallback",
204
+ "description": "Avatar.Fallback — the initials the consumer passes, one or two letters. Without children it shows a person glyph.\nIt derives nothing from a name or email.",
205
+ "props": [
206
+ {
207
+ "name": "className",
208
+ "required": false,
209
+ "type": "string | ((state: AvatarFallbackState) => string)",
210
+ "defaultValue": null,
211
+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."
212
+ },
213
+ {
214
+ "name": "delay",
215
+ "required": false,
216
+ "type": "number",
217
+ "defaultValue": null,
218
+ "description": "How long to wait before showing the fallback. Specified in milliseconds."
219
+ },
220
+ {
221
+ "name": "ref",
222
+ "required": false,
223
+ "type": "Ref<HTMLSpanElement>",
224
+ "defaultValue": null,
225
+ "description": "Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}"
226
+ },
227
+ {
228
+ "name": "render",
229
+ "required": false,
230
+ "type": "| ReactElement<\n unknown,\n string | JSXElementConstructor<any>\n >\n| ComponentRenderFn<HTMLProps, AvatarFallbackState>",
231
+ "defaultValue": null,
232
+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
233
+ },
234
+ {
235
+ "name": "style",
236
+ "required": false,
237
+ "type": "| CSSProperties\n| ((state: AvatarFallbackState) => CSSProperties)",
238
+ "defaultValue": null,
239
+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."
240
+ }
241
+ ]
242
+ },
243
+ {
244
+ "name": "Avatar.Image",
245
+ "description": "Avatar.Image — the person's photo, cropped to the circle. It shows once `src` has loaded; until then, and when it\nfails, `Avatar.Fallback` shows instead.",
246
+ "props": [
247
+ {
248
+ "name": "className",
249
+ "required": false,
250
+ "type": "string | ((state: AvatarImageState) => string)",
251
+ "defaultValue": null,
252
+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."
253
+ },
254
+ {
255
+ "name": "onLoadingStatusChange",
256
+ "required": false,
257
+ "type": "(status: ImageLoadingStatus) => void",
258
+ "defaultValue": null,
259
+ "description": "Callback fired when the loading status changes."
260
+ },
261
+ {
262
+ "name": "ref",
263
+ "required": false,
264
+ "type": "Ref<HTMLSpanElement>",
265
+ "defaultValue": null,
266
+ "description": "Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}"
267
+ },
268
+ {
269
+ "name": "render",
270
+ "required": false,
271
+ "type": "| ReactElement<\n unknown,\n string | JSXElementConstructor<any>\n >\n| ComponentRenderFn<HTMLProps, AvatarImageState>",
272
+ "defaultValue": null,
273
+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
274
+ },
275
+ {
276
+ "name": "style",
277
+ "required": false,
278
+ "type": "| CSSProperties\n| ((state: AvatarImageState) => CSSProperties)",
279
+ "defaultValue": null,
280
+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."
281
+ }
282
+ ]
283
+ }
284
+ ]
285
+ },
65
286
  "button": {
66
287
  "root": {
67
288
  "name": "Button",
@@ -278,6 +499,19 @@
278
499
  "description": "Width divided by height, or \"auto\" to use the image's intrinsic ratio."
279
500
  }
280
501
  ]
502
+ },
503
+ {
504
+ "name": "Card.Status",
505
+ "description": "Card.Status — a tinted slot that marks the card's status with the variant's glyph. Pass\nchildren to replace the glyph. Like `Card.Image`, place it first among the slots: a column\nbeside the body in a horizontal card, a band above it in a vertical one. Decorative\n(`aria-hidden`); the card's text carries the status.",
506
+ "props": [
507
+ {
508
+ "name": "variant",
509
+ "required": false,
510
+ "type": "| \"info\"\n| \"positive\"\n| \"warning\"\n| \"negative\"\n| null",
511
+ "defaultValue": "info",
512
+ "description": ""
513
+ }
514
+ ]
281
515
  }
282
516
  ]
283
517
  },
@@ -1742,7 +1976,7 @@
1742
1976
  },
1743
1977
  {
1744
1978
  "name": "Field.Error",
1745
- "description": "Field.Error — an inline validation message shown when its match condition fails.",
1979
+ "description": "Field.Error — an inline validation message shown when its match condition fails.\nIt announces itself with `role=\"alert\"`; pass another `role` to quiet it.",
1746
1980
  "props": [
1747
1981
  {
1748
1982
  "name": "className",
@@ -7596,6 +7830,33 @@
7596
7830
  }
7597
7831
  ]
7598
7832
  },
7833
+ {
7834
+ "name": "Typo.Eyebrow",
7835
+ "description": "Typo.Eyebrow — short uppercase label above a heading. Also called a kicker or overline.",
7836
+ "props": [
7837
+ {
7838
+ "name": "ref",
7839
+ "required": false,
7840
+ "type": "Ref<HTMLHeadingElement>",
7841
+ "defaultValue": null,
7842
+ "description": "Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}"
7843
+ },
7844
+ {
7845
+ "name": "render",
7846
+ "required": false,
7847
+ "type": "| ReactElement<\n unknown,\n string | JSXElementConstructor<any>\n >\n| ComponentRenderFn<HTMLProps, {}>",
7848
+ "defaultValue": null,
7849
+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
7850
+ },
7851
+ {
7852
+ "name": "variant",
7853
+ "required": false,
7854
+ "type": "| \"main\"\n| \"support\"\n| \"minor\"\n| \"brand\"\n| \"primary\"\n| \"negative\"\n| \"positive\"\n| \"warning\"\n| \"info\"\n| \"oncolor\"\n| \"accent-1\"\n| \"accent-2\"\n| \"accent-3\"\n| null",
7855
+ "defaultValue": "support",
7856
+ "description": ""
7857
+ }
7858
+ ]
7859
+ },
7599
7860
  {
7600
7861
  "name": "Typo.H1",
7601
7862
  "description": "Typo.H1 — top-level page heading.",
@@ -9,11 +9,22 @@ reading the whole file. `further reading` links (when present) point at
9
9
  the upstream library's own docs for usage/anatomy/composition — not for
10
10
  props, which always live in the docgen file above.
11
11
 
12
+ ## AccountCard
13
+ - category: Display, status: experimental
14
+ Card linking to the signed-in person's account: avatar, a large name or email, a quiet line under it, and organization and role at its foot, with a trailing action such as Log out. Also called an ID card or user row; for a bare person badge, use Avatar.
15
+ - props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .account-card (jq: jq '.account-card' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
16
+
12
17
  ## AppShell
13
18
  - category: Layout, status: stable
14
19
  Application layout shell for a header, sidebars, footer, and scrolling main area. Also called an app layout or dashboard shell; sizing is CSS-driven and sidebars can become sliding panels on small screens.
15
20
  - props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .app-shell (jq: jq '.app-shell' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
16
21
 
22
+ ## Avatar
23
+ - category: Display, status: experimental
24
+ Round badge that stands for a person, showing their photo, their initials, or a person glyph. Also called a profile picture or user badge; for a signed-in account row with a name, use AccountCard.
25
+ - props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .avatar (jq: jq '.avatar' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
26
+ - further reading (usage/anatomy, not props): https://base-ui.com/react/components/avatar.md
27
+
17
28
  ## Button
18
29
  - category: Buttons, status: stable
19
30
  Triggers an action such as submit, confirm, cancel, navigate, or delete. Also called a CTA or action button; variants and sizes communicate its importance.
@@ -27,7 +38,7 @@ Persistent, in-place status message for information, success, warnings, and erro
27
38
 
28
39
  ## Card
29
40
  - category: Layout, status: stable
30
- Surface container for related content on a tonal background. Also called a panel or tile; compose it from optional image, header, content, and footer parts.
41
+ Surface container for related content on a tonal background. Also called a panel or tile; compose it from optional image, status, header, content, and footer parts.
31
42
  - props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .card (jq: jq '.card' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
32
43
 
33
44
  ## Checkbox
@@ -11,6 +11,8 @@ description:
11
11
  Start here for UI work and library questions in a project that uses `@imfusion/web-ui`. This skill is a map, not a second
12
12
  copy of every convention.
13
13
 
14
+ Invoke `imf-web-ui-user-profile` first and explain at its levels throughout.
15
+
14
16
  ## 1. Decide whether guidance is needed
15
17
 
16
18
  Skip a companion when the task is explicit and small, an existing local pattern already solves it in the file being changed,
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: imf-web-ui-audit
3
3
  description:
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,
4
+ "Audit an existing ImFusion frontend against the @imfusion/web-ui conventions without changing project files. Use this for
5
+ a project health check, a pre-setup review, or one named topic. Report broken and missing pieces, working deviations,
6
6
  evidence, and an ordered plan."
7
7
  argument-hint: "[full|<topic>]"
8
- allowed-tools: Read Glob Grep
8
+ allowed-tools: Read Glob Grep Skill
9
9
  ---
10
10
 
11
11
  # Audit a consumer project
@@ -21,6 +21,8 @@ it low, and do not let it crowd the sections a consumer has to act on.
21
21
 
22
22
  ## Workflow
23
23
 
24
+ Invoke `imf-web-ui-user-profile` first and explain at its levels throughout.
25
+
24
26
  1. Resolve the argument. Bare means `full`; an unknown topic is an error, not a reason to widen the scope.
25
27
  2. Enter plan mode unless this audit is being called as verification by another skill or the host has no plan mode.
26
28
  3. Read the report template and existing reviewer notes, then dispatch one investigator per in-scope topic. Tell each
@@ -4,13 +4,15 @@ description:
4
4
  "Look up @imfusion/web-ui component APIs, compound parts, defaults, and icon glyphs without reading source. Use this
5
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
6
  use it to choose between components or bootstrap a project."
7
- allowed-tools: Bash
7
+ allowed-tools: Bash Skill
8
8
  ---
9
9
 
10
10
  # Look up components
11
11
 
12
12
  Use the generated package indexes. They are smaller and more reliable than reading the library source.
13
13
 
14
+ Invoke `imf-web-ui-user-profile` first and explain at its levels throughout.
15
+
14
16
  ## Component lookup
15
17
 
16
18
  1. Read the identity index first, even when you already know the component's name: it gives the docgen key and the status.
@@ -50,6 +50,7 @@ sections one to one — change a topic's sections and this file follows in the s
50
50
 
51
51
  - [ ] Types
52
52
  - [ ] Immutability & expressions
53
+ - [ ] Functions
53
54
  - [ ] Naming
54
55
 
55
56
  ## Styling — `styling`
@@ -19,7 +19,8 @@ Use one server-backed current-user query as the identity source:
19
19
 
20
20
  - Put it in `api/auth/queries.ts` and define its key and schema with the [data.md](data.md) pattern.
21
21
  - Expose query options as `context.api.auth.getUser()`.
22
- - Call `ensureQueryData` in a loader or a query hook in a component.
22
+ - Call `queryClient.query({ ...options, staleTime: "static" })` in a loader (see [data.md](data.md)) or a query hook in a
23
+ component.
23
24
  - Keep credentials and access tokens out of React state.
24
25
  - Do not infer authentication from local storage, decoded tokens, route flags, or permission-gated UI.
25
26
 
@@ -85,9 +85,11 @@ export function getDetails(options?: QueryOptions<User>) {
85
85
  }
86
86
  ```
87
87
 
88
- Callers choose `ensureQueryData`, `useSuspenseQuery`, or another Query API. Mutation factories likewise return
89
- `mutationOptions`, own their mutation key and parsing, and are passed to `useMutation`; do not inline those options at the
90
- call site.
88
+ Callers choose `queryClient.query`, `useSuspenseQuery`, or another Query API. A router loader reads the cache with
89
+ `queryClient.query({ ...options, staleTime: "static" })`, not the deprecated `ensureQueryData` or `fetchQuery`. Keep
90
+ `"static"`: without it the factory's `staleTime` applies (default 0), so every loader run waits on the network and the page's
91
+ `useQuery` refetches on mount. Mutation factories likewise return `mutationOptions`, own their mutation key and parsing, and
92
+ are passed to `useMutation`; do not inline those options at the call site.
91
93
 
92
94
  ## Router context access
93
95
 
@@ -30,6 +30,20 @@ input. Use `toSorted` and `toReversed` instead of their mutating counterparts.
30
30
  A loop is fine when it has a real early exit or measured hot-path benefit. A long chain or a `reduce` with several jobs wants
31
31
  named intermediate values.
32
32
 
33
+ ## Functions
34
+
35
+ Declare a named function with `function`, including a local helper inside a component. A callback passed inline as a prop or
36
+ argument stays an arrow.
37
+
38
+ ```tsx
39
+ function resetCaptcha() {
40
+ captcha.current?.reset();
41
+ }
42
+
43
+ <Button onClick={() => setOpen(true)}>Open</Button>;
44
+ items.map(item => item.id);
45
+ ```
46
+
33
47
  ## Naming
34
48
 
35
49
  Name what a value is, not how it is built. Booleans read as assertions (`isOpen`, `hasAccess`, `canSubmit`). Props use `onX`;
@@ -15,6 +15,8 @@ working choices.
15
15
 
16
16
  ## Workflow
17
17
 
18
+ Invoke `imf-web-ui-user-profile` first and explain at its levels throughout.
19
+
18
20
  1. Resolve the scope. A named topic limits the assessment to that topic. A bare invocation means `full`, unless the request
19
21
  is about one topic, in which case that topic is the scope: answer what was asked and offer the wider sweep rather than
20
22
  running it. If the argument is unknown, list the supported topics and point to `imf-web-ui-audit`.
@@ -5,7 +5,7 @@ description:
5
5
  lifecycle hooks. Refresh the base first, verify it, then audit any consumer migration separately. Preserve user work and
6
6
  get approval before each commit."
7
7
  argument-hint: "[--dry-run] [optional version or reason]"
8
- allowed-tools: Bash Read Grep
8
+ allowed-tools: Bash Read Grep Skill
9
9
  ---
10
10
 
11
11
  # Update Web UI
@@ -13,6 +13,22 @@ allowed-tools: Bash Read Grep
13
13
  This workflow has two possible commits: the package/tooling update, then an optional consumer migration. Keep them separate.
14
14
  Never overwrite user changes or commit without fresh approval.
15
15
 
16
+ ## Before you start
17
+
18
+ Invoke `imf-web-ui-user-profile` first and explain at its levels throughout.
19
+
20
+ Open with a short orientation, before any command runs, so the person knows the route and when they will be asked:
21
+
22
+ 1. **Preflight**: check the project and stop on uncommitted work.
23
+ 2. **Base update**: install the new package, refresh the skills and hooks, verify, then ask to commit.
24
+ 3. **Migration check**: read what the new releases changed and report what this project needs; changes and their separate
25
+ commit wait for approval.
26
+ 4. **Full audit**: offer `imf-web-ui-audit full`, a read-only check of the whole project against the conventions, wider than
27
+ what this release changed.
28
+
29
+ Name the decision points up front: `latest` or `dev` when the installed version is a prerelease, the base commit, the
30
+ migration commit, and the audit offer. With `--dry-run`, say the run stops after preflight and changes nothing.
31
+
16
32
  ## Preflight
17
33
 
18
34
  1. Work from the frontend package root. In a monorepo, find the package that owns the Web UI dependency.
@@ -20,9 +36,22 @@ Never overwrite user changes or commit without fresh approval.
20
36
  if another lockfile is the active one.
21
37
  3. Record `git status --short`, the installed Web UI version, the installed skill harness(es), hooks, registrations, and
22
38
  `AGENTS.md` fence.
23
- 4. Check for another npm process and stop on a conflict. Uncommitted work is also a conflict: report it and stop before the
24
- first mutating command, even if it looks unrelated to this workflow: what the update touches is only known once it runs,
25
- and the person can commit, stash, or wave it through in one reply. Never reset, clean, restore, or hide it.
39
+ 4. Check for another npm process in this package and stop on a conflict:
40
+
41
+ ```sh
42
+ pgrep npm # process IDs only
43
+ lsof -a -d cwd -p <pid> -Fn # the folder a process runs in
44
+ ps -o args= -p <pid> # its command, only when that folder is this package
45
+ ```
46
+
47
+ A running install, update, or `ci` in this package is a conflict; a long-running `npm exec` server is not. Full process
48
+ listings such as `pgrep -fl` or `ps aux` print every program's arguments, secrets included, so keep them out of the
49
+ transcript.
50
+
51
+ Uncommitted work is also a conflict: report it and stop before the first mutating command, even if it looks unrelated to
52
+ this workflow: what the update touches is only known once it runs, and the person can commit, stash, or wave it through in
53
+ one reply. Never reset, clean, restore, or hide it.
54
+
26
55
  5. With `--dry-run`, stop after reporting what would happen. Do not install, format, stage, commit, or ask for commit
27
56
  approval.
28
57
 
@@ -87,12 +116,13 @@ Update files : <paths>
87
116
  Held back : <paths or none>
88
117
  Conflicts : <paths or none>
89
118
  Commit : <message or not proposed>
119
+ Next : migration check, then the optional full audit
90
120
  ```
91
121
 
92
122
  Ask: **Approve these update-owned changes and commit them?** Stage only approved update paths and follow the repository's
93
123
  commit workflow.
94
124
 
95
- ## Audit the consumer migration
125
+ ## Check the consumer migration
96
126
 
97
127
  Start this phase only after the base update commit exists. Read `node_modules/@imfusion/web-ui/CHANGELOG.md`: every release
98
128
  section after the pre-update version, up to and including the new one. Each section's highlights, migration guide, and
@@ -119,7 +149,8 @@ releases read, then report separately:
119
149
  Do not infer a replacement from a name. Inspect the implementation, styles, and call sites. If there are no findings, say so
120
150
  and do not make an empty migration commit.
121
151
 
122
- Ask whether to run `imf-web-ui-audit full`. Run it only after an explicit yes.
152
+ Offer `imf-web-ui-audit full` as the next step: the migration check covered what the releases changed, the audit checks the
153
+ whole project against the conventions and changes nothing. Run it only after an explicit yes.
123
154
 
124
155
  For approved migration work, ask: **Approve these consumer migration changes and commit them separately?** Then stage only
125
156
  the approved paths, verify again, and use a separate imperative commit message.