repolens-ai 2.0.0 → 2.0.2

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/dist/cli.js CHANGED
@@ -1020,7 +1020,7 @@ function scoreContextFile(content, projectFiles) {
1020
1020
  let freshnessScore = 50;
1021
1021
  if (projectFiles && projectFiles.length > 0) {
1022
1022
  const refed = projectFiles.filter((f) => content.includes(path8.basename(f)));
1023
- freshnessScore = Math.round(refed.length / Math.min(projectFiles.length, 20) * 100);
1023
+ freshnessScore = Math.min(100, Math.round(refed.length / Math.min(projectFiles.length, 20) * 100));
1024
1024
  if (freshnessScore < 10) {
1025
1025
  issues.push({ severity: "warning", message: "Context file references very few project files \u2014 may be outdated" });
1026
1026
  }
@@ -1041,9 +1041,9 @@ function scoreContextFile(content, projectFiles) {
1041
1041
  }
1042
1042
  if (content.length === 0) issues.push({ severity: "error", message: "Context file is empty" });
1043
1043
  if (genericCount > 5) suggestions.push(`Remove ${genericCount} generic rules that hurt agent performance`);
1044
- const overall = Math.round(
1044
+ const overall = Math.min(100, Math.round(
1045
1045
  specificityScore * 0.3 + coverageScore * 0.2 + concisenessScore * 0.15 + freshnessScore * 0.15 + tribalKnowledgeScore * 0.2
1046
- );
1046
+ ));
1047
1047
  return {
1048
1048
  overall,
1049
1049
  breakdown: {
@@ -5008,10 +5008,11 @@ function getGradeColor(score, text) {
5008
5008
  return chalk14.red(text);
5009
5009
  }
5010
5010
  function scoreBar(score) {
5011
- const filled = Math.round(score / 10);
5011
+ const clamped = Math.min(100, Math.max(0, score));
5012
+ const filled = Math.min(10, Math.round(clamped / 10));
5012
5013
  const bar = "\u2588".repeat(filled) + "\u2591".repeat(10 - filled);
5013
- const color = score >= 80 ? chalk14.green : score >= 50 ? chalk14.yellow : chalk14.red;
5014
- return `${color(`${String(score).padStart(3)}/100`)} ${color(bar)}`;
5014
+ const color = clamped >= 80 ? chalk14.green : clamped >= 50 ? chalk14.yellow : chalk14.red;
5015
+ return `${color(`${String(clamped).padStart(3)}/100`)} ${color(bar)}`;
5015
5016
  }
5016
5017
  function getSmartSkills(framework, ctx) {
5017
5018
  const skills = [];