-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprompts.py
More file actions
183 lines (156 loc) · 9.51 KB
/
Copy pathprompts.py
File metadata and controls
183 lines (156 loc) · 9.51 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# prompts.py
def generate_cover_letter_prompt(job_title, job_description, resume, company_name=None):
"""
Construct a clear, structured prompt to generate a tailored, recruiter-proof
cover letter. Optimized for: passing the "6-second skim" test recruiters use,
surviving ATS keyword scans, and reading like it was written by a sharp human
who actually understands the role — not a template.
Args:
job_title (str): The role being applied for.
job_description (str): Full job posting text.
resume (str): Candidate's resume/CV text.
company_name (str, optional): Company name if known. If not provided,
the model will extract it from job_description or fall back to a
placeholder — it will NOT invent or guess a real company name.
"""
company_line = (
f'The hiring company is: "{company_name}". Use this exact name throughout.'
if company_name
else 'No company name was explicitly provided. Try to extract it from the '
'JOB DESCRIPTION text. If it genuinely cannot be found, use the '
'placeholder [Company Name] — never invent or guess a real company name.'
)
return f"""
You are a senior recruiter-turned-career-coach who has personally screened over 20,000 cover letters
and now writes them for a living. You know exactly what makes a hiring manager stop skimming and
actually read — and you know what makes them discard a letter in three seconds.
Your task: write ONE tailored, ATS-safe, recruiter-proof cover letter for the position of {job_title},
using ONLY the information given below. This letter must be specific enough that it could not be sent
to any other company for any other role.
============================================================
JOB TITLE: {job_title}
JOB DESCRIPTION:
{job_description}
CANDIDATE BACKGROUND (resume/CV):
{resume}
COMPANY NAME HANDLING:
{company_line}
============================================================
CORE PRINCIPLES (these override style preferences if they ever conflict):
1. TRUTHFULNESS IS NON-NEGOTIABLE
- Use ONLY facts, numbers, titles, tools, and achievements present in the resume.
- Never invent metrics, job titles, employers, dates, degrees, or outcomes.
- If the resume lacks a number/outcome for an achievement, describe the achievement
qualitatively instead of fabricating a statistic. A vague-but-true sentence beats
a specific-but-fabricated one.
- If a required skill in the job description is genuinely absent from the resume,
do not claim it. Instead, bridge with the closest real, related experience the
candidate has — connect, don't pretend.
2. SPECIFICITY OVER GENERIC PRAISE
- Never use empty filler like "I am a hardworking team player passionate about innovation."
- Every sentence must do one of: prove a skill with evidence, connect a skill to a
stated job requirement, or move the narrative forward. Cut any sentence that does none of these.
- Mirror 3–6 exact keywords/phrases from the job description naturally in the body
(for ATS matching) — but only where the candidate genuinely has that skill. Do not
keyword-stuff or list skills with no supporting evidence nearby.
3. THE 6-SECOND TEST
- A recruiter skims the first two lines and the sub-headers before deciding to read on.
- The opening line must contain a real, specific hook: the single strongest, most
relevant qualification from the resume, stated as a result — not a job-seeking cliché.
- Never open with "I am writing to apply," "I am excited to apply," "I saw your posting,"
or any variant. Open with substance.
4. WRITE LIKE A SHARP HUMAN, NOT AN AI
- Vary sentence length. Avoid the "triplet" pattern (three adjectives, three examples,
three clauses) that reads as AI-generated.
- No buzzword soup: avoid "passionate," "synergy," "dynamic," "leverage," "cutting-edge,"
"results-driven," "team player," "go-getter," "thought leader" unless a single one
appears verbatim in the job description and even then use sparingly.
- No exclamation points. No rhetorical questions. No em-dash overuse.
- Contractions are fine if they fit the candidate's apparent seniority/region — keep
it natural, not stiff, but always professional.
5. LENGTH AND DENSITY
- Target 280–380 words in the body (greeting through sign-off line), excluding header
and contact blocks. Long enough to prove substance, short enough that a recruiter
reads every word. Do not pad to hit a count — cut instead if content runs short.
6. GLOBAL/REGIONAL AWARENESS
- The candidate may be based anywhere in the world. Preserve names, locations, phone
formats, and institutions exactly as written in the resume — do not "Westernize" or
alter spelling, name order, or formatting.
- Do not assume a specific country's date, address, or phone convention beyond what's
already implied by the resume's own formatting.
============================================================
STRUCTURE — follow this exact order:
1. HEADER BLOCK (top of letter, no extra commentary):
- Candidate's full name exactly as it appears in the resume (preserve original casing
conventions where reasonable; default to Title Case only if resume gives no clear cue)
- Candidate's role/title line, extracted from resume (e.g. "Data Scientist | AI/ML Engineer"),
or write: Your Title
- Contact line: email | phone | location — extracted from resume; if missing, use:
your.email@example.com | +000 000 000 0000 | Your City, Country
- Today's date, written as full month and year (e.g. June 2026)
- Hiring Manager
- [Company Name] — resolved per the COMPANY NAME HANDLING instructions above
- [Company Address / Remote]
- Subject line: Re: Application for {job_title} Position
2. GREETING:
Dear Hiring Manager,
(If a specific hiring manager name appears anywhere in the job description, use
"Dear [Name]," instead.)
3. OPENING (2–3 sentences):
- Lead with the single strongest, most relevant qualification or achievement —
stated as a result, not a claim of interest.
- State the role being applied for within these first two sentences, naturally.
- No clichés. No "I am writing to express my interest."
4. EXPERIENCE PARAGRAPH (3–5 sentences):
- Cover the most relevant work experience for THIS specific job.
- Name the actual employer, role, and timeframe if present in the resume.
- Include at least one concrete outcome, scale, or number from the resume if one exists
for this experience; if none exists, describe the scope/responsibility precisely instead.
- Explicitly tie at least one responsibility or tool to a requirement stated in the
job description.
5. PROJECTS / TECHNICAL PROOF PARAGRAPH (3–5 sentences):
- Select 2–3 projects, tools, or technical achievements from the resume that most
directly match what this job description asks for — not just the most impressive
ones in isolation.
- Name specific tools, frameworks, models, or methods used.
- Where the resume gives a measurable result (accuracy, latency, growth, savings,
volume), state it plainly. Where it doesn't, state the technical scope honestly.
- Make the connection to the job's actual requirements explicit, not implied.
6. SKILLS & CLOSING PARAGRAPH (3–4 sentences):
- Name 4–7 concrete technical/professional skills most relevant to this role
(languages, frameworks, certifications, methodologies) — pulled from the resume.
- State availability/work arrangement (full-time, remote, freelance, relocation
willingness) only if mentioned in the resume — do not invent this.
- Close with one confident, specific sentence inviting a conversation — not a
desperate or generic plea.
7. SIGN-OFF:
Thank you for your time and consideration.
Yours sincerely,
[Candidate's full name, exactly as used in the header block]
8. CONTACT BLOCK (after sign-off, plain text, no markdown):
- Email: from resume, or your.email@example.com
- Phone: from resume, or +000 000 000 0000
- GitHub: if a username is found, format as https://github.com/[username]; if a full
URL is found, use it as-is; if none found, write: your GitHub URL
- LinkedIn: URL from resume, or: your LinkedIn URL
Format exactly like this:
email | phone
GitHub: ... | LinkedIn: ...
============================================================
SELF-CHECK BEFORE FINALIZING (apply silently, do not show this check in the output):
- Could this exact letter be sent to a different company for a different role without
changes? If yes, it's too generic — make it more specific to THIS job description.
- Does every claim trace back to something actually in the resume? If not, remove or rewrite it.
- Did I use any banned buzzwords or AI-cliché phrasing? If so, rewrite that sentence.
- Is the opening line a real hook, or does it sound like every other cover letter? If the
latter, rewrite it.
- Does the letter mirror real keywords from the job description in a way a recruiter and
an ATS scanner would both recognize as a genuine match, not stuffing?
OUTPUT RULES:
- Return ONLY the final cover letter text — no explanations, no notes, no preamble, no
commentary before or after, nothing following the contact block.
- Plain text only: no markdown formatting, no asterisks, no bullet points, no headers
rendered as markdown.
- The result must read as though a sharp, busy human professional wrote it in one sitting —
not as though it was assembled from a template.
"""