Skip to content

[Bug]: Repo skill-match score penalizes users for knowing more languages #51

Description

@animeshmanna1976

Describe the bug

The skill-match calculation in the repo insights compares the user's languages against the repo's single primary language, and divides by the number of the user's languages. This means a user is penalized for being multi-lingual, and
the score is capped far below 100% for anyone with a broad skill set.

Steps to reproduce

  1. Have a profile with, say, TypeScript, Python, Go, Rust, C++.
  2. Open insights for a TypeScript repo.
  3. See a ~20% skill match despite TypeScript being your top language.

Expected behavior

Skill match should reflect whether the user knows the repo's language(s) — ideally comparing against the repo's full language breakdown (GET /repos/{owner}/{repo}/languages, already used in profile.ts) rather than only the single
primary language, and it shouldn't decrease just because the user knows additional languages.

Suggested fix

Fetch the repo's language set and compute the match as "does the user cover the repo's languages," e.g.:

const repoLangs = Object.keys((await octokit.request(
"GET /repos/{owner}/{repo}/languages", { owner, repo: name }
)).data);

const userSet = new Set(userLanguages.map((l) => l.name.toLowerCase()));
const matched = repoLangs.filter((l) => userSet.has(l.toLowerCase()));
const skillPercent = repoLangs.length > 0
? Math.round((matched.length / repoLangs.length) * 100)
: 0;

Actual behavior

The skill-match calculation in the repo insights compares the user's languages against the repo's single primary language, and divides by the number of the user's languages. This means a user is penalized for being multi-lingual, and
the score is capped far below 100% for anyone with a broad skill set.

Location

lib/github/repo-insights.ts (lines ~66–90)

Environment

Linux Mint, Firefox

Metadata

Metadata

Assignees

No one assigned

    Labels

    ECSoC26Elite Coders Summer of CodebugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions