(root string, idx *skills.SkillIndex, matches []skills.MatchResult)
| 814 | } |
| 815 | |
| 816 | func injectConfigSetupSkill(root string, idx *skills.SkillIndex, matches []skills.MatchResult) []skills.MatchResult { |
| 817 | assessment := config.AssessSetup(root) |
| 818 | if !assessment.NeedsAttention() { |
| 819 | return matches |
| 820 | } |
| 821 | |
| 822 | skill, ok := idx.ByName["config-setup"] |
| 823 | if !ok || skill == nil { |
| 824 | return matches |
| 825 | } |
| 826 | for _, match := range matches { |
| 827 | if match.Skill != nil && match.Skill.Meta.Name == "config-setup" { |
| 828 | return matches |
| 829 | } |
| 830 | } |
| 831 | |
| 832 | reason := "config:" + string(assessment.State) |
| 833 | if len(assessment.Reasons) > 0 { |
| 834 | reason = reason + " " + assessment.Reasons[0] |
| 835 | } |
| 836 | |
| 837 | injected := skills.MatchResult{ |
| 838 | Skill: skill, |
| 839 | Score: 100, |
| 840 | Reason: reason, |
| 841 | } |
| 842 | matches = append([]skills.MatchResult{injected}, matches...) |
| 843 | if len(matches) > 3 { |
| 844 | matches = matches[:3] |
| 845 | } |
| 846 | return matches |
| 847 | } |
| 848 | |
| 849 | func showConfigSetupHint(root string) { |
| 850 | assessment := config.AssessSetup(root) |
no test coverage detected