Agents - Layer 2: Agent Primitives¶
Role-based strategic consultants implemented as .agent.md files with MCP Tool Boundaries for specialized AL development guidance in Business Central.
📋 What Are Agents?¶
Agents are: - Specialized consultant personas with domain expertise - Strategic advisors (not executors - they recommend workflows) - Context-aware specialists that auto-load relevant Instructions - Boundary-constrained agents with clear CAN/CANNOT rules (MCP model)
🎯 How to Use Agents¶
Activate modes explicitly for strategic consultation:
Or in multi-turn conversations:
---
mode: al-architect
title: Complex feature planning
---
I need to build a sales forecasting system...
📊 Complexity-Based Agent Selection¶
⚠️ Experimental & Customizable Framework: The complexity classification system is an experimental heuristic that provides initial guidance. You can modify these criteria by editing the framework files in your repository (
agents/index.md,instructions/copilot-instructions.md) to match your team's expertise, organizational standards, and project requirements. Adapt thresholds, add custom criteria, or redefine complexity levels based on your context.
All agents use automatic complexity inference with mandatory validation gate - the system analyzes your requirements and suggests the appropriate complexity level, then you confirm before proceeding.
Complexity Classification Matrix¶
| Complexity | Scope | Phases | TDD | Recommended Agent | Estimated Time |
|---|---|---|---|---|---|
| 🟢 LOW | Limited scope - isolated change | 1 phase | Optional | al-developer | 15-30 min |
| 🟡 MEDIUM | Moderate scope - internal integrations | 2-3 phases | Recommended | al-conductor | 1-3 hours |
| 🔴 HIGH | Extensive scope - complex architecture | 4+ phases | Mandatory | al-architect → al-conductor | 3+ hours |
Note: Scope refers to the breadth and depth of functionality, not the count of AL objects. Focus on integration complexity, business logic depth, and architectural impact.
Customization Tip: You can adjust these complexity definitions by editing this file in your repository. For example, if your team typically works with smaller changes, you might redefine MEDIUM as "1-2 phases" instead of "2-3 phases". The framework adapts to your workflow.
📦 Available Agents (13 total)¶
🏗️ Implementation Agents (Complexity-Driven)¶
| Mode | Role | Complexity Target | Best For |
|---|---|---|---|
| al-architect | Solution Architecture & Design | 🟡 MEDIUM / 🔴 HIGH | Start here - Design phase, specification boundaries, shared contracts and dependencies |
| al-spec-agent | Specification Owner | Any complexity | Technical contracts and acceptance criteria from an approved design, before implementation (details) |
| al-conductor | TDD Orchestra Coordinator | 🟡 MEDIUM / 🔴 HIGH | Multi-phase implementation with enforced TDD and quality gates |
| al-developer | Tactical Implementation Specialist | 🟢 LOW / 🟡 MEDIUM | Direct implementation when design is clear and scope is limited |
| al-developer-reviewer | Independent Increment Review | 🟢 LOW / 🟡 MEDIUM | Read-only review of a direct Developer increment before human approval (details) |
🎭 Internal Subagents (launched by al-architect, al-spec-agent or al-conductor)¶
| Mode | Role | Purpose |
|---|---|---|
| AL Planning Subagent | AL-aware Research Specialist | Analyzes codebase, gathers context for planning |
| AL Implementation Subagent | TDD Implementation Executor | Executes RED→GREEN→REFACTOR cycle |
| AL Code Review Subagent | Quality Assurance Validator | Reviews each phase against the specification and AL best practices |
| AL Knowledge Consultant | BCQuality Knowledge Consultation | Answers one knowledge question for Architect, Spec Agent or Conductor |
💡 Note: Subagents are launched by the agents that own them. You don't invoke them directly.
🔎 On-demand Specialists (user-invocable)¶
Invoked directly when you start from a symptom or want an independent audit — outside the TDD loop.
| Mode | Role | Best For |
|---|---|---|
| AL Triage | Reactive Diagnosis Specialist | Reproduce → localize → root-cause an existing bug/regression/incident; recommends the minimal fix (read-only on code) |
| Dredd | Independent AL Auditor | On-demand static audit against BCQuality + native checks; advisory verdict, incomplete coverage reported as such (read-only on code) |
💡 Both are read-only on AL code and hand fixes to
@AL Developer. Triage is the dynamic counterpart (reproduce & trace); Dredd is the static one (judge the artifact).
🔧 Specialized Consultants (Complexity-Agnostic)¶
| Mode | Role | Works With | Best For |
|---|---|---|---|
| al-presales | Pre-Sales & Project Estimation | Any complexity | Project planning, cost estimation, feasibility analysis, SWOT |
| al-agent-builder | Business Central Agent Toolkit Builder | Any complexity | Designing and coding BC agents with the AI Development Toolkit and Agent SDK (optional pack) |
Domain expertise for API, Copilot, debugging, testing, performance, events, permissions, pages, migration and translation is provided by the 16 composable skills that agents load on demand, not by separate agents.
🏗️ Tool Boundaries (MCP Model)¶
Each mode follows professional licensing constraints:
CAN (Strategic/Advisory)¶
- ✅ Design solutions and patterns
- ✅ Analyze code and architecture
- ✅ Recommend approaches
- ✅ Plan implementations
- ✅ Review and critique
- ✅ Explain concepts
CANNOT (advisory agents; al-developer and the implementation subagent do edit and build)¶
- ❌ Execute builds directly
- ❌ Run debuggers
- ❌ Deploy code
- ❌ Run tests
- ❌ Modify files without explicit request
Why? This prevents: - Context window pollution from execution logs - Cross-domain operations (architect shouldn't debug) - Loss of strategic focus
🎯 Complexity-Based Decision Flow with Validation Gate¶
MANDATORY PROCESS: All agents analyze requirements → infer complexity → present classification → user confirms → route to appropriate workflow
graph TD
Start[📄 Task/Requirements] --> Analyze[🔍 Automatic Complexity Analysis]
Analyze --> Infer[💭 System infers complexity based on:<br/>- Scope and scale<br/>- Integration depth<br/>- Business logic complexity<br/>- Implementation phases]
Infer --> Present[📊 Present Classification]
Present --> Gate{🚦 VALIDATION GATE<br/>User confirms complexity?}
Gate -->|❌ Adjust| UserInput[👤 User provides correct complexity]
UserInput --> Present
Gate -->|✅ Confirmed: LOW| Low[🟢 LOW Complexity]
Gate -->|✅ Confirmed: MEDIUM| Med[🟡 MEDIUM Complexity]
Gate -->|✅ Confirmed: HIGH| High[🔴 HIGH Complexity]
Low --> LowRoute{Specialized help?}
LowRoute -->|No| DevDirect[💻 al-developer<br/>Direct implementation]
LowRoute -->|Debug| Debug[🩺 al-triage<br/>Diagnosis, read-only]
LowRoute -->|Tests| Test1[🧪 al-developer<br/>loads skill-testing]
Med --> MedRoute{Need design first?}
MedRoute -->|Yes| Arch1[👨💼 al-architect<br/>Then al-conductor]
MedRoute -->|No, spec ready| Conductor1[🎼 al-conductor<br/>TDD Orchestra]
MedRoute -->|Debug| Debug
MedRoute -->|Tests| Test2[🧪 al-conductor<br/>tests first, skill-testing]
High --> HighRoute{Specialized domain?}
HighRoute -->|Standard| Arch2[👨💼 al-architect<br/>Design phase]
HighRoute -->|APIs| API[🌐 al-architect<br/>loads skill-api]
HighRoute -->|AI Features| Copilot[🤖 al-architect<br/>loads skill-copilot]
Arch1 --> Conductor2[🎼 al-conductor<br/>Implementation]
Arch2 --> Conductor3[🎼 al-conductor<br/>Implementation]
API --> Conductor4[🎼 al-conductor]
Copilot --> Conductor5[🎼 al-conductor]
style Gate fill:#D946EF,stroke:#A21CAF,color:#fff
style Low fill:#0F766E,stroke:#0F766E,color:#fff
style Med fill:#E0F7FF,stroke:#0891B2,color:#0F172A
style High fill:#A21CAF,stroke:#D946EF,color:#fff 📖 Detailed Mode Descriptions¶
�️ al-architect (★ Recommended Entry Point)¶
Role: Solution architecture and design specialist
Use when: - Starting a new feature (design first) - Planning new feature architecture - Designing data models - Evaluating integration strategies - Making architectural decisions - Reviewing existing designs
Auto-loads Instructions: - al-guidelines.instructions.md - al-code-style.instructions.md - al-performance.instructions.md
Example:
Use al-architect
Design a multi-company approval workflow system.
Should work across companies, support delegation, send emails.
💻 al-developer¶
Role: Tactical implementation specialist with full MCP tool access
Use when: - Implementing features from specifications - Creating AL objects (tables, pages, codeunits) - Extending base BC objects - Implementing event subscribers - Refactoring existing code - Fixing bugs - Building and publishing extensions
Full AL MCP Tool Access: - al_build, al_buildall, al_package, al_publish - al_incrementalpublish (fast iteration) - al_downloadsymbols, al_downloadsource - al_generatepermissionset, al_generatemanifest - Debugging and performance tools
Auto-loads Instructions: - al-code-style.instructions.md - al-naming-conventions.instructions.md - al-performance.instructions.md - al-error-handling.instructions.md - al-events.instructions.md
Example:
Use al-developer
#file: src/Sales/Customer.TableExt.al
Implement email validation on Customer table extension:
- Add event subscriber for OnBeforeValidateEvent on Email field
- Validate format using regex
- Show error if invalid
- Build and test
Delegates to: - al-architect (strategic decisions) - al-developer-reviewer (independent review of the increment) - AL Triage (diagnosis of an existing defect)
🧠 Domains covered by skills, not agents¶
Earlier releases had separate al-debugger, al-tester, al-api and al-copilot agents. They no longer exist. Their knowledge lives in the skills skill-debug, skill-testing, skill-api and skill-copilot, which the agents above load when the task needs them. To diagnose an existing defect, use AL Triage.
🔄 Mode Combinations & Workflows¶
Common Patterns¶
-
New Feature Development
-
Performance Optimization
-
Testing Implementation
-
API Development
Mode Handoffs¶
Modes can recommend switching:
Architect: "Design complete. Switch to al-conductor for TDD implementation."
Conductor: "Implementation complete. Run /al-build to build."
Triage: "Root cause identified. Hand the fix to al-developer."
💡 Best Practices¶
✅ DO¶
- Start with al-architect for new features (design first)
- Use al-conductor for medium/high complexity TDD orchestration
- Stay in strategic mode - let modes recommend workflows
- Provide context (#file:, business requirements)
- Ask about alternatives and trade-offs
- Request explanations of recommendations
❌ DON'T¶
- Ask modes to execute builds/tests directly (they'll recommend workflows)
- Switch modes mid-conversation without reason
- Expect implementation without using recommended workflows
- Forget to include relevant code context
Creating Custom Agents¶
- Create file in this directory:
al-[role].agent.md - Add frontmatter:
- Define the persona:
- Role & specialization
- Markdown Prompt Engineering principles
- Tool Boundaries (CAN/CANNOT)
- Context Engineering strategy
- Interaction protocol
- Update collection manifest in
collections/al-development.collection.yml - Test with sample scenarios
🔗 Related Resources¶
- Collection Manifest:
collections/al-development.collection.yml - Framework Reference:
docs/framework/ai-native-instructions-architecture.md - User Guide:
al-development.md - Contributing:
CONTRIBUTING.md
📊 Validation¶
Run npm run validate to verify: - All agent files exist - Frontmatter is properly formatted - File naming conventions are followed - Descriptions are clear and complete
Framework Compliance: These agents implement AI Native-Instructions Architecture - Layer 2 (Agent Primitives) with clear Tool Boundaries (MCP model), auto-loading Instructions (Layer 1), and strategic Context Engineering (Layer 3).
Version: 5.3.0 Total Agents: 13 (5 core + 3 on-demand specialists + 4 internal subagents + al-agent-builder) Last Updated: 2026-11-10
Usage Philosophy: Agents are strategic consultants, not code executors. They analyze, design, and recommend. For execution, they delegate to Agentic Workflows.