All files / utils/resume_handlers resume_AI_handler.ts

57.14% Statements 4/7
100% Branches 0/0
0% Functions 0/3
66.66% Lines 4/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 841x                   1x                                                           1x                                                         1x                            
export const SYSTEM_TEMPLATE = `You are a very experienced ATS (Application Tracking System) bot with a deep understanding named Bob the Resume builder.
You will review resumes with or without job descriptions.
You are an expert in resume evaluation and provide constructive feedback with dynamic evaluation.
You should also provide an improvement table, taking into account:
- Content (Medium priority)
- Keyword matching (High priority)
- Hard skills (High priority)
- Soft skills (High priority)
- Overall presentation (Low priority)`;
 
export const feedbackTemplate = (resumeText: string, jdText: string) => `
Resume Feedback Report
Here is the resume you provided:
${resumeText}
And the job description:
${jdText}
 
Create the Improvement Table in relevance to the resume and give the consideration and suggestion for each section strictly following 
the pattern as below and don't just out this guided pattern :
| Area          | Consideration                                                   | Status | Suggestions |
| ------------- | --------------------------------------------------------------- | ------ | ----------- |
| Content       | Measurable Results: At least 5 specific achievements or impact. |  Low   |             |
|               | Words to avoid: Negative phrases or clichés.                    |        |             |
| Keywords      | Hard Skills: Presence and frequency of hard skills.             |  High  |             |
|               | Soft Skills: Presence and frequency of soft skills.             |        |             |
| Presentation  | Education Match: Does the resume list a degree that matches the job requirements? |  High   |             |
 
Strengths:
List the strengths of the resume here.
 
Detailed Feedback:
Provide detailed feedback on the resume's content, structure, grammar, and relevance to the job description.
 
Suggestions:
Provide actionable suggestions for improvement, including specific keywords to include and skills to highlight.
 
Based on your analysis, provide a numerical score between 0-100 that represents the overall quality and match of the resume.
The score should be provided at the end of your response in the format: "SCORE: X" where X is the numerical score.
`;
 
export const createResumeModificationPrompt = (resumeContent: string, feedback: string, jobDescription: string): string => {
    return `You are a resume expert. Please modify the following resume content based on the feedback and job description.
 
Current Resume Content:
${resumeContent}
 
Feedback:
${feedback}
 
Job Description:
${jobDescription}
 
IMPORTANT: You must return your response in the following EXACT JSON format. Do not include any other text or explanation:
 
[
  {
    "paragraphIndex": 0,
    "text": "First paragraph content here"
  }
]
 
Rules:
1. Return ONLY the JSON array, nothing else
2. Each paragraph must maintain its original structure
3. The text content should be updated based on the feedback while preserving formatting
4. Maintain the same number of paragraphs as the original
5. Do not include any markdown, formatting, or additional text`;
};
 
export const createResumeExtractionPrompt = (resumeText: string): string => {
    return `
  Extract from this resume the following fields as JSON:
    • "aboutMe": a 1–2 sentence self-summary.
    • "skills": an array of technical skills.
    • "roleMatch": one-sentence best-fit role suggestion.
    • "experience": an array of 3–5 bullet points of key achievements.
  
  Resume text:
  ---
  ${resumeText}
  ---
    Respond with a single JSON object and nothing else. The json object should begin directly with parentheses and have the following structure: {"a": "value", "b": "value", ...}
  `;
};