Agent skill

Write Rules

by mendixlabs in mendixlabs/mxcli

Write Mendix rules — a special kind of microflow returning a Boolean or enumeration, callable only from a decision.

Apache-2.0Auto-check passed

Install Write Rules

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

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

GitHub CLI
$ gh skill install mendixlabs/mxcli write-rules --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/write-rules .claude/skills/write-rules && 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
write-rules
GitHub stars
128
Token cost
~1.5k tokens
SKILL.md length
692 words
Files
1
Skills in repo
75
Repo updated
First seen
Licence
Apache-2.0

At a glance

Write Mendix rules — a special kind of microflow returning a Boolean or enumeration, callable only from a decision.

  • Writing CREATE RULE
  • SKILL.md covers When to Use This Skill, When to Use a Rule vs a…, Key Differences from Microflows and Syntax, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Deciding whether logic belongs in a rule

What it does

Write Rules is an agent skill from mendixlabs/mxcli. Write Mendix rules — a special kind of microflow returning a Boolean or enumeration, callable only from a decision. Use when writing CREATE RULE, or deciding whether logic belongs in a rule or a microflow.

Its SKILL.md is about 1.5k 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

  • Writing CREATE RULE
  • Deciding whether logic belongs in a rule

Example prompts

  • “/write-rules”

What it can do on your machine

Read from SKILL.md and the folder at commit a924d11. 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.

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

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.mendix.com

    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

Write Rules loads about 1.5k tokens when it runs. Until then it costs about 54 tokens; SKILL.md has 692 words of instructions outside code blocks.

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

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 a924d11, republished under its Apache-2.0 licence (© mendixlabs). 692 words, ~1,517 tokens.

