diff options
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/session/system.ts | 1 | ||||
| -rw-r--r-- | packages/opencode/src/tool/skill.ts | 31 |
2 files changed, 18 insertions, 14 deletions
diff --git a/packages/opencode/src/session/system.ts b/packages/opencode/src/session/system.ts index 429e696db..e10ee3bad 100644 --- a/packages/opencode/src/session/system.ts +++ b/packages/opencode/src/session/system.ts @@ -2,7 +2,6 @@ import { Ripgrep } from "../file/ripgrep" import { Global } from "../global" import { Filesystem } from "../util/filesystem" import { Config } from "../config/config" -import { Skill } from "../skill" import { Instance } from "../project/instance" import path from "path" diff --git a/packages/opencode/src/tool/skill.ts b/packages/opencode/src/tool/skill.ts index 2503f7639..b56276f61 100644 --- a/packages/opencode/src/tool/skill.ts +++ b/packages/opencode/src/tool/skill.ts @@ -26,20 +26,25 @@ export const SkillTool: Tool.Info<typeof parameters> = { }) } + const description = + accessibleSkills.length === 0 + ? "Load a skill to get detailed instructions for a specific task. No skills are currently available." + : [ + "Load a skill to get detailed instructions for a specific task.", + "Skills provide specialized knowledge and step-by-step guidance.", + "Use this when a task matches an available skill's description.", + "<available_skills>", + ...accessibleSkills.flatMap((skill) => [ + ` <skill>`, + ` <name>${skill.name}</name>`, + ` <description>${skill.description}</description>`, + ` </skill>`, + ]), + "</available_skills>", + ].join(" ") + return { - description: [ - "Load a skill to get detailed instructions for a specific task.", - "Skills provide specialized knowledge and step-by-step guidance.", - "Use this when a task matches an available skill's description.", - "<available_skills>", - ...accessibleSkills.flatMap((skill) => [ - ` <skill>`, - ` <name>${skill.name}</name>`, - ` <description>${skill.description}</description>`, - ` </skill>`, - ]), - "</available_skills>", - ].join(" "), + description, parameters, async execute(params, ctx) { const agent = await Agent.get(ctx.agent) |
