generated from nhcarrigan/template
feat: another wave of features #61
@@ -183,6 +183,47 @@ export const slashCommands: SlashCommand[] = [
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "skill",
|
||||
description: "Invoke a Claude Code skill from ~/.claude/skills/",
|
||||
usage: "/skill <name> <data>",
|
||||
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 <skill-name> <data>\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): {
|
||||
|
||||
Reference in New Issue
Block a user