Skip to content
Development
Command

/al-agent-task

Generate AL code for Business Central Agent SDK task integration. Applies the patterns from skill-agent-task-patterns to produce production-ready codeunits, page extensions, and event subscribers — verified against the runtime API availability matrix. ALDC workflow (Copilot

BOOST
From plugin
aldc-al-development-collection
11211 skills28 agents11 commands4 MCP
Install
> /plugin marketplace add javiarmesto/ALDC-AL-Development-Collection
> /plugin install aldc@aldc-marketplace

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/al-agent-task

Context preview

What this command does when you run it.

Generate AL code for Business Central Agent SDK task integration. Applies the patterns from skill-agent-task-patterns to produce production-ready codeunits, page extensions, and event subscribers — verified against the runtime API availability matrix. ALDC workflow (Copilot

Command definition

al-agent-task.md
description: Generate AL code for Business Central Agent SDK task integration. Applies the patterns from skill-agent-task-patterns to produce production-ready codeunits, page extensions, and event subscribers — verified against the runtime API availability matrix. ALDC workflow (Copilot prompt al-agent.task); invoke explicitly.
disable-model-invocation: true

> **Copilot CLI adapter — generated; do not edit this distribution.** > Select a role using /agent or copilot --agent <id>. Role names in this contract > are routing destinations, never chat mentions or evidence of an invocation. > Delegate only through the native task tool, using the exact discovered agent ID > as agent_type (for example al-planning-subagent). Inspect list_agents and the > actual task schema first. Keep all canonical human gates. Pass bounded context > inline; wait for completion (read_agent for a background task) before consuming > the result. A delegated role returns questions to its caller for the human gate. > If task or the requested custom agent is unavailable in this context, return > the blocked handoff to the caller/user. Never impersonate a missing subagent, > silently substitute general-purpose, or launch another CLI process to fake it. > Tool aliases in frontmatter select capabilities; call the actual tools exposed > by the host: view, glob, grep/rg, edit/create/apply_patch, bash/powershell, > web_fetch, task. Use a capability only when granted to this role and available. > Load domain skills through the host's skill mechanism when exposed, otherwise > read the complete bundled SKILL.md. A read is not a native skill invocation. > Resolve PLUGIN_ROOT to this installed agent's plugin directory (not the project > or original checkout). It is a path placeholder here, not a promised global > shell variable. Read docs/copilot-cli-al-tooling.md there for LSP/MCP bindings; > it supersedes older availability examples in the shared terminal contract at > skills/skill-migrate/references/cli-al-tools.md, never role duties or human gates. > Project instructions and matching .github/instructions rules remain binding; > pass the relevant excerpts to delegated roles. Canonical artifacts remain in > .github/plans/. Role write scopes are behavioral, not filesystem sandboxes. > AL execution requires a verified terminal command/runner or an actually exposed > MCP capability. Reuse the configured AL LSP for Agents wrapper through native > CLI semantic tools when exposed to this role. Inspect the catalog; do not invent > tool aliases or broaden read-only grants to enable rename/write operations. > Editor debugger controls remain separate from semantic navigation. Official AL > MCP selectors use al/<tool>; only Developer/Implementer receive compile/build/ > restore. Discover the actual callable names and pass the correct App/Test path. > No official publish/authentication tool is granted by this adapter. Triage alone > receives the optional dedicated bc-profiling and bc-snapshot proxies; discover > their schemas and confirm an authorized target/window before capture. Other > roles consume evidence. Capture does not prove autonomous snapshot debugging. > Symbol MCP: before any tools/call, verify AL CLI prerequisites are already > provisioned; this provider may auto-install AL tools on first use. A read-only > role must return that prerequisite to the caller, never bootstrap software. > Load symbols via al_packages(action: load, path: absolute consumer path). > The MCP process may run from the plugin cache; never assume its cwd is the > consumer. Use the discovered schema and report missing .app packages explicitly. > Record missing capabilities and unexecuted checks explicitly; never simulate.

Workflow: Generate Agent Task Integration Code

Generates production-ready AL code for agent task integration. This prompt does not contain pattern knowledge — it applies the patterns from `skill-agent-task-patterns`.

**Load skill first**: `skill-agent-task-patterns` (8 patterns A–H, SDK codeunits, API availability matrix, OnPrem-only restrictions, workarounds).

Step 1 — Gather context

Before generating code, determine:

1. **Agent name and prefix** — read from `app.json` or ask the developer 2. **Object ID range** — check existing objects in `app/` for the next available IDs 3. **Which pattern(s)** — ask or infer from the request:

  • "I need a Public API" → Pattern A
  • "Add a button to send work to the agent" → Pattern B (calls A)
  • "Trigger agent on posting/releasing" → Pattern C (calls A)
  • "Agent needs to process files" → Pattern D (combine with A/B/C)
  • "Continue an existing task" → Pattern E (verify `AddToTask` availability against the matrix)
  • "Run code only in agent context" → Pattern G/H
  • "Force human review" → Warning annotation workaround (matrix: `SetRequiresReview` OnPrem-only)

4. **ExternalId format** — convention `{PREFIX}-{No.}` (e.g. `LEAD-001`, `SO-1001`) 5. **Target page/table** — which page extension or event subscriber is needed?

Step 2 — Verify availability

**Before writing any code**, check each method against the API Availability Matrix in `skill-agent-task-patterns`. Any method marked OnPrem-only or "Not in 17.0" requires the documented workaround.

Step 3 — Generate code

For each requested pattern:

1. **Search the codebase** for existing agent objects (Setup table, Public API, enums) to reuse 2. **Generate AL objects** following the pattern from the skill, substituting:

  • `{Agent}` → actual agent name/prefix
  • `{id}` → actual object IDs
  • Record names, field names, enum values → actual project values

3. **Place files** in the correct folder of the project structure:

  • Public API + Impl → `app/Example/`
  • Page extensions → `app/Example/`
  • Session events → `app/Setup/TaskExecution/`

4. **Verify** generated code references correct enum values and codeunit names

Step 4 — Validate

  • [ ] All generated codeunits compile (correct parameter types,
Read more
Ships withaldc-al-development-collection

Skills-based, spec-driven, TDD-orchestrated development framework for Microsoft Dynamics 365 Business Central. Engineering systems, visibly reasoned.

Get the whole plugin