MCPcopy Index your code
hub / github.com/coder/coder / FormatResolvedSkillIndex

Function FormatResolvedSkillIndex

coderd/x/chatd/chattool/skill.go:56–80  ·  view source on GitHub ↗

FormatResolvedSkillIndex renders an XML block listing all source-aware skills. Aliases are the names the model should pass to the skill tools.

(resolved []skillspkg.ResolvedSkill)

Source from the content-addressed store, hash-verified

54// FormatResolvedSkillIndex renders an XML block listing all source-aware
55// skills. Aliases are the names the model should pass to the skill tools.
56func FormatResolvedSkillIndex(resolved []skillspkg.ResolvedSkill) string {
57 if len(resolved) == 0 {
58 return ""
59 }
60
61 entries := make([]skillIndexEntry, 0, len(resolved))
62 hasQualifiedAlias := false
63 hasWorkspaceSkill := false
64 for _, s := range resolved {
65 entries = append(entries, skillIndexEntry{
66 Alias: s.Alias,
67 Description: s.Description,
68 })
69 if s.Source == skillspkg.SourceWorkspace {
70 hasWorkspaceSkill = true
71 }
72 if s.Alias == skillspkg.QualifiedAlias(s.Source, s.Name) {
73 hasQualifiedAlias = true
74 }
75 }
76 return renderSkillIndex(entries, skillIndexFormatOptions{
77 includeQualifiedAliasInstruction: hasQualifiedAlias,
78 includeReadSkillFileInstruction: hasWorkspaceSkill,
79 })
80}
81
82type skillIndexEntry struct {
83 Alias string

Callers 4

buildSystemPromptFunction · 0.92
runChatMethod · 0.92

Calls 1

renderSkillIndexFunction · 0.85