/**
 * @fileoverview Few-shot examples for LLM prompt
 * @module morph-spec/llm/few-shot-examples
 */

/**
 * Example 1: Next.js + Supabase stack
 */
export const EXAMPLE_NEXTJS_SUPABASE = {
  input: {
    packageJson: {
      name: 'my-nextjs-app',
      dependencies: ['next', 'react', '@supabase/supabase-js', 'tailwindcss'],
      devDependencies: ['typescript', 'eslint'],
      scripts: { dev: 'next dev', build: 'next build' },
      type: 'module'
    },
    csprojFilenames: [],
    hasSolution: false,
    readmeSummary: 'A modern web application built with Next.js 15 and Supabase...',
    claudeMdSummary: null,
    structure: {
      hasSrc: true,
      hasBackend: false,
      hasFrontend: true,
      hasTests: true,
      topLevelDirs: ['src', 'app', 'components', 'lib', 'public', 'test'],
      pattern: 'single-project'
    },
    infraSummary: {
      dockerfilesCount: 1,
      dockerComposeCount: 1,
      bicepFilesCount: 0,
      pipelinesCount: 0,
      hasAzure: false,
      hasDocker: true,
      hasDevOps: false
    },
    gitRemoteDomain: 'github.com',
    totalFiles: 60
  },
  output: {
    name: 'my-nextjs-app',
    description: 'A modern web application built with Next.js 15 and Supabase for backend',
    type: 'nextjs',
    stack: {
      frontend: {
        tech: 'Next.js',
        version: '15',
        details: 'App Router with Server Components'
      },
      backend: {
        tech: 'Supabase',
        version: 'latest',
        details: 'PostgreSQL with real-time features'
      },
      database: {
        tech: 'PostgreSQL',
        version: '16',
        details: 'Managed by Supabase'
      },
      hosting: 'Docker'
    },
    architecture: 'layered',
    projectStructure: 'Next.js App Router: app/ for routes, components/ for UI, lib/ for utilities',
    conventions: 'ESM modules, TypeScript, functional components with hooks',
    repository: null,
    hasAzure: false,
    hasDocker: true,
    hasDevOps: false,
    confidence: 95,
    warnings: []
  }
};

/**
 * Example 2: Blazor Server + .NET + Azure SQL
 */
export const EXAMPLE_BLAZOR_AZURE = {
  input: {
    packageJson: null,
    csprojFilenames: ['MyApp.Web.csproj', 'MyApp.Domain.csproj', 'MyApp.Infrastructure.csproj'],
    hasSolution: true,
    readmeSummary: 'Enterprise web application built with Blazor Server and .NET 10...',
    claudeMdSummary: 'Stack: Blazor Server + .NET 10 + Azure SQL. Architecture: Clean Architecture with DDD patterns...',
    structure: {
      hasSrc: true,
      hasBackend: false,
      hasFrontend: false,
      hasTests: true,
      topLevelDirs: ['src', 'test', 'infra', 'docs'],
      pattern: 'single-project'
    },
    infraSummary: {
      dockerfilesCount: 1,
      dockerComposeCount: 0,
      bicepFilesCount: 5,
      pipelinesCount: 1,
      hasAzure: true,
      hasDocker: true,
      hasDevOps: true
    },
    gitRemoteDomain: 'github.com',
    totalFiles: 120
  },
  output: {
    name: 'MyApp',
    description: 'Enterprise web application built with Blazor Server and .NET 10, deployed to Azure',
    type: 'blazor-server',
    stack: {
      frontend: {
        tech: 'Blazor',
        version: '10',
        details: 'Blazor Server with SignalR'
      },
      backend: {
        tech: '.NET',
        version: '10',
        details: 'Minimal API with Clean Architecture'
      },
      database: {
        tech: 'Azure SQL',
        version: 'latest',
        details: 'Entity Framework Core'
      },
      hosting: 'Azure'
    },
    architecture: 'clean-architecture',
    projectStructure: 'Clean Architecture: Domain (entities), Application (use cases), Infrastructure (EF Core), Web (Blazor UI)',
    conventions: 'C# 14, nullable reference types, record types for DTOs, async/await, PascalCase',
    repository: null,
    hasAzure: true,
    hasDocker: true,
    hasDevOps: true,
    confidence: 98,
    warnings: []
  }
};

/**
 * Example 3: Monorepo with Next.js + .NET API
 */
export const EXAMPLE_MONOREPO = {
  input: {
    packageJson: {
      name: 'monorepo-app',
      dependencies: [],
      devDependencies: ['turbo', 'lerna'],
      scripts: { dev: 'turbo dev', build: 'turbo build' },
      type: 'module'
    },
    csprojFilenames: ['backend/Api/Api.csproj', 'backend/Domain/Domain.csproj'],
    hasSolution: true,
    readmeSummary: 'Monorepo application with Next.js frontend and .NET backend API...',
    claudeMdSummary: null,
    structure: {
      hasSrc: false,
      hasBackend: true,
      hasFrontend: true,
      hasTests: true,
      topLevelDirs: ['frontend', 'backend', 'packages', 'test'],
      pattern: 'monorepo'
    },
    infraSummary: {
      dockerfilesCount: 2,
      dockerComposeCount: 1,
      bicepFilesCount: 0,
      pipelinesCount: 1,
      hasAzure: false,
      hasDocker: true,
      hasDevOps: true
    },
    gitRemoteDomain: 'github.com',
    totalFiles: 200
  },
  output: {
    name: 'monorepo-app',
    description: 'Monorepo application with Next.js frontend and .NET backend API',
    type: 'monorepo',
    stack: {
      frontend: {
        tech: 'Next.js',
        version: 'latest',
        details: 'App Router'
      },
      backend: {
        tech: '.NET',
        version: 'latest',
        details: 'Minimal API'
      },
      database: null,
      hosting: 'Docker'
    },
    architecture: 'microservices',
    projectStructure: 'Monorepo: frontend/ (Next.js), backend/ (. NET API), packages/ (shared libs)',
    conventions: 'Turbo for monorepo orchestration, ESM for frontend, C# for backend',
    repository: null,
    hasAzure: false,
    hasDocker: true,
    hasDevOps: true,
    confidence: 90,
    warnings: ['Database technology not detected - may not persist data']
  }
};

/**
 * Get all few-shot examples
 * @returns {Array} Array of examples
 */
export function getFewShotExamples() {
  return [
    EXAMPLE_NEXTJS_SUPABASE,
    EXAMPLE_BLAZOR_AZURE,
    EXAMPLE_MONOREPO
  ];
}
