(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 | var treeTooLarge *discovery.TreeTooLargeError |
| 640 | if errors.As(err, &treeTooLarge) { |
| 641 | fmt.Fprintf(opts.IO.ErrOut, "%s\n Use path-based install instead: gh skill install %s/%s skills/<skill-name>\n", |
| 642 | err, treeTooLarge.Owner, treeTooLarge.Repo) |
| 643 | return nil, err |
| 644 | } |
| 645 | return nil, err |
| 646 | } |
| 647 | skills, filterErr := filterHiddenDirSkills(opts, allSkills) |
| 648 | if filterErr != nil { |
| 649 | return nil, filterErr |
| 650 | } |
| 651 | logConventions(opts.IO, skills) |
| 652 | for _, s := range skills { |
| 653 | if !discovery.IsSpecCompliant(s.Name) { |
| 654 | fmt.Fprintf(opts.IO.ErrOut, "Warning: skill %q does not follow the agentskills.io naming convention\n", s.DisplayName()) |
| 655 | } |
| 656 | } |
| 657 | return skills, nil |
| 658 | } |
| 659 | |
| 660 | func logConventions(io *iostreams.IOStreams, skills []discovery.Skill) { |
| 661 | conventions := make(map[string]int) |
no test coverage detected