Agent skill

Fragments

by mendixlabs in mendixlabs/mxcli

Define reusable widget groups with CREATE FRAGMENT and place them with USE FRAGMENT.

Apache-2.0Auto-check passed

Install Fragments

skills CLI
$ npx skills add mendixlabs/mxcli --skill fragments -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mendixlabs/mxcli fragments --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mendixlabs/mxcli.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/mendix/fragments .claude/skills/fragments && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
fragments
GitHub stars
128
Token cost
~2.4k tokens
SKILL.md length
614 words
Files
1
Skills in repo
72
Repo updated
First seen
Licence
Apache-2.0

At a glance

Define reusable widget groups with CREATE FRAGMENT and place them with USE FRAGMENT.

  • The same widget pattern repeats across pages and should be written once
  • SKILL.md covers When to Use This Skill, What Are Fragments?, Syntax Reference and Common Patterns, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Fragments is an agent skill from mendixlabs/mxcli. Define reusable widget groups with CREATE FRAGMENT and place them with USE FRAGMENT. Use when the same widget pattern repeats across pages and should be written once.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Mendix cli tool, a headless way to work with Mendix projects. Enables Mendix projects for use with 3rd party agentic coding tools like Claude Code and Copilot. Includes a… The licence is Apache-2.0.

When your agent uses it

  • The same widget pattern repeats across pages and should be written once

Example prompts

  • “/fragments”

What it can do on your machine

Read from SKILL.md and the folder at commit 20a6c89. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are mdl).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Fragments loads about 2.4k tokens when it runs. Until then it costs about 44 tokens; SKILL.md has 614 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~44
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mendixlabs/mxcli at commit 20a6c89, republished under its Apache-2.0 licence (© mendixlabs). 614 words, ~2,366 tokens.

Download SKILL.mdSave it as .claude/skills/fragments/SKILL.md (or your agent's skills folder).
name
fragments
description
Define reusable widget groups with CREATE FRAGMENT and place them with USE FRAGMENT. Use when the same widget pattern repeats across pages and should be written once.

Mendix Fragments Skill

When to Use This Skill

Use this skill when:

  • Defining reusable widget groups with create fragment
  • Inserting fragments into pages or snippets with use fragment
  • Listing or inspecting fragments with list fragments / describe fragment
  • Building multiple pages that share common widget patterns (footers, form fields, buttons)
  • Avoiding copy-paste of repeated widget structures across pages

What Are Fragments?

Fragments are script-scoped, transient widget groups:

  • Defined once, reused in multiple pages/snippets within the same script
  • Not persisted in the MPR file — they exist only during script execution
  • Widgets are deep-cloned on expansion (each USE gets independent copies)
  • Optional prefix support to avoid name conflicts when using the same fragment multiple times

Syntax Reference

CREATE FRAGMENT
mdl
mdl 1;
create fragment SaveCancelFooter as {
  footer footer1 {
    actionbutton btnSave (caption: 'Save', action: save changes, buttonstyle: primary)
    actionbutton btnCancel (caption: 'Cancel', action: cancel changes)
  }
};

Multiple top-level widgets:

mdl
mdl 1;
create fragment CustomerFields as {
  textbox txtName (label: 'Name', attribute: Name)
  textbox txtEmail (label: 'Email', attribute: Email)
  textbox txtPhone (label: 'Phone', attribute: Phone)
};
USE FRAGMENT

Inside a page or snippet body:

mdl
mdl 1;
create page Module.CustomerEdit
(
  params: ( $Customer: Module.Customer ),
  title: 'Edit Customer',
  layout: Atlas_Core.PopupLayout
)
{
  dataview dvCustomer (datasource: $Customer) {
    use fragment CustomerFields
    use fragment SaveCancelFooter
  }
};

With prefix (avoids name conflicts):

mdl
use fragment SaveCancelFooter as order_
-- Creates: order_footer1, order_btnSave, order_btnCancel
Content Slots — wrap arbitrary content

A plain fragment substitutes a fixed widget group. A content slot lets a fragment wrap arbitrary caller-supplied content — a reusable shell (a card, panel, or section) whose body varies per use. Declare a slot where the caller's widgets should land, then fill it with the use fragment X { … } payload form:

mdl
mdl 1;
create fragment Card as {
  container cardWrap (class: 'card', designproperties: ('Card style': on)) {
    container cardBody (class: 'card-body') {
      slot content            -- caller's widgets are spliced in here
    }
  }
};

create page Module.Dashboard (title: 'Dashboard', layout: Atlas_Core.Atlas_Default) {
  use fragment Card {
    dynamictext cardHeading (content: 'Welcome', rendermode: H2)
    dynamictext cardText (content: 'Any widgets can go inside the reusable Card shell')
  }
};

Rules (v1):

  • The slot name is optional and defaults to content; a fragment supports one slot.
  • Using a slotted fragment with no payload (use fragment Card) expands the slot to nothing — a valid empty shell.
  • Supplying a payload to a fragment that declares no slot is an error.
  • The payload is deep-cloned; as prefix_ still renames the fragment's own widgets (not the caller's payload).
  • The slot resolves at expansion — describe page shows the fully-expanded tree (no slot marker), and there are no BSON/round-trip surprises.

