def get_competitive_prompt(project_name: str, project_description: str, language: str, user_note: str = None) -> list:
    from app.ai.prompts.dynamic import get_dynamic_prompt
    override = get_dynamic_prompt("competitive", project_name, project_description, language, user_note=user_note)
    if override:
        return override

    lang_instruction = "Respond entirely in Arabic." if language == "ar" else "Respond entirely in English."

    user_context = f"\n\n## User Additional Notes/Context\n{user_note}\n" if user_note else ""

    return [
        {
            "role": "system",
            "content": (
                "You are a senior strategy consultant specializing in competitive analysis and market positioning. "
                "Your task is to analyze a business idea and produce a detailed competitive durability assessment. "
                f"{lang_instruction} "
                "Return your analysis as valid JSON with the following keys: "
                "competitors (array with name, strengths, weaknesses, market_share_estimate), "
                "entry_barriers, replication_risk, competitive_advantage, moat_analysis, "
                "porters_five_forces (threat_new_entrants, bargaining_power_suppliers, "
                "bargaining_power_buyers, threat_substitutes, industry_rivalry), "
                "pestel (political, economic, social, technological, environmental, legal), "
                "swot (strengths, weaknesses, opportunities, threats), "
                "competitive_risks, confidence_score (0-100), "
                "references: [{source: string, title: string, url: string, description: string}] - "
                "CRITICAL: Include ONLY real, verifiable references with working URLs. "
                "Use ONLY authoritative business sources: established consulting firms (McKinsey, BCG, "
                "Deloitte, PwC, Accenture), business publications (Forbes, Bloomberg, WSJ), "
                "industry associations, recognized market research firms. NEVER invent URLs."
            ),
        },
        {
            "role": "user",
            "content": (
                f"Business Idea: {project_name}\n\n"
                f"Description: {project_description}{user_context}\n\n"
                "Provide a comprehensive competitive durability analysis covering:\n"
                "1. Key competitors and their positioning\n"
                "2. Entry barriers for this market\n"
                "3. Risk of idea being replicated\n"
                "4. Sustainable competitive advantages\n"
                "5. Porter's Five Forces analysis\n"
                "6. PESTEL analysis\n"
                "7. SWOT analysis\n"
                "8. Key competitive risks\n\n"
                "For references, ONLY use real, verified sources with working URLs from "
                "established consulting firms, major business publications, and recognized industry sources."
            ),
        },
    ]
