DiscoverLocalSkills finds non-hidden-dir skills in a local directory using the same conventions as remote discovery. Hidden-dir skills are excluded; use DiscoverLocalSkillsWithOptions to retrieve all skills including those in hidden directories.
(dir string)
| 898 | // DiscoverLocalSkillsWithOptions to retrieve all skills including those in |
| 899 | // hidden directories. |
| 900 | func DiscoverLocalSkills(dir string) ([]Skill, error) { |
| 901 | all, err := DiscoverLocalSkillsWithOptions(dir, DiscoverOptions{}) |
| 902 | if err != nil { |
| 903 | return nil, err |
| 904 | } |
| 905 | var skills []Skill |
| 906 | for _, s := range all { |
| 907 | if !s.IsHiddenDirConvention() { |
| 908 | skills = append(skills, s) |
| 909 | } |
| 910 | } |
| 911 | if len(skills) == 0 { |
| 912 | return nil, fmt.Errorf( |
| 913 | "no skills found in %s\n"+ |
| 914 | " Expected SKILL.md in the directory, or skills in skills/*/SKILL.md,\n"+ |
| 915 | " skills/{scope}/*/SKILL.md, */SKILL.md, or plugins/*/skills/*/SKILL.md", |
| 916 | dir, |
| 917 | ) |
| 918 | } |
| 919 | return skills, nil |
| 920 | } |
| 921 | |
| 922 | // DiscoverLocalSkillsWithOptions finds skills in a local directory using the |
| 923 | // same conventions as remote discovery, with configurable discovery behavior. |