// prompts.js — All AI prompts v3 // LANGUAGE RULES: Analysis = match job language. Everything else = ENGLISH ALWAYS. function buildPromptV2(tab, job, userProfile, language) { // Only analysis follows job language; rest is always English const analysisLang = language === 'arabic' ? 'Respond entirely in Arabic.' : language === 'english' ? 'Respond entirely in English.' : 'Respond in the same language as the job posting.'; const ctx = [ 'Job Title: ' + (job.jobTitle || 'Not specified'), 'Company: ' + (job.company || 'Not specified'), 'Location: ' + (job.location || 'Not specified'), 'Type: ' + (job.jobType || 'Not specified'), 'Description:\n' + (job.description || 'No description available'), job.skills.length ? 'Required Skills: ' + job.skills.join(', ') : '' ].filter(Boolean).join('\n'); const prof = 'MY PROFESSIONAL PROFILE:\n' + userProfile; const co = job.company || 'this company'; const loc = job.location || 'Middle East'; const P = {}; P.analysis = `You are an elite career strategist. ${analysisLang} Evaluate this job against my profile with brutal honesty and EXTREME brevity. DO NOT recount my history, military background, or summarize my profile. Keep it actionable and short. ${prof} JOB POSTING: ${ctx} Respond in this EXACT concise structure: ## 🎯 VERDICT: [YES - APPLY / NO - SKIP] [One short sentence explaining why] ## ✅ WHY IT FITS (If Yes) - [Bullet point 1] - [Bullet point 2] - [Bullet point 3] ## ❌ WHY IT MIGHT NOT FIT (If No or Maybe) - [Bullet point 1 - e.g. location, specific missing skill] - [Bullet point 2] ## 📝 CV TWEAKS (If Yes) - [What to emphasize in the CV] - [What to de-emphasize]`; P.coverletter = `You are an expert career writer. Write a COMPLETE, READY-TO-SEND cover letter. IMPORTANT: Write ENTIRELY in English regardless of the job posting language. ${prof} JOB: ${ctx} FORMAT — follow EXACTLY: Dear ${co} Team, [PARAGRAPH 1 — HOOK (3 sentences max): Compelling connection between my background and this role. Mention the company by name. NO generic "I am writing to apply" openers.] [PARAGRAPH 2 — PROOF (4-5 sentences): Match 3-4 job requirements to my REAL achievements with NUMBERS. Use "At Intaleq, I..." or "When building Tripz, I..." Be concrete.] [PARAGRAPH 3 — CLOSE (2-3 sentences): Enthusiasm for THIS company. Confident call to action requesting an interview.] Best regards, Hamza Ayed hamzaayed@intaleqapp.com +962 79 858 3052 CRITICAL RULES: - MUST be in English - NO brackets or placeholders — use ACTUAL names and data - Every sentence specific to THIS job at ${co} - Under 300 words total`; P.cvtips = `You are a LinkedIn optimization expert and ATS specialist. IMPORTANT: Respond ENTIRELY in English regardless of the job posting language. ${prof} JOB: ${ctx} Respond EXACTLY: ## LINKEDIN HEADLINE [One headline, max 120 chars, ATS-optimized for this role] ## PROFESSIONAL SUMMARY [3-4 sentences tailored summary ready to paste — in English] ## ATS KEYWORDS TO ADD - [10-15 specific keywords from this job that MUST appear in CV] ## EXPERIENCE TO LEAD WITH - [Which role first and which 3-4 bullet points to highlight] ## REMOVE OR MINIMIZE - [What to de-emphasize for this application] ## SKILLS SECTION (priority order) 1. [Most important skill] 2. [Second] 3. [Continue 8-10 skills] ## NEW BULLET POINTS TO ADD - [2-3 new achievement bullets ready to paste into CV — in English]`; const dynamicQuestions = job.questions && job.questions.length > 0 ? 'Answer THESE specific application questions:\n' + job.questions.map((q, i) => `${i + 1}. ${q.question}`).join('\n') : 'Answer these common application questions:\n1. Why are you interested in this role?\n2. What is your relevant experience?\n3. What are your salary expectations?\n4. When can you start?\n5. Do you require visa sponsorship?'; P.qa = `You are a career coach. IMPORTANT: ALL answers MUST be in English. Be highly concise (1 sentence max for text inputs, Yes/No for radio inputs). ${prof} JOB: ${ctx} ${dynamicQuestions} RETURN EXACTLY A RAW JSON OBJECT where keys are the exact questions above and values are your concise answers. Do NOT use markdown code blocks like \`\`\`json. Just return the raw JSON. Example: { "Have you completed the following level of education: Bachelor's Degree?": "Yes", "How many years of work experience do you have with Infrastructure?": "6", "Why are you interested in this role?": "My background in mapping perfectly aligns with your needs." }`; P.benefits = `You are a career analyst specializing in tech compensation in MENA. IMPORTANT: Respond ENTIRELY in English regardless of the job posting language. ${prof} JOB: ${ctx} Respond EXACTLY: ## COMPENSATION ESTIMATE - **Mentioned salary:** [exact text or "Not disclosed"] - **Market estimate:** [realistic range in USD based on role, seniority, location] - **Benefits listed:** [bonuses, equity, insurance] ## WORK SETUP - **Type:** [Remote / Hybrid / On-site] - **Location:** [where + relocation support] ## CAREER VALUE - **Growth potential:** [what this leads to in 2-3 years] - **Skills I will gain:** [new skills/tech] - **Resume value:** [how it improves my CV] ## WHAT IS ATTRACTIVE - [3-5 appealing aspects for MY profile] ## RED FLAGS - [Concerning requirements or red flags] ## OVERALL RATING: X/10 **Worth applying?** [YES / MAYBE / NO] [2-3 sentence honest assessment]`; return P[tab] || P.analysis; }