fragments

A fragments skill lets you define a group of Mendix page widgets once and reuse it in multiple pages or snippets. A fragment exists only while the script runs and is expanded into separate widget copies when used.

In plain words
What is it for?
Use it to create and reuse widget groups, inspect defined fragments, and avoid copying the same page structure across several Mendix screens.
Why use it?
It reduces repeated page markup and keeps shared patterns such as form fields, buttons, or footers in one reusable definition.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mendixlabs/mxcli/fragments
Any agent
npx skills add mendixlabs/mxcli --skill fragments
Clone the repo
git clone --depth 1 https://github.com/mendixlabs/mxcli

Made for: Claude Code, Codex.

Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,231 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00034 $0.02231
Opus 5 $0.00017 $0.01115
Sonnet 5 $0.00007 $0.00446
Haiku 4.5 $0.00003 $0.00223

Measured yesterday against content hash 1d862fb57b7f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fragments scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/mendix/fragments/SKILL.md · 302 lines

How it starts

The opening of the file, as written. The whole thing — 302 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mendix Fragments Skill

When to Use This Skill

Use this skill when:

  • Defining reusable widget groups with define fragment
  • Inserting fragments into pages or snippets with use fragment
  • Listing or inspecting fragments with show 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

DEFINE FRAGMENT

define 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:

define 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:

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):

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:

Read the full file on GitHub · 302 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 302 lines · 34 tokens per session scan A 1d862fb57b7f

Subscribe to this mod's changes

fragments is a skill published in the GitHub repository mendixlabs/mxcli (115 stars, last pushed 2d ago), licensed Apache-2.0. It adds 34 tokens to every session and 2,231 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.