Skip to content

feat(core): add buzzword overuse evaluation rule - #93

Open
IKetutWidiyane wants to merge 2 commits into
TechImmigrants:mainfrom
IKetutWidiyane:issue-43-buzzword-overuse
Open

feat(core): add buzzword overuse evaluation rule#93
IKetutWidiyane wants to merge 2 commits into
TechImmigrants:mainfrom
IKetutWidiyane:issue-43-buzzword-overuse

Conversation

@IKetutWidiyane

@IKetutWidiyane IKetutWidiyane commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a new CV evaluation rule that detects excessive buzzword usage.

The evaluator now counts how many entries from UNIVERSAL_RULES.antiPatterns match a CV. When 5 or more cliché patterns are detected, it surfaces a critical issue named "Buzzword overuse", encouraging candidates to replace generic buzzwords with measurable achievements.

This PR also adds a test case to verify the new behavior.

Related issue

Closes #43

Type of change

  • Bug fix
  • New feature
  • New archetype / rule
  • Documentation
  • Refactoring (no behavior change)
  • CI / tooling

Checklist

  • I've read CONTRIBUTING.md
  • My code follows the project's style
  • I've added/updated tests (if applicable)
  • I've tested locally and it works
  • New archetypes include 15+ keywords and source references

Screenshots (if UI change)

Before After
N/A N/A

Summary by CodeRabbit

  • New Features

    • Added “Buzzword overuse” issue generation when multiple anti-patterns are detected, marked as critical.
    • Updated the guidance to recommend swapping buzzwords for more specific, achievement-focused phrasing.
  • Tests

    • Added a Vitest case to confirm the new issue is produced and that its severity and why text match expectations.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a critical “Buzzword overuse” issue when at least five anti-patterns match during evaluation, with a test verifying the issue’s severity and message content.

Changes

Buzzword overuse rule

Layer / File(s) Summary
Buzzword overuse detection and validation
packages/core/src/evaluator/index.ts, packages/core/src/__tests__/evaluator.test.ts
findIssues emits a critical “Buzzword overuse” issue for five or more matches, and the evaluator test verifies its presence, severity, and why text.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a buzzword overuse rule in core.
Linked Issues check ✅ Passed The evaluator now flags 5+ anti-pattern matches as a critical "Buzzword overuse" issue, matching the linked rule requirements.【#43
Out of Scope Changes check ✅ Passed The changes stay within the requested evaluator rule and its test coverage, with no obvious unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/core/src/evaluator/index.ts (1)

185-194: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Decouple buzzword count from issues array ordering.

issues.length >= 5 only reflects anti-pattern matches because this block sits immediately after the anti-pattern loop and before any other issues.push calls. That's an implicit ordering dependency — if a future rule is inserted earlier in findIssues (e.g., before line 185), the buzzword threshold will silently count unrelated issues instead of anti-pattern matches, contrary to the stated objective of counting UNIVERSAL_RULES.antiPatterns matches specifically.

♻️ Suggested refactor: use a dedicated counter
 function findIssues(cv: string, _archetype: RoleArchetype) {
   const issues: EvaluationResult["issues"] = [];
+  let antiPatternMatches = 0;
 
   for (const pattern of UNIVERSAL_RULES.antiPatterns) {
     if (new RegExp(pattern.match, "i").test(cv)) {
+      antiPatternMatches++;
       issues.push({
         element: pattern.name,
         why: pattern.why,
         fix: pattern.fix,
         severity: pattern.severity as "critical" | "major" | "minor",
       });
     }
   }
 
   // Buzzword overuse: if 5+ anti-patterns matched, surface a critical issue
-  if (issues.length >= 5) {
+  if (antiPatternMatches >= 5) {
     issues.push({
       element: "Buzzword overuse",
-      why: `Your CV triggered ${issues.length} cliche patterns. This signals AI-generated or template-copied content to screeners.`,
+      why: `Your CV triggered ${antiPatternMatches} cliche patterns. This signals AI-generated or template-copied content to screeners.`,
       fix: "Replace each flagged phrase with a specific achievement. One real number beats ten adjectives.",
       severity: "critical",
     });
   }

As per path instructions, "Prioritize correctness of rules, evaluator scoring, and types" — this reduces the risk of silently incorrect scoring if the function is later reordered.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/core/src/evaluator/index.ts` around lines 185 - 194, The buzzword
threshold in findIssues is implicitly tied to issues.length, so it can drift if
new rules add issues earlier in the function. Introduce a dedicated counter for
UNIVERSAL_RULES.antiPatterns matches in packages/core/src/evaluator/index.ts,
increment it inside the anti-pattern loop, and use that counter in the Buzzword
overuse check instead of issues.length. Keep the critical issue push for
“Buzzword overuse” unchanged, but make its condition depend only on the
anti-pattern match count so ordering of other issues cannot affect it.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/core/src/evaluator/index.ts`:
- Around line 185-194: The buzzword threshold in findIssues is implicitly tied
to issues.length, so it can drift if new rules add issues earlier in the
function. Introduce a dedicated counter for UNIVERSAL_RULES.antiPatterns matches
in packages/core/src/evaluator/index.ts, increment it inside the anti-pattern
loop, and use that counter in the Buzzword overuse check instead of
issues.length. Keep the critical issue push for “Buzzword overuse” unchanged,
but make its condition depend only on the anti-pattern match count so ordering
of other issues cannot affect it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f5521b8b-0ee4-4c0a-b0c0-4eac39f15caa

📥 Commits

Reviewing files that changed from the base of the PR and between 37deb6e and 9a80261.

📒 Files selected for processing (2)
  • packages/core/src/__tests__/evaluator.test.ts
  • packages/core/src/evaluator/index.ts

@IKetutWidiyane
IKetutWidiyane force-pushed the issue-43-buzzword-overuse branch from 9a80261 to d56eccc Compare July 3, 2026 19:30

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/core/src/__tests__/evaluator.test.ts (1)

52-61: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the complete issue contract.

This test does not verify the required fix text or that why includes the actual matched count. Add assertions for both so future changes cannot silently break the PR’s specified output contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/core/src/__tests__/evaluator.test.ts` around lines 52 - 61, Extend
the “flags buzzword overuse when 5+ anti-patterns match” test to assert the
complete Buzzword overuse issue contract: verify buzzwordIssue.fix matches the
required fix text and buzzwordIssue.why includes the actual matched anti-pattern
count, while preserving the existing element and severity assertions.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/core/src/__tests__/evaluator.test.ts`:
- Around line 52-61: Extend the “flags buzzword overuse when 5+ anti-patterns
match” test to assert the complete Buzzword overuse issue contract: verify
buzzwordIssue.fix matches the required fix text and buzzwordIssue.why includes
the actual matched anti-pattern count, while preserving the existing element and
severity assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 079b5267-1ac9-4aad-9c3b-24c4b666044b

📥 Commits

Reviewing files that changed from the base of the PR and between 9a80261 and cb6197a.

📒 Files selected for processing (2)
  • packages/core/src/__tests__/evaluator.test.ts
  • packages/core/src/evaluator/index.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Rule] Detect buzzword overuse (5+ cliches)

1 participant