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)
| 434 | // path doesn't match. The namespace is non-empty for namespaced skills |
| 435 | // (e.g. skills/author/name/SKILL.md) and plugin skills. |
| 436 | func 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. |