babylonjs/babylon.js/porting-tools-to-fluent
Claude Code and agent skill by babylonjs/babylon.js
- community
Checking that the SKILL.md file is still in the repository.
Guide for porting Babylon.js tools from legacy shared-ui-components to Fluent UI using MakeModularTool. Use when: port to fluent, migrate to fluent, fluent migration, porting tool UI.
Install
npx vskill@latest install babylonjs/babylon.js/porting-tools-to-fluentSKILL.md
The same SKILL.md was published earlier as babylonjs/babylon.js/porting-tools-to-fluent.
Porting Babylon.js Tools to Fluent UI
Guide for porting Babylon.js tools (NME, NGE, NPE, NRGE, Playground, etc.) from the legacy shared-ui-components to Fluent UI using the MakeModularTool framework from shared-ui-components/modularTool/.
Reference implementation: packages/tools/viewer-configurator/ (fully ported).
Design guidelines: For the shared design system these ports target — color schema, shell/panel structure, component and styling conventions — see `.github/design-guidelines.md`.
Overview
A Fluent port replaces four layers:
- Bootstrapping — from ad-hoc
createRoot+<App />toMakeModularTool(provides theming, settings, shell layout) - Layout — from hand-rolled split containers / panes to
IShellService(central content, side panes, toolbars) - Components — from legacy shared-ui-components to
shared-ui-components/fluent/primitives and HOCs - Styling — from raw SCSS/CSS to
makeStylesfrom@fluentui/react-components - Icons — from FontAwesome to
@fluentui/react-icons
1. Dependencies
Add
Note: @dev/shared-ui-components should already be a dependency. It contains both the Fluent primitives (fluent/) and the ModularTool framework (modularTool/). No dependency on @dev/inspector is needed.
Remove
Vite config
Ensure the shared-ui-components alias is present:
tsconfig.json
Ensure the shared-ui-components path mapping is present (no inspector mapping needed):
2. Bootstrapping with MakeModularTool
Replace the old entry point:
MakeModularTool automatically provides:
FluentProvider+ theme (light/dark)SettingsStore(persisted user preferences)ThemeService+ optionalThemeSelectorServiceShellService(layout: central content, side panes, toolbars)ToastProvider+IToastServicefor toast notifications (consumeToastServiceIdentity— do not roll your own container)IDialogService(consumeDialogServiceIdentity) for modal alert/confirm dialogs — replaces ad-hocMessageDialog
Cross-window / popup hosting
MakeModularTool derives targetDocument from containerElement.ownerDocument. If your tool's entry function (e.g. Show(options)) hosts the editor in a popup window, just pass the popup body as containerElement — Fluent/Griffel/Theme plumb cross-window automatically.
- For a fully-Fluent popup, use
OpenPopupWindowfromshared-ui-components/fluent/hoc/popupWindow. - If part of your tool still ships traditional CSS/SCSS (e.g.
shared-ui-components/nodeGraphSystem/'s graph canvas), keep the legacyCreatePopupfromshared-ui-components/popupHelper— it copies stylesheets into the popup. Fluent andCreatePopupcoexist fine.
3. Service Architecture
Each tool should define its own services that populate the shell. A service is a ServiceDefinition<Produces, Consumes> with:
friendlyName— human-readable name for debuggingproduces— array of service identity symbols this service providesconsumes— array of service identity symbols this service depends onfactory(…consumedServices)— returns an object satisfying the produced contracts + optionalIDisposable
Defining a service identity and contract
Service factory pattern
Shell service APIs
shellService.addCentralContent({ key, component })— main content areashellService.addSidePane({ key, title, icon, horizontalLocation, verticalLocation, teachingMoment, content })— side paneshellService.addToolbarItem({ key, horizontalLocation, verticalLocation, teachingMoment, component })— toolbar button
All return IDisposable — clean up in your service's dispose().
Reactive state with useObservableState
Use the useObservableState hook from shared-ui-components/modularTool/ to subscribe to service state in React components:
4. Component Mapping
Legacy → Fluent shared component mapping
| Legacy Component | Fluent Replacement | Import Path | |
|---|---|---|---|
LineContainerComponent | AccordionSection | shared-ui-components/fluent/primitives/accordion | |
| Side pane container | Accordion (or ExtensibleAccordion) | shared-ui-components/fluent/primitives/accordion | |
CheckBoxLineComponent | Switch (primitive) or SwitchPropertyLine (with label) | shared-ui-components/fluent/primitives/switch or .../hoc/propertyLines/switchPropertyLine | |
SliderLineComponent | SyncedSliderInput (primitive) or SyncedSliderPropertyLine (with label) | shared-ui-components/fluent/primitives/syncedSlider or .../hoc/propertyLines/syncedSliderPropertyLine | |
OptionsLine | Dropdown (primitive) or StringDropdownPropertyLine (with label) | shared-ui-components/fluent/primitives/dropdown or .../hoc/propertyLines/dropdownPropertyLine | |
ButtonLineComponent | Button (primitive) | shared-ui-components/fluent/primitives/button | |
TextInputLineComponent (single-line) | TextInput (primitive) or TextInputPropertyLine (with label) | shared-ui-components/fluent/primitives/textInput or .../hoc/propertyLines/inputPropertyLine | |
TextInputLineComponent (multiline) | Fluent Textarea + slot props | @fluentui/react-components | |
MessageLineComponent | MessageBar | shared-ui-components/fluent/primitives/messageBar | |
Color4LineComponent | ColorPickerPopup (primitive) or Color4PropertyLine (with label) | shared-ui-components/fluent/primitives/colorPicker or .../hoc/propertyLines/colorPropertyLine | |
LockObject | Not needed (Fluent property lines don't use it) | — | |
FontAwesomeIconButton | Button with icon prop | shared-ui-components/fluent/primitives/button | |
SplitContainer / Splitter | Shell service layout (side panes) | Handled by MakeModularTool |
When to use PropertyLine vs primitives
- `PropertyLine` — Use when a row has a label. Renders
InfoLabel+ child content in a standardized layout with hover border. Import fromshared-ui-components/fluent/hoc/propertyLines/propertyLine. - `LineContainer` — Use for rows without a label. Simple wrapper with hover border. Same import path.
- Primitives directly — Use when you need custom layout, e.g. button groups or compound rows.
Composing controls within PropertyLine
PropertyLine constrains its children via an internal childWrapper div with overflow: hidden and whiteSpace: nowrap. For multi-element children, wrap them in a flex container:
5. Icons
Replace all FontAwesome icons with @fluentui/react-icons. For general icon conventions (unsized variants, fontSize sizing), see fluent.instructions.md.
Common FontAwesome → Fluent mappings:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 93 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/porting-tools-to-fluent/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/babylonjs/babylon.js/porting-tools-to-fluent)