For varying a leaf value (a label or attribute name) rather than wrapping a subtree, scalar params (create fragment F($label, $attr) as …) are a planned v1.1 follow-up; today use a slot plus a one-line value fill.

Show full SKILL.md (307 more words)Show less
Parameter bindings — datasource & action (experimental)

The content slot varies structure (which widgets). Typed parameters vary data and behavior: a fragment can declare a datasource and/or an action parameter, reference it with $name in a datasource/action position, and receive its value at the use site. This turns a shell into a real reusable component — one panel bound to a different entity and a different handler per use.

mdl
mdl 1;
create fragment DataPanel($data: datasource, $onEdit: action) as {
  container panelWrap (class: 'card') {
    listview lvItems (datasource: $data) {
      slot content
      actionbutton btnEdit (caption: 'Edit', action: $onEdit, buttonstyle: primary)
    }
  }
};

create page Module.Orders (title: 'Orders', layout: Atlas_Core.Atlas_Default) {
  use fragment DataPanel ($data: database Module.Order, $onEdit: microflow Module.EditOrder) {
    dynamictext panelHeading (content: 'Orders', rendermode: H4)
  }
};

Rules:

  • Param kinds are datasource ($var / database E / $currentObject/Assoc / microflow M) and action (a microflow / nanoflow / save changes / show page / …).
  • Every declared parameter must be supplied; unknown args and type mismatches are errors.
  • Values substitute at expansion — describe page shows the concrete datasource/action, no $param.

Building blocks can't declare params (they're authored in Studio Pro), but a use building block accepts rebind overrides that rewrite the block's outermost datasource and/or its first button after the copy:

mdl
use building block Atlas_Web_Content.List_Cards
  (datasource: database Module.Order, action: call microflow Module.OpenOrder) as orders_;

Binding-point rule (prototype): datasource → the first widget carrying a datasource; action → the first button widget. For anything more specific, copy the block in with as prefix_ and use alter page … set … on prefix_widget.

LIST FRAGMENTS
mdl
list fragments;
-- Lists all defined fragments with widget counts
DESCRIBE FRAGMENT
mdl
describe fragment SaveCancelFooter;
-- Outputs the full MDL definition

Common Patterns

mdl
create fragment CrudFooter as {
  footer footer1 {
    actionbutton btnSave (caption: 'Save', action: save changes, buttonstyle: primary)
    actionbutton btnCancel (caption: 'Cancel', action: cancel changes)
  }
};

-- Use in every edit page
create page Module.Customer_Edit (...) {
  dataview dv (datasource: $Customer) {
    textbox txtName (label: 'Name', attribute: Name)
    use fragment CrudFooter
  }
};

create page Module.Order_Edit (...) {
  dataview dv (datasource: $Order) {
    textbox txtNumber (label: 'Order #', attribute: Number)
    use fragment CrudFooter
  }
};
Pattern 2: Form Field Groups
mdl
create fragment AddressFields as {
  textbox txtStreet (label: 'Street', attribute: Street)
  textbox txtCity (label: 'City', attribute: City)
  textbox txtZip (label: 'Zip Code', attribute: ZipCode)
  textbox txtCountry (label: 'Country', attribute: Country)
};

