From d59daa3c4c823c4d38613ee64e6c25207fdfaba3 Mon Sep 17 00:00:00 2001 From: ruv Date: Fri, 2 Oct 2026 16:31:23 -0400 Subject: [PATCH] fix(ruflo-console): skills add checks the listed name without case (the CLI lowercases on install) Co-Authored-By: RuFlo --- plugins/ruflo-console/hooks/skills.ts | 3 ++- plugins/ruflo-console/tests/skills.spec.ts | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/ruflo-console/hooks/skills.ts b/plugins/ruflo-console/hooks/skills.ts index 5750cbba4d..43bb7ac27b 100644 --- a/plugins/ruflo-console/hooks/skills.ts +++ b/plugins/ruflo-console/hooks/skills.ts @@ -150,7 +150,8 @@ function change(state: State, host: Host, label: string, argv: readonly string[] } } -const isIn = (name: string, scope: Scope) => (installed: InstalledSkill[]) => installed.some(skill => skill.name === name && skill.scope === scope) +/** The CLI lowercases a skill's folder name on install, so a listed name is matched without case. */ +const isIn = (name: string, scope: Scope) => (installed: InstalledSkill[]) => installed.some(skill => skill.name.toLowerCase() === name.toLowerCase() && skill.scope === scope) export function addSpec(state: State, host: Host, found: FoundSkill, scope: Scope): ActionSpec | null { const id = skillIdOf(found.id) diff --git a/plugins/ruflo-console/tests/skills.spec.ts b/plugins/ruflo-console/tests/skills.spec.ts index ad105783f6..be5523fa80 100644 --- a/plugins/ruflo-console/tests/skills.spec.ts +++ b/plugins/ruflo-console/tests/skills.spec.ts @@ -146,19 +146,20 @@ describe('the skills actions', () => { return argv[3] === 'ls' ? { exitCode: 0, stdout: argv.includes('-g') ? '[]' : JSON.stringify(isAdded ? [{ name: 'tdd', path: '/work/.agents/skills/tdd', scope: 'project', agents: ['Claude Code'] }] : []), stderr: '' } : { exitCode: 0, stdout: 'Installed tdd\n', stderr: '' } }) - const spec = addSpec(state, host, { id: 'mattpocock/skills@tdd' }, 'project') + // Listed lowercase, as the CLI installs it: the check still finds it. + const spec = addSpec(state, host, { id: 'mattpocock/skills@TDD' }, 'project') runner.ask(spec, '') - expect(state.pending?.shows).toBe('npx -y skills add mattpocock/skills@tdd -y') + expect(state.pending?.shows).toBe('npx -y skills add mattpocock/skills@TDD -y') expect(runs).toEqual([]) await runner.confirm() for (let i = 0; i < 20 && state.skills.busy !== null; i++) await settle() await settle() - expect(runs[0]).toEqual(['npx', '-y', 'skills', 'add', 'mattpocock/skills@tdd', '-y']) + expect(runs[0]).toEqual(['npx', '-y', 'skills', 'add', 'mattpocock/skills@TDD', '-y']) expect(runs.slice(1).map(argv => argv[3])).toEqual(['ls', 'ls']) - expect(state.outcome).toMatchObject({ label: 'add skill mattpocock/skills@tdd to this project', ok: true, verified: 'yes' }) + expect(state.outcome).toMatchObject({ label: 'add skill mattpocock/skills@TDD to this project', ok: true, verified: 'yes' }) expect(state.skills.last?.label).toBe(state.outcome?.label) })