aldc-verify
English · Español
English
What it is
aldc-verify is a Claude Code plugin for Business Central AL developers. It makes Claude verify its own AL work: it compiles your projects with the real AL compiler (L1), runs the code analyzers (L2), and a Stop hook does not let Claude end a turn with compile errors it introduced. Agents can also deliver on their own (commit file by file, push a claude/… branch, open a draft PR) behind a guard that refuses merges, force pushes and pushes to the default branch.
It works on its own. ALDC is an optional integration, not a requirement.
L1 compile · L2 analyzers · Stop gate · guard · Windows · Linux/cloud · GitHub Actions · MIT
Requirements
- Claude Code (CLI, desktop or claude.ai/code).
- Node.js 20 or later (the hooks are plain Node scripts, no dependencies).
- An AL compiler, one of:
- Windows:
alc.exe from the AL Language extension for VS Code (ms-dynamics-smb.al-<version>); the plugin finds it under ~/.vscode*/extensions.
- Any platform: the cross-platform
al dotnet tool (Microsoft.Dynamics.BusinessCentral.Development.Tools). On Linux (cloud sessions) the plugin installs dotnet 8 and the pinned tool version itself.
- Symbols in each project's
.alpackages (or VS Code's al.packageCachePath). Without them the result is not-run, never a false green.
Install and update
claude plugin marketplace add javiarmesto/aldc-verify-plugin
claude plugin install aldc-verify@aldc-verify-dev
To move to a new version, update the marketplace and the plugin, then restart Claude Code:
claude plugin marketplace update aldc-verify-dev
claude plugin update aldc-verify@aldc-verify-dev
- Cloud sessions (claude.ai/code): the repo's
.claude/settings.json does not install plugins in cloud or headless (claude -p) sessions. Put the two install lines in the environment's setup script. It only runs in new sessions, not in sessions resumed from cache.
- Per repo:
/aldc-verify:init adds extraKnownMarketplaces and enabledPlugins to .claude/settings.json, so interactive sessions offer the plugin after the project is trusted.
- Try a local copy without installing it:
claude --plugin-dir <path-to-plugin> (also works with -p).
What happens in a session
The plugin registers five hooks. They only act in repos with at least one app.json. The key idea is the fingerprint: a hash of the .al files, the app.json files, the resources and the symbol list, taken when the turn starts and compared when it ends. If Claude did not touch AL, nothing is compiled.
| Hook | Script | What it does |
|---|
| SessionStart | ensure-al-toolchain.js | Finds the compiler (Windows/macOS: detect only; Linux: installs dotnet 8 and the pinned al tool). Gives Claude one line of context: compiler, BC version, projects. |
| UserPromptSubmit | al-verify-baseline.js | Stores the fingerprint at the start of each turn. Prints nothing. |
| PreToolUse (Bash, PowerShell) | guard.js | Denies git/gh commands that cannot be undone (see Guard). |
| SubagentStop (implement, developer, builder) | al-verify-gate.js | Same gate as Stop, for code-writing subagents, each with its own attempt counter. |
| Stop | al-verify-gate.js | The gate (below). |
The Stop gate:
- No
app.json in the repo: exit.
- Fingerprint unchanged since the turn started: exit without compiling, even if the tree is red. What was already broken is not a reason to block.
- Fingerprint equal to the last green build: exit (about 0.2 s).
- Otherwise compile every project in dependency order (App before Test), each with a filtered symbol cache: Microsoft symbols of the target BC major; in-repo apps replaced by the fresh build.
- Errors:
exit 2 with up to 40 diagnostics on stderr, so Claude keeps fixing. The message asks Claude to confirm with /aldc-verify:al-verify --l1, because only the user sees the gate's final green.
- After
maxAttempts (3) blocks in a row, or when Claude changes nothing after a block, it lets Claude stop and shows the pending errors. If the build turns green after a block, it tells Claude once, so the final answer cites it.
- No compiler, missing symbols, or
alc failing without diagnostics: not-run or incomplete verification, and it never blocks.