agent-builder
Agent Toolkit Builder — specialist in designing and coding Business Central agents using the AI Development Toolkit and Agent…
AL debugging and diagnostics for Business Central. Use when performing snapshot debugging, CPU profiling, analyzing telemetry, or troubleshooting runtime issues.
$ npx -y skills add javiarmesto/ALDC-AL-Development-Collection --skill skill-debug --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/skill-debugContext preview
The summary Claude sees to decide when to auto-load this skill.
AL debugging and diagnostics for Business Central. Use when performing snapshot debugging, CPU profiling, analyzing telemetry, or troubleshooting runtime issues.
name: skill-debug description: "AL debugging and diagnostics for Business Central. Use when performing snapshot debugging, CPU profiling, analyzing telemetry, or troubleshooting runtime issues."
For BC29 AL0926 section-order errors or new isolation behavior, read the relevant sections of [AL18 capability checks](../skill-migrate/references/al18-capabilities.md). Use actual compiler/runtime evidence and keep compilation distinct from execution.
Systematic diagnosis and root cause analysis for AL Business Central issues: runtime errors, logic bugs, intermittent failures, performance bottlenecks, and configuration problems.
This skill should be loaded when:
Select the right tool before starting:
| Issue Type | Strategy | Tool | |---|---|---| | Consistent runtime error | Standard debugger | `al_debug` | | Already deployed code | Debug without publish | `al_debug` | | Rapid dev cycle | Incremental publish | `al_publish` (incremental) | | Intermittent / hard-to-reproduce | Snapshot debugging | `al_snapshotdebugging` | | Slow performance | CPU profiling | VS Code command (not an agent tool) | | Auth / symbols / build | Configuration troubleshoot | See Workflow Step 2b | | Copilot AI feature | Agent session debug | `launch.json` with `clientType: Agent` |
Scenario: "Value is wrong after posting" 1. Set breakpoint at final location (where value is wrong) 2. Work backwards to find where value is set 3. Use `usages` tool to find all assignments 4. Set breakpoints at each assignment point 5. Step through to find which execution path is taken 6. Inspect conditions and variable states at each point
Scenario: "My event subscriber doesn't execute" 1. Verify subscriber signature exactly matches publisher (name, parameters, types) 2. Check SkipOnMissingLicense and SkipOnMissingPermission attributes 3. Confirm the extension containing the publisher is active and published 4. Set breakpoint inside subscriber body 5. Verify the publisher event is actually being raised (breakpoint in publisher) 6. Check if IsHandled = true is set before your subscriber runs 7. Inspect subscriber execution order (EventPriority)
// ❌ N+1 pattern — common cause of slow pages
repeat
Item.Get(SalesLine."No."); // DB call inside loop
SalesLine.Amount := Item.Price * SalesLine.Quantity;
until SalesLine.Next() = 0;
// ✅ Use SetLoadFields + single pass
SalesLine.SetLoadFields("No.", Quantity, Amount);
if SalesLine.FindSet() then
repeat
// ...
until SalesLine.Next() = 0;CPU profile analysis focus:
⚠️ HUMAN GATE: Snapshots may capture sensitive runtime data. Before initializing: 1. Confirm what data will be captured 2. Security review for sensitive information 3. Obtain explicit user approval Commands (one tool — `al_snapshotdebugging` — covers initialize / finish / view): al_snapshotdebugging (initialize) ← start capture session [reproduce scenario 10-20 times] al_snapshotdebugging (finish) ← end capture al_snapshotdebugging (view) ← view and compare Compare snapshots between success and failure cases: - Variable values at failure point - Timing differences - Execution paths taken - Data state variations
Read existing plans context first:
.github/plans/memory.md ← project state and recent decisions .github/plans/*-diagnosis.md ← previous debug sessions (similar issues)
Gather issue information:
**Stop criterion**: can reproduce the issue consistently (≥80% success rate).
1. Narrow down scope with `search` and `usages` tools 2. Identify suspect objects (tables, pages, codeunits, event subscribers) 3. Attach debugger with selected strategy (Pattern 1) 4. Set strategic breakpoints:
5. Inspect: variable values, record filters, call stack, parameter values 6. Step execution: F10 (step over), F11 (step into), Shift+F11 (step out)
**Authentication failures** (401/403, cannot download symbols):
⚠️ HUMAN GATE: Clearing credentials disconnects active sessions. Confirm impact and obtain approval before clearing the credentials cache (a VS Code command, not an agent tool). Then re-authenticate and verify launch.json authentication method.
**Missing symbols** (unresolved references, red squiggles):
al_downloadsymbols ← first attempt al_downloadsymbols (globalSourcesOnly) ← if no BC server connection is available al_build ← verify compilation
Check `app.json` dependencies version alignment.
**Build errors — common codes**:
Skills-based, spec-driven, TDD-orchestrated development framework for Microsoft Dynamics 365 Business Central. Engineering systems, visibly reasoned.
Agent Toolkit Builder — specialist in designing and coding Business Central agents using the AI Development Toolkit and Agent…
Generate optimized natural language instructions for Business Central agents (Designer or SDK). Applies the…
End-to-end workflow to create a coded Business Central agent using the Agent SDK. Orchestrates the 7 phases following the…
Generate optimized natural language instructions for Business Central agents (Designer or SDK). Applies the…
Generate AL code for Business Central Agent SDK task integration. Applies the patterns from skill-agent-task-patterns to produce…
Generate comprehensive test codeunits for Business Central Agent SDK integrations. Covers 6 categories: Registration, Factory,…