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

Function IsSkillPath

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

444// IsSkillPath reports whether a skill selector looks like a repo-relative path
445// rather than a simple skill name.
446func IsSkillPath(name string) bool {
447 name = strings.TrimSuffix(name, "/")
448 if name == "" {
449 return false
450 }
451 if strings.HasSuffix(name, "/SKILL.md") {
452 return true
453 }
454 if strings.HasPrefix(name, "skills/") || strings.HasPrefix(name, "plugins/") {
455 return true
456 }
457 if strings.Contains(name, "/skills/") || strings.Contains(name, "/plugins/") {
458 return true
459 }
460 if strings.Count(name, "/") >= 2 {
461 return true
462 }
463 return false
464}
465
466// matchSkillConventions checks if a blob path matches any known skill convention.
467func matchSkillConventions(entry treeEntry) *skillMatch {

Callers 3

installRunFunction · 0.92
previewRunFunction · 0.92
TestIsSkillPathFunction · 0.85

Calls 2

ContainsMethod · 0.80
CountMethod · 0.45

Tested by 1

TestIsSkillPathFunction · 0.68