README

Comprehensive guidelines for AI-assisted development within the Editor platform

AI Documentation - editor2 Platform

Documentation optimized for AI code generators Version: 1.0.0 | Last Updated: December 27, 2025


Purpose

This directory contains documentation specifically designed for AI code generators (Claude, GPT, Copilot, etc.) to efficiently generate business modules for the editor2 platform.


Document Index

Document Purpose Priority
MODULE-TEMPLATE.md Complete module structure and code templates Start Here
AI-RULES.md Mandatory rules and patterns for AI code generation Critical
QUICK-REFERENCE.md Copy-paste ready code snippets Reference
WORKFLOW-GUIDE.md How to use WorkflowService Reference
AGENT-GUIDE.md How to use AgentProcessService Reference
INTELLIGENCE-PYRAMID-GUIDE.md MCP tools usage Reference

Quick Start for AI Generators

1. Read the Rules First

Start by reading AI-RULES.md to understand mandatory patterns and anti-patterns.

2. Use the Template

Follow MODULE-TEMPLATE.md for the complete module structure.

3. Copy Code Snippets

Use QUICK-REFERENCE.md for ready-to-use code templates.

4. Integrate with editor2 Systems


Module Generation Overview

Location

libs/libs-modules/<module-name>/     # Business modules

Library Alias

@libs-modules/<module-name>

Core Contract

All modules MUST implement BrowserModuleContract from @libs-core/module-base.


Generation Methods

Method 1: AI Platform Generator (Complete Platforms)

Route: /modularity/ai-platform
Use for: Multi-module business platforms
Output: Complete universe with 5-10 modules
Service: WorkflowService (5-phase with SSE)

Method 2: Module Workbench (Guided Creation)

Route: /modularity/workbench
Use for: Individual modules with step-by-step guidance
Output: Single Nx library module
Service: AgentProcessService (8-phase with learning)

Method 3: AI Builder (Quick Scaffolding)

Route: /modularity/ai-builder
Use for: Quick module scaffolding
Output: Module definition
Service: AIModuleGeneratorService

Method 4: Modular Universe (Visual Canvas)

Route: /modular-universe
Use for: Visual universe building with AI modules
Output: Visual universe structure
Service: AI Panel + UniverseModuleService

Required Core Library Integrations

Library Purpose Import
@libs-core/module-base Module contract BrowserModuleContract, ModuleDecorator, ModuleManifest
@libs-core/log-system Logging LoggerService
@libs-core/security Auth & guards authGuard, permissionGuard, roleGuard
@libs-core/shared-models Base types BaseEntity, ApiResponse, Permission
@libs-core/action-registry Public actions PublicAction, ExecutableAction
@libs-core/data-access Repositories BaseRepository
@libs-core/event-system Domain events EventBusService, DomainEvent
@storage-system Flash persistence autoFlashState, GgStorage

editor2-Specific Features

Three-Tier AI Architecture

Intelligence Pyramid

// Load context before generation
await preflight({ task: 'Generate module' });

// Log decisions after generation
await log_decision({
  type: 'implementation',
  question: 'How to implement?',
  chosen: 'Selected approach',
  reasoning: 'Because...',
  confidence: 0.9
});

Flash Persistence

// Automatic state persistence
readonly settings = autoFlashState('settings', { theme: 'dark' });

Theme System

// Use CSS variables only
.my-component {
  background: var(--ux-surface);
  color: var(--ux-text-primary);
  backdrop-filter: blur(16px);
}

Essential Patterns

Angular 20 Requirements

Naming Conventions

Required Documentation

Each module needs documentation in docs/english/modules/<module-name>/:


Anti-Patterns to Avoid


Checklist

Before marking a module complete, verify:


Related Documentation


Version: 1.1.0 Last Updated: December 29, 2025 Platform: editor2 Location: docs/english/AI/ (moved from docs/ia/) Source: Adapted from gograb-modules + editor2 enhancements