The open source coding agent.
TypeScript
tweak: inform agent if no skills are available
Aiden Cline79c263494ff1
diff --git a/packages/opencode/src/session/system.ts b/packages/opencode/src/session/system.tsindex 429e696db3b..e10ee3bad30 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.tsindex 2503f76398b..b56276f61ef 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)