agentleFS
javiarmestojaviarmesto/ALDC-AL-Development-Collection/.claude/skills/al-agent-task/SKILL.md

al-agent-task

Skill115 starsChanged 11 days agoMITView on GitHub

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.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before generating code, determine:

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Claude Code adapter — generated by scripts/sync-plugin-support.js, do not edit. Canonical source: prompts/al-agent.task.prompt.md (sha256 2fd84ae74f374a979d6cc65fccd9aa51c8c60d7fba6ae9628d892446f3da6f1f). This workflow was written for @workspace use … in GitHub Copilot Chat. Apply these harness mappings and treat everything else as binding:

Copilot surface in the contractClaude Code equivalent
#runSubagent / runSubagent / agents:The Task tool with subagent_type: "aldc:<agent>"; one invocation carries everything inline (subagents are stateless)
#askQuestions / vscode/askQuestionsAskUserQuestion (main session only; a subagent returns its questions in its structured output)
handoffs: entries, and send: false on oneNo equivalent — the gate is yours to keep. In Copilot a handoff is a button the human clicks, and send: false additionally hands them the prompt to review before it is sent; the host supplies the approval. Claude Code delegates through the Task tool, with no click and no review step. So never auto-delegate: present your output, get explicit approval, and only then delegate or route to another role. The handoff's routing is carried by the plugin's role entry skills; its human gate is carried by this rule
@al-architect, @al-spec-agent, @al-conductor, @al-developer, @al-developer-reviewer, @al-triage, @al-presales, @al-agent-builder, @dredd/aldc:architect, /aldc:spec, /aldc:conduct, /aldc:develop, /aldc:review, /aldc:triage, /aldc:presales, /aldc:agent-builder, /aldc:audit (or claude --agent aldc:<agent>)
@workspace use <workflow>/aldc:<workflow> with dots replaced by dashes (al-spec.create -> /aldc:al-spec-create); already rewritten below
${input:Name} prompt variablesTake the value from $ARGUMENTS; ask through AskUserQuestion when missing. Already rewritten below as <Name from $ARGUMENTS>
execute / runInTerminal, AL compilation or symbol restoreDeveloper/Implementer: discovered official AL MCP mcp__al__al_compile / mcp__al__al_build / mcp__al__al_downloadsymbols, or an installed ALTool/AL-Go runner through Bash. Use the correct App/Test project; unavailable capabilities are never simulated. Publishing retains its separate human/CI gate and is not granted by this adapter
edit, read/readFile, search, #codebaseEdit/Write, Read, Grep/Glob
#changes, changes, search/changesRead-only git status / git diff through Bash only where granted; otherwise read the caller-supplied diff artifact or return the missing evidence request
read/problems, al_get_diagnostics, #testFailureDiscovered mcp__al__al_getdiagnostics for the explicit project, or actual compiler/test output. Diagnostics are not evidence of a fresh compile or executed tests. No result: record not-run / unavailable
al-symbols-mcp/*, upstash/context7/*, microsoft-learn/*, microsoft-docs/*Tools named mcp__al-symbols-mcp__*, mcp__context7__*, mcp__microsoft-docs__* (or the mcp__plugin_aldc_… form). A server that is not loaded is unavailable; do not simulate it
sshadowsdk.al-lsp-for-agents/*, #usages, semantic definition/reference queriesClaude LSP with the existing AL LSP for Agents companion; discover the actual operations and project context first. VS Code tool identifiers are not Claude tool names
ms-dynamics-smb.al/*, vscode.mermaid-chat-features/*VS Code tool identifiers do not exist here. Use only a separately discovered Claude capability; never rename community tools as Microsoft tools
vscode/memory, vscode/*Not available; keep state in the canonical .claude/plans/ artifacts of the project
todoTodoWrite for in-session tracking; durable state stays in .claude/plans/
"load skill-x"The Skill tool (aldc:<skill-name>) or read ${CLAUDE_PROJECT_DIR}/.claude/skills/<skill-name>/SKILL.md
.github/instructions/*.instructions.md (applyTo)${CLAUDE_PROJECT_DIR}/.claude/rules/*.md (paths:); /aldc:al-initialize copies them to the project's .claude/rules/ for auto-apply in the main session; inject inline for subagents exactly as the contract says
.github/skills/, .github/plans/…, docs/templates/${CLAUDE_PROJECT_DIR}/.claude/skills/, .claude/plans/… (project-owned, aldc.yaml -> plans.root), ${CLAUDE_PROJECT_DIR}/claude-plugin/docs/templates/; already rewritten below
python … runtime helpers, --aldc-rootPaths already point at ${CLAUDE_PLUGIN_ROOT}; use python or python3, whichever exists (stdlib only)
aldc.yaml${CLAUDE_PROJECT_DIR}/aldc.yaml when the project has one, otherwise ${CLAUDE_PROJECT_DIR}/claude-plugin/aldc.yaml

Read ${CLAUDE_PROJECT_DIR}/claude-plugin/docs/claude-al-tooling.md for this surface’s LSP/MCP bindings, then ${CLAUDE_PROJECT_DIR}/.claude/skills/skill-migrate/references/cli-al-tools.md for the shared role/evidence contract. The Claude guide supersedes older capability-availability examples, never role responsibilities or human gates.

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, return types)
  • Public API has Access = Public, Implementation has Access = Internal
  • Event-driven task creation uses [TryFunction]
  • Business conditions checked BEFORE task creation (outside TryFunction)
  • Failures logged via Session.LogMessage
  • ExternalId follows the agreed format convention
  • Page extensions use AgentSetup.OpenAgentLookup() for agent selection
  • No OnPrem-only methods invoked from Extension scope
  • If AddToTask was needed, follow-up task workaround is in place

🛑 STOP — Review generated code with the developer.

Skills Evidencing

End with:

**Skills loaded**: skill-agent-task-patterns
**Patterns applied**:
- Pattern {X} — {file where applied}
- API matrix verified: {list any OnPrem/future methods that triggered workarounds}

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.