diff --git a/src/lib/commands/slashCommands.ts b/src/lib/commands/slashCommands.ts index cf83a7b..185f03f 100644 --- a/src/lib/commands/slashCommands.ts +++ b/src/lib/commands/slashCommands.ts @@ -183,6 +183,47 @@ export const slashCommands: SlashCommand[] = [ } }, }, + { + name: "skill", + description: "Invoke a Claude Code skill from ~/.claude/skills/", + usage: "/skill ", + execute: async (args: string) => { + const conversationId = get(claudeStore.activeConversationId); + if (!conversationId) { + claudeStore.addLine("error", "No active conversation"); + return; + } + + const parts = args.trim().split(/\s+/); + const skillName = parts[0]; + const skillData = parts.slice(1).join(" "); + + if (!skillName) { + claudeStore.addLine( + "error", + "Usage: /skill \nExample: /skill onboard-mentee Discord ID: 123, GitHub: username" + ); + return; + } + + try { + claudeStore.addLine("system", `Invoking skill: ${skillName}`); + characterState.setState("thinking"); + + const message = skillData + ? `Please run the /${skillName} skill with the following data:\n\n${skillData}` + : `Please run the /${skillName} skill.`; + + await invoke("send_prompt", { + conversationId, + message, + }); + } catch (error) { + claudeStore.addLine("error", `Failed to invoke skill: ${error}`); + characterState.setTemporaryState("error", 3000); + } + }, + }, ]; export function parseSlashCommand(input: string): {