Phase 3: add detectSlashSkill — slash command detection per SPEC §6.2.
Detect /skill:name at the start of raw user input for the slash tracking source. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
/** Raw `/skill:name` at start of user input (SPEC §6.2 #1). */
|
||||||
|
const SLASH_SKILL_RE = /^\/skill:([a-z0-9-]+)/;
|
||||||
|
|
||||||
|
/** Returns skill name when text is a slash skill command, else null. */
|
||||||
|
export function detectSlashSkill(text: string): string | null {
|
||||||
|
const match = SLASH_SKILL_RE.exec(text);
|
||||||
|
return match?.[1] ?? null;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user