/** * Prompt builder for competitive intelligence analysis * Generates OpenAI prompts with explicit schema requirements */ export function buildSectorAnalysisPrompt(sector: string): string { return `You are a competitive intelligence analyst specializing in market research and strategic analysis. Your task is to provide factual, data-driven insights about market sectors. Analyze the "${sector}" sector and return a JSON object with the following structure (EXACTLY as specified): { "sector_overview": "string - exactly 3 sentences. First sentence: current state and market size estimate. Second sentence: key structural dynamic. Third sentence: future outlook or constraint.", "key_players": [ { "name": "string - company name", "positioning": "string - one sentence describing their market position", "market_tier": "string - one of: leader, challenger, niche", "key_weakness": "string - one sentence describing a key weakness" } ], "emerging_trends": [ { "trend": "string - name of the trend", "description": "string - 2 sentences max describing the trend and its manifestation", "relevance_to_entrant": "string - one sentence on why this matters for a market entrant", "confidence": "string - one of: high, medium, low - your confidence in this trend" } ], "white_spaces": [ { "opportunity": "string - name of the opportunity", "rationale": "string - 2 sentences max explaining why this is an opportunity" } ], "data_confidence": { "overall_rating": "string - one of: high, medium, low - your overall confidence in the analysis", "flagged_uncertainties": [ "string - specific data gaps or uncertain aspects of the analysis" ] } } CONSTRAINTS: - key_players: Must include 4-6 companies - emerging_trends: Must include 3-5 trends - white_spaces: Must include 2-3 opportunities - data_confidence.flagged_uncertainties: Must include at least 2 uncertainties - sector_overview: Exactly 3 sentences, no more, no less Return ONLY the JSON object. Do not include markdown code blocks, explanations, or any other text. Start with { and end with }. The JSON must be valid and parseable. Sector: ${sector}`; } export function buildSystemPrompt(): string { return `You are a competitive intelligence analyst. Provide factual, data-driven market analysis. Always return valid JSON that matches the specified schema exactly. Do not include any markdown formatting or explanations outside the JSON object.`; }