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

Function MatchSkillPath

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

434// path doesn't match. The namespace is non-empty for namespaced skills
435// (e.g. skills/author/name/SKILL.md) and plugin skills.
436func MatchSkillPath(filePath string) (name, namespace string) {
437 m := matchSkillConventions(treeEntry{Path: filePath})
438 if m == nil {
439 return "", ""
440 }
441 return m.name, m.namespace
442}
443
444// IsSkillPath reports whether a skill selector looks like a repo-relative path
445// 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