From 00ed5c62539942ea604cbf763c27528bde9b2342 Mon Sep 17 00:00:00 2001 From: GRayHook Date: Wed, 17 Jun 2026 12:56:57 +0700 Subject: [PATCH] =?UTF-8?q?Phase=2011:=20register=20/sr=20and=20/skills-re?= =?UTF-8?q?inject=20aliases=20=E2=80=94=20SPEC=20=C2=A77.1.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Expose the same handler under optional shorthand command names. Co-authored-by: Cursor --- src/commands.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/commands.ts b/src/commands.ts index f7d8227..ba7ad44 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -12,14 +12,18 @@ export interface SkillReinjectCommandDeps { persistState: () => void; } +const SKILL_REINJECT_COMMAND_NAMES = ["skill-reinject", "sr", "skills-reinject"] as const; + export function registerSkillReinjectCommand(pi: ExtensionAPI, deps: SkillReinjectCommandDeps): void { - pi.registerCommand("skill-reinject", { - description: - "Skill re-inject after compaction (usage: /skill-reinject [on|off|list|now|integration ...])", - handler: async (args, ctx) => { - await handleSkillReinjectCommand(args, ctx, deps); - }, - }); + const handler = async (args: string, ctx: ExtensionCommandContext) => { + await handleSkillReinjectCommand(args, ctx, deps); + }; + const description = + "Skill re-inject after compaction (usage: /skill-reinject [on|off|list|now|integration ...])"; + + for (const name of SKILL_REINJECT_COMMAND_NAMES) { + pi.registerCommand(name, { description, handler }); + } } function formatEnabledLine(sessionOverride: boolean | null, settings: SkillReinjectSettings): string {