MCPcopy Create free account
hub / github.com/JordanCoin/codemap / injectConfigSetupSkill

Function injectConfigSetupSkill

cmd/hooks.go:816–847  ·  view source on GitHub ↗
(root string, idx *skills.SkillIndex, matches []skills.MatchResult)

Source from the content-addressed store, hash-verified

814}
815
816func 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
849func showConfigSetupHint(root string) {
850 assessment := config.AssessSetup(root)

Callers 1

showMatchedSkillsFunction · 0.85

Calls 2

AssessSetupFunction · 0.92
NeedsAttentionMethod · 0.80

Tested by

no test coverage detected