generated from nhcarrigan/template
feat: list available skills when running /skill with no args
- Add list_skills Tauri command to scan ~/.claude/skills/ - Only lists directories containing a SKILL.md file - Show helpful message when no skills are found - Display bullet-point list of available skills with usage hint
This commit is contained in:
@@ -186,7 +186,7 @@ export const slashCommands: SlashCommand[] = [
|
||||
{
|
||||
name: "skill",
|
||||
description: "Invoke a Claude Code skill from ~/.claude/skills/",
|
||||
usage: "/skill <name> <data>",
|
||||
usage: "/skill [name] [data]",
|
||||
execute: async (args: string) => {
|
||||
const conversationId = get(claudeStore.activeConversationId);
|
||||
if (!conversationId) {
|
||||
@@ -198,11 +198,25 @@ export const slashCommands: SlashCommand[] = [
|
||||
const skillName = parts[0];
|
||||
const skillData = parts.slice(1).join(" ");
|
||||
|
||||
// If no skill name provided, list available skills
|
||||
if (!skillName) {
|
||||
claudeStore.addLine(
|
||||
"error",
|
||||
"Usage: /skill <skill-name> [data]\nSkills are loaded from ~/.claude/skills/<skill-name>/SKILL.md\nExample: /skill onboard-mentee Discord ID: 123, GitHub: username"
|
||||
);
|
||||
try {
|
||||
const skills = await invoke<string[]>("list_skills");
|
||||
if (skills.length === 0) {
|
||||
claudeStore.addLine(
|
||||
"system",
|
||||
"No skills found in ~/.claude/skills/\nCreate a skill by adding a folder with a SKILL.md file."
|
||||
);
|
||||
} else {
|
||||
const skillList = skills.map((s) => ` • ${s}`).join("\n");
|
||||
claudeStore.addLine(
|
||||
"system",
|
||||
`Available skills:\n${skillList}\n\nUsage: /skill <skill-name> [data]`
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
claudeStore.addLine("error", `Failed to list skills: ${error}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user