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

Function IsSkillPath

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

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