MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / computeSkillID

Function computeSkillID

internal/cli/management.go:276–294  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

274// "prefix/skills/foo/SKILL.md" → "foo"
275// "foo/SKILL.md" → "foo"
276func 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//

Callers 2

TestComputeSkillIDFunction · 0.85
searchGitHubFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestComputeSkillIDFunction · 0.68