Spaces:
Sleeping
Sleeping
| # %%writefile utils/prompts.py | |
| JD_PROMPT = """ | |
| ## Tasks | |
| Given the following Job Description, extract a structured hiring rubric. | |
| ## Strategy for High Recall: | |
| - **Scan the ENTIRE text**: Important skills (like Data Governance or AI) \ | |
| are often buried in "Responsibilities" or "About the Team" sections, not just "Qualifications." | |
| - **Capture Minima**: If multiple experience levels are mentioned \ | |
| (e.g., 5 years for Senior, 2 years for Mid), extract the ABSOLUTE minimum required to enter the role. | |
| - **Bonus Skills**: Include specialized interests or "plus" items mentioned in the text as Nice-to-Have skills. | |
| - **Comprehensive Extraction**: If a skill is listed under 'Minimum Qualifications' (e.g., problem-solving), \ | |
| include it in must_have_skills even if it feels like a soft skill. | |
| ## Output | |
| Return STRICT JSON with the following fields: | |
| - role_title | |
| - must_have_skills (list) | |
| - nice_to_have_skills (list) | |
| - soft_skills (list) | |
| - minimum_years_experience (number) | |
| - minimum_education_requirements (list) | |
| - recommended_weights (object with must_have, nice_to_have, experience, education, soft_skills) | |
| Job Description: | |
| ---------------- | |
| {jd_text} | |
| """ | |
| RESUME_PARSE_PROMPT = """ | |
| You are an experienced HR resume analyst. | |
| Given the following resume text, extract a structured candidate profile. | |
| Return STRICT JSON with these fields: | |
| - name | |
| - technical skills (list) | |
| - soft skills (list) | |
| - education (list) | |
| - work_experience (list of short role summaries) | |
| - total_years_experience (number) | |
| - summary (2–3 sentence professional summary) | |
| Resume Text: | |
| ------------- | |
| {resume_text} | |
| IMPORTANT: | |
| - Output JSON only | |
| - Do not include explanations | |
| """ | |
| JD_RESUME_MATCH_PROMPT = """ | |
| You are an experienced HR hiring analyst. | |
| You will be given: | |
| 1. A structured Job Description rubric (JSON) | |
| 2. A structured candidate profile (JSON) | |
| Your task: | |
| - Compare the candidate against the JD rubric | |
| - Identify matches, partial matches, and gaps | |
| - Identify positive and negative indicators | |
| - DO NOT calculate a score | |
| - Be factual and conservative | |
| - Do NOT infer sensitive personal attributes | |
| - Output ONLY valid JSON in the specified schema | |
| - IMPORTANT: Include selected JD rubric fields verbatim in the output for auditability | |
| Matching rules: | |
| - A skill is matched if clearly demonstrated in experience or skills | |
| - Partial if loosely related or implied | |
| - Missing if not found | |
| Education rules: | |
| - Compare candidate education list against the JD minimum_education_requirements list | |
| - "meets" if at least one listed minimum requirement is clearly satisfied (or higher) | |
| - "partial" if education is present but unclear / not directly matching | |
| - "missing" if no relevant education is found | |
| Soft skills rules: | |
| - Match soft skills only if explicitly present in resume/profile or clearly stated in summaries | |
| - Be conservative | |
| Output JSON schema (STRICT): | |
| { | |
| "role_title": "", | |
| "candidate_name": "", | |
| "jd_rubric_snapshot": { | |
| "minimum_years_experience": 0, | |
| "minimum_education_requirements": [], | |
| "recommended_weights": { | |
| "must_have": 0, | |
| "nice_to_have": 0, | |
| "experience": 0, | |
| "education": 0, | |
| "soft_skills": 0 | |
| }, | |
| "must_have_skills": [], | |
| "nice_to_have_skills": [], | |
| "soft_skills": [] | |
| }, | |
| "must_have_match": { | |
| "matched": [], | |
| "missing": [], | |
| "partial": [] | |
| }, | |
| "nice_to_have_match": { | |
| "matched": [], | |
| "missing": [] | |
| }, | |
| "soft_skills_match": { | |
| "matched": [], | |
| "missing": [] | |
| }, | |
| "experience_analysis": { | |
| "required_years": 0, | |
| "candidate_years": 0, | |
| "assessment": "below | meets | exceeds" | |
| }, | |
| "education_analysis": { | |
| "requirements": [], | |
| "candidate_education": [], | |
| "assessment": "missing | partial | meets" | |
| }, | |
| "positive_indicators": [], | |
| "negative_indicators": [], | |
| "overall_fit_summary": "" | |
| } | |
| IMPORTANT: | |
| - role_title MUST be copied from the JD rubric's role_title | |
| - jd_rubric_snapshot fields MUST be copied from the JD rubric (verbatim lists and numbers) | |
| - education_analysis.requirements MUST equal JD rubric minimum_education_requirements | |
| - education_analysis.candidate_education MUST equal candidate profile education list | |
| - Output JSON only (no markdown, no commentary) | |
| """ | |