From 9ae8de20ce22f42fa5d09d80611d09ec52e58bd5 Mon Sep 17 00:00:00 2001 From: DBT Date: Tue, 24 Feb 2026 05:45:38 +0000 Subject: [PATCH] align skill selection protocol with openclaw behavior --- pkg/agent/context.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/agent/context.go b/pkg/agent/context.go index 71c6b3d..37746ce 100644 --- a/pkg/agent/context.go +++ b/pkg/agent/context.go @@ -107,12 +107,18 @@ func (cb *ContextBuilder) BuildSystemPrompt() string { parts = append(parts, bootstrapContent) } - // Skills - show summary, AI can read full content with read_file tool + // Skills - OpenClaw-aligned selection protocol + available skill catalog skillsSummary := cb.skillsLoader.BuildSkillsSummary() if skillsSummary != "" { - parts = append(parts, fmt.Sprintf(`# Skills + parts = append(parts, fmt.Sprintf(`# Skills (mandatory protocol) -The following skills extend your capabilities. To use a skill, read its SKILL.md file using the read_file tool. +Before replying: scan entries in . +- If exactly one skill clearly applies: read its SKILL.md (via read tool) and follow it. +- If multiple could apply: choose the most specific one, then read/follow it. +- If none clearly apply: do not read any SKILL.md. +Constraints: +- Never read more than one skill up front. +- If SKILL.md references relative paths, resolve against the skill directory. %s`, skillsSummary)) }