Agent skill

Resolve Forward References

by mendixlabs in mendixlabs/mxcli

Order MDL statements so that every reference resolves — execution is sequential and immediate, so a document must exist before anything points at it.

Apache-2.0Auto-check passed

Install Resolve Forward References

skills CLI
$ npx skills add mendixlabs/mxcli --skill resolve-forward-references -a claude-code

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

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

At a glance

Order MDL statements so that every reference resolves — execution is sequential and immediate, so a document must exist before anything points at it.

  • Works in 3 steps: Create a minimal placeholder for the… → Create all documents that reference it.… → Fill in the placeholder using CREATE OR…
  • A script fails on a reference to something defined later in the same file
  • SKILL.md covers Why Forward References Fail, The Placeholder Pattern, Pattern 1 — Shared Navigation… and Pattern 2 — Page References…, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Resolve Forward References is an agent skill from mendixlabs/mxcli. Order MDL statements so that every reference resolves — execution is sequential and immediate, so a document must exist before anything points at it. Use when a script fails on a reference to something defined later in the same file.

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

  • A script fails on a reference to something defined later in the same file

Example prompts

  • “/resolve-forward-references”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Create a minimal placeholder for the document that will be referenced.
  2. Create all documents that reference it. They bind to the placeholder's ID.
  3. Fill in the placeholder using CREATE OR MODIFY or ALTER — both preserve the

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 sql).

    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

Resolve Forward References loads about 2.3k tokens when it runs. Until then it costs about 65 tokens; SKILL.md has 455 words of instructions outside code blocks.

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

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). 455 words, ~2,329 tokens.

