(opts *InstallOptions, client *api.Client, hostname string, resolved *discovery.ResolvedRef)
| 632 | } |
| 633 | |
| 634 | func discoverSkills(opts *InstallOptions, client *api.Client, hostname string, resolved *discovery.ResolvedRef) ([]discovery.Skill, error) { |
| 635 | opts.IO.StartProgressIndicatorWithLabel("Discovering skills") |
| 636 | allSkills, err := discovery.DiscoverSkillsWithOptions(client, hostname, opts.repo.RepoOwner(), opts.repo.RepoName(), resolved.SHA, discovery.DiscoverOptions{}) |
| 637 | opts.IO.StopProgressIndicator() |
| 638 | if err != nil { |
| 639 | if treeTooLarge, ok := errors.AsType[*discovery.TreeTooLargeError](err); ok { |
| 640 | fmt.Fprintf(opts.IO.ErrOut, "%s\n Use path-based install instead: gh skill install %s/%s skills/<skill-name>\n", |
| 641 | err, treeTooLarge.Owner, treeTooLarge.Repo) |
| 642 | return nil, err |
| 643 | } |
| 644 | return nil, err |
| 645 | } |
| 646 | skills, filterErr := filterHiddenDirSkills(opts, allSkills) |
| 647 | if filterErr != nil { |
| 648 | return nil, filterErr |
| 649 | } |
| 650 | logConventions(opts.IO, skills) |
| 651 | for _, s := range skills { |
| 652 | if !discovery.IsSpecCompliant(s.Name) { |
| 653 | fmt.Fprintf(opts.IO.ErrOut, "Warning: skill %q does not follow the agentskills.io naming convention\n", s.DisplayName()) |
| 654 | } |
| 655 | } |
| 656 | return skills, nil |
| 657 | } |
| 658 | |
| 659 | func logConventions(io *iostreams.IOStreams, skills []discovery.Skill) { |
| 660 | conventions := make(map[string]int) |
no test coverage detected