diff options
| author | Aiden Cline <[email protected]> | 2025-12-27 21:20:00 -0600 |
|---|---|---|
| committer | Aiden Cline <[email protected]> | 2025-12-27 21:20:00 -0600 |
| commit | 79c263494ff1426c7f25e5c05c3f55b0e0b0fe9d (patch) | |
| tree | 44777d059640d0ecf016ffd0be1438d5bda50840 | |
| parent | 1b5bf32ce560f44dd558f3951121c3f4b0560e85 (diff) | |
| download | opencode-79c263494ff1426c7f25e5c05c3f55b0e0b0fe9d.tar.gz opencode-79c263494ff1426c7f25e5c05c3f55b0e0b0fe9d.zip | |
tweak: inform agent if no skills are available
| -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) |
