@imfusion/web-ui 0.5.1-dev.19.g11b806f9 → 0.5.1-dev.2.gf11bbed1

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 (45) hide show
  1. package/README.md +32 -119
  2. package/bin/install-skill.js +180 -0
  3. package/dist/components/logo/logo.d.ts +1 -1
  4. package/dist/index.js +2 -4
  5. package/dist/style.css +1 -1
  6. package/package.json +24 -34
  7. package/src/docgen/doc.gen.json +1 -1
  8. package/src/llms/skills/imf-web-ui/SKILL.md +11 -15
  9. package/src/llms/skills/imf-web-ui-components/SKILL.md +1 -1
  10. package/src/llms/skills/imf-web-ui-frontend-patterns/SKILL.md +93 -0
  11. package/src/llms/skills/imf-web-ui-frontend-patterns/references/code-conventions.md +133 -0
  12. package/src/llms/skills/{imf-web-ui-frontend-conventions/references/react.md → imf-web-ui-frontend-patterns/references/react-patterns.md} +12 -26
  13. package/src/llms/skills/imf-web-ui-imfusion-frontend-setup/SKILL.md +201 -0
  14. package/src/llms/skills/imf-web-ui-setup/SKILL.md +57 -0
  15. package/src/llms/skills/imf-web-ui-ux/SKILL.md +4 -4
  16. package/src/llms/skills/imf-web-ui-ux/references/forms.md +1 -1
  17. package/bin/install.js +0 -319
  18. package/bin/install.test.ts +0 -139
  19. package/dist/build/vite-css-module-names/index.d.ts +0 -20
  20. package/dist/build/vite-css-module-names.js +0 -17
  21. package/src/llms/skills/imf-web-ui-agent-setup/SKILL.md +0 -71
  22. package/src/llms/skills/imf-web-ui-agent-setup/templates/hooks/baseline-staleness.sh +0 -17
  23. package/src/llms/skills/imf-web-ui-agent-setup/templates/hooks/post-tool-use.sh +0 -21
  24. package/src/llms/skills/imf-web-ui-agent-setup/templates/hooks/session-start.sh +0 -4
  25. package/src/llms/skills/imf-web-ui-agent-setup/templates/hooks/user-prompt-submit.sh +0 -4
  26. package/src/llms/skills/imf-web-ui-agent-setup/templates/settings.json +0 -37
  27. package/src/llms/skills/imf-web-ui-frontend-conventions/SKILL.md +0 -45
  28. package/src/llms/skills/imf-web-ui-frontend-conventions/references/assets.md +0 -23
  29. package/src/llms/skills/imf-web-ui-frontend-conventions/references/class-names.md +0 -42
  30. package/src/llms/skills/imf-web-ui-frontend-conventions/references/components.md +0 -63
  31. package/src/llms/skills/imf-web-ui-frontend-conventions/references/data.md +0 -196
  32. package/src/llms/skills/imf-web-ui-frontend-conventions/references/docs-structure.md +0 -44
  33. package/src/llms/skills/imf-web-ui-frontend-conventions/references/git.md +0 -33
  34. package/src/llms/skills/imf-web-ui-frontend-conventions/references/library-boundary.md +0 -37
  35. package/src/llms/skills/imf-web-ui-frontend-conventions/references/npm-project.md +0 -57
  36. package/src/llms/skills/imf-web-ui-frontend-conventions/references/project-structure.md +0 -21
  37. package/src/llms/skills/imf-web-ui-frontend-conventions/references/stack.md +0 -39
  38. package/src/llms/skills/imf-web-ui-frontend-conventions/references/styling.md +0 -91
  39. package/src/llms/skills/imf-web-ui-frontend-conventions/references/testing.md +0 -16
  40. package/src/llms/skills/imf-web-ui-frontend-conventions/references/tooling.md +0 -76
  41. package/src/llms/skills/imf-web-ui-frontend-conventions/references/typescript.md +0 -45
  42. package/src/llms/skills/imf-web-ui-frontend-setup/SKILL.md +0 -89
  43. package/src/llms/skills/imf-web-ui-frontend-setup/templates/AGENTS.md +0 -34
  44. package/src/llms/skills/imf-web-ui-frontend-setup/templates/README.md +0 -27
  45. package/src/llms/skills/imf-web-ui-library-setup/SKILL.md +0 -36
