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

Function MatchSkillPath

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

MatchSkillPath checks if a file path matches any known skill convention and returns the skill name and namespace. Returns empty strings if the path doesn't match. The namespace is non-empty for namespaced skills (e.g. skills/author/name/SKILL.md) and plugin skills.

(filePath string)

Source from the content-addressed store, hash-verified

405// path doesn't match. The namespace is non-empty for namespaced skills
406// (e.g. skills/author/name/SKILL.md) and plugin skills.
407func MatchSkillPath(filePath string) (name, namespace string) {
408 m := matchSkillConventions(treeEntry{Path: filePath})
409 if m == nil {
410 return "", ""
411 }
412 return m.name, m.namespace
413}
414
415// IsSkillPath reports whether a skill selector looks like a repo-relative path
416// rather than a simple skill name.

Callers 2

extractSkillInfoFunction · 0.92
TestMatchSkillPathFunction · 0.85

Calls 1

matchSkillConventionsFunction · 0.85

Tested by 1

TestMatchSkillPathFunction · 0.68