fix(kiro): don't rewrite absolute paths as slash command skill refs#1171
Conversation
The Kiro slash-command transform matched any /word, so absolute paths and URLs like /etc/hosts became "the etc skill/hosts". Add the same path-token allowlist (dev/tmp/etc/usr/var/bin/home) that the copilot, pi, codex and droid converters already carry.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 363bc1c856
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codex review flagged that the seven-name allowlist still corrupts absolute paths whose root sits outside it — /Users/... became "the users skill/..." and /private/tmp became "the private skill/tmp" (both appear in the repo's own content). Add the trailing-delimiter lookahead the copilot/pi/codex converters already use so the slash-command transform only fires when a token is followed by whitespace/punctuation/end. Any multi-segment path is now left verbatim regardless of root, since its first segment is followed by "/". The allowlist stays to guard bare single-segment roots like "/etc".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dce153b0a1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The positive-delimiter lookahead from the previous commit omitted ; ! ?, so "/workflows:plan; then /workflows:work" and "/ce:review!" stopped converting (Codex review). Replace it with a negative lookahead that rejects only a following word char or "/", so every sentence punctuation counts as a delimiter again while multi-segment paths stay verbatim. Excluding the whole word-char set (not just "/") also keeps the match atomic — the greedy token can't backtrack to a shorter prefix like /etc -> /et to satisfy the lookahead.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b84dbb0ef0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c79dab5956
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The trailing negative lookahead corrupted backticked namespaced commands:
"Run `/ce-plan`: ..." matched without its closing backtick (":" is in the
lookahead's exclusion set, forcing the optional backtick to be given back),
leaving a stray "the ce-plan skill`:" (Codex review). Drop the lookahead
entirely — capture the token greedily and check the trailing char in the
callback: a token directly followed by "/" (and not backtick-closed) is a
path and is left verbatim, everything else converts. This also fixes
backticked absolute paths like `/Users/foo`, and removes the whole class of
regex-backtracking traps around ":" and "`".
c79dab5 to
d39f4be
Compare
Problem
transformContentForKiroturns slash-command references like/workflows:planinto "the workflows-plan skill". The regex matches any/word, so absolute filesystem paths and URLs in agent bodies, generated command-skills, and steering files get rewritten too:Root cause
The copilot, pi, codex, and droid converters all guard this transform with a small allowlist of common path roots so absolute paths are left alone. Kiro's copy of the transform (
src/converters/claude-to-kiro.ts) is the one missing that guard.Fix
Add the same allowlist (
dev,tmp,etc,usr,var,bin,home) the sibling converters already use. A/etc/...path is now left verbatim, while real command refs like/workflows:planstill convert.Tests
New case in
tests/kiro-converter.test.tsasserting/etc/hosts,/usr/local/bin/tool, and/tmp/out.mdsurvive the transform. It fails before the change (paths become "the etc skill/...") and passes after. The existing slash-command test and the rest of the kiro suite stay green (33/33).tsc --noEmitclean.