cv-agent-mcp 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +132 -2
- package/dist/cli.js +117 -0
- package/dist/core/keywords.js +75 -0
- package/dist/core/lint.js +97 -0
- package/dist/core/store.js +59 -0
- package/dist/core/text.js +71 -0
- package/dist/core/verify.js +110 -0
- package/dist/mcp/server.js +106 -0
- package/dist/render/index.js +69 -0
- package/dist/schema/resume.js +79 -0
- package/package.json +60 -4
- package/prompts/context-import.md +54 -0
- package/prompts/review-rubric.md +20 -0
- package/skill/cv-agent/SKILL.md +35 -0
- package/templates/classic.typ +119 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 cv-agent contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,133 @@
|
|
|
1
|
-
#
|
|
1
|
+
# cv-agent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/zeiado/cv-agent/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/cv-agent-mcp)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
**Your AI already knows your career. cv-agent turns that into a CV, reviews it, and tailors it to each job, without
|
|
8
|
+
inventing a single fact.**
|
|
9
|
+
|
|
10
|
+
cv-agent is an open-source MCP server and CLI that runs *inside* the AI agent you already use (Claude Desktop, Claude
|
|
11
|
+
Code, Cursor, or any MCP client). Your agent does the writing. cv-agent stores your profile, checks the CV, blocks
|
|
12
|
+
made-up claims and renders an ATS-friendly PDF. You don't need an API key or an account, and your data stays on your
|
|
13
|
+
machine.
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
*Real CLI output. In step 4 an AI "tailored" the CV by inventing a 70% improvement and Kubernetes experience.
|
|
18
|
+
cv-agent rejects all of it. In normal use your agent calls these as MCP tools, so you never type the commands.*
|
|
19
|
+
|
|
20
|
+
## Why another CV tool?
|
|
21
|
+
|
|
22
|
+
| | cv-agent | Typical AI resume builders |
|
|
23
|
+
| ---------------------------------------- | :------: | :------------------------: |
|
|
24
|
+
| Starts from what your AI already knows | ✅ | Blank form or CV upload |
|
|
25
|
+
| Runs in your existing agent, no API key | ✅ | Their app, your API key or a subscription |
|
|
26
|
+
| **Blocks invented numbers, employers, skills** | ✅ | ❌ (happily writes "improved X by 40%") |
|
|
27
|
+
| Open data format (JSON Resume) | ✅ | Often proprietary |
|
|
28
|
+
| ATS-safe PDF with clean text order | ✅ | Varies |
|
|
29
|
+
|
|
30
|
+
If you want a visual drag-and-drop editor, use [Reactive Resume](https://github.com/AmruthPillai/Reactive-Resume).
|
|
31
|
+
It's excellent, and cv-agent's `profile.json` is JSON Resume, so you can import it there.
|
|
32
|
+
|
|
33
|
+
## How it works
|
|
34
|
+
|
|
35
|
+
1. **Bring your context.** Run `cv-agent prompt` (or ask your agent) and paste the prompt into the AI you talk to most.
|
|
36
|
+
It writes your profile as JSON Resume, using only facts it actually knows and marking anything it guessed.
|
|
37
|
+
2. **Import and confirm.** cv-agent saves it as your *master profile* and lists the guessed items for you to confirm.
|
|
38
|
+
3. **Review.** Deterministic checks (weak verbs, missing metrics, dates, length, ATS formatting) plus a rubric your
|
|
39
|
+
agent uses for a real critique.
|
|
40
|
+
4. **Tailor.** Paste a job description. You get keyword matches and honest gaps. Your agent selects, reorders and
|
|
41
|
+
rewords. `tailor_cv` then checks every bullet against your master profile and **rejects any number, technology,
|
|
42
|
+
employer, title, date or skill that isn't in it**.
|
|
43
|
+
5. **Render** to PDF and Markdown.
|
|
44
|
+
|
|
45
|
+
## Install
|
|
46
|
+
|
|
47
|
+
**Claude Desktop: one click, nothing else to install.** Download the bundle for your computer and double-click it:
|
|
48
|
+
|
|
49
|
+
| Windows | Mac (Apple Silicon) | Mac (Intel) |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| [cv-agent-windows-x64.mcpb](https://github.com/zeiado/cv-agent/releases/latest/download/cv-agent-windows-x64.mcpb) | [cv-agent-macos-arm64.mcpb](https://github.com/zeiado/cv-agent/releases/latest/download/cv-agent-macos-arm64.mcpb) | [cv-agent-macos-x64.mcpb](https://github.com/zeiado/cv-agent/releases/latest/download/cv-agent-macos-x64.mcpb) |
|
|
52
|
+
|
|
53
|
+
**Claude Code** (requires Node 20+)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
claude mcp add cv-agent -- npx -y cv-agent-mcp serve
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
cv-agent is also listed in the [official MCP Registry](https://registry.modelcontextprotocol.io) as
|
|
60
|
+
`io.github.zeiado/cv-agent`.
|
|
61
|
+
|
|
62
|
+
**Cursor / other MCP clients:** add to your MCP config:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{ "mcpServers": { "cv-agent": { "command": "npx", "args": ["-y", "cv-agent-mcp", "serve"] } } }
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Optional: copy `skill/cv-agent` into `~/.claude/skills/` so Claude follows the full workflow automatically.
|
|
69
|
+
|
|
70
|
+
Then just ask: *"Build my CV with cv-agent"* or *"Tailor my CV to this job: …"*
|
|
71
|
+
|
|
72
|
+
<details>
|
|
73
|
+
<summary>From source</summary>
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
git clone https://github.com/zeiado/cv-agent && cd cv-agent
|
|
77
|
+
npm install && npm run build
|
|
78
|
+
claude mcp add cv-agent -- node "$(pwd)/dist/cli.js" serve
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
</details>
|
|
82
|
+
|
|
83
|
+
## CLI
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npm i -g cv-agent-mcp # installs the `cv-agent` command
|
|
87
|
+
cv-agent prompt # the context-import prompt
|
|
88
|
+
cv-agent import answer.txt # or: pbpaste | cv-agent import -
|
|
89
|
+
cv-agent lint # review the master profile
|
|
90
|
+
cv-agent match job.txt # keyword match vs a job description
|
|
91
|
+
cv-agent verify tailored.json # check a tailored CV for invented facts
|
|
92
|
+
cv-agent render -o cv.pdf --md # PDF (+ Markdown); --letter for US Letter
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Try it on the bundled examples: `cv-agent verify examples/tailored-overclaimed.json --dir /tmp/demo` after
|
|
96
|
+
`cv-agent import examples/profile.json --dir /tmp/demo`.
|
|
97
|
+
|
|
98
|
+
Data lives in `~/.cv-agent` (override with `--dir` or `CV_AGENT_HOME`).
|
|
99
|
+
|
|
100
|
+
## MCP tools
|
|
101
|
+
|
|
102
|
+
| Tool | What it does |
|
|
103
|
+
| --- | --- |
|
|
104
|
+
| `get_context_prompt` | The prompt for exporting your profile from another AI |
|
|
105
|
+
| `import_profile` | Validate and save the master profile; returns items to confirm |
|
|
106
|
+
| `get_profile` / `update_profile` | Read / edit the master profile |
|
|
107
|
+
| `review_cv` | Deterministic checks and a review rubric |
|
|
108
|
+
| `analyze_job` | Keywords, gaps and match score for a job description |
|
|
109
|
+
| `tailor_cv` | Save a tailored CV, but only if it invents nothing |
|
|
110
|
+
| `render_cv` | PDF and Markdown output |
|
|
111
|
+
| `list_tailored` | Saved tailored CVs |
|
|
112
|
+
|
|
113
|
+
## How the "no invention" check works
|
|
114
|
+
|
|
115
|
+
For each tailored entry and bullet:
|
|
116
|
+
|
|
117
|
+
- Employers, projects, institutions, titles and dates must match the master profile.
|
|
118
|
+
- Every **number** (`40%`, `$2M`, `3x`, `10k`) must appear somewhere in the master profile.
|
|
119
|
+
- Every **technology or proper noun** (`Kubernetes`, `Node.js`, `Google`) must appear somewhere in it.
|
|
120
|
+
- Every **skill** must be evidenced in it.
|
|
121
|
+
- Bullets that can't be traced to any source get a warning for you to confirm.
|
|
122
|
+
|
|
123
|
+
It's deliberately strict. If the AI found something true that isn't in your profile yet, add it to the profile
|
|
124
|
+
first, then tailor.
|
|
125
|
+
|
|
126
|
+
## Contributing
|
|
127
|
+
|
|
128
|
+
New Typst templates are the easiest way to help. See `templates/classic.typ`. They must stay single-column and
|
|
129
|
+
ATS-safe. Run tests with `npm test`.
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
MIT
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { parseArgs } from "node:util";
|
|
6
|
+
import { Resume } from "./schema/resume.js";
|
|
7
|
+
import { Store, parseImport } from "./core/store.js";
|
|
8
|
+
import { lint } from "./core/lint.js";
|
|
9
|
+
import { analyzeJob } from "./core/keywords.js";
|
|
10
|
+
import { verifyTailored } from "./core/verify.js";
|
|
11
|
+
import { renderMarkdown, renderPdf } from "./render/index.js";
|
|
12
|
+
const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
13
|
+
const HELP = `cv-agent: agent-native CV builder, reviewer and tailor
|
|
14
|
+
|
|
15
|
+
Usage:
|
|
16
|
+
cv-agent prompt Print the prompt to paste into ChatGPT/Claude/Gemini
|
|
17
|
+
cv-agent import <file|-> [--force] Save that AI's answer as your master profile
|
|
18
|
+
cv-agent lint [file] Review a CV (default: master profile)
|
|
19
|
+
cv-agent match <job.txt> [file] Keyword match against a job description
|
|
20
|
+
cv-agent verify <tailored.json> Check a tailored CV for invented facts
|
|
21
|
+
cv-agent render [file] [-o out.pdf] [--md] [--letter]
|
|
22
|
+
cv-agent serve Run the MCP server (stdio)
|
|
23
|
+
|
|
24
|
+
Options:
|
|
25
|
+
--dir <path> Data directory (default: $CV_AGENT_HOME or ~/.cv-agent)
|
|
26
|
+
`;
|
|
27
|
+
const { positionals, values } = parseArgs({
|
|
28
|
+
allowPositionals: true,
|
|
29
|
+
options: {
|
|
30
|
+
dir: { type: "string" },
|
|
31
|
+
out: { type: "string", short: "o" },
|
|
32
|
+
force: { type: "boolean" },
|
|
33
|
+
md: { type: "boolean" },
|
|
34
|
+
letter: { type: "boolean" },
|
|
35
|
+
help: { type: "boolean", short: "h" },
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
const [cmd, ...args] = positionals;
|
|
39
|
+
const readInput = (p) => (p === "-" ? readFileSync(0, "utf8") : readFileSync(p, "utf8"));
|
|
40
|
+
const store = () => new Store(values.dir);
|
|
41
|
+
const loadCv = (file) => (file ? Resume.parse(JSON.parse(readInput(file))) : store().loadProfile());
|
|
42
|
+
const ICON = { error: "✖", warn: "▲", info: "·" };
|
|
43
|
+
const printIssues = (issues) => issues.forEach((i) => console.log(` ${ICON[i.severity]} ${i.path.padEnd(28)} ${i.message}`));
|
|
44
|
+
async function main() {
|
|
45
|
+
switch (cmd) {
|
|
46
|
+
case "prompt":
|
|
47
|
+
process.stdout.write(readFileSync(join(ROOT, "prompts", "context-import.md"), "utf8"));
|
|
48
|
+
break;
|
|
49
|
+
case "import": {
|
|
50
|
+
if (!args[0])
|
|
51
|
+
throw new Error("Usage: cv-agent import <file|->");
|
|
52
|
+
const s = store();
|
|
53
|
+
if (s.hasProfile() && !values.force)
|
|
54
|
+
throw new Error(`A profile already exists at ${s.profilePath}. Use --force to replace it.`);
|
|
55
|
+
const { profile, review } = parseImport(readInput(args[0]));
|
|
56
|
+
s.saveProfile(profile);
|
|
57
|
+
s.saveReview(review);
|
|
58
|
+
console.log(`Saved master profile to ${s.profilePath}`);
|
|
59
|
+
if (review.length) {
|
|
60
|
+
console.log(`\n${review.length} item(s) the AI was not sure about. Check these before using the CV:`);
|
|
61
|
+
review.forEach((r) => console.log(` ? ${r.path.padEnd(28)} ${r.confidence}${r.note ? `: ${r.note}` : ""}`));
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
case "lint": {
|
|
66
|
+
const { score, issues, stats } = lint(loadCv(args[0]));
|
|
67
|
+
console.log(`Score ${score}/100 · ${stats.bullets} bullets, ${stats.bulletsWithMetric} with numbers, ~${stats.approxWords} words\n`);
|
|
68
|
+
printIssues(issues);
|
|
69
|
+
if (!issues.length)
|
|
70
|
+
console.log(" No issues found.");
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
case "match": {
|
|
74
|
+
if (!args[0])
|
|
75
|
+
throw new Error("Usage: cv-agent match <job.txt> [cv.json]");
|
|
76
|
+
const a = analyzeJob(readInput(args[0]), loadCv(args[1]));
|
|
77
|
+
console.log(`Keyword match ${a.matchScore}%\n`);
|
|
78
|
+
console.log(` Matched: ${a.matched.join(", ") || "(none)"}`);
|
|
79
|
+
console.log(` Missing: ${a.missing.join(", ") || "(none)"}`);
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case "verify": {
|
|
83
|
+
if (!args[0])
|
|
84
|
+
throw new Error("Usage: cv-agent verify <tailored.json>");
|
|
85
|
+
const v = verifyTailored(store().loadProfile(), loadCv(args[0]));
|
|
86
|
+
console.log(v.ok ? "No invented facts found." : "Found claims that are not in your master profile:");
|
|
87
|
+
v.findings.forEach((f) => console.log(` ${ICON[f.severity]} ${f.path.padEnd(28)} ${f.message}`));
|
|
88
|
+
process.exitCode = v.ok ? 0 : 1;
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
case "render": {
|
|
92
|
+
const cv = loadCv(args[0]);
|
|
93
|
+
const out = resolve(values.out ?? (args[0] ? args[0].replace(/\.json$/i, "") + ".pdf" : store().outPath("master", "pdf")));
|
|
94
|
+
writeFileSync(out, renderPdf(cv, { paper: values.letter ? "us-letter" : "a4" }));
|
|
95
|
+
console.log(`Wrote ${out}`);
|
|
96
|
+
if (values.md) {
|
|
97
|
+
const md = out.replace(/\.pdf$/i, ".md");
|
|
98
|
+
writeFileSync(md, renderMarkdown(cv), "utf8");
|
|
99
|
+
console.log(`Wrote ${md}`);
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
case "serve": {
|
|
104
|
+
const { startServer } = await import("./mcp/server.js");
|
|
105
|
+
await startServer(values.dir);
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
default:
|
|
109
|
+
process.stdout.write(HELP);
|
|
110
|
+
if (cmd && cmd !== "help" && !values.help)
|
|
111
|
+
process.exitCode = 1;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
main().catch((e) => {
|
|
115
|
+
console.error(e instanceof Error ? e.message : e);
|
|
116
|
+
process.exitCode = 1;
|
|
117
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { STOPWORDS, contentTokens, corpusText, stem, tokens } from "./text.js";
|
|
2
|
+
/** Common technologies and skills, matched case-insensitively. Multi-word terms use "-". */
|
|
3
|
+
const LEXICON = ("python java javascript typescript go golang rust c++ c# .net kotlin swift scala ruby php sql nosql matlab dart flutter " +
|
|
4
|
+
"react angular vue svelte next.js node.js express django flask fastapi spring rails laravel graphql rest grpc html css tailwind " +
|
|
5
|
+
"aws azure gcp docker kubernetes terraform ansible linux git ci/cd jenkins github-actions kafka rabbitmq redis postgresql postgres " +
|
|
6
|
+
"mysql mongodb elasticsearch snowflake spark hadoop airflow dbt pandas numpy pytorch tensorflow scikit-learn llm nlp rag " +
|
|
7
|
+
"machine-learning deep-learning computer-vision mlops microservices serverless agile scrum jira figma excel power-bi tableau " +
|
|
8
|
+
"salesforce sap seo sem crm b2b saas etl api apis testing tdd unity unreal ios android security oauth devops sre observability " +
|
|
9
|
+
"prometheus grafana leadership mentoring stakeholder communication").split(/\s+/);
|
|
10
|
+
const REQUIREMENT_RE = /\b(must|require|required|experience (with|in)|proficien|knowledge of|familiar|you have|you'll|degree|years)\b/i;
|
|
11
|
+
function countOccurrences(haystack, needle) {
|
|
12
|
+
return haystack.split(needle).length - 1;
|
|
13
|
+
}
|
|
14
|
+
/** Deterministic keyword extraction from a job description, matched against a resume. */
|
|
15
|
+
export function analyzeJob(jobText, r) {
|
|
16
|
+
const jdTokens = tokens(jobText);
|
|
17
|
+
const jdJoined = " " + jdTokens.join(" ") + " ";
|
|
18
|
+
const weights = new Map();
|
|
19
|
+
const bump = (t, w) => weights.set(t, (weights.get(t) ?? 0) + w);
|
|
20
|
+
for (const term of LEXICON) {
|
|
21
|
+
let n = countOccurrences(jdJoined, ` ${term} `);
|
|
22
|
+
if (term.includes("-"))
|
|
23
|
+
n += countOccurrences(jdJoined, ` ${term.replace(/-/g, " ")} `);
|
|
24
|
+
if (n)
|
|
25
|
+
bump(term, 2 + n);
|
|
26
|
+
}
|
|
27
|
+
// Frequent content words and bigrams not already covered by the lexicon.
|
|
28
|
+
const counts = new Map();
|
|
29
|
+
for (const t of contentTokens(jobText))
|
|
30
|
+
if (!/^\d+$/.test(t))
|
|
31
|
+
counts.set(t, (counts.get(t) ?? 0) + 1);
|
|
32
|
+
for (let i = 0; i < jdTokens.length - 1; i++) {
|
|
33
|
+
const a = jdTokens[i];
|
|
34
|
+
const b = jdTokens[i + 1];
|
|
35
|
+
if (STOPWORDS.has(a) || STOPWORDS.has(b) || a.length < 3 || b.length < 3)
|
|
36
|
+
continue;
|
|
37
|
+
const bg = `${a}-${b}`;
|
|
38
|
+
counts.set(bg, (counts.get(bg) ?? 0) + 1);
|
|
39
|
+
}
|
|
40
|
+
for (const [t, n] of counts)
|
|
41
|
+
if (n >= 2 && !weights.has(t))
|
|
42
|
+
bump(t, n);
|
|
43
|
+
// Requirement-looking lines boost the terms they mention.
|
|
44
|
+
const requirementLines = jobText
|
|
45
|
+
.split(/\r?\n/)
|
|
46
|
+
.map((l) => l.replace(/^[\s*•\-–·\d.)]+/, "").trim())
|
|
47
|
+
.filter((l) => l.length > 15 && REQUIREMENT_RE.test(l));
|
|
48
|
+
for (const line of requirementLines) {
|
|
49
|
+
const lt = new Set(tokens(line));
|
|
50
|
+
for (const t of weights.keys())
|
|
51
|
+
if (t.split("-").every((p) => lt.has(p)))
|
|
52
|
+
bump(t, 1);
|
|
53
|
+
}
|
|
54
|
+
const profileText = corpusText(r).toLowerCase();
|
|
55
|
+
const profileTokens = " " + tokens(profileText).join(" ") + " ";
|
|
56
|
+
const profileStems = new Set(contentTokens(profileText).map(stem));
|
|
57
|
+
const inProfile = (term) => {
|
|
58
|
+
if (profileTokens.includes(` ${term} `) || profileTokens.includes(` ${term.replace(/-/g, " ")} `))
|
|
59
|
+
return true;
|
|
60
|
+
return !LEXICON.includes(term) && term.split("-").every((p) => profileStems.has(stem(p)));
|
|
61
|
+
};
|
|
62
|
+
const keywords = [...weights.entries()]
|
|
63
|
+
.sort((a, b) => b[1] - a[1])
|
|
64
|
+
.slice(0, 30)
|
|
65
|
+
.map(([term, weight]) => ({ term, weight, inProfile: inProfile(term) }));
|
|
66
|
+
const total = keywords.reduce((s, k) => s + k.weight, 0) || 1;
|
|
67
|
+
const hit = keywords.filter((k) => k.inProfile).reduce((s, k) => s + k.weight, 0);
|
|
68
|
+
return {
|
|
69
|
+
keywords,
|
|
70
|
+
matched: keywords.filter((k) => k.inProfile).map((k) => k.term),
|
|
71
|
+
missing: keywords.filter((k) => !k.inProfile).map((k) => k.term),
|
|
72
|
+
requirementLines: requirementLines.slice(0, 25),
|
|
73
|
+
matchScore: Math.round((hit / total) * 100),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { metrics } from "./text.js";
|
|
2
|
+
const WEAK_OPENERS = [
|
|
3
|
+
"responsible for", "worked on", "helped", "assisted", "participated in", "involved in", "duties included",
|
|
4
|
+
"tasked with", "in charge of", "was part of", "contributed to",
|
|
5
|
+
];
|
|
6
|
+
const DATE_RE = /^\d{4}(-\d{2}(-\d{2})?)?$/;
|
|
7
|
+
const EMOJI_RE = /[\u{1F300}-\u{1FAFF}\u{2600}-\u{27BF}]/u;
|
|
8
|
+
/** Deterministic CV checks. The agent layers judgement on top using prompts/review-rubric.md. */
|
|
9
|
+
export function lint(r) {
|
|
10
|
+
const issues = [];
|
|
11
|
+
const add = (severity, path, rule, message) => issues.push({ severity, path, rule, message });
|
|
12
|
+
const b = r.basics;
|
|
13
|
+
if (!b.email)
|
|
14
|
+
add("error", "basics.email", "contact", "No email address. Recruiters and ATS need one.");
|
|
15
|
+
if (!b.phone)
|
|
16
|
+
add("info", "basics.phone", "contact", "No phone number. Many recruiters still call first.");
|
|
17
|
+
if (!b.label)
|
|
18
|
+
add("info", "basics.label", "headline", 'Add a headline (e.g. "Backend Engineer") so the target role is obvious.');
|
|
19
|
+
if (!b.summary)
|
|
20
|
+
add("warn", "basics.summary", "summary", "No summary. Two or three lines that position you for the role help a lot.");
|
|
21
|
+
else if (b.summary.split(/\s+/).length > 80)
|
|
22
|
+
add("warn", "basics.summary", "summary", "Summary is over 80 words; keep it to 2-3 tight lines.");
|
|
23
|
+
if (!r.work?.length && !r.projects?.length)
|
|
24
|
+
add("error", "work", "content", "No work experience or projects.");
|
|
25
|
+
let bullets = 0;
|
|
26
|
+
let withMetric = 0;
|
|
27
|
+
let words = 0;
|
|
28
|
+
const seen = new Map();
|
|
29
|
+
const checkBullets = (section, list) => list?.forEach((e, i) => {
|
|
30
|
+
const hs = e.highlights ?? [];
|
|
31
|
+
if (section === "work" && hs.length === 0)
|
|
32
|
+
add("warn", `${section}[${i}].highlights`, "bullets", "Role has no achievement bullets.");
|
|
33
|
+
if (hs.length > 6)
|
|
34
|
+
add("warn", `${section}[${i}].highlights`, "bullets", `${hs.length} bullets; keep the 3-6 strongest per entry.`);
|
|
35
|
+
hs.forEach((h, j) => {
|
|
36
|
+
const p = `${section}[${i}].highlights[${j}]`;
|
|
37
|
+
const lower = h.toLowerCase();
|
|
38
|
+
bullets++;
|
|
39
|
+
words += h.split(/\s+/).length;
|
|
40
|
+
if (metrics(h).length)
|
|
41
|
+
withMetric++;
|
|
42
|
+
const weak = WEAK_OPENERS.find((w) => lower.startsWith(w));
|
|
43
|
+
if (weak)
|
|
44
|
+
add("warn", p, "weak-verb", `Starts with "${weak}". Lead with a strong action verb and the outcome.`);
|
|
45
|
+
if (/\b(i|my|me)\b/i.test(h))
|
|
46
|
+
add("info", p, "pronoun", "Drop first-person pronouns in bullets.");
|
|
47
|
+
if (h.length > 220)
|
|
48
|
+
add("warn", p, "length", "Bullet is over 220 characters; split it or cut it down.");
|
|
49
|
+
if (h.length < 25)
|
|
50
|
+
add("info", p, "length", "Very short bullet; say what you did and what changed because of it.");
|
|
51
|
+
if (EMOJI_RE.test(h))
|
|
52
|
+
add("warn", p, "ats-format", "Emoji/symbols can break ATS parsing.");
|
|
53
|
+
const key = lower.replace(/[^a-z0-9]/g, "");
|
|
54
|
+
if (seen.has(key))
|
|
55
|
+
add("warn", p, "duplicate", `Duplicate of ${seen.get(key)}.`);
|
|
56
|
+
else
|
|
57
|
+
seen.set(key, p);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
checkBullets("work", r.work);
|
|
61
|
+
checkBullets("projects", r.projects);
|
|
62
|
+
checkBullets("volunteer", r.volunteer);
|
|
63
|
+
if (bullets >= 4 && withMetric / bullets < 0.3)
|
|
64
|
+
add("warn", "work", "metrics", `Only ${withMetric}/${bullets} bullets have a number. Quantify impact where you honestly can.`);
|
|
65
|
+
const datedSections = ["work", "education", "projects", "volunteer"];
|
|
66
|
+
for (const s of datedSections) {
|
|
67
|
+
r[s]?.forEach((e, i) => {
|
|
68
|
+
for (const k of ["startDate", "endDate"]) {
|
|
69
|
+
const v = e[k];
|
|
70
|
+
if (v && !DATE_RE.test(v))
|
|
71
|
+
add("warn", `${s}[${i}].${k}`, "date-format", `"${v}" is not YYYY-MM. Use one consistent date format.`);
|
|
72
|
+
}
|
|
73
|
+
if (s === "work" && !e.startDate)
|
|
74
|
+
add("warn", `${s}[${i}].startDate`, "dates", "Missing start date.");
|
|
75
|
+
if (e.startDate && e.endDate && e.endDate < e.startDate)
|
|
76
|
+
add("error", `${s}[${i}]`, "dates", "End date is before start date.");
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
r.work?.forEach((w, i) => {
|
|
80
|
+
const prev = r.work[i - 1];
|
|
81
|
+
if (prev?.startDate && w.startDate && w.startDate > prev.startDate)
|
|
82
|
+
add("info", `work[${i}]`, "order", "Work is not in reverse-chronological order.");
|
|
83
|
+
});
|
|
84
|
+
if (!r.skills?.length)
|
|
85
|
+
add("warn", "skills", "skills", "No skills section. ATS keyword matching relies on it.");
|
|
86
|
+
if (!r.education?.length)
|
|
87
|
+
add("info", "education", "education", "No education listed.");
|
|
88
|
+
const totalWords = words + (b.summary?.split(/\s+/).length ?? 0);
|
|
89
|
+
if (totalWords > 900)
|
|
90
|
+
add("warn", "(document)", "length", `~${totalWords} words, probably over 2 pages. Cut older or weaker items.`);
|
|
91
|
+
const penalty = issues.reduce((s, i) => s + (i.severity === "error" ? 15 : i.severity === "warn" ? 4 : 1), 0);
|
|
92
|
+
return {
|
|
93
|
+
score: Math.max(0, 100 - penalty),
|
|
94
|
+
issues,
|
|
95
|
+
stats: { bullets, bulletsWithMetric: withMetric, approxWords: totalWords },
|
|
96
|
+
};
|
|
97
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync, existsSync, readdirSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { ImportPayload, Resume } from "../schema/resume.js";
|
|
5
|
+
import { slug } from "./text.js";
|
|
6
|
+
/** Where profiles live. Override with --dir or CV_AGENT_HOME. */
|
|
7
|
+
export function dataDir(override) {
|
|
8
|
+
const dir = override ?? process.env.CV_AGENT_HOME ?? join(homedir(), ".cv-agent");
|
|
9
|
+
mkdirSync(join(dir, "tailored"), { recursive: true });
|
|
10
|
+
mkdirSync(join(dir, "out"), { recursive: true });
|
|
11
|
+
return dir;
|
|
12
|
+
}
|
|
13
|
+
const readJson = (p) => JSON.parse(readFileSync(p, "utf8"));
|
|
14
|
+
const writeJson = (p, v) => writeFileSync(p, JSON.stringify(v, null, 2) + "\n", "utf8");
|
|
15
|
+
/** Pull the first JSON object out of text an AI chat returned (handles ```json fences and chatter). */
|
|
16
|
+
export function extractJson(text) {
|
|
17
|
+
const fenced = text.match(/```(?:json)?\s*([\s\S]*?)```/);
|
|
18
|
+
const body = fenced?.[1] ?? text;
|
|
19
|
+
const start = body.indexOf("{");
|
|
20
|
+
const end = body.lastIndexOf("}");
|
|
21
|
+
if (start < 0 || end <= start)
|
|
22
|
+
throw new Error("No JSON object found in the pasted text.");
|
|
23
|
+
return JSON.parse(body.slice(start, end + 1));
|
|
24
|
+
}
|
|
25
|
+
export function parseImport(raw) {
|
|
26
|
+
const data = typeof raw === "string" ? extractJson(raw) : raw;
|
|
27
|
+
const parsed = ImportPayload.safeParse(data);
|
|
28
|
+
if (!parsed.success) {
|
|
29
|
+
const msg = parsed.error.issues.map((i) => `${i.path.join(".") || "(root)"}: ${i.message}`).join("\n");
|
|
30
|
+
throw new Error(`Profile does not match the schema:\n${msg}`);
|
|
31
|
+
}
|
|
32
|
+
const { _review = [], ...profile } = parsed.data;
|
|
33
|
+
return { profile: profile, review: _review.filter((r) => r.confidence !== "known") };
|
|
34
|
+
}
|
|
35
|
+
export class Store {
|
|
36
|
+
dir;
|
|
37
|
+
constructor(dir) {
|
|
38
|
+
this.dir = dataDir(dir);
|
|
39
|
+
}
|
|
40
|
+
get profilePath() { return join(this.dir, "profile.json"); }
|
|
41
|
+
get reviewPath() { return join(this.dir, "profile.review.json"); }
|
|
42
|
+
hasProfile() { return existsSync(this.profilePath); }
|
|
43
|
+
loadProfile() {
|
|
44
|
+
if (!this.hasProfile())
|
|
45
|
+
throw new Error(`No profile yet at ${this.profilePath}. Import one first.`);
|
|
46
|
+
return Resume.parse(readJson(this.profilePath));
|
|
47
|
+
}
|
|
48
|
+
saveProfile(p) { writeJson(this.profilePath, Resume.parse(p)); }
|
|
49
|
+
loadReview() { return existsSync(this.reviewPath) ? readJson(this.reviewPath) : []; }
|
|
50
|
+
saveReview(items) { writeJson(this.reviewPath, items); }
|
|
51
|
+
saveTailored(name, r) {
|
|
52
|
+
const p = join(this.dir, "tailored", `${slug(name)}.json`);
|
|
53
|
+
writeJson(p, Resume.parse(r));
|
|
54
|
+
return p;
|
|
55
|
+
}
|
|
56
|
+
loadTailored(name) { return Resume.parse(readJson(join(this.dir, "tailored", `${slug(name)}.json`))); }
|
|
57
|
+
listTailored() { return readdirSync(join(this.dir, "tailored")).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -5)); }
|
|
58
|
+
outPath(name, ext) { return join(this.dir, "out", `${slug(name)}.${ext}`); }
|
|
59
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export const STOPWORDS = new Set(("a an and are as at be been being but by can could did do does for from had has have having he her his i if in into is it its " +
|
|
2
|
+
"me my of on or our ours she so than that the their them then there these they this those to too us was we were what when where which " +
|
|
3
|
+
"while who whom why will with would you your yours about above after again against all also am any because before below between both " +
|
|
4
|
+
"during each few further here how just more most no nor not now only other out over own same should some such through under until up " +
|
|
5
|
+
"very within without etc per via across including well able strong excellent good great new using use used work working experience " +
|
|
6
|
+
"years year role team teams candidate ideal plus must nice required requirements responsibilities preferred skills ability knowledge " +
|
|
7
|
+
"understanding familiarity looking join help across ensure based within day like make making want").split(/\s+/));
|
|
8
|
+
/** Lower-case word tokens, keeping tech-ish characters (c++, c#, node.js, ci/cd). */
|
|
9
|
+
export function tokens(text) {
|
|
10
|
+
return (text.toLowerCase().match(/[a-z0-9][a-z0-9+#./-]*[a-z0-9+#]|[a-z0-9]/g) ?? []).map((t) => t.replace(/[./-]+$/, ""));
|
|
11
|
+
}
|
|
12
|
+
export function contentTokens(text) {
|
|
13
|
+
return tokens(text).filter((t) => !STOPWORDS.has(t) && t.length > 1);
|
|
14
|
+
}
|
|
15
|
+
/** Light stemming so "led/leading", "built/builds" etc. still overlap a bit. */
|
|
16
|
+
export function stem(t) {
|
|
17
|
+
return t.replace(/(ing|ed|es|s)$/, "") || t;
|
|
18
|
+
}
|
|
19
|
+
/** Numbers / metrics as they appear in claims: 40%, $2.5m, 3x, 10k, 2019, 1,200. Normalised for comparison. */
|
|
20
|
+
export function metrics(text) {
|
|
21
|
+
// Unit suffix only when it ends the word, so "900ms" is 900 (not 900 million) and "2M" is 2m.
|
|
22
|
+
const found = text.match(/[$€£]?\d[\d,.]*(?:%|\+|\s?(?:x|k|m|bn|b)(?![a-z]))?/gi) ?? [];
|
|
23
|
+
return found
|
|
24
|
+
.map((m) => m.toLowerCase().replace(/[\s,]/g, "").replace(/\.$/, ""))
|
|
25
|
+
.filter((m) => m.length > 0 && !/^(1|2)$/.test(m)); // ignore trivial "1"/"2" (e.g. "2 teams" is fine to restate)
|
|
26
|
+
}
|
|
27
|
+
/** Tokens that look like proper nouns / technologies: capitalised mid-sentence, or containing +#. etc. */
|
|
28
|
+
export function entities(text) {
|
|
29
|
+
const out = new Set();
|
|
30
|
+
const words = text.split(/\s+/);
|
|
31
|
+
words.forEach((raw, i) => {
|
|
32
|
+
const w = raw.replace(/^[("'“]+|[)"'”,;:.!?]+$/g, "");
|
|
33
|
+
if (!w || w.length < 2)
|
|
34
|
+
return;
|
|
35
|
+
const techy = /[+#]|\.[a-z]/i.test(w) || /[a-z][A-Z]/.test(w) || /^[A-Z0-9]{2,}$/.test(w);
|
|
36
|
+
const capitalisedMid = i > 0 && /^[A-Z][a-z]/.test(w) && !/[.!?:]$/.test(words[i - 1] ?? "");
|
|
37
|
+
if (techy || capitalisedMid)
|
|
38
|
+
out.add(w.toLowerCase());
|
|
39
|
+
});
|
|
40
|
+
return [...out];
|
|
41
|
+
}
|
|
42
|
+
/** Every fact-bearing string in a resume, with its JSON path. */
|
|
43
|
+
export function corpus(r) {
|
|
44
|
+
const out = [];
|
|
45
|
+
const push = (path, text) => text && out.push({ path, text });
|
|
46
|
+
push("basics.label", r.basics.label);
|
|
47
|
+
push("basics.summary", r.basics.summary);
|
|
48
|
+
const sections = ["work", "volunteer", "projects", "education", "awards", "certificates"];
|
|
49
|
+
for (const s of sections) {
|
|
50
|
+
r[s]?.forEach((e, i) => {
|
|
51
|
+
for (const [k, v] of Object.entries(e)) {
|
|
52
|
+
if (typeof v === "string")
|
|
53
|
+
push(`${s}[${i}].${k}`, v);
|
|
54
|
+
else if (Array.isArray(v))
|
|
55
|
+
v.forEach((x, j) => typeof x === "string" && push(`${s}[${i}].${k}[${j}]`, x));
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
r.skills?.forEach((s, i) => {
|
|
60
|
+
push(`skills[${i}].name`, s.name);
|
|
61
|
+
s.keywords?.forEach((k, j) => push(`skills[${i}].keywords[${j}]`, k));
|
|
62
|
+
});
|
|
63
|
+
r.languages?.forEach((l, i) => push(`languages[${i}].language`, l.language));
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
66
|
+
export function corpusText(r) {
|
|
67
|
+
return corpus(r).map((c) => c.text).join("\n");
|
|
68
|
+
}
|
|
69
|
+
export function slug(s) {
|
|
70
|
+
return s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 60) || "cv";
|
|
71
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { contentTokens, corpus, entities, metrics, stem } from "./text.js";
|
|
2
|
+
const norm = (s) => (s ?? "").toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
|
|
3
|
+
const MIN_OVERLAP = 0.35;
|
|
4
|
+
function overlap(claim, source) {
|
|
5
|
+
const c = new Set(contentTokens(claim).map(stem));
|
|
6
|
+
if (!c.size)
|
|
7
|
+
return 1;
|
|
8
|
+
const s = new Set(contentTokens(source).map(stem));
|
|
9
|
+
let hit = 0;
|
|
10
|
+
for (const t of c)
|
|
11
|
+
if (s.has(t))
|
|
12
|
+
hit++;
|
|
13
|
+
return hit / c.size;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The "no invented experience" guard. A tailored CV may select, reorder and reword what is in the
|
|
17
|
+
* master profile. It may not add employers, titles, dates, numbers, technologies or skills that the
|
|
18
|
+
* master profile does not contain anywhere.
|
|
19
|
+
*/
|
|
20
|
+
export function verifyTailored(master, tailored) {
|
|
21
|
+
const findings = [];
|
|
22
|
+
const err = (path, message, source) => findings.push({ severity: "error", path, message, source });
|
|
23
|
+
const warn = (path, message, source) => findings.push({ severity: "warn", path, message, source });
|
|
24
|
+
const all = corpus(master);
|
|
25
|
+
const allText = all.map((c) => c.text).join("\n").toLowerCase() + "\n" + norm(master.basics.name);
|
|
26
|
+
const allMetrics = new Set(all.flatMap((c) => metrics(c.text)));
|
|
27
|
+
const allWords = ` ${norm(allText)} `;
|
|
28
|
+
const mentioned = (s) => allWords.includes(` ${norm(s)} `);
|
|
29
|
+
/** Check one free-text claim against a pool of candidate sources. */
|
|
30
|
+
const checkClaim = (path, text, pool, requireTrace) => {
|
|
31
|
+
for (const m of metrics(text))
|
|
32
|
+
if (!allMetrics.has(m))
|
|
33
|
+
err(path, `Number "${m}" does not appear anywhere in your master profile.`);
|
|
34
|
+
for (const e of entities(text)) {
|
|
35
|
+
if (!mentioned(e))
|
|
36
|
+
err(path, `"${e}" is not mentioned anywhere in your master profile.`);
|
|
37
|
+
}
|
|
38
|
+
if (!requireTrace)
|
|
39
|
+
return;
|
|
40
|
+
let best;
|
|
41
|
+
for (const c of pool.length ? pool : all) {
|
|
42
|
+
const o = overlap(text, c.text);
|
|
43
|
+
if (!best || o > best.overlap)
|
|
44
|
+
best = { path: c.path, text: c.text, overlap: Math.round(o * 100) / 100 };
|
|
45
|
+
}
|
|
46
|
+
if (!best || best.overlap < MIN_OVERLAP)
|
|
47
|
+
warn(path, "Can't trace this bullet to anything in your master profile. Confirm it is true or remove it.", best);
|
|
48
|
+
};
|
|
49
|
+
// Identity must not change.
|
|
50
|
+
for (const k of ["name", "email", "phone"]) {
|
|
51
|
+
const t = tailored.basics[k];
|
|
52
|
+
const m = master.basics[k];
|
|
53
|
+
if (t && norm(t) !== norm(m))
|
|
54
|
+
err(`basics.${k}`, `Changed from master profile ("${m ?? ""}" -> "${t}").`);
|
|
55
|
+
}
|
|
56
|
+
if (tailored.basics.label)
|
|
57
|
+
checkClaim("basics.label", tailored.basics.label, [], false);
|
|
58
|
+
if (tailored.basics.summary)
|
|
59
|
+
checkClaim("basics.summary", tailored.basics.summary, [], false);
|
|
60
|
+
const matchEntry = (list, key, value) => list?.findIndex((x) => norm(x[key]) === norm(value)) ?? -1;
|
|
61
|
+
const sectionPool = (section, idx) => all.filter((c) => c.path.startsWith(`${section}[${idx}].`));
|
|
62
|
+
const checkDated = (section, key, label) => {
|
|
63
|
+
const tList = tailored[section];
|
|
64
|
+
const mList = master[section];
|
|
65
|
+
tList?.forEach((t, i) => {
|
|
66
|
+
const p = `${section}[${i}]`;
|
|
67
|
+
const mi = matchEntry(mList, key, t[key]);
|
|
68
|
+
if (mi < 0)
|
|
69
|
+
return err(p, `${label} "${t[key]}" is not in your master profile.`);
|
|
70
|
+
const m = mList[mi];
|
|
71
|
+
for (const f of ["startDate", "endDate"])
|
|
72
|
+
if (t[f] && t[f] !== m[f])
|
|
73
|
+
err(`${p}.${f}`, `Date changed from "${m[f] ?? ""}" to "${t[f]}".`);
|
|
74
|
+
for (const f of ["position", "studyType", "area", "institution"])
|
|
75
|
+
if (t[f] && m[f] && norm(t[f]) !== norm(m[f]))
|
|
76
|
+
warn(`${p}.${f}`, `Changed from "${m[f]}" to "${t[f]}". Titles should match what you actually held.`);
|
|
77
|
+
if (t.position && !m.position)
|
|
78
|
+
err(`${p}.position`, `Title "${t.position}" is not in your master profile.`);
|
|
79
|
+
const pool = sectionPool(section, mi);
|
|
80
|
+
if (typeof t.summary === "string")
|
|
81
|
+
checkClaim(`${p}.summary`, t.summary, pool, true);
|
|
82
|
+
if (typeof t.description === "string")
|
|
83
|
+
checkClaim(`${p}.description`, t.description, pool, true);
|
|
84
|
+
t.highlights?.forEach((h, j) => checkClaim(`${p}.highlights[${j}]`, h, pool, true));
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
checkDated("work", "name", "Employer");
|
|
88
|
+
checkDated("volunteer", "organization", "Organisation");
|
|
89
|
+
checkDated("projects", "name", "Project");
|
|
90
|
+
checkDated("education", "institution", "Institution");
|
|
91
|
+
// Skills: every keyword must be evidenced somewhere in the master profile.
|
|
92
|
+
tailored.skills?.forEach((s, i) => {
|
|
93
|
+
for (const [j, k] of [s.name, ...(s.keywords ?? [])].entries()) {
|
|
94
|
+
const path = j === 0 ? `skills[${i}].name` : `skills[${i}].keywords[${j - 1}]`;
|
|
95
|
+
if (j === 0 && master.skills?.some((m) => norm(m.name) === norm(k)))
|
|
96
|
+
continue;
|
|
97
|
+
if (j === 0)
|
|
98
|
+
continue; // skill group names ("Backend", "Tools") are labels, not claims
|
|
99
|
+
if (!mentioned(k))
|
|
100
|
+
err(path, `Skill "${k}" is not evidenced anywhere in your master profile.`);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
for (const [section, key] of [["certificates", "name"], ["awards", "title"], ["languages", "language"]]) {
|
|
104
|
+
tailored[section]?.forEach((t, i) => {
|
|
105
|
+
if (matchEntry(master[section], key, t[key]) < 0)
|
|
106
|
+
err(`${section}[${i}]`, `"${t[key]}" is not in your master profile.`);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return { ok: !findings.some((f) => f.severity === "error"), findings };
|
|
110
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { Resume } from "../schema/resume.js";
|
|
8
|
+
import { Store, parseImport } from "../core/store.js";
|
|
9
|
+
import { lint } from "../core/lint.js";
|
|
10
|
+
import { analyzeJob } from "../core/keywords.js";
|
|
11
|
+
import { verifyTailored } from "../core/verify.js";
|
|
12
|
+
import { renderMarkdown, renderPdf, TEMPLATES } from "../render/index.js";
|
|
13
|
+
const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
14
|
+
const readPrompt = (name) => readFileSync(join(ROOT, "prompts", name), "utf8");
|
|
15
|
+
const VERSION = JSON.parse(readFileSync(join(ROOT, "package.json"), "utf8")).version;
|
|
16
|
+
const json = (v) => ({ content: [{ type: "text", text: JSON.stringify(v, null, 2) }] });
|
|
17
|
+
const fail = (e) => ({ isError: true, content: [{ type: "text", text: e instanceof Error ? e.message : String(e) }] });
|
|
18
|
+
const safe = (fn) => async (a) => { try {
|
|
19
|
+
return json(await fn(a));
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
return fail(e);
|
|
23
|
+
} };
|
|
24
|
+
export async function startServer(dir) {
|
|
25
|
+
const store = new Store(dir);
|
|
26
|
+
const server = new McpServer({ name: "cv-agent", version: VERSION }, {
|
|
27
|
+
instructions: "cv-agent stores the user's master CV profile and produces tailored CVs. Workflow: get_context_prompt -> " +
|
|
28
|
+
"import_profile -> review_cv -> analyze_job -> tailor_cv -> render_cv. Never invent experience, numbers, " +
|
|
29
|
+
"employers or skills; tailor_cv rejects them. If you already know the user well from this conversation or memory, " +
|
|
30
|
+
"you may draft the profile yourself following get_context_prompt, but confirm uncertain items with the user.",
|
|
31
|
+
});
|
|
32
|
+
server.registerTool("get_context_prompt", {
|
|
33
|
+
title: "Get context-import prompt",
|
|
34
|
+
description: "Returns the prompt the user pastes into their main AI (ChatGPT, Claude, Gemini) to export a factual profile, or that you follow yourself if you already know the user.",
|
|
35
|
+
inputSchema: {},
|
|
36
|
+
}, async () => ({ content: [{ type: "text", text: readPrompt("context-import.md") }] }));
|
|
37
|
+
server.registerTool("import_profile", {
|
|
38
|
+
title: "Import master profile",
|
|
39
|
+
description: "Validate and save the master profile. Accepts the raw text the user's AI returned (JSON, optionally inside ```json fences). Returns items the AI marked inferred/unsure so you can confirm them with the user.",
|
|
40
|
+
inputSchema: { text: z.string().describe("The AI's output: a JSON Resume object, optionally with a _review array"), overwrite: z.boolean().default(false) },
|
|
41
|
+
}, safe(({ text, overwrite }) => {
|
|
42
|
+
if (store.hasProfile() && !overwrite)
|
|
43
|
+
throw new Error("A profile already exists. Ask the user before replacing it, then call again with overwrite: true, or use update_profile.");
|
|
44
|
+
const { profile, review } = parseImport(text);
|
|
45
|
+
store.saveProfile(profile);
|
|
46
|
+
store.saveReview(review);
|
|
47
|
+
return { saved: store.profilePath, needsConfirmation: review, lint: lint(profile) };
|
|
48
|
+
}));
|
|
49
|
+
server.registerTool("get_profile", { title: "Get master profile", description: "Read the saved master profile and any still-unconfirmed items.", inputSchema: {} }, safe(() => ({ profile: store.loadProfile(), unconfirmed: store.loadReview() })));
|
|
50
|
+
server.registerTool("update_profile", {
|
|
51
|
+
title: "Update master profile",
|
|
52
|
+
description: "Replace the master profile with an edited version (full JSON Resume object). Use after the user confirms or corrects facts. Pass the paths the user confirmed to clear them from the review list.",
|
|
53
|
+
inputSchema: { profile: z.record(z.string(), z.unknown()), confirmedPaths: z.array(z.string()).default([]) },
|
|
54
|
+
}, safe(({ profile, confirmedPaths }) => {
|
|
55
|
+
const parsed = Resume.parse(profile);
|
|
56
|
+
store.saveProfile(parsed);
|
|
57
|
+
const remaining = store.loadReview().filter((r) => !confirmedPaths.includes(r.path));
|
|
58
|
+
store.saveReview(remaining);
|
|
59
|
+
return { saved: store.profilePath, unconfirmed: remaining, lint: lint(parsed) };
|
|
60
|
+
}));
|
|
61
|
+
server.registerTool("review_cv", {
|
|
62
|
+
title: "Review CV",
|
|
63
|
+
description: "Run deterministic checks (contact info, weak verbs, missing metrics, dates, length, ATS-hostile formatting) on the master profile or a tailored CV, and return a review rubric for your own qualitative critique.",
|
|
64
|
+
inputSchema: { tailoredName: z.string().optional().describe("Review a saved tailored CV instead of the master profile") },
|
|
65
|
+
}, safe(({ tailoredName }) => {
|
|
66
|
+
const r = tailoredName ? store.loadTailored(tailoredName) : store.loadProfile();
|
|
67
|
+
return { ...lint(r), rubric: readPrompt("review-rubric.md") };
|
|
68
|
+
}));
|
|
69
|
+
server.registerTool("analyze_job", {
|
|
70
|
+
title: "Analyze job description",
|
|
71
|
+
description: "Extract keywords and requirement lines from a job description and match them against the master profile. Returns a keyword match score, matched and missing terms. Missing terms are gaps, not things to add unless the user confirms they have them.",
|
|
72
|
+
inputSchema: { jobDescription: z.string() },
|
|
73
|
+
}, safe(({ jobDescription }) => analyzeJob(jobDescription, store.loadProfile())));
|
|
74
|
+
server.registerTool("tailor_cv", {
|
|
75
|
+
title: "Save tailored CV",
|
|
76
|
+
description: "Submit a tailored CV (full JSON Resume object) you derived from the master profile for one job. You may select, reorder and reword. " +
|
|
77
|
+
"It is checked against the master profile: new employers, titles, dates, numbers, technologies or skills are rejected. " +
|
|
78
|
+
"Saved only if there are no errors; warnings mean a bullet could not be traced and should be confirmed with the user.",
|
|
79
|
+
inputSchema: { name: z.string().describe('Short name for this application, e.g. "acme-backend"'), cv: z.record(z.string(), z.unknown()) },
|
|
80
|
+
}, safe(({ name, cv }) => {
|
|
81
|
+
const tailored = Resume.parse(cv);
|
|
82
|
+
const v = verifyTailored(store.loadProfile(), tailored);
|
|
83
|
+
if (!v.ok)
|
|
84
|
+
return { saved: false, ...v, hint: "Fix the errors (remove or restate using only facts from the master profile) and resubmit. If the user confirms a missing fact is true, add it to the master profile first with update_profile." };
|
|
85
|
+
return { saved: store.saveTailored(name, tailored), ...v, lint: lint(tailored) };
|
|
86
|
+
}));
|
|
87
|
+
server.registerTool("render_cv", {
|
|
88
|
+
title: "Render CV",
|
|
89
|
+
description: "Render the master profile or a saved tailored CV to an ATS-friendly PDF and Markdown file. Returns the file paths.",
|
|
90
|
+
inputSchema: {
|
|
91
|
+
tailoredName: z.string().optional(),
|
|
92
|
+
template: z.enum(TEMPLATES).default("classic"),
|
|
93
|
+
paper: z.enum(["a4", "us-letter"]).default("a4"),
|
|
94
|
+
},
|
|
95
|
+
}, safe(({ tailoredName, template, paper }) => {
|
|
96
|
+
const name = tailoredName ?? "master";
|
|
97
|
+
const r = tailoredName ? store.loadTailored(tailoredName) : store.loadProfile();
|
|
98
|
+
const pdf = store.outPath(name, "pdf");
|
|
99
|
+
const md = store.outPath(name, "md");
|
|
100
|
+
writeFileSync(pdf, renderPdf(r, { template, paper }));
|
|
101
|
+
writeFileSync(md, renderMarkdown(r), "utf8");
|
|
102
|
+
return { pdf, markdown: md };
|
|
103
|
+
}));
|
|
104
|
+
server.registerTool("list_tailored", { title: "List tailored CVs", description: "List saved tailored CVs.", inputSchema: {} }, safe(() => store.listTailored()));
|
|
105
|
+
await server.connect(new StdioServerTransport());
|
|
106
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { NodeCompiler } from "@myriaddreamin/typst-ts-node-compiler";
|
|
5
|
+
const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
6
|
+
export const TEMPLATES = ["classic"];
|
|
7
|
+
let compiler;
|
|
8
|
+
export function renderPdf(r, opts = {}) {
|
|
9
|
+
const template = opts.template ?? "classic";
|
|
10
|
+
const source = readFileSync(join(ROOT, "templates", `${template}.typ`), "utf8");
|
|
11
|
+
compiler ??= NodeCompiler.create({ workspace: ROOT });
|
|
12
|
+
const args = { mainFileContent: source, inputs: { data: JSON.stringify(r), paper: opts.paper ?? "a4" } };
|
|
13
|
+
try {
|
|
14
|
+
const result = compiler.compile(args);
|
|
15
|
+
const doc = result.result;
|
|
16
|
+
if (!doc) {
|
|
17
|
+
const diags = result.takeError()?.shortDiagnostics ?? [];
|
|
18
|
+
throw new Error(`Typst failed to compile the CV:\n${diags.map((d) => d.message ?? JSON.stringify(d)).join("\n")}`);
|
|
19
|
+
}
|
|
20
|
+
return compiler.pdf(doc);
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
compiler.evictCache(10);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const range = (e) => e.startDate ? `${e.startDate} – ${e.endDate || "Present"}` : (e.endDate ?? "");
|
|
27
|
+
export function renderMarkdown(r) {
|
|
28
|
+
const b = r.basics;
|
|
29
|
+
const out = [`# ${b.name}`];
|
|
30
|
+
if (b.label)
|
|
31
|
+
out.push(`**${b.label}**`);
|
|
32
|
+
const contact = [b.email, b.phone, b.location?.city, b.url, ...(b.profiles ?? []).map((p) => p.url ?? p.username)].filter(Boolean);
|
|
33
|
+
if (contact.length)
|
|
34
|
+
out.push(contact.join(" · "));
|
|
35
|
+
if (b.summary)
|
|
36
|
+
out.push("", "## Summary", "", b.summary);
|
|
37
|
+
if (r.work?.length) {
|
|
38
|
+
out.push("", "## Experience");
|
|
39
|
+
for (const w of r.work) {
|
|
40
|
+
out.push("", `### ${w.position ? `${w.position}, ${w.name}` : w.name}`, `*${range(w)}${w.location ? ` · ${w.location}` : ""}*`);
|
|
41
|
+
if (w.summary)
|
|
42
|
+
out.push("", w.summary);
|
|
43
|
+
if (w.highlights?.length)
|
|
44
|
+
out.push("", ...w.highlights.map((h) => `- ${h}`));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (r.projects?.length) {
|
|
48
|
+
out.push("", "## Projects");
|
|
49
|
+
for (const p of r.projects) {
|
|
50
|
+
out.push("", `### ${p.name}`);
|
|
51
|
+
if (p.description)
|
|
52
|
+
out.push("", p.description);
|
|
53
|
+
if (p.highlights?.length)
|
|
54
|
+
out.push("", ...p.highlights.map((h) => `- ${h}`));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (r.education?.length) {
|
|
58
|
+
out.push("", "## Education");
|
|
59
|
+
for (const e of r.education)
|
|
60
|
+
out.push("", `**${e.institution}**, ${[e.studyType, e.area].filter(Boolean).join(", ")} *(${range(e)})*`);
|
|
61
|
+
}
|
|
62
|
+
if (r.skills?.length)
|
|
63
|
+
out.push("", "## Skills", "", ...r.skills.map((s) => `- **${s.name}:** ${(s.keywords ?? []).join(", ")}`));
|
|
64
|
+
if (r.certificates?.length)
|
|
65
|
+
out.push("", "## Certifications", "", ...r.certificates.map((c) => `- ${[c.name, c.issuer, c.date].filter(Boolean).join(" — ")}`));
|
|
66
|
+
if (r.languages?.length)
|
|
67
|
+
out.push("", "## Languages", "", r.languages.map((l) => (l.fluency ? `${l.language} (${l.fluency})` : l.language)).join(", "));
|
|
68
|
+
return out.join("\n") + "\n";
|
|
69
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* A pragmatic subset of the JSON Resume schema (https://jsonresume.org/schema).
|
|
4
|
+
* Objects are "loose" so unknown JSON Resume fields survive a round trip.
|
|
5
|
+
*/
|
|
6
|
+
const str = z.string().trim();
|
|
7
|
+
const date = str.describe("ISO-ish date: YYYY, YYYY-MM or YYYY-MM-DD; empty endDate means present");
|
|
8
|
+
export const Profile = z.looseObject({ network: str.optional(), username: str.optional(), url: str.optional() });
|
|
9
|
+
export const Basics = z.looseObject({
|
|
10
|
+
name: str.min(1),
|
|
11
|
+
label: str.optional(),
|
|
12
|
+
email: str.optional(),
|
|
13
|
+
phone: str.optional(),
|
|
14
|
+
url: str.optional(),
|
|
15
|
+
summary: str.optional(),
|
|
16
|
+
location: z
|
|
17
|
+
.looseObject({ city: str.optional(), region: str.optional(), countryCode: str.optional() })
|
|
18
|
+
.optional(),
|
|
19
|
+
profiles: z.array(Profile).optional(),
|
|
20
|
+
});
|
|
21
|
+
export const Work = z.looseObject({
|
|
22
|
+
name: str.min(1).describe("Employer / organisation"),
|
|
23
|
+
position: str.optional(),
|
|
24
|
+
url: str.optional(),
|
|
25
|
+
location: str.optional(),
|
|
26
|
+
startDate: date.optional(),
|
|
27
|
+
endDate: date.optional(),
|
|
28
|
+
summary: str.optional(),
|
|
29
|
+
highlights: z.array(str).optional(),
|
|
30
|
+
});
|
|
31
|
+
export const Education = z.looseObject({
|
|
32
|
+
institution: str.min(1),
|
|
33
|
+
area: str.optional(),
|
|
34
|
+
studyType: str.optional(),
|
|
35
|
+
startDate: date.optional(),
|
|
36
|
+
endDate: date.optional(),
|
|
37
|
+
score: str.optional(),
|
|
38
|
+
courses: z.array(str).optional(),
|
|
39
|
+
});
|
|
40
|
+
export const Project = z.looseObject({
|
|
41
|
+
name: str.min(1),
|
|
42
|
+
description: str.optional(),
|
|
43
|
+
url: str.optional(),
|
|
44
|
+
startDate: date.optional(),
|
|
45
|
+
endDate: date.optional(),
|
|
46
|
+
highlights: z.array(str).optional(),
|
|
47
|
+
keywords: z.array(str).optional(),
|
|
48
|
+
});
|
|
49
|
+
export const Skill = z.looseObject({ name: str.min(1), level: str.optional(), keywords: z.array(str).optional() });
|
|
50
|
+
export const Language = z.looseObject({ language: str.min(1), fluency: str.optional() });
|
|
51
|
+
export const Certificate = z.looseObject({ name: str.min(1), issuer: str.optional(), date: date.optional(), url: str.optional() });
|
|
52
|
+
export const Award = z.looseObject({ title: str.min(1), awarder: str.optional(), date: date.optional(), summary: str.optional() });
|
|
53
|
+
export const Volunteer = z.looseObject({
|
|
54
|
+
organization: str.min(1),
|
|
55
|
+
position: str.optional(),
|
|
56
|
+
startDate: date.optional(),
|
|
57
|
+
endDate: date.optional(),
|
|
58
|
+
summary: str.optional(),
|
|
59
|
+
highlights: z.array(str).optional(),
|
|
60
|
+
});
|
|
61
|
+
export const Resume = z.looseObject({
|
|
62
|
+
basics: Basics,
|
|
63
|
+
work: z.array(Work).optional(),
|
|
64
|
+
volunteer: z.array(Volunteer).optional(),
|
|
65
|
+
education: z.array(Education).optional(),
|
|
66
|
+
projects: z.array(Project).optional(),
|
|
67
|
+
skills: z.array(Skill).optional(),
|
|
68
|
+
languages: z.array(Language).optional(),
|
|
69
|
+
certificates: z.array(Certificate).optional(),
|
|
70
|
+
awards: z.array(Award).optional(),
|
|
71
|
+
});
|
|
72
|
+
/** Items the source AI was not sure about. Kept outside the resume so profile.json stays valid JSON Resume. */
|
|
73
|
+
export const ReviewItem = z.object({
|
|
74
|
+
path: str.describe('JSON path into the resume, e.g. "work[0].highlights[2]"'),
|
|
75
|
+
confidence: z.enum(["known", "inferred", "unsure"]),
|
|
76
|
+
note: str.optional(),
|
|
77
|
+
});
|
|
78
|
+
/** What the context-import prompt asks the user's AI to produce. */
|
|
79
|
+
export const ImportPayload = Resume.extend({ _review: z.array(ReviewItem).optional() });
|
package/package.json
CHANGED
|
@@ -1,6 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cv-agent-mcp",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"mcpName": "io.github.zeiado/cv-agent",
|
|
4
|
+
"version": "0.2.0",
|
|
5
|
+
"description": "Agent-native CV builder, reviewer and tailor. Runs inside your AI agent as an MCP server — no API key, no invented experience.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"cv-agent": "dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"prompts",
|
|
13
|
+
"templates",
|
|
14
|
+
"skill",
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=20"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc -p tsconfig.json",
|
|
23
|
+
"dev": "tsx src/cli.ts",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
26
|
+
"prepublishOnly": "npm run build && npm test",
|
|
27
|
+
"version": "node scripts/sync-version.mjs && git add server.json",
|
|
28
|
+
"build:mcpb": "npm run build && node scripts/build-mcpb.mjs"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/zeiado/cv-agent.git"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/zeiado/cv-agent#readme",
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/zeiado/cv-agent/issues"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"cv",
|
|
40
|
+
"resume",
|
|
41
|
+
"mcp",
|
|
42
|
+
"ats",
|
|
43
|
+
"json-resume",
|
|
44
|
+
"claude",
|
|
45
|
+
"ai-agent",
|
|
46
|
+
"mcp-server",
|
|
47
|
+
"model-context-protocol",
|
|
48
|
+
"typst"
|
|
49
|
+
],
|
|
50
|
+
"license": "MIT",
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
53
|
+
"@myriaddreamin/typst-ts-node-compiler": "^0.7.0",
|
|
54
|
+
"zod": "^4.6.7"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/node": "^26.6.11",
|
|
58
|
+
"tsx": "^4.23.15",
|
|
59
|
+
"typescript": "^7.0.2",
|
|
60
|
+
"vitest": "^5.1.2"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# cv-agent: context-import prompt
|
|
2
|
+
|
|
3
|
+
Copy everything below the line and paste it into the AI you use most (ChatGPT, Claude, Gemini, ...), ideally one with
|
|
4
|
+
memory or a long chat history with you. Paste its answer into `cv-agent import -` (or give it to your agent, which will
|
|
5
|
+
call `import_profile`).
|
|
6
|
+
|
|
7
|
+
> **Privacy:** the answer may include things you told that AI in private. Read it before importing, and delete anything
|
|
8
|
+
> you would not put on a CV.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
I'm building my CV with an open-source tool. Using **only what you actually know about me** from our conversations
|
|
13
|
+
and your memory of me, write my professional profile as a single JSON object in the JSON Resume format below.
|
|
14
|
+
|
|
15
|
+
Rules. Follow them strictly:
|
|
16
|
+
|
|
17
|
+
1. **Do not invent anything.** No made-up employers, titles, dates, numbers, technologies, degrees or achievements.
|
|
18
|
+
If you don't know something, leave the field out. A short, true profile is far better than a long, padded one.
|
|
19
|
+
2. Numbers only if I told you them. Never estimate a metric ("improved performance by ~30%") I didn't give you.
|
|
20
|
+
3. For every item you **inferred** (pieced together, not stated by me) or are **unsure** about, add an entry to the
|
|
21
|
+
`_review` array with its JSON path, `"confidence": "inferred"` or `"unsure"`, and a short note saying why.
|
|
22
|
+
I will confirm these myself.
|
|
23
|
+
4. Write `highlights` as achievement bullets: start with a strong verb, say what I did and what changed because of it.
|
|
24
|
+
No first person ("I", "my").
|
|
25
|
+
5. Dates as `YYYY-MM` (or `YYYY` if that's all you know). Leave `endDate` out for current roles.
|
|
26
|
+
6. Put the most recent roles first. Include side projects, open-source work, volunteering and certificates if you
|
|
27
|
+
know about them. Projects often matter as much as jobs.
|
|
28
|
+
7. After the JSON, list up to 10 **questions** whose answers would most improve my CV (missing numbers, unclear
|
|
29
|
+
dates, achievements you suspect but I never confirmed).
|
|
30
|
+
|
|
31
|
+
Output format: one ```json code block, then the questions as a plain list. Nothing else.
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"basics": {
|
|
36
|
+
"name": "", "label": "target job title / headline", "email": "", "phone": "", "url": "",
|
|
37
|
+
"summary": "2-3 sentences positioning me professionally",
|
|
38
|
+
"location": { "city": "", "countryCode": "" },
|
|
39
|
+
"profiles": [{ "network": "GitHub", "username": "", "url": "" }]
|
|
40
|
+
},
|
|
41
|
+
"work": [{
|
|
42
|
+
"name": "employer", "position": "", "location": "", "startDate": "YYYY-MM", "endDate": "YYYY-MM",
|
|
43
|
+
"summary": "optional one line about the team/product",
|
|
44
|
+
"highlights": ["achievement bullet", "achievement bullet"]
|
|
45
|
+
}],
|
|
46
|
+
"projects": [{ "name": "", "description": "", "url": "", "highlights": [""], "keywords": [""] }],
|
|
47
|
+
"education": [{ "institution": "", "studyType": "BSc / MSc / ...", "area": "", "startDate": "", "endDate": "", "score": "" }],
|
|
48
|
+
"skills": [{ "name": "group, e.g. Backend", "keywords": ["", ""] }],
|
|
49
|
+
"certificates": [{ "name": "", "issuer": "", "date": "" }],
|
|
50
|
+
"languages": [{ "language": "", "fluency": "" }],
|
|
51
|
+
"volunteer": [{ "organization": "", "position": "", "startDate": "", "endDate": "", "highlights": [""] }],
|
|
52
|
+
"_review": [{ "path": "work[0].highlights[1]", "confidence": "inferred", "note": "you mentioned this project but not your exact role" }]
|
|
53
|
+
}
|
|
54
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# CV review rubric (for the agent)
|
|
2
|
+
|
|
3
|
+
The deterministic checks above catch mechanical problems. Add judgement on these points, citing JSON paths. Be
|
|
4
|
+
specific and kind, and give a rewritten example for the 3 weakest bullets, using **only facts already in the
|
|
5
|
+
profile**. If a better bullet needs a fact you don't have (a number, the outcome), ask the user instead of guessing.
|
|
6
|
+
|
|
7
|
+
1. **Positioning:** Can a recruiter tell in 6 seconds what role this person wants and why they fit? Do the
|
|
8
|
+
headline and summary match the strongest evidence below them?
|
|
9
|
+
2. **Impact over duties:** Do bullets show outcomes (faster, cheaper, more users, fewer incidents) rather than
|
|
10
|
+
responsibilities? Which ones read as job-description copy?
|
|
11
|
+
3. **Evidence of level:** Do scope, ownership and leadership match the seniority being targeted?
|
|
12
|
+
4. **Relevance and order:** Are the strongest, most relevant items first within each section? Is anything old or
|
|
13
|
+
irrelevant taking space?
|
|
14
|
+
5. **Gaps and red flags:** Unexplained gaps, very short stints, inconsistent dates or titles. Note them neutrally
|
|
15
|
+
and suggest how to address them if the user wants to.
|
|
16
|
+
6. **ATS readiness:** Standard section names, a skills section that uses the market's exact terms, no information
|
|
17
|
+
only in headers, tables or images.
|
|
18
|
+
7. **Concision:** One page for under ~5 years of experience, two at most otherwise.
|
|
19
|
+
|
|
20
|
+
Finish with the 3 changes that would improve this CV the most, in priority order.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cv-agent
|
|
3
|
+
description: Build, review and tailor the user's CV/resume without inventing anything. Use when the user wants to create or update a CV or resume, get feedback on one, tailor it to a job posting, check ATS keyword match, or export it to PDF. Requires the cv-agent MCP server.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# cv-agent
|
|
7
|
+
|
|
8
|
+
You help the user build one truthful **master profile**, then derive a tailored CV per job from it. The
|
|
9
|
+
`cv-agent` MCP server stores the files, runs deterministic checks, blocks invented facts and renders PDFs.
|
|
10
|
+
|
|
11
|
+
## The one hard rule
|
|
12
|
+
|
|
13
|
+
Never add an employer, title, date, number, technology or skill the user has not confirmed. `tailor_cv` rejects
|
|
14
|
+
these. When the master profile lacks something a job wants, **ask the user**. If they confirm it, add it with
|
|
15
|
+
`update_profile` first, then tailor.
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
1. **Get the profile.** Call `get_profile`. If none exists:
|
|
20
|
+
- If you already know the user well (this conversation or your memory), draft the profile yourself following
|
|
21
|
+
`get_context_prompt`, show it to them, and import it once they agree.
|
|
22
|
+
- Otherwise give them the text from `get_context_prompt` to paste into the AI they use most, and import its
|
|
23
|
+
answer with `import_profile`.
|
|
24
|
+
- Walk through every `needsConfirmation` item with the user. Then `update_profile` with `confirmedPaths`.
|
|
25
|
+
2. **Review.** Call `review_cv`. Report the deterministic issues briefly, then your own critique using the
|
|
26
|
+
returned rubric. Ask for missing numbers rather than guessing them.
|
|
27
|
+
3. **Tailor** for a job description:
|
|
28
|
+
- `analyze_job` for keywords, gaps and the match score.
|
|
29
|
+
- Tell the user the real gaps. For each one, ask whether they have that experience. Never quietly add it.
|
|
30
|
+
- Build the tailored JSON Resume: choose the most relevant entries and bullets, reorder by relevance, and reword
|
|
31
|
+
using the job's terminology **only where it describes the same fact**. Adjust the headline and summary.
|
|
32
|
+
- `tailor_cv`. If it returns errors, fix them and resubmit. Show any warnings to the user.
|
|
33
|
+
4. **Render.** Call `render_cv` and give the user the PDF path. Ask if they want US Letter instead of A4.
|
|
34
|
+
|
|
35
|
+
Keep the tailored CV to one page for under ~5 years of experience, two pages at most otherwise.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// cv-agent "classic" template: single column, no tables, icons or graphics, so ATS parsers read it in order.
|
|
2
|
+
// Data arrives as JSON in sys.inputs.data. All values are inserted as plain text, never evaluated as markup.
|
|
3
|
+
|
|
4
|
+
#let cv = json(bytes(sys.inputs.at("data")))
|
|
5
|
+
#let b = cv.at("basics")
|
|
6
|
+
#let get(d, k, default: none) = if type(d) == dictionary and k in d { d.at(k) } else { default }
|
|
7
|
+
|
|
8
|
+
#set document(title: get(b, "name", default: "CV"), author: get(b, "name", default: ""))
|
|
9
|
+
#set page(paper: sys.inputs.at("paper", default: "a4"), margin: (x: 1.7cm, y: 1.5cm))
|
|
10
|
+
#set text(font: ("Libertinus Serif", "New Computer Modern", "DejaVu Sans"), size: 10.5pt, lang: "en")
|
|
11
|
+
#set par(justify: false, leading: 0.55em)
|
|
12
|
+
#set list(indent: 0.6em, body-indent: 0.5em, spacing: 0.45em)
|
|
13
|
+
|
|
14
|
+
#let fmt-date(d) = {
|
|
15
|
+
if d == none or d == "" { return "" }
|
|
16
|
+
let months = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
|
|
17
|
+
let parts = d.split("-")
|
|
18
|
+
if parts.len() >= 2 { months.at(int(parts.at(1)) - 1) + " " + parts.at(0) } else { parts.at(0) }
|
|
19
|
+
}
|
|
20
|
+
#let range(e) = {
|
|
21
|
+
let s = fmt-date(get(e, "startDate"))
|
|
22
|
+
let f = get(e, "endDate")
|
|
23
|
+
if s == "" { fmt-date(f) } else if f == none or f == "" { s + " – Present" } else { s + " – " + fmt-date(f) }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
#let section(title) = {
|
|
27
|
+
v(0.7em)
|
|
28
|
+
text(size: 11.5pt, weight: "bold", upper(title))
|
|
29
|
+
v(-0.6em)
|
|
30
|
+
line(length: 100%, stroke: 0.5pt)
|
|
31
|
+
v(-0.2em)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
#let entry(left-top, right-top, left-bottom: "", right-bottom: "") = {
|
|
35
|
+
block(breakable: false, above: 0.8em, below: 0.4em)[
|
|
36
|
+
#strong(left-top) #h(1fr) #right-top \
|
|
37
|
+
#if left-bottom != "" or right-bottom != "" [#emph(left-bottom) #h(1fr) #emph(right-bottom)]
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
#let bullets(items) = if items != none and items.len() > 0 { list(..items.map(i => [#i])) }
|
|
42
|
+
|
|
43
|
+
// ---------- Header ----------
|
|
44
|
+
#align(center)[
|
|
45
|
+
#text(size: 20pt, weight: "bold", get(b, "name", default: ""))
|
|
46
|
+
#if get(b, "label") != none [ \ #text(size: 11.5pt, get(b, "label")) ]
|
|
47
|
+
#v(-0.3em)
|
|
48
|
+
#{
|
|
49
|
+
let loc = get(b, "location")
|
|
50
|
+
let city = if loc != none { (get(loc, "city"), get(loc, "region"), get(loc, "countryCode")).filter(x => x != none and x != "").join(", ") } else { none }
|
|
51
|
+
let bits = (get(b, "email"), get(b, "phone"), city, get(b, "url"))
|
|
52
|
+
for p in get(b, "profiles", default: ()) { bits.push(get(p, "url", default: get(p, "username"))) }
|
|
53
|
+
text(size: 9.5pt, bits.filter(x => x != none and x != "").join(" | "))
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
#if get(b, "summary") != none {
|
|
58
|
+
section("Summary")
|
|
59
|
+
get(b, "summary")
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#let work = get(cv, "work", default: ())
|
|
63
|
+
#if work.len() > 0 {
|
|
64
|
+
section("Experience")
|
|
65
|
+
for w in work {
|
|
66
|
+
entry(get(w, "position", default: get(w, "name")), range(w),
|
|
67
|
+
left-bottom: if get(w, "position") != none { get(w, "name") } else { "" },
|
|
68
|
+
right-bottom: get(w, "location", default: ""))
|
|
69
|
+
if get(w, "summary") != none [#get(w, "summary")]
|
|
70
|
+
bullets(get(w, "highlights"))
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
#let projects = get(cv, "projects", default: ())
|
|
75
|
+
#if projects.len() > 0 {
|
|
76
|
+
section("Projects")
|
|
77
|
+
for p in projects {
|
|
78
|
+
entry(get(p, "name"), range(p), left-bottom: get(p, "url", default: ""))
|
|
79
|
+
if get(p, "description") != none [#get(p, "description")]
|
|
80
|
+
bullets(get(p, "highlights"))
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
#let edu = get(cv, "education", default: ())
|
|
85
|
+
#if edu.len() > 0 {
|
|
86
|
+
section("Education")
|
|
87
|
+
for e in edu {
|
|
88
|
+
let degree = (get(e, "studyType"), get(e, "area")).filter(x => x != none and x != "").join(", ")
|
|
89
|
+
entry(get(e, "institution"), range(e), left-bottom: if degree == none { "" } else { degree },
|
|
90
|
+
right-bottom: if get(e, "score") != none { "Grade: " + get(e, "score") } else { "" })
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
#let skills = get(cv, "skills", default: ())
|
|
95
|
+
#if skills.len() > 0 {
|
|
96
|
+
section("Skills")
|
|
97
|
+
for s in skills {
|
|
98
|
+
let kw = get(s, "keywords", default: ())
|
|
99
|
+
[#strong(get(s, "name")): #kw.join(", ") \ ]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
#let certs = get(cv, "certificates", default: ())
|
|
104
|
+
#if certs.len() > 0 {
|
|
105
|
+
section("Certifications")
|
|
106
|
+
bullets(certs.map(c => (get(c, "name"), get(c, "issuer"), fmt-date(get(c, "date"))).filter(x => x != none and x != "").join(" — ")))
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
#let awards = get(cv, "awards", default: ())
|
|
110
|
+
#if awards.len() > 0 {
|
|
111
|
+
section("Awards")
|
|
112
|
+
bullets(awards.map(a => (get(a, "title"), get(a, "awarder"), fmt-date(get(a, "date"))).filter(x => x != none and x != "").join(" — ")))
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
#let langs = get(cv, "languages", default: ())
|
|
116
|
+
#if langs.len() > 0 {
|
|
117
|
+
section("Languages")
|
|
118
|
+
langs.map(l => get(l, "language") + if get(l, "fluency") != none { " (" + get(l, "fluency") + ")" } else { "" }).join(", ")
|
|
119
|
+
}
|