summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2026-01-21 11:08:04 -0600
committerAiden Cline <[email protected]>2026-01-21 11:08:28 -0600
commitab3d412a817ea6570a7d260705d77efefc44550b (patch)
treec43ad5cd5eb35743f294828550a676df64cc9919
parent0e1a8a1839f647dca41eae1be66c451b54338c74 (diff)
downloadopencode-ab3d412a817ea6570a7d260705d77efefc44550b.tar.gz
opencode-ab3d412a817ea6570a7d260705d77efefc44550b.zip
tweak: adjust skill tool description to make it more clear which skills are available
-rw-r--r--packages/opencode/src/skill/skill.ts1
-rw-r--r--packages/opencode/src/tool/skill.ts15
2 files changed, 11 insertions, 5 deletions
diff --git a/packages/opencode/src/skill/skill.ts b/packages/opencode/src/skill/skill.ts
index 6ae0e9fe8..12fc9ee90 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.ts
index 386abdae7..9536685ef 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,