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)
| 948 | // DiscoverLocalSkillsWithOptions to retrieve all skills including those in |
| 949 | // hidden directories. |
| 950 | func DiscoverLocalSkills(dir string) ([]Skill, error) { |
| 951 | all, err := DiscoverLocalSkillsWithOptions(dir, DiscoverOptions{}) |
| 952 | if err != nil { |
| 953 | return nil, err |
| 954 | } |
| 955 | var skills []Skill |
| 956 | for _, s := range all { |
| 957 | if !s.IsHiddenDirConvention() { |
| 958 | skills = append(skills, s) |
| 959 | } |
| 960 | } |
| 961 | if len(skills) == 0 { |
| 962 | return nil, fmt.Errorf( |
| 963 | "no skills found in %s\n"+ |
| 964 | " Expected SKILL.md in the directory, or skills in skills/*/SKILL.md,\n"+ |
| 965 | " skills/{scope}/*/SKILL.md, */SKILL.md, or plugins/*/skills/*/SKILL.md", |
| 966 | dir, |
| 967 | ) |
| 968 | } |
| 969 | return skills, nil |
| 970 | } |
| 971 | |
| 972 | // DiscoverLocalSkillsWithOptions finds skills in a local directory using the |
| 973 | // same conventions as remote discovery, with configurable discovery behavior. |