33: Universe Code Generation - Domain Templates & Type Fixes

Documentation for Sessions

Session 33: Universe Code Generation - Domain Templates & Type Fixes

Session Overview

This session focuses on fixing and enhancing the universe code generation system, specifically:

  1. Domain Entity Templates - Creating comprehensive entity templates for multiple domains (fitness, ecommerce, healthcare, education, restaurant)
  2. Entity Resolution Fallback Chain - Implementing a priority-based entity resolution system
  3. Type System Fixes - Resolving TypeScript type mismatches in the module generator
  4. Integration Tests - Comprehensive test coverage for the domain entity system

Sub-Sessions

33.1 - Domain Template Implementation

33.2 - Integration Tests & Type Fixes

Key Files Modified

Templates

Tests

Documentation

Architecture Decision: Entity Resolution Fallback Chain

The entity resolution follows this priority:

  1. AI-extracted entities (highest priority) - From LLM analysis
  2. Explicit entities - Provided directly in request
  3. Domain-specific templates - From domain entity templates
  4. Pattern matching (lowest priority) - Generic fallback

This ensures domain-specific entities are used when available while allowing AI to override with more accurate extractions.

Known Issues

Session Tracking Design Flaw: The MCP currently reads session info from .cursor/mcp-config.json, which doesn't support concurrent sessions. This needs to be refactored to pass session context per-request.