diff --git a/data/cover_letter_api.json b/data/cover_letter_api.json index 1295d1a..9ba6633 100644 --- a/data/cover_letter_api.json +++ b/data/cover_letter_api.json @@ -8,7 +8,7 @@ "content": [ { "type": "text", - "text": "You are an expert in job hunting and cover letter writing. Your task is to create a persuasive and professional cover letter for a job candidate based on their resume, the job description, and the current date. \n\nHere is the job description:\n\n{{job_description}}\n\n\nHere is the candidate's resume in JSON format:\n\n{{resume_json}}\n\n\nThe current date is:\n\n{{date}}\n\n\nPlease follow these steps to create an effective cover letter:\n\n1. Analyze the resume and job description to identify key skills and experiences that match the job requirements.\n2. Determine the most persuasive points to highlight in the cover letter.\n3. Structure the cover letter with an introduction, body paragraphs, and a conclusion.\n4. Ensure the letter is professional, engaging, and tailored to the specific job and company.\n\nBefore writing the cover letter, wrap your analysis inside tags. In this analysis:\n1. Extract and list key skills and experiences from the resume.\n2. Identify the most important requirements from the job description.\n3. Brainstorm specific examples or achievements that match the job requirements.\n4. Create a brief outline of the cover letter structure.\n\nAfter your analysis, write the cover letter using the following structure:\n\n\n
\n[Candidate's Name]\n[Candidate's Address]\n[City, State ZIP Code]\n[Phone Number]\n[Email Address]\n\n[Date]\n\n[Employer's Name]\n[Company Name]\n[Company Address]\n[City, State ZIP Code]\n
\n\n\n[Greeting]\n\n\n\n[Opening paragraph]\n\n\n\n[Main paragraphs highlighting relevant skills and experiences]\n\n\n\n[Closing paragraph]\n\n\n\n[Signature line]\n\n
\n\nRemember to be persuasive, professional, and to tailor the content specifically to the job description and the candidate's qualifications." + "text": "You are an expert in job hunting and cover letter writing. Your task is to create a persuasive and professional cover letter for a job candidate based on their resume, the job description, the current date, and any optional key points they want to highlight.\n\nHere are the inputs for this task:\n\nJob Description:\n\n{{job_description}}\n\n\nCandidate's Resume (in JSON format):\n\n{{resume_json}}\n\n\nCurrent Date:\n\n{{date}}\n\n\nOptional Key Points to Highlight:\n\n{{key_points}}\n\n\nBefore writing the cover letter, please analyze the provided information. Wrap your analysis inside tags:\n\n\n1. Extract and list key skills and experiences from the resume.\n2. Identify the most important requirements from the job description.\n3. If provided, consider how to incorporate the optional key points.\n4. Match the candidate's qualifications with the job requirements:\n a. List qualifications that directly match job requirements.\n b. Identify qualifications that indirectly relate to job requirements.\n c. Note any potential gaps between candidate qualifications and job requirements.\n5. List the most relevant achievements from the resume, connecting them to job requirements.\n6. Brainstorm specific examples that demonstrate the candidate's suitability.\n7. For any gaps identified, brainstorm how to address them positively in the letter.\n8. Create a brief outline of the cover letter structure, noting where to include key points and achievements.\n\n\nAfter your analysis, craft a professional and engaging cover letter using the following structure:\n\n\n
\n[Candidate's Name]\n[Candidate's Address]\n[City, State ZIP Code]\n[Phone Number]\n[Email Address]\n\n[Current Date]\n\n[Employer's Name]\n[Company Name]\n[Company Address]\n[City, State ZIP Code]\n
\n\n\n[Professional greeting]\n\n\n\n[Opening paragraph: Introduce yourself, state the position you're applying for, and briefly mention how you learned about the opportunity.]\n\n\n\n[2-3 paragraphs highlighting relevant skills, experiences, and achievements. Connect these to the job requirements and company needs. If provided, incorporate the optional key points naturally into these paragraphs.]\n\n\n\n[Closing paragraph: Express enthusiasm for the position, request an interview, and thank the reader for their consideration.]\n\n\n\nSincerely,\n[Candidate's Name]\n\n
\n\nImportant guidelines:\n1. Tailor the content specifically to the job description and the candidate's qualifications.\n2. Be persuasive and professional throughout the letter.\n3. Use concrete examples to demonstrate the candidate's skills and experiences.\n4. Keep the letter concise, typically not exceeding one page.\n5. Ensure proper grammar, spelling, and formatting.\n6. If provided, seamlessly integrate the optional key points into the letter without explicitly mentioning them as separate items.\n\nPlease write the cover letter based on these instructions and the provided information." } ] }, @@ -17,7 +17,7 @@ "content": [ { "type": "text", - "text": "" + "text": "" } ] } diff --git a/public/index.html b/public/index.html index 2209722..54f987a 100644 --- a/public/index.html +++ b/public/index.html @@ -20,13 +20,15 @@ + + diff --git a/public/js/script.js b/public/js/script.js index 57917df..77a2b33 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -47,6 +47,7 @@ document.getElementById('uploadForm').addEventListener('submit', async function document.getElementById("generateCoverLetterBtn").addEventListener("click", async function () { const extractedResumeText = document.getElementById("resumeTextOutput").value; const jobDescription = document.getElementById("jobDescription").value; + const keyPoints = document.getElementById("keyPoints").value; const generateBtn = document.getElementById("generateCoverLetterBtn") if (!extractedResumeText.trim()) { @@ -62,6 +63,7 @@ document.getElementById("generateCoverLetterBtn").addEventListener("click", asyn const requestData = { extractedResumeText, jobDescription, + keyPoints, }; generateBtn.textContent = "Generating Cover Letter...." diff --git a/routes/generate.js b/routes/generate.js index 6378cff..d8ec650 100644 --- a/routes/generate.js +++ b/routes/generate.js @@ -33,7 +33,7 @@ router.post('/extract-resume', upload.single('resume'), async (req, res) => { // Handle Resume upload and user input for Job Description router.post('/', async (req, res) => { try { - const { extractedResumeText, jobDescription } = req.body; + const { extractedResumeText, jobDescription, keyPoints } = req.body; const resume_parser_api = require('../data/resume_parser_api.json'); const cover_letter_api = require('../data/cover_letter_api.json'); @@ -47,6 +47,7 @@ router.post('/', async (req, res) => { cover_letter_api.messages[0].content[0].text = cover_letter_api.messages[0].content[0].text .replace('{{resume_json}}', candidateProfile) .replace('{{job_description}}', jobDescription) + .replace('{{key_points}}', keyPoints ) .replace('{{date}}', new Date().toDateString()); const coverLetterResponse = await anthropic.messages.create(cover_letter_api);