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.
npx skills add mbaic/mb-al-ai-toolkit --skill al-sortrecordrefgit clone --depth 1 https://github.com/mbaic/mb-al-ai-toolkitWrote 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.
[](https://agentmods.dev/skills/mbaic/mb-al-ai-toolkit/al-sortrecordref)<a href="https://agentmods.dev/skills/mbaic/mb-al-ai-toolkit/al-sortrecordref"><img src="https://agentmods.dev/badge/skills/mbaic/mb-al-ai-toolkit/al-sortrecordref.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00057 | $0.02975 |
| Opus 5 | $0.00028 | $0.01488 |
| Sonnet 5 | $0.00011 | $0.00595 |
| Haiku 4.5 | $0.00006 | $0.00298 |
Grade A, and why
al-sortrecordref 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 8d 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.
How it starts
The opening of the file, as written. The whole thing — 394 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AL RecordRef Sorting & SortRecordRef Skill
Purpose
This skill provides expert guidance on sorting records dynamically using RecordRef in Dynamics 365 Business Central. It covers:
- SortRecordRef procedure from the Type Helper codeunit (Codeunit 10)
- RecordRef sorting strategies for dynamic, table-agnostic code
- SetView method for combining sorting, ordering, and filtering
- Ascending/Descending order control via the Ascending() method
- Best practices for generic code that works across multiple tables
- Key selection strategies for reliable sorting without hardcoding
When to Use This Skill
Use this skill when you need to:
- Sort records dynamically using a RecordRef variable (not tied to a specific table type)
- Implement the SortRecordRef procedure in your codeunits
- Handle sorting for multiple table types in a single code path
- Control sort order programmatically (ascending vs. descending)
- Combine sorting, filtering, and key selection in generic code
- Understand the SetView method and its impact on record iteration
- Apply field-based sorting when the primary key is not suitable
- Make language-independent sorting code that works across locales
Core Concepts: RecordRef Sorting
What is RecordRef?
RecordRef is a data type that acts as a generic runtime pointer to any table. Unlike a typed Record variable (which is bound to a specific table at compile time), a RecordRef can reference any table by its ID.
Key Differences:
| Aspect | Record (Typed) | RecordRef (Dynamic) |
|---|---|---|
| Table Binding | Compile-time, specific table | Runtime, any table |
| Syntax | Record Customer |
RecordRef + Open(Integer) |
| Use Case | Normal AL code | Generic utilities, Type Helpers |
| Sorting | SetCurrentKey() |
CurrentKeyIndex() or SetView() |
Why Sort RecordRef?
RecordRef defaults to the primary key. When you need:
- A different sort order (by Name instead of ID)
- Descending order instead of ascending
- Multi-table generic code that applies the same sort to different tables
- Dynamic sort specifications at runtime
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 8d ago First seen · 394 lines · 57 tokens per session scan A 85ce84406dcf
al-sortrecordref is a skill published in the GitHub repository mbaic/mb-al-ai-toolkit (1 stars, last pushed 5mo ago), licensed MIT. It adds 57 tokens to every session and 2,975 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-31.
Other skills, from other repositories
dynamics-nav
Comprehensive operational skill specification for Anthropic Claude to automate, script, troubleshoot, and optimize Microsoft Dynamics NAV, Business Central, AL/CAL codeunits, OData V4, and NAV Server administration.
bc-exploratory-test
Use when exploratory-testing a Business Central extension through BC web and MobileNAV with bc-rig, then producing an evidence-backed handover.
businesscentral
Interact with Microsoft Dynamics 365 Business Central — authenticate, query entities, create/update/delete records, manage sales orders, invoices, customers, vendors, items, and more via the BC REST API.
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…