The open source coding agent.
TypeScript
tweak: adjust skill tool description to make it more clear which skills are available
Aiden Clineab3d412a817e
diff --git a/packages/opencode/src/skill/skill.ts b/packages/opencode/src/skill/skill.tsindex 6ae0e9fe887..12fc9ee90c7 100644--- a/packages/opencode/src/skill/skill.ts+++ b/packages/opencode/src/skill/skill.ts@@ -9,7 +9,6 @@ import { Global } from "@/global"import { Filesystem } from "@/util/filesystem"import { Flag } from "@/flag/flag"import { Bus } from "@/bus"-import { TuiEvent } from "@/cli/cmd/tui/event"import { Session } from "@/session"export namespace Skill {diff --git a/packages/opencode/src/tool/skill.ts b/packages/opencode/src/tool/skill.tsindex 386abdae745..9536685ef94 100644--- a/packages/opencode/src/tool/skill.ts+++ b/packages/opencode/src/tool/skill.ts@@ -5,10 +5,6 @@ import { Skill } from "../skill"import { ConfigMarkdown } from "../config/markdown"import { PermissionNext } from "../permission/next"-const parameters = z.object({- name: z.string().describe("The skill identifier from available_skills (e.g., 'code-review' or 'category/helper')"),-})-export const SkillTool = Tool.define("skill", async (ctx) => {const skills = await Skill.all()@@ -28,6 +24,7 @@ export const SkillTool = Tool.define("skill", async (ctx) => {"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.",+ "Only the skills listed here are available:","<available_skills>",...accessibleSkills.flatMap((skill) => [` <skill>`,@@ -38,6 +35,16 @@ export const SkillTool = Tool.define("skill", async (ctx) => {"</available_skills>",].join(" ")+ const examples = accessibleSkills+ .map((skill) => `'${skill.name}'`)+ .slice(0, 3)+ .join(", ")+ const hint = examples.length > 0 ? ` (e.g., ${examples}, ...)` : ""++ const parameters = z.object({+ name: z.string().describe(`The skill identifier from available_skills${hint}`),+ })+return {description,parameters,