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
- Have a profile with, say, TypeScript, Python, Go, Rust, C++.
- Open insights for a TypeScript repo.
- 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
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
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