Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/cli/src/__tests__/cli.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { describe, it, expect } from "vitest";

describe("cli package", () => {
it("runs without errors", () => {
expect(true).toBe(true);
});
});
32 changes: 31 additions & 1 deletion packages/core/src/__tests__/evaluator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,34 @@ describe("evaluate", () => {
withoutJD.dimensions.find((d) => d.name === "Keyword Match")!.score
);
});
});

it("flags CVs over 800 words as minor issue", async () => {
const makeText = (count: number) =>
Array.from({ length: count }).fill("word").join(" ");

const result = await evaluate({
cv: { content: makeText(850), format: "markdown" },
});

const issue = result.issues.find(i =>
i.element.includes("CV")
);

expect(issue?.severity).toBe("minor");
});

it("flags CVs over 1000 words as major issue", async () => {
const makeText = (count: number) =>
Array.from({ length: count }).fill("word").join(" ");

const result = await evaluate({
cv: { content: makeText(1100), format: "markdown" },
});

const issue = result.issues.find(i =>
i.element.includes("CV")
);

expect(issue?.severity).toBe("major");
});
});
20 changes: 19 additions & 1 deletion packages/core/src/evaluator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,25 @@ function findIssues(cv: string, archetype: RoleArchetype) {
});
}
}

// Word count heuristic: CVs >800 words (~2 pages), >1000 clearly too long
const wordCount = cv.trim() ? cv.trim().split(/\s+/).length : 0;

if (wordCount > 1000) {
issues.push({
element: "Excessive CV length",
why: "CVs longer than 2 pages reduce readability and make it harder for recruiters to quickly identify key achievements.",
fix: "Keep CV within 1–2 pages by removing outdated experience and focusing on high-impact work.",
severity: "major",
});
} else if (wordCount > 800) {
issues.push({
element: "Potentially long CV",
why: "CVs over ~800 words may exceed optimal length and reduce recruiter attention.",
fix: "Keep CV concise (1–2 pages) by shortening bullet points and removing less relevant details.",
severity: "minor",
});
}

return issues;
}

Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.