Skip to content

fix(kiro): don't rewrite absolute paths as slash command skill refs#1171

Merged
tmchow merged 4 commits into
EveryInc:mainfrom
LukeTheoJohnson:fix-kiro-absolute-path-transform
Jul 21, 2026
Merged

fix(kiro): don't rewrite absolute paths as slash command skill refs#1171
tmchow merged 4 commits into
EveryInc:mainfrom
LukeTheoJohnson:fix-kiro-absolute-path-transform

Conversation

@LukeTheoJohnson

Copy link
Copy Markdown
Contributor

Problem

transformContentForKiro turns slash-command references like /workflows:plan into "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:

Read /etc/hosts and /usr/local/bin/tool  ->  Read the etc skill/hosts and the usr skill/local/bin/tool
/tmp/out.md                              ->  the tmp skill/out.md
/var/log/app.log                         ->  the var skill/log/app.log

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:plan still convert.

Tests

New case in tests/kiro-converter.test.ts asserting /etc/hosts, /usr/local/bin/tool, and /tmp/out.md survive 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 --noEmit clean.

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.
@LukeTheoJohnson LukeTheoJohnson changed the title fix(kiro): don't rewrite absolute paths as slash-command skill refs fix(kiro): don't rewrite absolute paths as slash command skill refs Jul 17, 2026
@LukeTheoJohnson
LukeTheoJohnson marked this pull request as ready for review July 17, 2026 21:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/converters/claude-to-kiro.ts Outdated
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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/converters/claude-to-kiro.ts Outdated
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/converters/claude-to-kiro.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/converters/claude-to-kiro.ts Outdated
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 "`".
@LukeTheoJohnson
LukeTheoJohnson force-pushed the fix-kiro-absolute-path-transform branch from c79dab5 to d39f4be Compare July 17, 2026 23:18
@tmchow
tmchow merged commit 11e3d46 into EveryInc:main Jul 21, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants