refactor: move skills directory from .skills to skills and enrich prompt

- Change skills storage path from `/data/.skills` to `/data/skills`
- Add usage instructions and directory location to the Skills section
  in the system prompt
This commit is contained in:
Acbox
2026-03-31 15:35:57 +08:00
parent faaf13a0e9
commit bb14bcb3bc
2 changed files with 8 additions and 4 deletions
+7 -3
View File
@@ -200,11 +200,15 @@ func buildSkillsSection(skills []SkillEntry) string {
return strings.Compare(a.Name, b.Name)
})
var sb strings.Builder
sb.WriteString("## Skills\n")
sb.WriteString("## Skills\n\n")
sb.WriteString("Skills are stored in `{{home}}/skills/`. ")
sb.WriteString("Each skill is a `SKILL.md` file inside a named subdirectory.\n\n")
sb.WriteString("Call `use_skill` with the skill name to load its full instructions before following them. ")
sb.WriteString("Only activate a skill when it is relevant to the current task.\n\n")
sb.WriteString(strconv.Itoa(len(sorted)))
sb.WriteString(" skills available via `use_skill`:\n")
sb.WriteString(" skill(s) available:\n")
for _, s := range sorted {
sb.WriteString("- " + s.Name + ": " + s.Description + "\n")
sb.WriteString("- **" + s.Name + "**: " + s.Description + "\n")
}
return sb.String()
}
+1 -1
View File
@@ -14,7 +14,7 @@ import (
"github.com/memohai/memoh/internal/workspace/bridge"
)
const skillsDirPath = config.DefaultDataMount + "/.skills"
const skillsDirPath = config.DefaultDataMount + "/skills"
type SkillItem struct {
Name string `json:"name"`