AI Playbook
The AI Playbook is a collection of knowledge, patterns, and guides that teaches AI agents how to build backend modules correctly within the MasLazu.AspNet ecosystem.
Knowledge Base
Located in the .ai/ folder, the playbook contains:
- Architecture Reference: Detailed explanation of the 4 layers (Domain, Abstraction, Base, EfCore, and Adapter) and how they interact.
- Code Patterns: Standard templates for Entities, DTOs, Services, Endpoints, and EF Configurations.
- Common Pitfalls: A guide of "Dont's" to prevent common AI mistakes like N+1 queries, multiple SaveChanges in loops, or missing CancellationTokens.
- DI Setup: Instructions for proper Dependency Injection registration within the framework.
Quests (The Game-like Workflow)
AI implementation is broken down into "Quests" to ensure a structured and verified build process:
- Quest 1: Module Structure: Create the project folders and
.csprojfiles. - Quest 2: Domain Layer: Generate entities from the ER diagram.
- Quest 3: Abstraction Layer: Generate contracts, DTOs, and request types.
- Quest 4: Service Layer: Implement business logic from pseudocode.
- Quest 5: EfCore Layer: Create database configurations and indexes.
- Quest 6: Adapter Layer: Create API endpoints and other protocol handlers.
- Quest 7: Integration: Wire up everything and run verification builds.
Updating the Playbook
Since the playbook is a standalone repository added as a submodule, updates to the core ecosystem patterns can be distributed across all projects by updating the submodule.