Migrate Codex integration from bootstrap CLI to native skill discovery#430
Migrate Codex integration from bootstrap CLI to native skill discovery#430
Conversation
The bootstrap CLI (superpowers-codex), Windows wrapper, and bootstrap content file are no longer needed — Codex now has native skill discovery that replaces this mechanism. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Creates symlink from ~/.agents/skills/superpowers to repo skills dir, updates ~/.codex/AGENTS.md with gatekeeper block, removes old bootstrap block if present. Windows junction fallback when symlinks are blocked. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two-step install: clone + run installer. Replaces the old manual setup that required editing AGENTS.md by hand. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replaces bootstrap CLI references with native discovery flow. Install is now clone + run installer. Documents tool mappings, personal skills path, and Windows junction fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
This change is part of the following stack: Change managed by git-spice. |
📝 WalkthroughWalkthroughThis PR removes the Node.js superpowers CLI and bootstrap docs, and changes installation to a clone at Changes
Sequence Diagram(s)(Skipped — changes are documentation and removal of a CLI; no new multi-component sequential flow requiring visualization.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In @.codex/install-codex.mjs:
- Line 16: Replace the manual pathname parsing when computing repoSkillsDir:
instead of calling resolve(new URL('.',
import.meta.url).pathname.replace(/^\/([A-Z]:)/i, '$1'), '..', 'skills'), use
url.fileURLToPath to convert the file URL to a platform-correct filesystem path;
call fileURLToPath(new URL('.', import.meta.url)) and pass that into resolve (or
path.resolve) and then '../skills' to build repoSkillsDir, ensuring
percent-encoded characters are decoded correctly on Windows and other platforms.
- Around line 146-156: The code can create duplicate gatekeeper blocks when
GATEKEEPER_BEGIN exists but GATEKEEPER_END is missing; update the logic around
content.indexOf(GATEKEEPER_BEGIN)/GATEKEEPER_END to detect endIdx === -1 or
endIdx <= beginIdx and handle it explicitly: either remove the orphaned
GATEKEEPER_BEGIN marker (slice out the begin marker and then insert
GATEKEEPER_BLOCK) or log/warn and replace from the orphan begin through
insertion of GATEKEEPER_BLOCK, then writeFileSync(agentsMdPath, content, 'utf8')
and return; ensure you reference GATEKEEPER_BEGIN, GATEKEEPER_END,
GATEKEEPER_BLOCK, content, agentsMdPath, and writeFileSync when making the fix.
- Line 193: The printed update instruction is hardcoded to
"~/.codex/superpowers" while the script computes repoSkillsDir dynamically;
update the console.log so it derives the actual repo root from repoSkillsDir (or
its parent) and prints that path instead of the hardcoded string, referencing
the repoSkillsDir variable and the console.log('To update: cd
~/.codex/superpowers && git pull') call so users see the correct clone location.
🧹 Nitpick comments (2)
.codex/install-codex.mjs (1)
55-55: Preferfs.unlinkSyncover shelling out to remove the stale symlink.
symlinkPathis constructed from controlled inputs so injection risk is minimal, but usingfs.unlinkSync(symlinkPath)(orfs.rmSync(symlinkPath)) is simpler, avoids spawning a shell, and sidesteps platform-specific command differences.Proposed fix
- execSync(isWindows ? `rmdir "${symlinkPath}"` : `rm "${symlinkPath}"`); + const { unlinkSync } = await import('fs'); // already imported at top + unlinkSync(symlinkPath);Since
unlinkSyncis already imported at the top of the file, simply:- execSync(isWindows ? `rmdir "${symlinkPath}"` : `rm "${symlinkPath}"`); + unlinkSync(symlinkPath);Note: You'll need to add
unlinkSyncto the import on line 7.docs/README.codex.md (1)
44-46: Add a language specifier to the fenced code block.Static analysis (MD040) flags this block for missing a language identifier. Since it's a plain-text path illustration,
textis appropriate.-``` +```text ~/.agents/skills/superpowers/ → ~/.codex/superpowers/skills/</blockquote></details> </blockquote></details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
- INSTALL.md: add prerequisites, Windows note, verify step, clone deletion in uninstall - README.codex.md: fix Windows section (junctions not symlinks), add description field guidance, consistent terminology - install-codex.mjs: accurate link type labels (symlink vs junction) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.codex/INSTALL.md:
- Around line 24-52: The uninstall section in INSTALL.md only lists the Unix `rm
~/.agents/skills/superpowers` command; add Windows-specific removal instructions
so junctions are removed correctly: update the uninstall block in
.codex/INSTALL.md to keep the existing Unix `rm ~/.agents/skills/superpowers`
line and append a small “Windows” note showing the equivalent PowerShell and cmd
commands for removing the junction (e.g., Remove-Item
"$env:USERPROFILE\.agents\skills\superpowers" and rmdir
%USERPROFILE%\.agents\skills\superpowers) and label them as PowerShell/cmd so
Windows users can uninstall correctly.
In `@docs/README.codex.md`:
- Around line 44-46: Update the Markdown fenced code block that currently
contains "~/.agents/skills/superpowers/ → ~/.codex/superpowers/skills/" to
include a language identifier (e.g., text or bash) after the opening backticks
so markdownlint MD040 is satisfied; locate the fenced block in
docs/README.codex.md and change the opening fence from ``` to ```text (or
```bash) to provide proper highlighting and resolve the warning.
Use fileURLToPath() instead of manual URL pathname parsing to correctly handle paths with spaces and special characters on all platforms. Replace execSync rm/rmdir with fs.unlinkSync for stale symlink removal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.codex/install-codex.mjs:
- Around line 47-67: The existsSync check can miss dangling symlinks; replace
the existsSync(...) gate with a try/catch that calls lstatSync(symlinkPath) to
detect any filesystem entry (including broken links), then run the existing
logic (stat.isSymbolicLink(), readlinkSync, resolve compare, unlinkSync, etc.)
inside that try block; on lstatSync throwing ENOENT continue to create the
symlink, and for any other lstatSync error log the error and exit (preserving
the existing error messages and process.exit paths).
Testing showed native skill discovery works without the AGENTS.md gatekeeper — using-superpowers bootstraps itself via SKILL.md frontmatter. Install is now just clone + symlink, driven by INSTALL.md. No Node.js dependency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@docs/README.codex.md`:
- Around line 92-98: Update the "Uninstalling" section to include Windows
equivalents for removing the junction and optional clone alongside the existing
Unix `rm` examples: add PowerShell instructions using Remove-Item for the
junction path (with recursive/force flags) and cmd instructions using rmdir
(with /S /Q) for the clone directory, and mention the Windows junction path
equivalent to ~/.agents/skills/superpowers so Windows users can remove both the
link and the repository copy.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
~/.codex/skills/ is deprecated; Codex uses ~/.agents/skills/ via native discovery. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
in f4db4a7 doesn't look right.. Was that intentional? |
Migrate Codex integration from bootstrap CLI to native skill discovery
Remove bootstrap CLI and related files
The bootstrap CLI (superpowers-codex), Windows wrapper, and bootstrap
content file are no longer needed — Codex now has native skill discovery
that replaces this mechanism.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Add minimal Codex installer for native skill discovery
Creates symlink from ~/.agents/skills/superpowers to repo skills dir,
updates ~/.codex/AGENTS.md with gatekeeper block, removes old bootstrap
block if present. Windows junction fallback when symlinks are blocked.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Rewrite INSTALL.md for native skill discovery
Two-step install: clone + run installer. Replaces the old manual
setup that required editing AGENTS.md by hand.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Rewrite Codex docs for native skill discovery
Replaces bootstrap CLI references with native discovery flow.
Install is now clone + run installer. Documents tool mappings,
personal skills path, and Windows junction fallback.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Motivation and Context
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context
Summary by CodeRabbit
Documentation
Refactor