MCPcopy Create free account
hub / github.com/cli/cli / IsSkillPath

Function IsSkillPath

internal/skills/discovery/discovery.go:417–435  ·  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

415// IsSkillPath reports whether a skill selector looks like a repo-relative path
416// rather than a simple skill name.
417func IsSkillPath(name string) bool {
418 name = strings.TrimSuffix(name, "/")
419 if name == "" {
420 return false
421 }
422 if strings.HasSuffix(name, "/SKILL.md") {
423 return true
424 }
425 if strings.HasPrefix(name, "skills/") || strings.HasPrefix(name, "plugins/") {
426 return true
427 }
428 if strings.Contains(name, "/skills/") || strings.Contains(name, "/plugins/") {
429 return true
430 }
431 if strings.Count(name, "/") >= 2 {
432 return true
433 }
434 return false
435}
436
437// matchSkillConventions checks if a blob path matches any known skill convention.
438func 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