-- Reuse in customer and supplier pages
create page Module.Customer_Edit (...) {
  dataview dv (datasource: $Customer) {
    textbox txtName (label: 'Name', attribute: Name)
    use fragment AddressFields
    use fragment CrudFooter
  }
};
Pattern 3: Same Fragment with Prefix
mdl
create fragment ActionButtons as {
  actionbutton btnApprove (caption: 'Approve', action: save changes, buttonstyle: success)
  actionbutton btnReject (caption: 'Reject', action: cancel changes, buttonstyle: danger)
};

create page Module.DualPanel (...) {
  layoutgrid lg {
    row {
      column (desktopwidth: 6) {
        use fragment ActionButtons as left_
      }
      column (desktopwidth: 6) {
        use fragment ActionButtons as right_
      }
    }
  }
};

Common Mistakes

Duplicate Fragment Names
mdl
-- WRONG: Defining the same fragment name twice causes an error
create fragment footer as { ... };
create fragment footer as { ... };  -- Error: fragment "Footer" already defined
Missing Fragment
mdl
-- WRONG: Using a fragment that hasn't been defined
create page Module.MyPage (...) {
  use fragment NonExistent   -- Error: fragment "NonExistent" not found
};
Name Conflicts Without Prefix
mdl
-- WRONG: Using same fragment twice without prefix creates duplicate widget names
use fragment footer
use fragment footer   -- Widget name "footer1" already exists!

-- CORRECT: Use prefix for uniqueness
use fragment footer as first_
use fragment footer as second_
Fragment Order
mdl
-- WRONG: Using a fragment before defining it
create page Module.MyPage (...) {
  use fragment footer   -- Error: fragment "Footer" not found
};
create fragment footer as { ... };

-- CORRECT: Define before use
create fragment footer as { ... };
create page Module.MyPage (...) {
  use fragment footer   -- OK
};

Validation Checklist

  • All create fragment statements appear before their use fragment references
  • No duplicate fragment names in the script
  • Prefix used when the same fragment appears multiple times on one page
  • Fragment widget names don't conflict with other widgets on the page
  • All widgets inside fragments use valid syntax (same as page bodies)
  • A use fragment X { … } payload is only supplied when fragment X declares a slot
  • A slotted fragment has exactly one slot (v1 supports a single slot)
  • mxcli syntax fragment — CLI help topic
  • create-page — Page/widget syntax reference
  • overview-pages — CRUD page patterns
  • Proposal: docs/11-proposals/proposal_page_composition.md

© mendixlabs, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/mendix/fragments of mendixlabs/mxcli.

Open the folder on GitHubat commit 20a6c89

Compare with similar skills

Fragments next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Fragments compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Fragments this skillmendixlabs/mxcli128—~2.4kAutomated safety check: PassApache-2.0
Makepad Widgetssickn33/agentic-awesome-skills47k2 repos~1.7kAutomated safety check: PassMIT
Contact Widgetnexu-io/open-design100k—~1.6kAutomated safety check: PassApache-2.0
WidgetLeoYeAI/openclaw-master-skills2.2k—~1.9kAutomated safety check: PassMIT
Chat Widgetsickn33/agentic-awesome-skills47k2 repos~332Automated safety check: PassMIT
Groupsparcadei/Continuous-Claude-v33.9k1 repos~956Automated safety check: NotesMIT

