From 5fb29ee749b4afed5bccf25b20b646b4bab574a0 Mon Sep 17 00:00:00 2001 From: Michael Dieringer <65093775+MichaelDieringer@users.noreply.github.com> Date: Fri, 3 Jul 2026 15:49:05 +0200 Subject: [PATCH] find-altool.ps1 er et CURABIS-artefakt - fantomkommandoen udryddet Felttest paa fremmed maskine afsloerede at VS Code-kommandoen AL: Configure MCP Server IKKE FINDES - den har staaet i setup- dokumentationen siden v6 og er blevet gentaget ukritisk siden, inkl. af Claude i dag. find-altool.ps1 var i virkeligheden haandlavet i Jernpladsen/Wareco (funktionelt identiske kopier). - custom/setup/templates/find-altool.ps1: kanonisk template med robust versionssortering ([version]-parse i stedet for leksikalsk) og klar fejlbesked ved manglende/for gammel AL-extension - Setup v16: 4b deployer filen fra templaten (raa bytes) og skriver ALTID al-entryen i .mcp.json; det betingede spor og fantom-noten er fjernet. Mode B: ny raekke deployer filen hvis den mangler - Install-CurabisMachine.ps1 + CONSUMPTION.md: pr.-repo-trinnet er nu bare Opdater CURABIS Standard - AL-extensionen fra Marketplace er eneste maskinforudsaetning - Roemer v5, station 12: AL MCP-wiring paa runden med autoriseret stille korrektion. Evidens: en session skrev AL-kode den ikke kunne compile og flagede det foerst ved forespoergsel (Conzept) Co-Authored-By: Claude Fable 5 --- CONSUMPTION.md | 6 ++- custom/agents/roemer.agent.md | 8 +++- custom/setup/curabis-standard.agent.md | 42 +++++++++---------- .../setup/machine/Install-CurabisMachine.ps1 | 8 ++-- custom/setup/templates/find-altool.ps1 | 25 +++++++++++ 5 files changed, 60 insertions(+), 29 deletions(-) create mode 100644 custom/setup/templates/find-altool.ps1 diff --git a/CONSUMPTION.md b/CONSUMPTION.md index d05faf3..9fe2e89 100644 --- a/CONSUMPTION.md +++ b/CONSUMPTION.md @@ -48,8 +48,10 @@ A fresh developer machine is made CURABIS-ready with ONE command It installs the global CLAUDE.md (identity substituted from git config), bc-mcp-bridge.js, the bc-mcp config template (the developer inserts their personal client secret), the knowledge sync script, and syncs the machine -mirror. Per repo afterwards: VS Code → `AL: Configure MCP Server` (generates -`.vscode/find-altool.ps1`), then "Opdater CURABIS Standard fra BCQuality". +mirror. Per repo afterwards: "Opdater CURABIS Standard fra BCQuality" — it +deploys `.vscode/find-altool.ps1` (a CURABIS template; no VS Code command +generates it) and the AL MCP wiring itself. The AL Language extension from +the Marketplace is the only per-machine prerequisite for AL MCP. **Auto-trigger:** the command above rarely needs to be run by hand. Every project CLAUDE.md (setup v15+) carries a machine self-heal: any Claude Code diff --git a/custom/agents/roemer.agent.md b/custom/agents/roemer.agent.md index 58a93ef..98f251f 100644 --- a/custom/agents/roemer.agent.md +++ b/custom/agents/roemer.agent.md @@ -1,7 +1,7 @@ --- kind: action-skill id: curabis-standards-inspector -version: 4 +version: 5 title: Rømer — Standards Inspector description: > Owns the uniformity inspection across CURABIS repos: walks one full @@ -97,6 +97,12 @@ Walk ALL stations, every time. A partial round creates false confidence 11. **Test app per main app.** Every main app project has a `.Test` companion (same rule). Missing on a template-compliant repo = one `CreateTestApp` workflow run, not a migration. Report-only. +12. **AL MCP wiring.** `.vscode/find-altool.ps1` exists (tracked) and + `.mcp.json` has the `al` entry. Silent correction authorized: deploy the + file from `{BASE}/templates/find-altool.ps1` (raw bytes) and add the + entry — it is a CURABIS artifact; no VS Code command generates it. + Evidence for this station: a session wrote AL code it could not compile + and only surfaced the gap when asked (Conzept, 2026-07-02). ## Safety rules diff --git a/custom/setup/curabis-standard.agent.md b/custom/setup/curabis-standard.agent.md index c7915f5..8603dda 100644 --- a/custom/setup/curabis-standard.agent.md +++ b/custom/setup/curabis-standard.agent.md @@ -1,7 +1,7 @@ --- kind: action-skill id: curabis-standard-setup -version: 15 +version: 16 title: CURABIS Standard — Project Setup description: > Configures a new or existing repository to the CURABIS Standard development @@ -66,6 +66,7 @@ AGENTS_BASE = https://raw.githubusercontent.com/Curabis/BCQuality/stable/custom/ | ferencz.agent.md | `{AGENTS_BASE}/ferencz.agent.md` | | roemer.agent.md | `{AGENTS_BASE}/roemer.agent.md` | | cspell.json | `{BASE}/templates/cspell.json` | +| find-altool.ps1 | `{BASE}/templates/find-altool.ps1` | | sync-bcquality-knowledge.ps1 | `{BASE}/sync-bcquality-knowledge.ps1` | CLAUDE.md and .mcp.json are generated dynamically — not fetched as static templates @@ -191,8 +192,9 @@ run the full onboarding NOW (idempotent; identity taken from git config): powershell -ExecutionPolicy Bypass -Command "Invoke-WebRequest -UseBasicParsing https://raw.githubusercontent.com/Curabis/BCQuality/stable/custom/setup/machine/Install-CurabisMachine.ps1 -OutFile $env:TEMP\icm.ps1; & $env:TEMP\icm.ps1" -Then report the manual leftovers it lists (personal client secret, AL: -Configure MCP Server) and ask the developer to restart Claude Code. +Then report the manual leftovers it lists (personal client secret; the AL +Language extension if VS Code lacks it) and ask the developer to restart +Claude Code. If only `~/.claude/bcquality-knowledge/` is missing or stale, the lighter self-heal suffices: @@ -345,9 +347,17 @@ After creating any new `.al` file, reload the AL extension in VS Code (`Ctrl+Shift+P -> AL: Reload Extension`) before trusting diagnostics. ``` -#### 4b. .mcp.json +#### 4b. AL MCP + .mcp.json + +`find-altool.ps1` is a CURABIS artifact deployed from BCQuality — there is NO +VS Code command that generates it (the historical instruction "AL: Configure +MCP Server" referenced a command that does not exist). + +1. If `.vscode/find-altool.ps1` is missing: fetch + `{BASE}/templates/find-altool.ps1` AS RAW BYTES → `.vscode/find-altool.ps1` + (create `.vscode/` if needed) and stage it for commit. +2. Write `.mcp.json` — ALWAYS with both entries: -If `.vscode/find-altool.ps1` exists: ```json { "mcpServers": { @@ -368,28 +378,15 @@ If `.vscode/find-altool.ps1` exists: } ``` -If `.vscode/find-altool.ps1` does NOT exist: -```json -{ - "mcpServers": { - "businesscentral": { - "command": "node", - "args": ["${USERPROFILE}\\.claude\\bc-mcp-bridge.js"] - } - } -} -``` - Use Claude Code's built-in environment-variable expansion — `${CLAUDE_PROJECT_DIR:-.}` and `${USERPROFILE}` — instead of substituting literal detected paths. `.mcp.json` is git-committed and shared; a path baked in for one developer's machine or username breaks every other developer's clone (see BCQuality rule `mcp-config-must-not-hardcode-developer-paths`). -If `find-altool.ps1` is missing, note after writing .mcp.json: -> "ℹ️ AL MCP er ikke konfigureret endnu. Kør `Ctrl+Shift+P → AL: Configure MCP Server` -> i VS Code for at generere find-altool.ps1, og kør derefter -> 'Opdater CURABIS Standard fra BCQuality' — AL MCP tilføjes automatisk." +The only machine prerequisite is the AL Language extension itself +(`ms-dynamics-smb.al` from the Marketplace, recent version) — find-altool.ps1 +locates its `altool.exe` dynamically and reports clearly if it is missing. #### 4c. .github/.agents/ (fetch from BCQuality) @@ -546,7 +543,8 @@ Never touches `CLAUDE.md`, `projectmemory/`, `docs/`, or `~/.bc-mcp.config.json` | `~/.claude/bcquality-knowledge/` | Re-run the sync script (see below) — machine-local, nothing to commit | | `.github/.agents/bcquality-knowledge/` + `.github/.agents/sync-bcquality-knowledge.ps1` | v6-era repo-local mirror: propose removal (see below) | | `cspell.json` — words from template | Merge new words, keep project words | -| `.mcp.json` — `al` entry | Add if `find-altool.ps1` now exists and entry is missing | +| `.vscode/find-altool.ps1` | Fetch from `{BASE}/templates/` (raw bytes), add if missing — CURABIS artifact, no VS Code command generates it | +| `.mcp.json` — `al` entry | Add if missing (find-altool.ps1 is deployed by the row above) | | `.mcp.json` — `businesscentral` path | Validate and correct if wrong (see below) | | `.mcp.json` — `al` `-File` path | Validate and correct if wrong (see below) | | `.apps/*.code-workspace` — reference layout | Create/complete: app projects + `.AL-Go` + relative `../docs` (rule `al-development-must-use-apps-workspace`) | diff --git a/custom/setup/machine/Install-CurabisMachine.ps1 b/custom/setup/machine/Install-CurabisMachine.ps1 index c49ef81..83f7430 100644 --- a/custom/setup/machine/Install-CurabisMachine.ps1 +++ b/custom/setup/machine/Install-CurabisMachine.ps1 @@ -11,7 +11,7 @@ # Hvad der IKKE haandteres her (personligt/manuel): # - din client secret i ~/.bc-mcp.config.json (scriptet lægger templaten # og siger til) -# - VS Code + AL-extension + 'AL: Configure MCP Server' pr. repo +# - VS Code + AL Language-extensionen (ms-dynamics-smb.al fra Marketplace) param( [string]$FullName, [string]$UserName @@ -77,6 +77,6 @@ if ($todo) { $todo | ForEach-Object { Write-Host " !! $_" -ForegroundColor Yellow } } Write-Host '' -Write-Host 'Pr. repo herefter: aabn i VS Code -> AL: Configure MCP Server (genererer' -Write-Host '.vscode/find-altool.ps1), og sig "Opdater CURABIS Standard fra BCQuality"' -Write-Host 'i Claude Code. Genstart Claude Code efter foerste onboarding.' +Write-Host 'Pr. repo herefter: sig "Opdater CURABIS Standard fra BCQuality" i Claude' +Write-Host 'Code - den deployer selv .vscode/find-altool.ps1 og AL MCP-opsaetningen.' +Write-Host 'Genstart Claude Code efter foerste onboarding.' diff --git a/custom/setup/templates/find-altool.ps1 b/custom/setup/templates/find-altool.ps1 new file mode 100644 index 0000000..37debcb --- /dev/null +++ b/custom/setup/templates/find-altool.ps1 @@ -0,0 +1,25 @@ +# find-altool.ps1 - CURABIS-artefakt (deployes fra BCQuality, ikke genereret +# af AL-extensionen - der findes ingen VS Code-kommando til dette). +# +# Finder altool.exe dynamisk i den NYESTE installerede AL Language extension, +# uanset version, og videresender alle argumenter. Bruges af .mcp.json til at +# starte AL MCP-serveren: +# powershell -ExecutionPolicy Bypass -File .vscode/find-altool.ps1 launchmcpserver --transport stdio + +$ext = Get-ChildItem "$env:USERPROFILE\.vscode\extensions" -Filter "ms-dynamics-smb.al-*" -Directory | + Sort-Object { [version]($_.Name -replace '^ms-dynamics-smb\.al-', '' -replace '-.*$', '') } -Descending | + Select-Object -First 1 + +if (-not $ext) { + Write-Error "AL Language extension ikke fundet. Installer ms-dynamics-smb.al fra VS Code Marketplace." + exit 1 +} + +$altool = Join-Path $ext.FullName "bin\win32\altool.exe" + +if (-not (Test-Path $altool)) { + Write-Error "altool.exe ikke fundet i $($ext.FullName) - opdater AL-extensionen (MCP-serveren kraever en nyere version)." + exit 1 +} + +& $altool @args