Phase 11: list and clear tracked skills — SPEC §7.1.
Show tracked skill names with sources on list; clear skills array without resetting session toggle. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -108,6 +108,14 @@ async function handleSkillReinjectCommand(
|
|||||||
handleGlobalToggle(trimmed, ctx);
|
handleGlobalToggle(trimmed, ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (subcommand === "list") {
|
||||||
|
showTrackedSkillsList(ctx, deps);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (subcommand === "clear") {
|
||||||
|
handleClearTrackedSkills(ctx, deps);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ctx.hasUI) {
|
if (ctx.hasUI) {
|
||||||
ctx.ui.notify(`skill-reinject: unknown subcommand "${subcommand}"`, "warning");
|
ctx.ui.notify(`skill-reinject: unknown subcommand "${subcommand}"`, "warning");
|
||||||
@@ -154,3 +162,26 @@ function handleGlobalToggle(args: string, ctx: ExtensionCommandContext): void {
|
|||||||
}
|
}
|
||||||
ctx.ui.notify(`skill-reinject: global ${action}`, "info");
|
ctx.ui.notify(`skill-reinject: global ${action}`, "info");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showTrackedSkillsList(ctx: ExtensionCommandContext, deps: SkillReinjectCommandDeps): void {
|
||||||
|
if (!ctx.hasUI) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (deps.state.skills.length === 0) {
|
||||||
|
ctx.ui.notify("skill-reinject: no tracked skills", "info");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const lines = deps.state.skills.map(
|
||||||
|
(skill) => `- ${skill.name} [${skill.sources.join(", ")}]`,
|
||||||
|
);
|
||||||
|
ctx.ui.notify(`tracked skills (${deps.state.skills.length}):\n${lines.join("\n")}`, "info");
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleClearTrackedSkills(ctx: ExtensionCommandContext, deps: SkillReinjectCommandDeps): void {
|
||||||
|
deps.state.skills = [];
|
||||||
|
deps.persistState();
|
||||||
|
if (!ctx.hasUI) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ctx.ui.notify("skill-reinject: cleared tracked skills", "info");
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user