xpath-constraints

xpath-constraints is a skill for Claude Code from mendixlabs/mxcli. It costs 42 tokens per session (4,083 once invoked), scanned A, original, Apache-2.0.

A reference for writing XPath constraints in Mendix, expressions that limit which records a retrieve, page data source, or security rule can access. It explains the syntax used inside square brackets and how it differs from other Mendix expressions.

In plain words
What is it for?
Use it to write or debug filters for retrieved records, page data sources, and security rules, including association paths and functions.
Why use it?
It prevents subtle parsing and filtering mistakes caused by mixing XPath rules with Mendix’s other expression syntax. Correct constraints are important for both displayed data and row-level access.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./bin/mxcli check script.mdl.

Good fit Use it to write or debug filters for retrieved records, page data sources, and security rules, including association paths and functions.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/mendixlabs/mxcli
agentmods
npx agentmods add skills/mendixlabs/mxcli/xpath-constraints

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for xpath-constraints

README.md
[![agentmods](https://agentmods.dev/badge/skills/mendixlabs/mxcli/xpath-constraints/github.svg)](https://agentmods.dev/skills/mendixlabs/mxcli/xpath-constraints)
Your own site
<a href="https://agentmods.dev/skills/mendixlabs/mxcli/xpath-constraints"><img src="https://agentmods.dev/badge/skills/mendixlabs/mxcli/xpath-constraints/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for xpath-constraints

Your own site · 80×15
<a href="https://agentmods.dev/skills/mendixlabs/mxcli/xpath-constraints"><img src="https://agentmods.dev/badge/skills/mendixlabs/mxcli/xpath-constraints.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,083 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00042 $0.04083
Opus 5.5 $0.00017 $0.01633
Sonnet 5.5 $0.00008 $0.00817
Haiku 4.5 $0.00004 $0.00408

Measured 5d ago against content hash 1ffba3ef98aa, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

xpath-constraints 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 5d ago.

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/xpath-constraints/SKILL.md · 434 lines

How it starts

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

Find it fast

sed -n '<from>,<to>p' SKILL.md one section rather than reading the file; ./mxcli syntax <topic> answers how do I write this for a fraction of either.

lines section
28-34 When to Use This Skill
35-75 XPath vs Mendix Expressions
76-119 Syntax Reference
120-278 How a Constraint Is Laid Out on Disk
279-329 Usage Contexts
330-369 Enumeration Attributes
370-411 Common Patterns
412-423 Validation
424-433 Troubleshooting

XPath Constraints in MDL

This skill provides reference for writing XPath constraint expressions in MDL RETRIEVE statements, page data sources, and security rules.

When to Use This Skill

  • Writing retrieve ... where [xpath] statements in microflows
  • Writing database from entity where [xpath] in page data sources
  • Writing grant ... where 'xpath' for row-level entity access
  • Debugging XPath parsing or serialization issues

XPath vs Mendix Expressions

Critical distinction: XPath constraints (inside [...]) use different syntax from Mendix expressions (in SET, IF, DECLARE, etc.):

Feature XPath [...] Mendix Expression
Path separator / (always path traversal) / (also division)
Boolean ops lowercase: and, or, not() and, or, not
Negation not(expr) function not expr
Empty check = empty, != empty = empty
Token quoting '[%CurrentUser%]' (quoted) [%CurrentUser%] (unquoted)
Nested filter Assoc/entity[pred] Not applicable
Arithmetic on value not supported — pre-compute into a variable +, -, *, div, mod

XPath constraints cannot compute values. where [Seq = $Game/MoveSeq + 1] is a parse error (Mendix XPath has no arithmetic on the value side). Compute the value first, then compare against the variable:

declare $Next integer = $Game/MoveSeq + 1;
retrieve $M from Mod.Move where [Seq = $Next] first;

mxcli check explains this and shows the workaround when it sees +/*/div/ mod inside a constraint.

Read the full file on GitHub · 434 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. 5d ago Changed · +18 lines 1ffba3ef98aa
  2. 9d ago Changed · +3 lines dc3d3819c335
  3. 14d ago Changed · +7 lines 28b0af5b391c
  4. 15d ago Changed · +2 lines eccec5aef43d
  5. 16d ago Changed · +1 lines 4e7a0f548e45
  6. 1mo ago Changed · +9 lines 6c1fbce3fce5
  7. 1mo ago First seen · 394 lines · 42 tokens per session scan A 12778bc6a46e

Subscribe to this mod's changes

xpath-constraints is a skill published in the GitHub repository mendixlabs/mxcli (131 stars, last pushed yesterday), licensed Apache-2.0. It adds 42 tokens to every session and 4,083 once invoked, about $0.0002 per session on Opus 5.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-09-03.

Related

Other skills, from other repositories

hatch3r-api-spec

Generates and validates OpenAPI specifications from codebase. Covers endpoint design, schema validation, and documentation generation.

hatch3r/hatch3r · 29 tokens

hatch3r-scalability-verify

Scalability verification gate before commit/release — stateless-handler ratio, back-pressure patterns, idempotency-key adoption, queue-based offloading, pool sizing, bulkheads, load-test pass at target scale.

hatch3r/hatch3r · 51 tokens

golang-manual-di

Guides manual dependency injection wiring for Go services: three-tier naming taxonomy (Provide/MustProvide/Must), Must-pattern entrypoints, OS-signal-driven context lifecycle, common provider structs, infrastructure must-builders, interface-segregated bus registration, decorator/tracing wrappers, and…

soulcodex/agentic · 97 tokens

terraform-infrastructure

Structures, writes, and reviews Terraform infrastructure code. Covers module layout, remote state, workspace strategy, variable and secrets handling, CI plan/apply pipeline, naming conventions, and multi-region deployment patterns (provider aliases, per-region state, failover strategies), while delegating shared risk…

soulcodex/agentic · 96 tokens

microservices-architecture

Guides service boundary analysis, communication pattern selection, data consistency design, API contract strategy, and resilience checklist for microservices systems. Complements the microservices fragment. Invoked when the user asks to design a microservices system, split a monolith, or review service boundaries.

soulcodex/agentic · 61 tokens

nosql-database-design

Designs a NoSQL data model by leading with access pattern analysis. Covers DynamoDB single-table design (PK/SK/GSI) and MongoDB embedding vs referencing, consistency models, and capacity planning. Invoked when the user asks to design a DynamoDB schema, MongoDB data model, or NoSQL data model.

soulcodex/agentic · 71 tokens