Similar skills

  • Makepad Widgets

    sickn33/agentic-awesome-skills

    Version: makepad-widgets (dev branch) | Last Updated: 2026-01-19 Check for updates: https://crates.io/crates/makepad-widgets

    47k GitHub starsUsed in 2 repos~1.7k tokens
    Auto-check passed
  • Contact Widget

    nexu-io/open-design

    Self-contained floating chat widget with welcome screen, social links, meeting button, and message input.

    100k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Widget

    LeoYeAI/openclaw-master-skills

    Create, update, hide, show, list, and delete Übersicht desktop widgets on macOS.

    2.2k GitHub stars~1.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Chat Widget

    sickn33/agentic-awesome-skills

    Build a real-time support chat system with a floating widget for users and an admin dashboard for support staff.

    47k GitHub starsUsed in 2 repos~332 tokens
    Sales & SupportAuto-check passed
  • Groups

    parcadei/Continuous-Claude-v3

    Problem-solving strategies for groups in abstract algebra. An agent skill from parcadei/Continuous-Claude-v3.

    3.9k GitHub starsUsed in 1 repo~956 tokens
    Research & ScienceAuto-check: notes
  • Robius Widget Patterns

    sickn33/agentic-awesome-skills

    CRITICAL: Use for Robius widget patterns. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~3.1k tokens
    Auto-check passed

More from mendixlabs/mxcli

All 72 skills in this repo
  • Mendix Odata Pushdown

    mendixlabs/mxcli

    Push OData query options into the SQL of a Mendix resource served by a read microflow, so $filter, $orderby, $top, $skip, $count and the key lookup reach the database instead of being silently…

    128 GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Mendix Vega Charts

    mendixlabs/mxcli

    Chart a Mendix app with Vega-Lite through a pluggable widget that takes the specification and the data as separate properties, so the model emits rows and never assembles a chart payload.

    128 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Agents

    mendixlabs/mxcli

    Author Mendix AI agent documents in MDL — Model, Knowledge Base, Consumed MCP Service and Agent, with variables, tools and multi-line prompts.

    128 GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed
  • Mendix Bulk Oql Dml

    mendixlabs/mxcli

    Run set-based INSERT, UPDATE and DELETE against Mendix entities through OQL statements, which the runtime supports and Studio Pro cannot author.

    128 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Business Events

    mendixlabs/mxcli

    Define event-driven APIs over Kafka with Mendix business event services — publish and subscribe contracts, CREATE/DROP/DESCRIBE.

    128 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Catalog Search

    mendixlabs/mxcli

    Search the Mendix Catalog platform service registry (catalog.mendix.com) from the CLI to find services published across an organisation.

    128 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed

Questions about Fragments

What does Fragments do?

Define reusable widget groups with CREATE FRAGMENT and place them with USE FRAGMENT. Fragments is an agent skill from mendixlabs/mxcli. Define reusable widget groups with CREATE FRAGMENT and place them with USE FRAGMENT.

When should I use Fragments?

Fragments fits situations like: the same widget pattern repeats across pages and should be written once.

How do I install Fragments in Claude Code?

Run `npx skills add mendixlabs/mxcli --skill fragments -a claude-code`. Or copy the skill folder (.claude/skills/mendix/fragments in mendixlabs/mxcli) into .claude/skills/fragments in your project. Claude Code loads it when a task matches its description.

How do I install Fragments in Codex?

Run `npx skills add mendixlabs/mxcli --skill fragments -a codex`. Or copy the skill folder (.claude/skills/mendix/fragments in mendixlabs/mxcli) into .agents/skills/fragments in your project. Codex loads it when a task matches its description.

Can I use Fragments in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mendixlabs/mxcli --skill fragments -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fragments, .gemini/skills/fragments, .github/skills/fragments and .opencode/skills/fragments in your project.

What does Fragments need to run?

SKILL.md names no scripts, command-line tools or credentials: Fragments is instructions for the agent only.

Does Fragments access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Fragments safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Fragments use?

Fragments is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Fragments use?

About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Fragments?

Skills that share tags, products or a category with Fragments: Makepad Widgets (sickn33/agentic-awesome-skills, 47k stars), Contact Widget (nexu-io/open-design, 100k stars), Widget (LeoYeAI/openclaw-master-skills, 2.2k stars) and Chat Widget (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Fragments?

mendixlabs (a GitHub organization) maintains it in mendixlabs/mxcli, which has 128 GitHub stars. The repository holds 72 skills in this directory. The repository was last updated on October 7, 2026.

Source: mendixlabs/mxcli on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.