@@ -1,89 +0,0 @@
1
- ---
2
- name: imf-web-ui-frontend-setup
3
- description:
4
- "Set up or audit an ImFusion frontend's project tooling: the stack, package.json scripts, formatting, linting, typecheck,
5
- staged-file and pre-commit hooks, verification scopes, dependency pinning, tsconfig, docs structure, agent wiring. House
6
- conventions, not industry standards. Load when starting a new ImFusion frontend, when asked what an existing one's setup is
7
- missing, when asked to align a repo with the baseline, or when asked to check or set up one named topic from it (e.g. CSS
8
- class names, Prettier). Not for a bare 'add this config file' request — that's just the edit. Not for wiring the library
9
- itself (imf-web-ui-library-setup)."
10
- argument-hint: "[new|audit|align|<topic>]"
11
- ---
12
-
13
- # imf-web-ui-frontend-setup
14
-
15
- First-time setup and audit against the ImFusion frontend baseline. The conventions live in `imf-web-ui-frontend-conventions`
16
- — this skill is the process that checks a repo against them and wires up what they assume. In-house conventions, not industry
17
- standards: report findings as "missing against the ImFusion baseline", never "against best practice". Built for ImFusion
18
- frontends; anyone else who likes the baseline can run it too.
19
-
20
- Four modes, same checklist:
21
-
22
- - **New project** — work down the checklist and set each piece up.
23
- - **Audit** — read the repo (don't ask what it has), report present / missing / broken, change nothing until the human picks.
24
- An established repo is where a forgotten piece hides. **The project wins:** where the repo already decided, that stands —
25
- report what's _absent_; a working convention you'd have chosen differently is not a finding.
26
- - **Align** — when the user asks to _align_ the repo with the baseline ("align"/"alignment" is the flag), the project-wins
27
- guard lifts: deviations become migration findings, proposed as a plan, still nothing changed until approved.
28
- - **One topic** — any other argument names a topic instead of a mode (`class names`, `prettier`, `tooling`). Resolve it to
29
- the checklist rows it touches and run the audit process against those only, reading their references as usual. Say which
30
- rows you resolved it to before reporting, and if nothing matches, say so and list the rows rather than guessing or sweeping
31
- everything. Same output as an audit: findings, nothing changed until the human picks.
32
-
33
- **Producer scope.** The web-ui repo itself produces this baseline; it is not a consumer frontend. Consumer-only rows — the
34
- AGENTS.md fence, vendored-skill staleness, the app stack and app `src/` tree — don't apply there. Audit it against the shared
35
- rows only: scripts, tooling, git, docs.
36
-
37
- ## The checklist
38
-
39
- Each row is a reference in `../imf-web-ui-frontend-conventions/references/` — read it, then check the repo against it. A
40
- topic argument narrows this table to the rows it names; every other mode works down all of it.
41
-
42
- | Reference | Set up / audit |
43
- | ---------------------- | ------------------------------------------------------------------------------------------- |
44
- | `stack.md` | the dependencies match the topic→tool map; devtools siblings present |
45
- | `npm-project.md` | script names table, `type`/`private`, exact pins, `.npmrc`, Node pinning |
46
- | `tooling.md` | Prettier values, ESLint flat config, tsconfig, staged-file runner, readable CSS class names |
47
- | `git.md` | `git:config` run and hooks directory present, verify scopes, staleness hooks |
48
- | `project-structure.md` | the `src/` tree, file naming, `#/` alias wiring |
49
- | `components.md` | component folders and colocation |
50
- | `styling.md` | CSS Modules, tokens, no CSS-in-JS or utility framework |
51
- | `docs-structure.md` | docs shape and content rules (see Docs below) |
52
- | — agent tooling | delegated to `imf-web-ui-agent-setup` (see Agent tooling below) |
53
-
54
- ## Docs
55
-
56
- `README.md`, `AGENTS.md`, and `docs/` with a `docs/index.md` that registers every doc. Scaffold from
57
- [`templates/README.md`](templates/README.md) and [`templates/AGENTS.md`](templates/AGENTS.md); missing structure is a
58
- finding.
59
-
60
- Keep `AGENTS.md` lean. The decision test for every line: would the agent make a costly mistake without it? If it would just
61
- need to read a file first, cut it — dev commands, path aliases, and tool config are discoverable from the files themselves.
62
-
63
- `AGENTS.md` contains one installer-owned section: the `<!-- imf-web-ui:begin -->` … `<!-- imf-web-ui:end -->` fence.
64
- `npx web-ui-install` refreshes what's inside on every skills install; everything outside the fence is the repo's own. A
65
- missing fence in an existing `AGENTS.md` is a finding — without it the baseline note can't be kept current.
66
-
67
- Judge existing docs only against `docs-structure.md`: repo-unique content stays, restated baseline becomes a pointer,
68
- deviations get named as deviations. Don't rewrite a repo's docs uninvited — report, and let the human pick.
69
-
70
- ## Agent tooling
71
-
72
- The agent side — vendored skills and their freshness, the lifecycle hooks, the settings registrations — is
73
- `imf-web-ui-agent-setup`. Delegate to it: in a new project after the docs step, in an audit as one checklist row (skills
74
- present and current, hooks wired or consciously adapted). Findings it produces report here like any other.
75
-
76
- ## Optional
77
-
78
- Recommend when the shape calls for it; absence is not a finding.
79
-
80
- - **knip** — once several people delete things independently.
81
- - **`eslint-plugin-jsx-a11y`** — anything user-facing.
82
-
83
- Out of scope, project-specific: CI, env and secrets, error tracking, deploy, dependency updates.
84
-
85
- ## Not this skill
86
-
87
- - Library wiring (styles import, provider) → `imf-web-ui-library-setup`
88
- - The conventions themselves → `imf-web-ui-frontend-conventions` and its references — this skill checks the structure exists,
89
- that skill owns what goes inside it
@@ -1,34 +0,0 @@
1
- # AGENTS.md
2
-
3
- <Keep this file lean — target ~50 lines. Decision test for every line: would the agent make a costly mistake without it? If
4
- it would just need to read a file first, cut it. Dev commands, path aliases, and tool config are discoverable from the files
5
- themselves.>
6
-
7
- <One paragraph: what the app is and the stack in one line.>
8
-
9
- Scripts, deps, and setup: [`README.md`](./README.md) and [`package.json`](./package.json) are the source of truth. Check the
10
- `package.json` scripts before running or suggesting a command — don't infer one exists by pattern-matching a sibling.
11
-
12
- ## Read before you write
13
-
14
- <One bullet per doc in docs/, each with when to read it, e.g.:>
15
-
16
- - [`docs/<topic>.md`](./docs/<topic>.md) — <what it covers>. Read before <the change it governs>.
17
-
18
- [`docs/index.md`](./docs/index.md) registers all of them.
19
-
20
- ## Working here
21
-
22
- <The fenced block below is the only part of this file `npx web-ui-install` touches: its content comes from this template and
23
- is refreshed on every skills install. Everything else in the file is scaffolded once by the setup skill and then owned by the
24
- repo.>
25
-
26
- <!-- imf-web-ui:begin — managed by `npx web-ui-install`; edits inside the fence are overwritten -->
27
-
28
- `.agents/skills/imf-web-ui-*` is vendored from `@imfusion/web-ui` and resynced with `npx web-ui-install`. Don't edit it and
29
- don't put repo conventions there. Load the matching `imf-web-ui-*` skill before writing code, styles, data fetching, or docs;
30
- repo docs hold only what is unique to this repo.
31
-
32
- <!-- imf-web-ui:end -->
33
-
34
- <Repo-specific agent guidance: generated files that are committed, tools to verify APIs against, things never to touch.>
@@ -1,27 +0,0 @@
1
- # <App name>
2
-
3
- <One paragraph: what the app is, the stack in one line — e.g. "Vite + React 19 + TanStack Router (file-based, CSR) + TanStack
4
- Query + @imfusion/web-ui".>
5
-
6
- ## Install
7
-
8
- ```bash
9
- npm install
10
- npm run git:config # once per clone: hooks path, pull.rebase, merge.ff
11
- ```
12
-
13
- <Registry tokens, required services, or other one-time setup. Delete if none.>
14
-
15
- ## Usage
16
-
17
- ```bash
18
- npm run dev
19
- ```
20
-
21
- <Environment specifics: proxies, .env files, ports. Delete if none.>
22
-
23
- `npm run` lists every script; `package.json` is the source of truth. `verify:full` is the CI gate.
24
-
25
- ## Docs
26
-
27
- [`docs/index.md`](./docs/index.md) registers them.
@@ -1,36 +0,0 @@
1
- ---
2
- name: imf-web-ui-library-setup
3
- description:
4
- "One-time wiring of a consumer project: the @imfusion/web-ui styles import and WebUIProvider wrapper. Load when installing
5
- the library for the first time, or when components render unstyled or without theme context."
6
- ---
7
-
8
- # imf-web-ui-library-setup
9
-
10
- This is library wiring: the styles import and the provider. It applies to anyone using `@imfusion/web-ui`.
11
-
12
- If the project is an **ImFusion** frontend and this is first-time setup, mention once that `imf-web-ui-frontend-setup` sets
13
- up or audits the repo's tooling (formatting, linting, hooks, scripts) against the ImFusion baseline, and let the human
14
- decide. Offer it; never run it uninvited, and don't raise it again if they pass — the library works fine without any of it.
15
-
16
- Every consumer entry point needs exactly two lines, in this order:
17
-
18
- ```tsx
19
- import "@imfusion/web-ui/styles.css";
20
- import { WebUIProvider, Button } from "@imfusion/web-ui";
21
- ```
22
-
23
- Wrap the app root in `<WebUIProvider>` once. Components rendered outside it won't have the theme/CSS-variable context they
24
- expect.
25
-
26
- Never import a Base UI (or other upstream) stylesheet or component directly — everything a web-ui component needs is already
27
- inside `styles.css` and the package's own exports; reaching around web-ui to the upstream library is always wrong, even if
28
- the upstream docs show it that way.
29
-
30
- ## Symptoms of a broken setup
31
-
32
- - **Components render but look unstyled** — the `styles.css` import is missing from the entry point.
33
- - **Components render but ignore the theme (wrong colors, no CSS variables resolving)** — they're mounted outside
34
- `<WebUIProvider>`.
35
- - **An integration component throws on import** — its optional peer dependency isn't installed; check the component's
36
- description in the docgen index (`imf-web-ui-components`) for which peer to add to your `package.json`.