Skip to content

fix(codex): convert /gsd- workflow commands to $gsd- during installation#1994

Merged
trek-e merged 1 commit intogsd-build:mainfrom
LakshmanTurlapati:fix/codex-command-prefix-conversion
Apr 10, 2026
Merged

fix(codex): convert /gsd- workflow commands to $gsd- during installation#1994
trek-e merged 1 commit intogsd-build:mainfrom
LakshmanTurlapati:fix/codex-command-prefix-conversion

Conversation

@LakshmanTurlapati
Copy link
Copy Markdown
Contributor

Fix PR


Linked Issue

Fixes #1993


What was broken

When running GSD inside Codex, workflow chat output (Next Up blocks, phase completion messages) displayed /gsd- prefixed commands instead of the correct $gsd- prefix. Users could not copy-paste suggested commands directly.

What this fix does

Extends the Codex installation-time conversion to also handle hyphen-style command references (/gsd-command$gsd-command) and strips /clear references that have no Codex equivalent.

Root cause

convertSlashCommandsToCodexSkillMentions() in bin/install.js only converted colon-style skill invocations (/gsd:command$gsd-command) but not hyphen-style references (/gsd-command) used throughout all workflow output templates. The /clear command was also left unconverted.

Testing

How I verified the fix

  • All 2,741 existing tests pass
  • 5 new regression tests added covering: hyphen-style conversion, backtick-wrapped commands, file path exclusion, and /clear removal (both backtick-wrapped and bare)

Regression test added?

  • Yes — added 5 tests that would have caught this bug

Platforms tested

  • macOS
  • Windows (including backslash path handling)
  • Linux
  • N/A (not platform-specific)

Runtimes tested

  • Claude Code
  • Gemini CLI
  • OpenCode
  • Other: Codex (the affected runtime)

Checklist

  • Issue linked above with Fixes #1993
  • Linked issue has the confirmed-bug label
  • Fix is scoped to the reported bug — no unrelated changes included
  • Regression test added (or explained why not)
  • All existing tests pass (npm test)
  • CHANGELOG.md updated if this is a user-facing fix
  • No unnecessary dependencies added

Breaking changes

None

The convertSlashCommandsToCodexSkillMentions function only converted
colon-style skill invocations (/gsd:command) but not hyphen-style
command references (/gsd-command) used in workflow output templates
(Next Up blocks, phase completion messages, etc.). This caused Codex
users to see /gsd- prefixed commands instead of $gsd- in chat output.

- Add regex to convert /gsd-command → $gsd-command with negative
  lookbehind to exclude file paths (e.g. bin/gsd-tools.cjs)
- Strip /clear references in Codex output (no Codex equivalent)
- Add 5 regression tests covering command conversion, path
  preservation, and /clear removal

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@trek-e trek-e left a comment

Choose a reason for hiding this comment

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

Review: APPROVE

Summary

Correct fix for the Codex /gsd- prefix conversion gap. The negative lookbehind (?<![a-zA-Z0-9./]) correctly excludes file path segments like bin/gsd-tools.cjs while converting slash-command references like /gsd-discuss-phase.

Test coverage

5 new regression tests in codex-config.test.cjs cover:

  • Hyphen-style command conversion
  • Backtick-wrapped commands
  • File path exclusion (non-regression)
  • /clear removal (bare and backtick-wrapped)

Tests follow project conventions.

One minor observation

The /clear removal regex handles three cases (backtick-wrapped with trailing text, bare with trailing text, standalone line). The order matters — backtick+trailing is handled before bare+trailing, which is correct. No issues.

No blocking issues

@trek-e trek-e added the review: approved PR reviewed and approved by maintainer label Apr 10, 2026
@trek-e trek-e merged commit d0ab1d8 into gsd-build:main Apr 10, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: approved PR reviewed and approved by maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(codex): workflow output shows /gsd- prefix instead of $gsd- in Codex

2 participants