(entries []skillIndexEntry, opts skillIndexFormatOptions)
| 90 | } |
| 91 | |
| 92 | func renderSkillIndex(entries []skillIndexEntry, opts skillIndexFormatOptions) string { |
| 93 | if len(entries) == 0 { |
| 94 | return "" |
| 95 | } |
| 96 | |
| 97 | var b strings.Builder |
| 98 | _, _ = b.WriteString(AvailableSkillsOpenTag + "\n") |
| 99 | _, _ = b.WriteString( |
| 100 | "Use read_skill to load a skill's full instructions " + |
| 101 | "before following them.\n", |
| 102 | ) |
| 103 | if opts.includeReadSkillFileInstruction { |
| 104 | _, _ = b.WriteString( |
| 105 | "Use read_skill_file to read supporting files " + |
| 106 | "referenced by a workspace skill.\n", |
| 107 | ) |
| 108 | } |
| 109 | if opts.includeQualifiedAliasInstruction { |
| 110 | _, _ = b.WriteString( |
| 111 | "When a skill is listed as personal/name or workspace/name, " + |
| 112 | "pass that qualified alias to read_skill.\n", |
| 113 | ) |
| 114 | } |
| 115 | _, _ = b.WriteString("\n") |
| 116 | for _, s := range entries { |
| 117 | _, _ = b.WriteString("- ") |
| 118 | _, _ = b.WriteString(s.Alias) |
| 119 | if s.Description != "" { |
| 120 | _, _ = b.WriteString(": ") |
| 121 | _, _ = b.WriteString(s.Description) |
| 122 | } |
| 123 | _, _ = b.WriteString("\n") |
| 124 | } |
| 125 | _, _ = b.WriteString(AvailableSkillsCloseTag) |
| 126 | return b.String() |
| 127 | } |
| 128 | |
| 129 | // LoadSkillBody reads the full skill meta file for a discovered |
| 130 | // skill and lists the supporting files in its directory. |
no test coverage detected