computeSkillID derives the display identifier from a SKILL.md path, matching gh skill search format. It strips "skills/" prefix and the manifest filename, keeping scope/name structure. "skills/foo/SKILL.md" → "foo" "scope/foo/SKILL.md" → "scope/foo" "prefix/skills/foo/SKILL
(path string)
| 274 | // "prefix/skills/foo/SKILL.md" → "foo" |
| 275 | // "foo/SKILL.md" → "foo" |
| 276 | func computeSkillID(path string) string { |
| 277 | path = filepath.ToSlash(path) |
| 278 | // Remove the manifest filename. |
| 279 | dir := filepath.Dir(path) |
| 280 | dir = filepath.ToSlash(dir) |
| 281 | |
| 282 | parts := strings.Split(dir, "/") |
| 283 | // Remove leading "skills" directory if present. |
| 284 | for i, p := range parts { |
| 285 | if p == "skills" { |
| 286 | parts = parts[i+1:] |
| 287 | break |
| 288 | } |
| 289 | } |
| 290 | if len(parts) == 0 { |
| 291 | return "" |
| 292 | } |
| 293 | return strings.Join(parts, "/") |
| 294 | } |
| 295 | |
| 296 | // formatStars formats a star count for display, like gh skill search: |
| 297 | // |
no outgoing calls