al-context-create
Generate or update context.md file documenting project structure, architecture, and key patterns for AI assistants and developers. ALDC workflow (Copilot prompt al-context.create); invoke explicitly.
javiarmesto · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add javiarmesto/ALDC-AL-Development-Collection --skill al-context-create技能说明
name: al-context-create description: "Generate or update context.md file documenting project structure, architecture, and key patterns for AI assistants and developers. ALDC workflow (Copilot prompt al-context.create); invoke explicitly." disable-model-invocation: true
Claude Code runtime: read
${CLAUDE_PROJECT_DIR}/claude-plugin/docs/claude-runtime.mdbefore running this workflow (gates, tools, paths,<Name from $ARGUMENTS>inputs). It runs in the main session.
AL Context File Generator
Generate a comprehensive context.md file that serves as the master context document for AI assistants and developers working on this AL/Business Central project.
Purpose
The context.md file provides:
- Project Overview: What this extension does and its business purpose
- Architecture Snapshot: How the code is organized and key patterns used
- Critical Decisions: Important architectural choices and their rationale
- Integration Points: Dependencies, events, APIs exposed/consumed
- Quick Navigation: Where to find specific functionality
This enables AI assistants to load complete project context quickly and make informed suggestions.
Execution Steps
1. Analyze Project Structure
Load project metadata:
# Get app.json configuration
Read app.json
# Understand dependencies
mcp__al__al_getpackagedependencies # when the official AL MCP is connected
# Map directory structure
Glob src/**
Identify key patterns:
# Find all table extensions
@search "tableextension" *.al
# Find all page extensions
@search "pageextension" *.al
# Find event subscribers
@search "EventSubscriber" *.al
# Find published integration events
@search "IntegrationEvent" *.al
# Find API pages
@search "APIPublisher\|APIVersion" *.al
2. Analyze Business Domain
Understand what the extension does:
- Read README.md if exists
- Analyze table/page names to understand business entities
- Check codeunit names for business processes
- Review comments and XML docs for business rules
Key questions to answer:
- What business problem does this solve?
- Who are the end users?
- What standard BC functionality does it extend?
- What industry/vertical is this for (if applicable)?
3. Document Architecture Patterns
Identify and document:
- Organization Strategy: Feature-based vs object-type folders?
- Naming Conventions: Prefixes, suffixes, patterns used
- Extension Patterns: How are standard objects extended?
- Event Usage: Subscriber patterns, custom events published
- Data Model: Key tables and their relationships
- Processing Logic: Main codeunits and their responsibilities
- UI Structure: Page organization and user flows
4. Map Integration Points
Document:
- Dependencies: What other extensions are required?
- Events Subscribed: Which standard BC events are hooked?
- Events Published: What integration events does this extension provide?
- APIs: REST/OData endpoints exposed
- External Integrations: External systems connected (if any)
- Web Services: SOAP services published (if any)
5. Capture Critical Decisions
Document key architectural choices:
- Why certain tables are structured in specific ways
- Why specific event patterns were chosen
- Performance optimization decisions
- Security/permission design rationale
- Any constraints or limitations to be aware of
6. Generate context.md
Create the file at project root with this structure:
# Project Context - [Extension Name]
> **Auto-generated**: [Date]
> **Purpose**: Master context document for AI assistants and developers
## 1. Project Overview
### Business Purpose
[What business problem does this extension solve?]
### Target Users
- [User role 1]: [What they do with this extension]
- [User role 2]: [What they do with this extension]
### Extension Metadata
- **App ID**: [from app.json]
- **Version**: [current version]
- **Publisher**: [publisher name]
- **Platform**: [Business Central version target]
- **License**: [if applicable]
## 2. Architecture Overview
### Organization Strategy
[Describe how code is organized - feature-based folders, naming patterns, etc.]
src/ ├── [Feature1]/ │ ├── Data/ # Tables, table extensions │ ├── Processing/ # Codeunits, business logic │ └── UI/ # Pages, page extensions └── [Feature2]/ └── ...
### Key Design Patterns
- **[Pattern 1]**: [Description and rationale]
- **[Pattern 2]**: [Description and rationale]
### Naming Conventions
- **Tables**: [Pattern, e.g., "Prefix_EntityName"]
- **Pages**: [Pattern]
- **Codeunits**: [Pattern]
- **Fields**: [Pattern]
- **Variables**: [Pattern]
## 3. Data Model
### Core Tables
| Table | Object ID | Purpose | Key Relationships |
|-------|-----------|---------|-------------------|
| [Table 1] | [ID] | [Purpose] | → [Related tables] |
| [Table 2] | [ID] | [Purpose] | → [Related tables] |
### Table Extensions
| Extends | New Fields | Purpose |
|---------|------------|---------|
| [Standard Table] | [Field 1, Field 2] | [Why extended] |
### Key FlowFields
- **[Table].[FlowField]**: [What it calculates and why]
## 4. Processing Logic
### Main Codeunits
| Codeunit | Purpose | Key Methods |
|----------|---------|-------------|
| [Name] | [Responsibility] | [Method1(), Method2()] |
### Business Flows
1. **[Flow Name]** (e.g., "Order Approval Flow")
- Entry point: [Where it starts]
- Steps: [Key processing steps]
- Events: [Events published/subscribed]
- Output: [What it produces]
## 5. UI Structure
### Main Pages
| Page | Type | Purpose | Extends |
|------|------|---------|---------|
| [Page Name] | Card/List/Document | [Purpose] | [Base page if extension] |
### User Flows
1. **[User Task]**: [Navigation path and steps]
## 6. Integration Points
### Dependencies
```json
[List key dependencies from app.json]
Event Subscribers
| Event | Publishe
阅读完整来源 ↗