============================================================================ Relevance scoring — rank results by multi-signal score (mirroring gh skill search) ============================================================================ relevanceScore computes a numeric ranking score for a search re
(name, description, repo string, stars int, query string)
| 946 | // - Description contains query (100 points) |
| 947 | // - Repository stars (sqrt bonus, ~2400 for 6k stars) |
| 948 | func relevanceScore(name, description, repo string, stars int, query string) int { |
| 949 | term := strings.ToLower(query) |
| 950 | termHyphen := strings.ReplaceAll(term, " ", "-") |
| 951 | score := 0 |
| 952 | |
| 953 | nameLower := strings.ToLower(name) |
| 954 | if nameLower == term || nameLower == termHyphen { |
| 955 | score += 3_000 |
| 956 | } else if strings.Contains(nameLower, term) || strings.Contains(nameLower, termHyphen) { |
| 957 | score += 1_000 |
| 958 | } |
| 959 | |
| 960 | if strings.Contains(strings.ToLower(description), term) { |
| 961 | score += 100 |
| 962 | } |
| 963 | |
| 964 | if stars > 0 { |
| 965 | score += int(math.Sqrt(float64(stars)) * 30) |
| 966 | } |
| 967 | |
| 968 | return score |
| 969 | } |
| 970 | |
| 971 | // ============================================================================ |
| 972 | // list — show what's installed across code agents |
no outgoing calls