feat(cli): improve skill enablement/disablement verbiage (#17192)

This commit is contained in:
N. Taylor Mullen
2026-01-21 09:39:37 -08:00
committed by GitHub
parent d0cae4547e
commit 80069b4a78
2 changed files with 36 additions and 7 deletions

View File

@@ -234,7 +234,34 @@ describe('skillsCommand', () => {
expect(context.ui.addItem).toHaveBeenCalledWith(
expect.objectContaining({
type: MessageType.INFO,
text: 'Skill "skill1" disabled by adding it to the disabled list in workspace (/workspace) settings. Use "/skills reload" for it to take effect.',
text: 'Skill "skill1" disabled by adding it to the disabled list in workspace (/workspace) settings. You can run "/skills reload" to refresh your current instance.',
}),
);
});
it('should show reload guidance even if skill is already disabled', async () => {
const disableCmd = skillsCommand.subCommands!.find(
(s) => s.name === 'disable',
)!;
(
context.services.settings as unknown as { merged: MergedSettings }
).merged = createTestMergedSettings({
skills: { enabled: true, disabled: ['skill1'] },
});
(
context.services.settings as unknown as {
workspace: { settings: { skills: { disabled: string[] } } };
}
).workspace.settings = {
skills: { disabled: ['skill1'] },
};
await disableCmd.action!(context, 'skill1');
expect(context.ui.addItem).toHaveBeenCalledWith(
expect.objectContaining({
type: MessageType.INFO,
text: 'Skill "skill1" is already disabled. You can run "/skills reload" to refresh your current instance.',
}),
);
});
@@ -269,7 +296,7 @@ describe('skillsCommand', () => {
expect(context.ui.addItem).toHaveBeenCalledWith(
expect.objectContaining({
type: MessageType.INFO,
text: 'Skill "skill1" enabled by removing it from the disabled list in workspace (/workspace) and user (/user/settings.json) settings. Use "/skills reload" for it to take effect.',
text: 'Skill "skill1" enabled by removing it from the disabled list in workspace (/workspace) and user (/user/settings.json) settings. You can run "/skills reload" to refresh your current instance.',
}),
);
});
@@ -308,7 +335,7 @@ describe('skillsCommand', () => {
expect(context.ui.addItem).toHaveBeenCalledWith(
expect.objectContaining({
type: MessageType.INFO,
text: 'Skill "skill1" enabled by removing it from the disabled list in workspace (/workspace) and user (/user/settings.json) settings. Use "/skills reload" for it to take effect.',
text: 'Skill "skill1" enabled by removing it from the disabled list in workspace (/workspace) and user (/user/settings.json) settings. You can run "/skills reload" to refresh your current instance.',
}),
);
});

View File

@@ -112,8 +112,9 @@ async function disableAction(
result,
(label, path) => `${label} (${path})`,
);
if (result.status === 'success') {
feedback += ' Use "/skills reload" for it to take effect.';
if (result.status === 'success' || result.status === 'no-op') {
feedback +=
' You can run "/skills reload" to refresh your current instance.';
}
context.ui.addItem({
@@ -153,8 +154,9 @@ async function enableAction(
result,
(label, path) => `${label} (${path})`,
);
if (result.status === 'success') {
feedback += ' Use "/skills reload" for it to take effect.';
if (result.status === 'success' || result.status === 'no-op') {
feedback +=
' You can run "/skills reload" to refresh your current instance.';
}
context.ui.addItem({