Download SKILL.mdSave it as .claude/skills/write-rules/SKILL.md (or your agent's skills folder).
name
write-rules
description
Write Mendix rules — a special kind of microflow returning a Boolean or enumeration, callable only from a decision. Use when writing CREATE RULE, or deciding whether logic belongs in a rule or a microflow.

Mendix Rule Skill

Guidance for writing Mendix rules in MDL. Mendix's own reference calls a rule "a special kind of microflow": it returns a Boolean or an enumeration, and it can only be used from a decision.

When to Use This Skill

  • Writing CREATE RULE statements
  • Deciding whether logic belongs in a rule or a microflow
  • Understanding what mxcli check refuses in a rule body and why

The mirrors are write-microflows and write-nanoflows — a rule is the third flavour and shares their body syntax exactly.

When to Use a Rule vs a Microflow

ScenarioUse
One condition, evaluated from several decisionsRule
A named business condition the model should show by nameRule
Choosing one of several enumerated outcomes from inputRule
Anything that changes dataMicroflow
Anything the user sees (page, message, download)Microflow
Anything that talks to another systemMicroflow

Rule of thumb: a rule answers a question. The moment it needs to do something, it is a microflow.

Key Differences from Microflows

AspectMicroflowRule
Return typeAnything, including voidBoolean or enumeration — mandatory
Called fromAnywhereA decision, and nowhere else
Changes dataYesNo
Talks to the clientYesNo
IntegrationYesNo
Module-role securitygrant execute on microflow …None — a rule has no security to grant

That last row is not an mxcli omission. A rule document stores no AllowedModuleRoles, because a rule is never called on its own; it is reached through the microflow that evaluates it, and that microflow's security applies.

Syntax

mdl 1;
create or modify rule Sales.Rule_IsSolvent ($pCustomer: Sales.Customer)
returns Boolean
folder 'Rules'
begin
  return $pCustomer/Balance >= 0;
end;

An enumeration rule lets one decision fan out to several branches:

mdl 1;
create or modify rule Sales.Rule_Outcome ($pCustomer: Sales.Customer)
returns enum Sales.Outcome
begin
  if $pCustomer/Balance >= 0 then
    return Sales.Outcome.Approved;
  else
    return Sales.Outcome.Rejected;
  end if;
end;

Calling one — the only place a rule may be called:

mdl 1;
create or modify microflow Sales.MF_Screen ($pCustomer: Sales.Customer)
begin
  if Sales.Rule_IsSolvent(pCustomer = $pCustomer) then
    return;
  else
    return;
  end if;
end;

The argument names are the rule's parameter names, so Rule_IsSolvent(pCustomer = $pCustomer) reads the same way a microflow call does.

Reading and managing rules

mdl 1;
list rules;                  -- `list rules` is the same statement
list rules in Sales;
describe rule Sales.Rule_IsSolvent;   -- round-trippable MDL
drop rule Sales.Rule_IsSolvent;
move rule Sales.Rule_IsSolvent to folder 'Rules/Customer';

list microflows lists microflows only — not nanoflows, not workflows, and not rules. Each doctype has its own listing.

list callers of Sales.Rule_IsSolvent lists the microflows whose decisions evaluate it, and a microflow called from inside a rule's body is a normal reference: it will not be reported as dead code.

What a rule may not contain

mxcli check refuses these before the build, with the same function exec uses, so the two cannot disagree. Each was measured against mxbuild 11.13.0:

Written in a rulemxbuild says
create / change / delete / commit / rollbackCE0009 "This action is not supported in rules."
show page, close page, show message, validation feedback, downloadCE0009
call web serviceCE0009
A void, String, Integer … return typeCE0103 and CE0139 — the return type must be Boolean or an enumeration

A missing returns clause is refused too. For a microflow, void is a legitimate choice; for a rule it means the decision calling it has nothing to branch on.

Show full SKILL.md (238 more words)Show less

Validation checklist

Before presenting a rule:

  • returns Boolean or returns enum Module.Enum is present
  • The body only reads — no create/change/delete/commit/rollback
  • Nothing in the body touches the client or another system
  • Every path returns a value of the declared type
  • The caller is a decision: if Module.Rule_Name(Param = $Value) then
  • mxcli check script.mdl -p app.mpr --references passes

Rules (LIST/DESCRIBE/CREATE [OR MODIFY]/DROP/MOVE RULE)

Mendix's "special kind of microflow" — returns Boolean or an enumeration, callable only from a decision. Handled as a third flow flavour beside microflows and nanoflows: its own semantic type, its own listing (list microflows stays microflow-only), the shared microflowBody, flow builder and describer. The document is the ten properties a Studio Pro rule stores, pinned against two reference rules (ako/TestApp, 11.13.0) — no AllowedModuleRoles (a rule is not independently callable, so there is no grant execute on rule) and no ReturnType despite gen declaring one beside MicroflowReturnType. Two keys only a reference document catches, both invisible to mx check: ExportLevel (Studio Pro writes "Hidden" on every rule) and Flows (written as the bare marker even when empty — a MandatoryLists entry). Rules are catalog objects and their bodies are walked for references, which together stop a microflow called only from a rule reading as dead. The body restrictions are refused at check time by the same function exec calls, each measured: create/change/delete/commit/rollback and client or web-service activities are CE0009, a non-Boolean/enum return is CE0103 + CE0139. Authoring is modelsdk-only; legacy refuses.

© 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/write-rules of mendixlabs/mxcli.

Open the folder on GitHubat commit a924d11

Compare with similar skills

Write Rules 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.

Write Rules compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Write Rules this skillmendixlabs/mxcli128—~1.5kAutomated safety check: PassApache-2.0
Returns Reverse Logisticssickn33/agentic-awesome-skills47k8 repos~6.4kAutomated safety check: PassMIT
Special Charsthedaviddias/Front-End-Checklist74k—~561Automated safety check: PassMIT
Returns Reverse Logisticsaffaan-m/ECC274k2 repos~2.3kAutomated safety check: PassApache-2.0
Returns Reverse Logisticsaffaan-m/ECC274k—~2.9kAutomated safety check: PassApache-2.0
Add Memory KindEverMind-AI/EverOS13k—~2.6kAutomated safety check: PassApache-2.0

Similar skills

  • Returns Reverse Logistics

    sickn33/agentic-awesome-skills

    Codified expertise for returns authorisation, receipt and inspection, disposition decisions, refund processing, fraud detection, and warranty claims management.

    47k GitHub starsUsed in 8 repos~6.4k tokens
    Data & AnalyticsAuto-check passed
  • Special Chars

    thedaviddias/Front-End-Checklist

    A skill your agent uses when applies to any site with user-generated slugs, CMS-generated URLs, or content in non-English languages.

    74k GitHub stars~561 tokensUpdated yesterday
    Auto-check passed
  • 用于退货授权、接收与检验、处置决策、退款处理、欺诈检测以及保修索赔管理的标准化专业知识。基于拥有15年以上经验的退货运营经理的见解。包括分级框架、处置经济学、欺诈模式识别和供应商回收流程。适用于处理产品退货、逆向物流、退款决策、退货欺诈检测或保修索赔时使用。

    274k GitHub starsUsed in 2 repos~2.3k tokens
    Auto-check passed
  • 返品承認、受取・検品、処分決定、返金処理、不正検出、保証クレーム管理のための標準化された専門知識。15年以上の経験を持つ返品オペレーションマネージャーの知見に基づく。段階的フレームワーク、処分経済性、不正パターン認識、ベンダー回収プロセスを含む。製品返品、逆物流、返金決定、返品不正検出、保証クレームを扱う場合に使用。

    274k GitHub stars~2.9k tokensUpdated 2 days ago
    Auto-check passed
  • Add Memory Kind

    EverMind-AI/EverOS

    Walks through adding a new persisted memory kind to EverOS: choose storage among Markdown, SQLite and LanceDB, pick a Markdown strategy, then wire schemas, repos and writers.

    13k GitHub stars~2.6k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Specialize

    sharpdeveye/maestro

    A skill your agent uses when the user wants to tailor a workflow for a specific industry, domain, or vertical with specialized expertise, terminology, and guardrails.

    592 GitHub stars~614 tokensUpdated 5 mo ago
    AI & LLM EngineeringAuto-check passed

More from mendixlabs/mxcli

All 75 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
  • Mock REST APIs

    mendixlabs/mxcli

    Stand up an HTTP endpoint you control instead of a live third-party API, and point the Mendix app at it — Prism from an OpenAPI contract, a constant swap, or a forward proxy.

    128 GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • REST Client

    mendixlabs/mxcli

    Call external REST APIs from Mendix — the three approaches (inline REST CALL, consumed REST client document, generated from OpenAPI) and how to choose.

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

Questions about Write Rules

What does Write Rules do?

Write Mendix rules — a special kind of microflow returning a Boolean or enumeration, callable only from a decision. Write Rules is an agent skill from mendixlabs/mxcli. Write Mendix rules — a special kind of microflow returning a Boolean or enumeration, callable only from a decision.

When should I use Write Rules?

Write Rules fits situations like: writing CREATE RULE; deciding whether logic belongs in a rule.

How do I install Write Rules in Claude Code?

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

How do I install Write Rules in Codex?

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

Can I use Write Rules 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 write-rules -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/write-rules, .gemini/skills/write-rules, .github/skills/write-rules and .opencode/skills/write-rules in your project.

What does Write Rules need to run?

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

Does Write Rules access the network?

SKILL.md names 1 domain. As links in the text: docs.mendix.com. This is read from the text; nothing was executed.

Is Write Rules 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 Write Rules use?

Write Rules 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 Write Rules use?

About 1.5k tokens (SKILL.md is roughly 6.1k 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 Write Rules?

Skills that share tags, products or a category with Write Rules: Returns Reverse Logistics (sickn33/agentic-awesome-skills, 47k stars), Special Chars (thedaviddias/Front-End-Checklist, 74k stars), Returns Reverse Logistics (affaan-m/ECC, 274k stars) and Returns Reverse Logistics (affaan-m/ECC, 274k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Write Rules?

mendixlabs (a GitHub organization) maintains it in mendixlabs/mxcli, which has 128 GitHub stars. The repository holds 75 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.