Merge pull request #59 from Curabis/setup/find-altool-template

find-altool.ps1 er et CURABIS-artefakt — fantomkommandoen udryddet (setup v16, Rømer v5)
This commit is contained in:
Michael Dieringer 2026-07-03 15:50:57 +02:00 • committed by GitHub
commit 470524eac9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 60 additions and 29 deletions

View file

@ -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), It installs the global CLAUDE.md (identity substituted from git config),
bc-mcp-bridge.js, the bc-mcp config template (the developer inserts their bc-mcp-bridge.js, the bc-mcp config template (the developer inserts their
personal client secret), the knowledge sync script, and syncs the machine personal client secret), the knowledge sync script, and syncs the machine
mirror. Per repo afterwards: VS Code → `AL: Configure MCP Server` (generates mirror. Per repo afterwards: "Opdater CURABIS Standard fra BCQuality" — it
`.vscode/find-altool.ps1`), then "Opdater CURABIS Standard fra BCQuality". 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 **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 project CLAUDE.md (setup v15+) carries a machine self-heal: any Claude Code

View file

@ -1,7 +1,7 @@
--- ---
kind: action-skill kind: action-skill
id: curabis-standards-inspector id: curabis-standards-inspector
version: 4 version: 5
title: Rømer — Standards Inspector title: Rømer — Standards Inspector
description: > description: >
Owns the uniformity inspection across CURABIS repos: walks one full 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 `<App>.Test` 11. **Test app per main app.** Every main app project has a `<App>.Test`
companion (same rule). Missing on a template-compliant repo = one companion (same rule). Missing on a template-compliant repo = one
`CreateTestApp` workflow run, not a migration. Report-only. `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 ## Safety rules

View file

@ -1,7 +1,7 @@
--- ---
kind: action-skill kind: action-skill
id: curabis-standard-setup id: curabis-standard-setup
version: 15 version: 16
title: CURABIS Standard — Project Setup title: CURABIS Standard — Project Setup
description: > description: >
Configures a new or existing repository to the CURABIS Standard development 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` | | ferencz.agent.md | `{AGENTS_BASE}/ferencz.agent.md` |
| roemer.agent.md | `{AGENTS_BASE}/roemer.agent.md` | | roemer.agent.md | `{AGENTS_BASE}/roemer.agent.md` |
| cspell.json | `{BASE}/templates/cspell.json` | | cspell.json | `{BASE}/templates/cspell.json` |
| find-altool.ps1 | `{BASE}/templates/find-altool.ps1` |
| sync-bcquality-knowledge.ps1 | `{BASE}/sync-bcquality-knowledge.ps1` | | sync-bcquality-knowledge.ps1 | `{BASE}/sync-bcquality-knowledge.ps1` |
CLAUDE.md and .mcp.json are generated dynamically — not fetched as static templates 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" 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: Then report the manual leftovers it lists (personal client secret; the AL
Configure MCP Server) and ask the developer to restart Claude Code. 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 If only `~/.claude/bcquality-knowledge/` is missing or stale, the lighter
self-heal suffices: 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. (`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 ```json
{ {
"mcpServers": { "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:-.}` Use Claude Code's built-in environment-variable expansion — `${CLAUDE_PROJECT_DIR:-.}`
and `${USERPROFILE}` — instead of substituting literal detected paths. `.mcp.json` is 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 git-committed and shared; a path baked in for one developer's machine or username
breaks every other developer's clone (see BCQuality rule breaks every other developer's clone (see BCQuality rule
`mcp-config-must-not-hardcode-developer-paths`). `mcp-config-must-not-hardcode-developer-paths`).
If `find-altool.ps1` is missing, note after writing .mcp.json: The only machine prerequisite is the AL Language extension itself
> "ℹ️ AL MCP er ikke konfigureret endnu. Kør `Ctrl+Shift+P → AL: Configure MCP Server` (`ms-dynamics-smb.al` from the Marketplace, recent version) — find-altool.ps1
> i VS Code for at generere find-altool.ps1, og kør derefter locates its `altool.exe` dynamically and reports clearly if it is missing.
> 'Opdater CURABIS Standard fra BCQuality' — AL MCP tilføjes automatisk."
#### 4c. .github/.agents/ (fetch from BCQuality) #### 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 | | `~/.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) | | `.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 | | `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` — `businesscentral` path | Validate and correct if wrong (see below) |
| `.mcp.json` — `al` `-File` 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`) | | `.apps/*.code-workspace` — reference layout | Create/complete: app projects + `.AL-Go` + relative `../docs` (rule `al-development-must-use-apps-workspace`) |

View file

@ -11,7 +11,7 @@
# Hvad der IKKE haandteres her (personligt/manuel): # Hvad der IKKE haandteres her (personligt/manuel):
# - din client secret i ~/.bc-mcp.config.json (scriptet lægger templaten # - din client secret i ~/.bc-mcp.config.json (scriptet lægger templaten
# og siger til) # 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( param(
[string]$FullName, [string]$FullName,
[string]$UserName [string]$UserName
@ -77,6 +77,6 @@ if ($todo) {
$todo | ForEach-Object { Write-Host " !! $_" -ForegroundColor Yellow } $todo | ForEach-Object { Write-Host " !! $_" -ForegroundColor Yellow }
} }
Write-Host '' Write-Host ''
Write-Host 'Pr. repo herefter: aabn i VS Code -> AL: Configure MCP Server (genererer' Write-Host 'Pr. repo herefter: sig "Opdater CURABIS Standard fra BCQuality" i Claude'
Write-Host '.vscode/find-altool.ps1), og sig "Opdater CURABIS Standard fra BCQuality"' Write-Host 'Code - den deployer selv .vscode/find-altool.ps1 og AL MCP-opsaetningen.'
Write-Host 'i Claude Code. Genstart Claude Code efter foerste onboarding.' Write-Host 'Genstart Claude Code efter foerste onboarding.'

View file

@ -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