Category Specific Training

Comprehensive guidelines for AI-assisted development within the Editor platform

Category-Specific Agent Training

Teaching agents specialized module generation through domain expertise

Overview

The GoGrab AI system uses specialized agents trained on specific module categories. This enables:

Agent Specialization Matrix

Agent Tier Categories Complexity Success Rate
Cursor Angular Development structural, layout, feature simple, medium 92%
Cursor Architecture Development layout, saas, ecommerce, space-management complex, enterprise 88%
Platform Module Platform ecommerce, blog, product-catalog, portfolio medium, complex 85%
Platform Widget Platform structural, saas, product-catalog simple, medium 90%

Training Data Structure

Per-Agent Training Sets

Each agent receives category-specific training examples:

interface AgentTrainingExample {
  agentId: string;
  category: ModuleCategory;
  
  // Pattern to learn
  pattern: {
    manifestStructure: object;
    moduleImplementation: string;
    componentStructure: string;
    typesStructure: string;
  };
  
  // When to use
  triggers: string[];  // Keywords
  
  // Success metrics
  successRate: number;
  avgQualityScore: number;
  timesUsed: number;
  
  // Learning guidance
  goodFor: string[];
  badFor: string[];
  requirements: string[];
}

Example: Cursor Angular Training (Structural Modules)

const CURSOR_ANGULAR_TRAINING = [
  {
    agentId: 'cursor-angular',
    category: 'structural',
    pattern: {
      // From sidebar-nav module
      manifestStructure: {
        hasNavigation: true,
        hasRoutes: false,
        hasEmbeddables: false,
        dataStrategy: null,
      },
      moduleImplementation: `
        @ModuleDecorator({
          id: 'sidebar-nav',
          navigation: { menuItems: [...] }
        })
        export class SidebarNavModule implements BrowserModuleContract {
          // ... implementation
        }
      `,
    },
    triggers: ['sidebar', 'navigation', 'menu', 'nav'],
    successRate: 0.95,
    goodFor: ['simple navigation', 'menu systems', 'sidebars'],
    badFor: ['complex forms', 'data tables'],
    requirements: ['navigation definition', 'menu items'],
  },
  {
    agentId: 'cursor-angular',
    category: 'layout',
    pattern: {
      // From header-content-footer module
      manifestStructure: {
        hasNavigation: false,
        hasRoutes: true,
        hasEmbeddables: false,
        dataStrategy: null,
      },
    },
    triggers: ['layout', 'template', 'header footer', 'page structure'],
    successRate: 0.92,
    goodFor: ['page templates', 'layout structure'],
    badFor: ['business logic', 'data operations'],
  },
];

Example: Cursor Architecture Training (Complex Modules)

const CURSOR_ARCHITECTURE_TRAINING = [
  {
    agentId: 'cursor-architecture',
    category: 'ecommerce',
    pattern: {
      // From ecommerce module
      manifestStructure: {
        hasNavigation: true,
        hasRoutes: true,
        hasEmbeddables: true,  // ProductCardWidget, MiniCartWidget
        hasActions: true,
        dataStrategy: {
          storage: {
            primary: 'hybrid',
            collections: {
              products: { sync: 'eager' },
              cart: { sync: 'immediate' },
              orders: { sync: 'guaranteed' },
            },
          },
        },
      },
      moduleImplementation: `
        // Multi-service architecture
        - ProductService (catalog management)
        - CartService (shopping cart with flash-persistence)
        - OrderService (order processing)
        
        // Models in models/ (platform-agnostic)
        - Product, Cart, Order interfaces
        
        // Components
        - ProductListComponent
        - CartComponent
        - CheckoutComponent
        
        // Embeddables
        - ProductCardWidget
        - MiniCartWidget
      `,
    },
    triggers: ['shop', 'ecommerce', 'cart', 'products', 'checkout'],
    successRate: 0.88,
    goodFor: ['online stores', 'marketplaces', 'b2b commerce'],
    badFor: ['simple content sites', 'portfolios'],
    requirements: [
      'Product models with pricing',
      'Cart service with persistence',
      'Payment integration structure',
      'Order management system',
    ],
  },
];

Training Data Sources

1. Module Intelligence (AI Metadata)

Extracted from manifest.metadata.ai:

2. Outcome Tracking

Real-world success/failure data:

3. Pattern Library

Extracted patterns from successful modules:

Training Loop

1. Module Generated
         ↓
2. Outcome Tracked (drop, edit, build, deploy)
         ↓
3. Quality Score Calculated (0-100)
         ↓
4. Pattern Extracted (if score ≥ 70)
         ↓
5. Agent Training Data Updated
         ↓
6. Next Generation Improved

Category-Specific Guidelines

Structural Modules (Navigation)

Characteristics:

Key Patterns:

Success Signals:

Ecommerce Modules

Characteristics:

Key Patterns:

Success Signals:

Blog Modules

Characteristics:

Key Patterns:

Success Signals:

Real-Time Pattern Learning

As modules are generated and outcomes tracked, the system automatically:

  1. Identifies Successful Patterns

    • Success rate ≥ 70%
    • Quality score ≥ 70
    • Used as template ≥ 3 times
  2. Extracts Pattern Features

    • Code structure
    • Key capabilities
    • Success factors
  3. Updates Agent Training

    • Adds to category-specific examples
    • Adjusts trigger keywords
    • Updates success metrics
  4. Identifies Anti-Patterns

    • Failure rate > 50%
    • Consistent user deletion
    • Build failures
  5. Removes/Updates Bad Patterns

    • Marks as anti-pattern
    • Updates "badFor" guidance
    • Reduces training weight

Integration with MCP

Module outcomes are reported to MCP via handleModuleOutcome():

const outcome = {
  outcomeId: 'outcome-123',
  moduleId: 'ecommerce',
  category: 'ecommerce',
  wasDropped: true,
  editCount: 2,
  buildSuccess: true,
  deployedToProduction: true,
  qualityScore: 85,
  originalPrompt: 'Create an online store',
};

await handleModuleOutcome(outcome);
// → Converts to MCP decision
// → Reports outcome
// → Extracts learnings
// → Updates agent training

Training Metrics

Track training effectiveness:

interface TrainingMetrics {
  agentId: string;
  category: ModuleCategory;
  
  // Performance
  totalGenerations: number;
  successfulGenerations: number;
  successRate: number;
  
  // Quality
  avgQualityScore: number;
  avgEditCount: number;
  avgTimeToProduction: number;
  
  // Patterns
  patternsUsed: number;
  newPatternsLearned: number;
  antiPatternsIdentified: number;
  
  // Improvement over time
  successRateTrend: number[];  // Last 10 generations
  qualityScoreTrend: number[];
}

Best Practices

For Cursor Angular Agent

DO:

DON'T:

For Cursor Architecture Agent

DO:

DON'T:

Continuous Improvement

The system improves over time through:

  1. Outcome Feedback Loop

    • Every generation teaches the system
    • Successes become patterns
    • Failures become anti-patterns
  2. Cross-Tier Intelligence Transfer

    • Cursor agents learn from Platform agents
    • Platform agents learn from Space agents
    • Best practices bubble up
  3. Pattern Mining

    • Automated pattern extraction
    • Multi-dimensional analysis
    • Sequential, contextual, outcome patterns
  4. Predictive Intelligence

    • ML-based outcome prediction
    • Confidence scoring
    • Risk assessment

Related Documentation


Result: Each agent becomes an expert in its specialized categories, learning from every generation to produce higher quality modules faster.