MCPcopy
hub / github.com/cli/cli / IsSkillPath

Function IsSkillPath

internal/skills/discovery/discovery.go:395–413  ·  view source on GitHub ↗

IsSkillPath reports whether a skill selector looks like a repo-relative path rather than a simple skill name.

(name string)

Source from the content-addressed store, hash-verified

393// IsSkillPath reports whether a skill selector looks like a repo-relative path
394// rather than a simple skill name.
395func IsSkillPath(name string) bool {
396 name = strings.TrimSuffix(name, "/")
397 if name == "" {
398 return false
399 }
400 if strings.HasSuffix(name, "/SKILL.md") {
401 return true
402 }
403 if strings.HasPrefix(name, "skills/") || strings.HasPrefix(name, "plugins/") {
404 return true
405 }
406 if strings.Contains(name, "/skills/") || strings.Contains(name, "/plugins/") {
407 return true
408 }
409 if strings.Count(name, "/") >= 2 {
410 return true
411 }
412 return false
413}
414
415// matchSkillConventions checks if a blob path matches any known skill convention.
416func matchSkillConventions(entry treeEntry) *skillMatch {

Callers 3

installRunFunction · 0.92
previewRunFunction · 0.92
TestIsSkillPathFunction · 0.85

Calls 2

ContainsMethod · 0.80
CountMethod · 0.80

Tested by 1

TestIsSkillPathFunction · 0.68