Prompt file imported from sanjeevpandita/MannokIntegrations (
.github/prompts/al-initialize.prompt.md). Fill in{{ProjectName}},{{CodeCop}},{{PerTenantExtensionCop}},{{UICop}},{{EnvironmentName}}before use. Copyright stays with the author.
AL Environment Initialization
Your goal is to initialize the AL development environment and workspace for {{ProjectName}}.
This workflow covers both initial environment setup (VS Code, GitHub Copilot) and AL workspace configuration (project structure, symbols, dependencies).
Phase 1: Environment Setup
Prerequisites Check
Verify the following are available:
Required Tools:
- Visual Studio Code (latest version)
- AL Language Extension (Microsoft's official extension)
- GitHub Copilot or compatible AI assistant
- Git for version control
Recommended Tools:
- AL Test Runner for test management
- Business Central Docker Container for local development
- AL Object Designer for navigation
- GitLens for enhanced git integration
GitHub Copilot Installation
Step 1: Install VS Code Extensions
- Open Visual Studio Code
- Access Extensions marketplace (
Ctrl+Shift+XorCmd+Shift+X) - Install:
- GitHub Copilot - Code completion
- GitHub Copilot Chat - Interactive assistance
- AL Language - Business Central development
Step 2: Authentication
- Sign in to GitHub when prompted
- Authorize the extension
- Verify connection is active
VS Code Workspace Configuration
Create or update .vscode/settings.json in the workspace root:
{
// AL Language settings
"al.enableCodeAnalysis": true,
"al.codeAnalyzers": ["{{CodeCop}}", "{{PerTenantExtensionCop}}", "{{UICop}}"],
// GitHub Copilot settings
"github.copilot.enable": {
"*": true,
"al": true
},
// Editor settings for better AI integration
"editor.inlineSuggest.enabled": true,
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true
}
}
Configuration Benefits:
- Code analysis with CodeCop, PerTenantExtensionCop, and UICop
- AI suggestions optimized for AL files
- Enhanced inline completion
Phase 2: Project Initialization
Choose Project Type
For New Projects:
al_new_project
For Existing Folders:
al_go
Project Structure
Implement feature-based organization:
{{ProjectName}}/
├── .vscode/
│ ├── settings.json # Workspace settings
│ └── launch.json # Debug configurations
├── src/
│ ├── Tables/ # Table objects
│ ├── Pages/ # Page objects
│ ├── Codeunits/ # Codeunit objects
│ ├── Reports/ # Report objects
│ ├── Queries/ # Query objects
│ ├── XMLports/ # XMLport objects
│ ├── PageExtensions/ # Page extensions
│ ├── TableExtensions/ # Table extensions
│ └── Enums/ # Enum objects
├── test/
│ ├── TestCodeunits/ # Test codeunits
│ └── TestData/ # Test data and helpers
├── app.json # Application manifest
├── .gitignore # Git ignore rules
└── README.md # Project documentation
Download Symbols
Download required symbols:
al_download_symbols
Verify all base application dependencies are available.
Generate Manifest
Create manifest file:
al_generate_manifest
Human Review: Validate manifest contents before proceeding.
Phase 3: Launch Configuration
🔒 Human Gate: Authentication Configuration Review
SECURITY CHECKPOINT - Configuration contains sensitive information
Before creating launch.json:
- Review authentication method with stakeholder
- Confirm server URLs are correct for target environment
- Verify credentials handling follows security policies
- Obtain approval before saving configuration
Configure Debugging
Create .vscode/launch.json based on your environment:
For Cloud Sandbox:
{
"version": "0.2.0",
"configurations": [
{
"type": "al",
"request": "launch",
"name": "Your own server",
"server": "https://businesscentral.dynamics.com",
"serverInstance": "BC",
"authentication": "AAD",
"startupObjectType": "Page",
"startupObjectId": 22,
"schemaUpdateMode": "Synchronize",
"tenant": "default"
}
]
}
For On-Premises:
{
"version": "0.2.0",
"configurations": [
{
"type": "al",
"request": "launch",
"name": "Local server",
"server": "http://localhost",
"serverInstance": "BC210",
"authentication": "Windows",
"startupObjectType": "Page",
"startupObjectId": 22,
"schemaUpdateMode": "Synchronize"
}
]
}
For Agent Debugging (Copilot features):
{
"version": "0.2.0",
"configurations": [
{
"type": "al",
"request": "attach",
"name": "Attach to agent (Sandbox)",
"clientType": "Agent",
"environmentType": "Sandbox",
"environmentName": "{{EnvironmentName}}",
"breakOnNext": "WebClient"
}
]
}
Phase 4: Best Practices Setup
Create .gitignore
Generate appropriate .gitignore:
# AL Compiler outputs
.alpackages/
.alcache/
.snapshots/
rad.json
*.app
# VS Code settings (optional)
.vscode/launch.json
.vscode/*.log
# Build artifacts
.netFramework/
bin/
obj/
# Test results
TestResults/
*.trx
# Temporary files
*.tmp
*.bak
*~
Documentation Standards
Create comprehensive README.md:
# {{ProjectName}}
## Overview
[Project purpose and business value]
## Key Features
- Feature 1: [Description]
- Feature 2: [Description]
## Architecture
[High-level architecture description]
## Naming Conventions
- Tables: `[BusinessEntity]` (e.g., `CustomerExtended`)
- Pages: `[BusinessEntity][PageType]` (e.g., `CustomerListPage`)
- Codeunits: `[Purpose]` (e.g., `SalesOrderProcessor`)
- ID Range: 50000-50099
## Development Guidelines
- Follow AL coding standards
- Use XML documentation for procedures
- Implement error handling with try-functions
- Write unit tests for business logic
## Dependencies
[List of extension dependencies]
## Setup Instructions
[How to set up the development environment]
XML Documentation Pattern
Demonstrate documentation for procedures:
/// <summary>
/// Calculates the total amount for a sales order including tax
/// </summary>
/// <param name="SalesHeader">The sales header record</param>
/// <returns>The total amount including tax</returns>
procedure CalculateTotalWithTax(var SalesHeader: Record "Sales Header"): Decimal
begin
// Implementation
end;
Phase 5: Verification
Test Your Setup
-
Open an AL File
- Navigate to any
.alfile in the project - Ensure syntax highlighting is active
- Navigate to any
-
Test Code Completion
- Start typing a procedure declaration
- Verify inline suggestions appear from Copilot
-
Test Copilot Chat
- Open Copilot Chat (
Ctrl+Shift+I) - Ask: "Explain this AL code"
- Verify you receive a response
- Open Copilot Chat (
-
Verify Code Analysis
- Introduce a small code issue
- Check that warnings appear
-
Test Build
- Run AL: Download Symbols
- Attempt to compile the project
- Verify no configuration errors
Troubleshooting
Authentication Issues
If authentication fails:
- Use
al_clear_credentials_cacheto clear cached credentials - Re-authenticate when prompted
- Verify launch.json authentication method is correct
Symbol Issues
If symbols are missing:
- Download symbols:
al_download_symbols - If persistent, download source:
al_download_source - Verify app.json dependencies match BC version
AI Suggestions Not Appearing
Check:
- AI extension is installed and enabled
- You're signed in to AI service
editor.inlineSuggest.enabledistrue- Restart VS Code if needed
Poor Quality Suggestions
Improvements:
- Use descriptive file names
- Add code comments and XML documentation
- Keep related files open for better context
- Follow naming conventions consistently
Success Criteria
Verify the setup is complete:
- ✅ Visual Studio Code is installed and configured
- ✅ AL Language extension is active
- ✅ GitHub Copilot is installed and authenticated
- ✅ Workspace settings are configured
- ✅ Project structure is organized
- ✅ Symbols downloaded successfully
- ✅ Manifest generated
- ✅ Launch.json configured
- ✅ README.md exists with project documentation
- ✅ Code completion is working
- ✅ Build succeeds without errors
Next Steps
Once your environment is initialized:
For Development:
@AL Implementation Specialist # Implement features (loads page/event skills on demand)
@workspace use al-build # Build and deploy
For Architecture:
@AL Architecture & Design Specialist # Design solutions
For TDD Orchestration:
@AL Development Conductor # Plan → Implement → Review → Commit
Security Considerations
What Gets Sent to AI Services:
- Code snippets from your workspace
- Currently open files
- Your prompts and questions
What You Should NOT Include:
- Sensitive credentials or passwords
- Customer data or PII
- Security keys or certificates
Best Practices:
- Review organization's AI usage policy
- Use
.gitignorefor sensitive files - Use environment variables for credentials
- Close files with sensitive information when not needed
Environment Initialization Complete! 🎉
Your AL development environment is ready for Business Central development with optimized AI assistance.