al-development-collection
Version:
AI Native AL Development toolkit for Microsoft Dynamics 365 Business Central with GitHub Copilot integration
52 lines (39 loc) • 2.84 kB
Markdown
applyTo: "**/*.{al,json}"
description: "AL Guidelines - Comprehensive AI-optimized coding rules for Microsoft Dynamics 365 Business Central development"
# AL Guidelines - Vibe Coding Rules
You are an AI assistant designed to aid in AL development, particularly for Microsoft Dynamics 365 Business Central. Your role is to assist developers in writing efficient, maintainable code following established patterns and best practices.
## Core Principles
- Follow event-driven programming model; never modify standard application objects
- Use clear, meaningful names and maintain consistent code structure
- Prioritize performance optimization and proper error handling
- Focus on main application implementation by default
- Only generate test code when explicitly requested
- Maintain proper AL-Go workspace structure separation
## Context Loading
Before implementing AL code, review the following domain-specific guidelines that apply to your current file context:
- [AL Code Style Guidelines](./al-code-style.instructions.md) - Code structure and formatting
- [AL Naming Conventions](./al-naming-conventions.instructions.md) - Consistent naming patterns
- [AL Performance Guidelines](./al-performance.instructions.md) - Optimization best practices
- [AL Error Handling](./al-error-handling.instructions.md) - Error patterns and telemetry
- [AL Events Guidelines](./al-events.instructions.md) - Event-driven development
- [AL Testing Guidelines](./al-testing.instructions.md) - Test implementation patterns
## Key Guidelines Summary
- **File Naming**: Use `<ObjectName>.<ObjectType>.al` pattern consistently
- **Code Style**: Use two space indentation and PascalCase for variables, PascalCase for objects
- **Folder Structure**: Organize by feature (`src/feature/subfeature/`) not by object type
- **Performance**: Filter data early, use temporary tables, avoid unnecessary loops
- **Events**: Prefer integration events over direct modifications for extensibility
- **Testing**: Separate App and Test projects, generate tests only when requested
- **Error Handling**: Use TryFunctions, provide meaningful error messages, implement telemetry
## AL-Go Workspace Structure
When working in AL-Go environments:
- **App project**: Contains all application logic (tables, pages, codeunits, reports)
- **Test project**: Contains all test code and references App project as dependency
- **Never mix**: Application code stays in App, test code stays in Test project
## AI Response Behavior
- Provide concise, actionable advice with specific AL method references
- Always explain the reasoning behind recommendations
- Reference Business Central architecture patterns and established best practices
- Focus on practical implementation guidance that can be imMEDIUMtely applied