Upgrade tailoring LLM prompt to generate articulate multi-section resumes and formal 4-paragraph cover letters
This commit is contained in:
@@ -350,27 +350,48 @@ Extraction Rules:
|
||||
// API 3: Tailor Resume & Calculate Match Score
|
||||
app.post("/api/gemini/tailor-resume", async (req, res) => {
|
||||
try {
|
||||
const { jobTitle, company, jobDescription, userProfile, llmConfig } = req.body;
|
||||
const { jobTitle, company, companyName, jobDescription, userProfile, llmConfig } = req.body;
|
||||
|
||||
const prompt = `You are an expert AI Resume Strategist & Career Coach.
|
||||
Target Job: ${jobTitle} at ${company}
|
||||
Job Description:
|
||||
${jobDescription}
|
||||
const targetCompany = company || companyName || "Target Employer";
|
||||
const targetTitle = jobTitle || "Target Role";
|
||||
const masterProfile = userProfile || {};
|
||||
|
||||
Applicant Master Profile:
|
||||
Name: ${userProfile.fullName}
|
||||
Summary: ${userProfile.summary}
|
||||
Skills: ${userProfile.skills?.join(", ")}
|
||||
Experience: ${JSON.stringify(userProfile.experience || [])}
|
||||
const prompt = `You are an Executive Resume Writer & Senior Security Career Strategist.
|
||||
Your mandate is to craft an articulate, comprehensive, and highly persuasive application package tailored specifically for:
|
||||
- Role: ${targetTitle}
|
||||
- Company: ${targetCompany}
|
||||
|
||||
Perform an in-depth match analysis and resume tailoring:
|
||||
1. Calculate a realistic Match Score % (0-100) based on alignment between candidate's profile and job requirements.
|
||||
2. List matched skills present in candidate's profile.
|
||||
3. List critical missing skills/keywords that should be highlighted.
|
||||
4. Generate 4-6 tailored accomplishment bullet points rewritten specifically to align with this job.
|
||||
5. Create a full tailored Resume draft in clean markdown.
|
||||
6. Write a customized, compelling Cover Letter tailored to ${company}.
|
||||
7. Provide 3 specific strategic tips for passing the interview screen.`;
|
||||
Job Description & Requirements:
|
||||
${jobDescription || "General Senior Cyber Security & Systems Engineering Role"}
|
||||
|
||||
Candidate Profile Specs:
|
||||
- Candidate Name: ${masterProfile.fullName || "David Kifer"}
|
||||
- Contact Info: ${masterProfile.email || "dkifer19@gmail.com"} | ${masterProfile.phone || "(203) 841-8629"} | ${masterProfile.location || "Wolcott, CT"}
|
||||
- Summary: ${masterProfile.summary || "Senior Cybersecurity Professional with 10+ years experience in vulnerability management, EDR/DLP, SOC automation (Claude Code, Antigravity, ChatGPT), SIEM threat monitoring, and ITAR/NIST compliance."}
|
||||
- Master Technical Skills: ${(masterProfile.skills || ["AI-Driven SOC Automation", "Claude Code & Antigravity Workflows", "Vulnerability Management", "EDR / DLP Administration", "SIEM Threat Triage", "NIST / CIS Hardening"]).join(", ")}
|
||||
- Full Experience Background: ${JSON.stringify(masterProfile.experience || [])}
|
||||
- Education & Certifications: ${JSON.stringify(masterProfile.education || [])}
|
||||
|
||||
INSTRUCTIONS FOR GENERATING THE TAILORED RESUME:
|
||||
- Write a COMPLETE, articulated, multi-section Resume text formatted in Markdown.
|
||||
- Do NOT abbreviate or summarize. Include an Executive Summary, Technical Skills matrix, detailed Work History section with full bullet points for each company (highlighting quantitative metrics and AI SOC automation workflows), and Education / Certifications.
|
||||
- Ensure the tone is authoritative, highly professional, and tailored to the job description keywords.
|
||||
|
||||
INSTRUCTIONS FOR GENERATING THE COVER LETTER:
|
||||
- Write a comprehensive, 4-paragraph formal Cover Letter tailored specifically to ${targetCompany} and the ${targetTitle} position.
|
||||
- Paragraph 1: Powerful opening hook expressing enthusiastic interest in the ${targetTitle} role at ${targetCompany}, citing specific alignment with their team goals.
|
||||
- Paragraph 2: Highlight core career achievements, emphasizing vulnerability management transformation (reducing QIDs from thousands to baseline state) and operational leadership.
|
||||
- Paragraph 3: Detail AI-driven SOC automation expertise (Claude Code, Antigravity, ChatGPT) for threat triage, EDR/DLP policy governance, and technical alignment with ${targetCompany}'s technical environment.
|
||||
- Paragraph 4: Strong closing statement offering an interview discussion, thanking the hiring team, and formal sign-off ("Sincerely, ${masterProfile.fullName || "David Kifer"}").
|
||||
|
||||
Return a JSON object containing:
|
||||
- matchScore: number (0-100)
|
||||
- matchedSkills: array of strings
|
||||
- missingSkills: array of strings
|
||||
- tailoredBullets: array of 5-8 rich, metric-driven accomplishment bullets
|
||||
- tailoredResumeText: complete, articulate multi-page markdown resume
|
||||
- coverLetter: full 4-paragraph formal cover letter
|
||||
- insights: 3 actionable strategic interview positioning insights`;
|
||||
|
||||
const schema = {
|
||||
type: Type.OBJECT,
|
||||
@@ -392,14 +413,15 @@ Perform an in-depth match analysis and resume tailoring:
|
||||
coverLetter: { type: Type.STRING },
|
||||
insights: { type: Type.STRING },
|
||||
},
|
||||
required: ["matchScore", "matchedSkills", "tailoredResumeText", "coverLetter"],
|
||||
required: ["matchScore", "matchedSkills", "tailoredResumeText", "coverLetter", "tailoredBullets"],
|
||||
};
|
||||
|
||||
const configToUse = llmConfig || userProfile?.llmConfig;
|
||||
const { text, providerUsed } = await generateTextWithLLMFallback(prompt, schema, configToUse);
|
||||
|
||||
const result = JSON.parse(text || "{}");
|
||||
res.json({ success: true, data: result, providerUsed });
|
||||
const cleanJsonText = text.replace(/```json/gi, '').replace(/```/g, '').trim();
|
||||
const result = JSON.parse(cleanJsonText || "{}");
|
||||
res.json({ success: true, data: result, tailored: result, providerUsed });
|
||||
} catch (error: any) {
|
||||
console.error("Error tailoring resume:", error);
|
||||
res.status(500).json({
|
||||
|
||||
Reference in New Issue
Block a user