Repository navigation
fix(hooks): widen track-slash regex to match SKILL_NAME_REGEX - #737
Merged
jeff-r2026 merged 1 commit intoSep 23, 2026
Merged
Conversation
The trackSlashHandler extracted the slash-command skill name with
`/^\/([\w-]+)/`, which does not match dots (`.`) or colons (`:`) —
both valid per `SKILL_NAME_REGEX` (`/^[a-zA-Z0-9_\-:.]{1,200}$/`).
A user invoking `/org.setup` or `/ns:deploy` had the name silently
truncated to `org` or `ns`, so the wrong (or nonexistent) skill was
tracked.
The CLI counterpart `trackSlashCommand` (usage-tracker.ts) already
uses the full `[a-zA-Z0-9_\-:.]+` set. Align the hook handler.
|
Findings
The regex change itself correctly covers |
Walternater
pushed a commit
to Walternater/teamai-cli
that referenced
this pull request
Nov 2, 2026
…t#737) The trackSlashHandler extracted the slash-command skill name with `/^\/([\w-]+)/`, which does not match dots (`.`) or colons (`:`) — both valid per `SKILL_NAME_REGEX` (`/^[a-zA-Z0-9_\-:.]{1,200}$/`). A user invoking `/org.setup` or `/ns:deploy` had the name silently truncated to `org` or `ns`, so the wrong (or nonexistent) skill was tracked. The CLI counterpart `trackSlashCommand` (usage-tracker.ts) already uses the full `[a-zA-Z0-9_\-:.]+` set. Align the hook handler.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
trackSlashHandlerhook handler extracted slash-command skill names with the regex[\w-]+([a-zA-Z0-9_-]+), which does not match dots (.) or colons (:) — both of which are valid skill name characters perSKILL_NAME_REGEXin types.ts (/^[a-zA-Z0-9_\-:.]{1,200}$/).A user invoking
/org.setuphad the skill name silently truncated toorg, and/ns:deploytons. The wrong (or nonexistent) skill was tracked, while the intended skill received no usage event.The CLI counterpart
trackSlashCommandin usage-tracker.ts already uses the full[a-zA-Z0-9_\-:.]+character class. This PR aligns the hook handler's regex to match.Before:
/org.setup args→ tracks skillorg(truncated at the dot)After:
/org.setup args→ tracks skillorg.setup(full name)Test plan
tracks a skill name that contains a dot— fails before, passes aftertracks a skill name that contains a colon— fails before, passes afterEnd-to-end verification (CLI build):
Build produces a clean
dist/index.jsbundle; the two new tests exercise the handler throughbuildHandlerRegistry()→handler.execute()with realappendUsageEvent/updateKnownSkillscalls, confirming the regex captures the full dotted/colon skill name end-to-end.Found by a defect-hunting pipeline I build and run (Dev-next-gen), using Claude Code with Anthropic's Claude Opus 5.