/fmxer:fmxer-developmentfrom FMXER
Develops Delphi FireMonkey apps with FMXER, a Flutter-inspired declarative framework. Handles named routes via TNavigator, screen composition with container elements, fluent element configuration, and state sharing.
Ships in FMXER. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
FMXER (https://github.com/andrea-magni/FMXER, docs https://andrea-magni.github.io/FMXER/, whole docs for agents: https://andrea-magni.github.io/FMXER/llms-full.txt) builds FMX screens in code, Flutter-style: a screen is a tree of elements (frames and forms), each created by its container and configured by an anonymous method. Every container shows its children through its own TFrameStand/TFormStand (https://andrea-magni.github.io/TFrameStand/). Requirements since v.1.2: Delphi 12 or 13 (Skia built into RAD Studio), FireMonkey only; source library, no packages (add source\ and the dependencies to the search path).
TFrame or TForm descendant with a small fluent API (Set* methods returning the element). Built-in ones live in source\FMXER.*.pas....AsFrame<T: TFrame> / ...AsForm<T: TForm> (or AddFrame<T> / AddForm<T>) that creates a T in the slot (inside the slot's stand), calls your configuration procedure TProc<T> with it, shows it, and keeps its TSubjectInfo.Navigator.DefineRoute<TScaffoldForm>('home', procedure (Home: TScaffoldForm) ...), built when RouteTo opens it, freed (with its whole tree) by CloseRoute/StackPop. The next RouteTo rebuilds it from the definition.TFormStand on the main form: Navigator(FormStand1) once, then Navigator anywhere.// main form: the only design-time component is FormStand1: TFormStand
uses FMXER.Navigator, FMXER.UI.Misc, FMXER.UI.Consts,
FMXER.ScaffoldForm, FMXER.ColumnForm, FMXER.TextFrame, FMXER.ButtonFrame;
procedure TMainForm.FormCreate(Sender: TObject);
begin
Navigator(FormStand1); // first: initializes the singleton
Navigator.DefineRoute<TScaffoldForm>('home'
, procedure (Home: TScaffoldForm)
begin
Home
.SetTitle('Home')
.SetContentAsForm<TColumnForm>(
procedure (Col: TColumnForm)
begin
Col
.AddFrame<TTextFrame>(50
, procedure (Text: TTextFrame)
begin
Text.SetContent('Hello').SetFontColor(TAlphaColorRec.Black); // default text is white
end)
.AddFrame<TButtonFrame>(60
, procedure (Button: TButtonFrame)
begin
Button.SetText('Details').SetOnClickProc(
procedure begin Navigator.RouteTo('detail'); end);
end);
end)
.AddActionButton('X', procedure begin Navigator.CloseRoute('home'); end);
end);
Navigator.SetOnCloseRoute(
procedure (ARouteName: string) begin if ARouteName = 'home' then Close; end);
Navigator.RouteTo('home');
end;
The project source sets GlobalUseSkia := True; before Application.Initialize (uses FMX.Skia).
| The user wants | Use |
|---|---|
| a new screen | Navigator.DefineRoute<TScaffoldForm>(AName, AConfigProc) (or any TForm); a frame or another stand: DefineRoute(AName, function: TSubjectInfo ...) |
| open / go back / close | RouteTo(AName), StackPop, CloseRoute(AName), CloseAllRoutes, CloseAllRoutesExcept(AName) |
| overlay not in Back history (wait screen, splash) | RouteTo(AName, True) (transient), CloseRouteDelayed(AName, True, 3000) |
| update elements when a value changes (state of a route, app state, background thread) | v.1.9: TObservable<T> / TChangeNotifier (unit FMXER.Observable), owned by the state; in the element's config: State.Total.Listen(Element, procedure (V) begin Element.Set...(V) end) (owner = the element, called now too); inputs: Switch.BindChecked(State.Paid), Edit.BindText(State.Note), Text.BindContent(...), Button.BindEnabled(...) |
| pass data to a screen, get a result back | v.1.8: DefineRoute<TView, TState> (a data module per route, freed with it) + RouteTo<TState>(AName, procedure (State) ... (arguments), procedure (AResult: TValue) ...), CloseRouteWithResult(AName, AValue); any route: RouteToForResult. Before: set a field/data module value, then RouteTo |
| title bar, floating buttons, short messages | TScaffoldForm: SetTitle, SetContentAs*, AddActionButton, ShowSnackBar(AText, ADuration_ms[, AThen]), SetTitleDetailContentAs* |
| alert, confirm, choice list, custom dialog or bottom sheet | v.1.7: Modals.Alert, Modals.Confirm(..., procedure (AOk: Boolean) ...), Modals.Choose(ATitle, AChoices, procedure (AIndex: Integer) ...), Modals.ShowDialog<T> / ShowBottomSheet<T> (unit FMXER.Modals) |
| side menu (drawer), bottom navigation bar, tabs | v.1.7: Scaffold.SetDrawerAsFrame<T> (+ CloseDrawer in its items), Scaffold.SetBottomNavigation(procedure (Tabs: TTabsFrame) ...), TTabsFrame.AddTabFrame<T>(ACaption[, AIcon], AConfigProc) |
| elements one under another | TColumnForm.AddFrame<T>(AHeight, ...) (default 200; TColumnForm.AUTO_HEIGHT = the element's own height; TColumnForm.EXPAND = fill the leftover space, Flutter's Expanded — last slot, one per column) |
| scrolling column | TVertScrollFrame.SetContentAsForm<TColumnForm> (or SetContentAsFrame<TColumnFrame>) |
| many rows / columns, long columns | TRowFrame/TColumnFrame (frames: ~10x cheaper than the forms) and Col.BatchUpdate(procedure (C) ...) to add them (v.1.4); hundreds of uniform rows: TListViewFrame |
| side by side | TRowForm.AddFrame<T>(AWidth, ...) inside a column slot, THorzPairFrame (two halves), TAccessoryFrame (fixed left/right + content) |
| layers (background + content) | TStackFrame.AddFrame<T>(AConfigProc, AName) (frames only; later = on top) |
| fixed-size centered element | TCenterForm.SetContentAsFrame<T>(AWidth, AHeight, ...) |
| long / data-driven list | TListViewFrame (AddItem(..., AOnSelect), ItemBuilderProc), not a column |
| any FMX control as an element | TContainerFrame.SetContentAs<TSwitch>(...) |
| icons | IconFonts.MD.<name> (FMXER.IconFontsData), TIconFontsGlyphFrame.SetIcon(AIcon, AColor), AddActionButton(AIcon, AColor, AProc) |
| app colors | TAppColors.PrimaryColor / PrimaryTextColor... set in FormCreate before the first route |
| margins, paddings, align, size | FMXER.UI.Misc helpers: SetMargin, SetPadding, SetAlign*, SetWidth, SetHeight, SetHitTest |
| a reusable element of your own | a frame with Align = Client, Set* methods returning Self, TProc events (see references/custom-elements.md) |
Navigator(FormStand1) before any DefineRoute/RouteTo, or Navigator has not been initialized. Route names are case-sensitive and defined once (keep them in constants); unknown names raise Route definition not found.AddItem's AOnSelect, a timer) and captures the loop variable, or an inline var declared in the loop body, sees the value of the last iteration (closures capture variables, not values). Pass the value through the element (AddItem(...).Tag := LIndex and read AItem.Tag) or through a function that takes it as a parameter and returns the closure. Configuration procedures run during the iteration and are fine.TTextFrame text is white (TAppColors.PrimaryTextColor, meant for text on the primary color). On a light background call SetFontColor(TAlphaColorRec.Black) (or your color), or the text is invisible.AddFrame/AddForm of a column/row gets the height/width you pass (200 if omitted), or with TColumnForm.AUTO_HEIGHT / TRowForm.AUTO_WIDTH (v.1.3+) the element's own size (design size, or the one set in the configuration procedure); the column's Height grows by it. A TColumnForm.EXPAND / TRowForm.EXPAND slot instead fills the space the fixed slots leave and follows later resizes (one per column/row, declared last). Columns do not scroll: wrap long ones in TVertScrollFrame. Sizes are computed once (use Col.Width, Scaffold.Width at build time; rebuild the route or use TVertScrollFrame.OnResizedProc to react to resizes).TControl helpers return TControl: after .SetMargin(5) the element's own setters are gone. Use the generic overload (.SetMargin<TButtonFrame>(5).SetText('OK')) or call the helpers last. Since v.1.3 every slot method returns its container and every clickable element has SetOnClickProc (on v.1.2 some slot methods were procedures: see references/api.md).TMessageManager subscription, a timer, TDelayedAction, a background callback or a data-module listener that references elements runs on freed objects after the route closes (and re-subscribes each time the route opens). Tie it to the element (a TComponent guard owned by the element that unsubscribes in its destructor), clear it in Navigator.OnCloseRoute, or check Navigator.IsRouteActive(AName) before touching elements. See references/state.md.TAppColors affects only elements created afterwards.TStackFrame.CloseFrame(AName)). Close routes first in FormClose (Action := caNone; Navigator.CloseAllRoutes) and let the home route's OnCloseRoute close the form.Navigator(FormStand1).SetCatchBackKey(True) (Back/Esc pop the top route, root left to the form, transient routes consume the key); don't also keep a handler that calls StackPop. v.1.7: an open scaffold drawer closes first; an element of yours can do the same with Navigator.AddBackHandler. Older versions: in OnKeyUp, if (Key = vkHardwareBack) and (Navigator.Stack.Count > 1) then begin Key := 0; Navigator.StackPop; end;. Close-then-route in the same handler is fine (CloseRoute hides first, frees afterwards); use RouteToDelayed to wait for the hide animation.Row.ElementStand := 'fadeIn'; Row.AddFrame<...>). Unknown stand names give a plain layout, no error.System.Skia, FMX.Skia, FMX.Skia.Canvas (never Skia, Skia.FMX, Skia.FMX.Graphics of the old Skia4Delphi: F2613 Unit 'Skia.FMX' not found). TSkTextHorzAlign, TSkAnimatedImageWrapMode, TSkSvgWrapMode come from FMX.Skia, ISkCanvas from System.Skia.AddActionButton(ACaption, [OnClickProc(...)]): pass a TProc variable to OnClickProc; an inline anonymous method there fails on Delphi 13 (E2250) unless qualified FMXER.UI.Misc.OnClickProc(...). Simpler: AddActionButton(ACaption, AOnClickProc).media\Material Design Icons.ttf) installed on Windows or next to the exe, deployed on the other platforms (Android: .\assets\internal), or no icons. Not the Desktop variant (FMXER up to v.1.7): Skia takes seconds to load it, at every app start.Routes.<name>.pas unit per route with a DefineXxxRoute(const ARouteName: string) procedure (NewProjectTemplate demo), commas at the start of argument lines, fluent chains one call per line.Read the reference matching the task:
references/api.md — exact declarations from source\ (navigator, containers, elements, helpers, TAppColors, icons) and which unit declares what: read it before calling a method you are not sure about.references/navigation.md — routes, RouteTo/CloseRoute/StackPop, transient routes, the stack, Back button, OnCreateRoute/OnCloseRoute, closing the app, passing data.references/layouts.md — containers, slots and stands, sizing rules, columns/rows/stacks/scroll/pair/accessory/center/card, scaffold, lists, styling with TAppColors and stands.references/state.md — closures, sharing values between elements, data modules, System.Messaging with a subscription guard, background work, lifetime rules.references/custom-elements.md — writing your own elements and containers, [SubjectInfo]/[Show]/[Hide] injection, conventions, project setup (search path, Skia, icon font deployment).What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub andrea-magni/fmxer --plugin fmxerOther plugins' skills for the same job