debug-bson

A debugging guide for BSON files used by Mendix, a platform for building business applications. BSON is a binary format for storing structured documents that Studio Pro reads.

In plain words
What is it for?
Use it to compare generated and Studio Pro BSON, inspect field names and nested objects, and diagnose missing properties, widget settings, captions, or array markers.
Why use it?
It helps find cases where generated model data looks correct in commands but appears empty, missing, or incorrect in Mendix Studio Pro because its stored structure does not match expectations.

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/debug-bson
Any agent
npx skills add mendixlabs/mxcli --skill debug-bson
Clone the repo
git clone --depth 1 https://github.com/mendixlabs/mxcli

Made for: Claude Code, Codex.

Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,175 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.00056 $0.05175
Opus 5 $0.00028 $0.02587
Sonnet 5 $0.00011 $0.01035
Haiku 4.5 $0.00006 $0.00517

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

Security

Grade A, and why

debug-bson 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/debug-bson/SKILL.md · 610 lines

How it starts

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

BSON Serialization Debugging Skill

This skill provides guidance for debugging BSON serialization issues when implementing or fixing Mendix SDK writers.

When to Use This Skill

Use this skill when:

  • Objects created via MDL don't appear correctly in Studio Pro
  • Properties are missing, empty, or showing default values
  • Widget captions, parameters, or nested structures aren't stored correctly
  • You need to compare SDK-generated BSON with Studio Pro-generated BSON
  • You encounter "empty" or "(Empty caption)" issues in Studio Pro
  • Debugging BSON array version markers or object structures

Overview

When the ModelSDK Go serializes objects to BSON, the output must exactly match what Mendix Studio Pro expects. Even small differences in:

  • Field names (e.g., caption vs CaptionTemplate)
  • Object structures (e.g., string vs nested object)
  • Array version markers (e.g., [2, items...] vs [3, items...])

...can cause Studio Pro to ignore the data entirely.

Part 1: The Debugging Workflow

Step 1: Identify the Problem

Symptoms that indicate BSON serialization issues:

  • MDL describe command shows correct data, but Studio Pro shows empty/default
  • Object is created but properties don't persist
  • Nested structures (templates, parameters) are missing
  • "(Empty caption)" or similar placeholder text in Studio Pro

Step 2: Create a Reference Object in Studio Pro

  1. Open the MPR project in Mendix Studio Pro
  2. Manually create or fix the problematic object
  3. Save the project (this writes the correct BSON)
  4. Note the exact name/path of the fixed object

Step 3: Dump Both BSON Structures

Use the mxcli dump-bson command to extract and compare:

# Dump the SDK-generated object (the broken one)
mxcli dump-bson -p app.mpr -o "PgTest.BrokenPage" > broken.json

# Dump the Studio Pro-generated object (the fixed one)
mxcli dump-bson -p app.mpr -o "PgTest.FixedPage" > fixed.json

# Compare the two
diff broken.json fixed.json

Or use the --compare flag:

mxcli dump-bson -p app.mpr --compare "PgTest.BrokenPage" "PgTest.FixedPage"

Read the full file on GitHub · 610 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 · 610 lines · 56 tokens per session scan A 3cac80ae8941

Subscribe to this mod's changes

debug-bson is a skill published in the GitHub repository mendixlabs/mxcli (115 stars, last pushed 2d ago), licensed Apache-2.0. It adds 56 tokens to every session and 5,175 once invoked, about $0.0003 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.