Download SKILL.mdSave it as .claude/skills/resolve-forward-references/SKILL.md (or your agent's skills folder).
name
resolve-forward-references
description
Order MDL statements so that every reference resolves — execution is sequential and immediate, so a document must exist before anything points at it. Use when a script fails on a reference to something defined later in the same file.

Resolving Forward References in MDL Scripts

Why Forward References Fail

MDL script execution is sequential and immediate — each CREATE statement commits its document to the project database before the next statement runs. When a document is being built, all its references (snippets, pages, microflows) are resolved against the database at that moment. A reference to something defined later in the same script fails because it is not in the database yet.

Error: snippet not found: MyModule.NavMenu

This applies to the following reference types:

ReferenceInFails when
snippetcallpage / snippetsnippet created after the page
show page in actionpage / snippetpage created after the page that references it
SHOW PAGEmicroflowpage created after the microflow
call microflowmicroflowcallee microflow created after the caller (in the same script, exec resolves the call against the project/backend, not later same-script definitions — so order the callee first)

Note: SHOW PAGE inside a microflow body resolves the page reference at microflow-creation time, not at invocation time. If the target page doesn't exist yet, the microflow creation fails.


The Placeholder Pattern

The standard workaround is a three-step sequence:

  1. Create a minimal placeholder for the document that will be referenced.
  2. Create all documents that reference it. They bind to the placeholder's ID.
  3. Fill in the placeholder using CREATE OR MODIFY or ALTER — both preserve the original ID so existing bindings remain valid.

Critical: Never use CREATE OR REPLACE for the fill-in step. OR REPLACE deletes the placeholder and creates a new document with a different ID. Every page or snippet that references the placeholder immediately becomes a dangling reference.


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

Pattern 1 — Shared Navigation Snippet (most common)

A navigation snippet contains show page buttons (references pages) and pages include the snippet via snippetcall (references the snippet). Both sides reference each other.

sql
mdl 1;
-- Step 1: placeholder snippet (minimal valid content)
create snippet MyModule.NavMenu
{
  layoutgrid g { row { column (desktopwidth: 12) {
    dynamictext loading (content: 'Loading...')
  }}}
};

-- Step 2: pages that embed the snippet (snippet already exists → resolves OK)
create page MyModule.Customer_Overview
(
  title: 'Customers',
  layout: Atlas_Core.Atlas_Default
)
{
  layoutgrid g { row {
    column (desktopwidth: 3) {
      snippetcall nav (snippet: MyModule.NavMenu)
    }
    column (desktopwidth: 9) {
      datagrid dg (datasource: database MyModule.Customer) { }
    }
  }}
};

create page MyModule.Order_Overview
(
  title: 'Orders',
  layout: Atlas_Core.Atlas_Default
)
{
  layoutgrid g { row {
    column (desktopwidth: 3) {
      snippetcall nav (snippet: MyModule.NavMenu)
    }
    column (desktopwidth: 9) {
      datagrid dg (datasource: database MyModule.Order) { }
    }
  }}
};

-- Step 3: fill in the snippet with real content (pages now exist → show page resolves OK)
-- Use CREATE OR MODIFY (preserves ID) or ALTER SNIPPET (in-place)
create or modify snippet MyModule.NavMenu
{
  layoutgrid g { row { column (desktopwidth: 12) {
    actionbutton btnCustomers (
      caption: 'Customers',
      action: show page MyModule.Customer_Overview
    )
    actionbutton btnOrders (
      caption: 'Orders',
      action: show page MyModule.Order_Overview
    )
  }}}
};

Pattern 2 — Page References Another Page (new/edit from overview)

An overview page has a New button that opens a NewEdit page via show page. The NewEdit page must exist before the overview can reference it.

sql
mdl 1;
-- Solution: declare the target page first (even if empty), then the referencing page

create page MyModule.Customer_NewEdit
(
  params: ( $Customer: MyModule.Customer ),
  title: 'Edit Customer',
  layout: Atlas_Core.PopupLayout
)
{
  layoutgrid g { row { column (desktopwidth: 12) {
    dataview dv (datasource: $Customer) {
      textbox txtName (label: 'Name', attribute: Name)
    }
    actionbutton btnSave (caption: 'Save', action: save changes)
    actionbutton btnCancel (caption: 'Cancel', action: cancel changes)
  }}}
};

-- Now the overview can safely reference the NewEdit page
create page MyModule.Customer_Overview
(
  title: 'Customers',
  layout: Atlas_Core.Atlas_Default
)
{
  layoutgrid g { row { column (desktopwidth: 12) {
    actionbutton btnNew (
      caption: 'New',
      action: call microflow MyModule.ACT_Customer_New
    )
    datagrid dg (datasource: database MyModule.Customer) {
      column (caption: 'Name', attribute: Name)
    }
  }}}
};

For simple cases, reordering declarations is sufficient and no placeholder is needed.


Pattern 3 — Microflow References a Page Not Yet Created

sql
mdl 1;
-- If the page is defined later in the script, create a placeholder or reorder.
-- Easiest fix: declare the page before the microflow that shows it.

-- Page first
create page MyModule.Order_Detail
(
  params: ( $Order: MyModule.Order ),
  title: 'Order Detail',
  layout: Atlas_Core.Atlas_Default
)
{
  layoutgrid g { row { column (desktopwidth: 12) {
    dataview dv (datasource: $Order) {
      textbox txtID (label: 'Order ID', attribute: OrderID)
    }
  }}}
};

-- Microflow after the page it references
create microflow MyModule.ACT_OpenOrder ($Order: MyModule.Order)
begin
  @position(200,200)
  show page MyModule.Order_Detail (Order = $Order);
  @position(400,200) return;
end;

Ordering Rules for Dependency-Free Scripts

To avoid forward references entirely, follow this declaration order within a script:

1. Entities and associations       (no cross-document references)
2. Enumerations and constants      (no cross-document references)
3. Snippets (placeholder if needed)
4. Pages                           (reference snippets + other pages)
5. Snippets (fill-in step, if placeholder was used)
6. Microflows and nanoflows        (reference pages, entities)
7. Navigation                      (references pages)

When generating MDL scripts, write sections in this order. Doing so avoids the placeholder pattern for the majority of scripts.


Choosing Between CREATE OR MODIFY and ALTER SNIPPET

Both preserve the snippet's ID. Use whichever fits:

ApproachWhen to use
create or modify snippetRewriting the whole snippet body from scratch
alter snippetInserting or replacing specific widgets within an existing layout
sql
mdl 1;
-- ALTER SNIPPET: targeted widget replacement (keeps surrounding structure)
alter snippet MyModule.NavMenu {
  replace loading with {
    actionbutton btnCustomers (
      caption: 'Customers',
      action: show page MyModule.Customer_Overview
    )
  }
};

Script Template for a Full CRUD Module

sql
mdl 1;
-- ============================================================
-- MyModule CRUD scaffold
-- Correct declaration order: snippets → pages → microflows → nav
-- ============================================================

-- 1. Placeholder for shared navigation (will reference pages created below)
create snippet MyModule.AppNav
{
  layoutgrid g { row { column (desktopwidth: 12) {
    dynamictext placeholder (content: '...')
  }}}
};

-- 2. NewEdit page (referenced by Overview's New button)
create page MyModule.Customer_NewEdit
(
  params: ( $Customer: MyModule.Customer ),
  title: 'Edit Customer',
  layout: Atlas_Core.PopupLayout
)
{
  -- ... widgets ...
};

-- 3. Overview page (references NewEdit + NavMenu)
create page MyModule.Customer_Overview
(
  title: 'Customers',
  layout: Atlas_Core.Atlas_Default
)
{
  layoutgrid g { row {
    column (desktopwidth: 3) {
      snippetcall nav (snippet: MyModule.AppNav)
    }
    column (desktopwidth: 9) {
      -- ... datagrid with New button calling ACT_Customer_New ...
    }
  }}
};

-- 4. Fill in navigation (pages now exist)
create or modify snippet MyModule.AppNav
{
  layoutgrid g { row { column (desktopwidth: 12) {
    actionbutton btnCustomers (
      caption: 'Customers',
      action: show page MyModule.Customer_Overview
    )
  }}}
};

-- 5. Microflows (pages already exist)
create microflow MyModule.ACT_Customer_New ()
begin
  $c = create MyModule.Customer ();
  show page MyModule.Customer_NewEdit (Customer = $c);
  return;
end;

-- 6. Navigation (pages already exist). This statement sets the whole profile,
-- its menu included: list every item the menu must keep.
create or modify navigation Responsive
  home page MyModule.Customer_Overview
  {
    menu item 'Customers' ( OnClick: show page MyModule.Customer_Overview )
  };

© 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/resolve-forward-references of mendixlabs/mxcli.

Open the folder on GitHubat commit 20a6c89

Compare with similar skills

Resolve Forward References 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.

Resolve Forward References compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Resolve Forward References this skillmendixlabs/mxcli128—~2.3kAutomated safety check: PassApache-2.0
CSS Orderthedaviddias/Front-End-Checklist74k—~404Automated safety check: PassMIT
Focus Orderthedaviddias/Front-End-Checklist74k—~519Automated safety check: PassMIT
Heading Orderthedaviddias/Front-End-Checklist74k—~452Automated safety check: PassMIT
Food Orderingasgeirtj/system_prompts_leaks69k—~1.4kAutomated safety check: PassCC0-1.0
Three-Statement Financial AnalysisHKUDS/Vibe-Trading35k—~1.2kAutomated safety check: PassMIT

Similar skills

  • CSS Order

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing stylesheets, component styles, and responsive behavior related to Order CSS files correctly.

    74k GitHub stars~404 tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed
  • Focus Order

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing rendered HTML, interactive components, or design-system patterns related to Ensure logical focus order.

    74k GitHub stars~519 tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed
  • Heading Order

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing rendered HTML, interactive components, or design-system patterns related to Maintain logical heading order.

    74k GitHub stars~452 tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed
  • Food Ordering

    asgeirtj/system_prompts_leaks

    Prepare restaurant food orders for delivery or pickup; use for cart, checkout and tracking.

    69k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Reads the income statement, balance sheet and cash flow statement together to judge earnings quality, apply DuPont analysis and check 12 red-flag indicators for manipulation; Chinese text.

    35k GitHub stars~1.2k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Official

    A skill your agent uses when a user asks to wobble ty constraint ordering, check constraint-set or TDD ordering determinism, test reversed constraint/typevar IDs, or investigate nondeterministic ty…

    50k GitHub stars~838 tokensUpdated today
    Testing & QAAuto-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 Resolve Forward References

What does Resolve Forward References do?

Order MDL statements so that every reference resolves — execution is sequential and immediate, so a document must exist before anything points at it. Resolve Forward References is an agent skill from mendixlabs/mxcli. Order MDL statements so that every reference resolves — execution is sequential and immediate, so a document must exist before anything points at it.

When should I use Resolve Forward References?

Resolve Forward References fits situations like: A script fails on a reference to something defined later in the same file.

How do I install Resolve Forward References in Claude Code?

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

How do I install Resolve Forward References in Codex?

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

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

What does Resolve Forward References need to run?

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

Does Resolve Forward References 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 Resolve Forward References 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 Resolve Forward References use?

Resolve Forward References 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 Resolve Forward References use?

About 2.3k tokens (SKILL.md is roughly 9.3k 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 Resolve Forward References?

Skills that share tags, products or a category with Resolve Forward References: CSS Order (thedaviddias/Front-End-Checklist, 74k stars), Focus Order (thedaviddias/Front-End-Checklist, 74k stars), Heading Order (thedaviddias/Front-End-Checklist, 74k stars) and Food Ordering (asgeirtj/system_prompts_leaks, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Resolve Forward References?

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.