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