Skip to content

Comments

Migrate Codex integration from bootstrap CLI to native skill discovery#430

Merged
arittr merged 10 commits intomainfrom
feat/codex-native-skills
Feb 6, 2026
Merged

Migrate Codex integration from bootstrap CLI to native skill discovery#430
arittr merged 10 commits intomainfrom
feat/codex-native-skills

Conversation

@arittr
Copy link
Collaborator

@arittr arittr commented Feb 6, 2026

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Summary by CodeRabbit

  • Documentation

    • Simplified install/uninstall: explicit clone, create/verify symlink or Windows junction, single-step update, and optional removal.
    • Rewrote guides to emphasize native skill discovery, updated personal-skill paths, and streamlined troubleshooting.
    • Removed the legacy bootstrap guide and related long-form bootstrap content.
  • Refactor

    • Migrated from bootstrap-led workflow to native discovery and removed the legacy interactive CLI launcher.

arittr and others added 5 commits February 5, 2026 16:00
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>
@arittr
Copy link
Collaborator Author

arittr commented Feb 6, 2026

This change is part of the following stack:

Change managed by git-spice.

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

This PR removes the Node.js superpowers CLI and bootstrap docs, and changes installation to a clone at ~/.codex/superpowers with a symlink/junction from ~/.agents/skills~/.codex/superpowers/skills, plus updated install/verify/update/uninstall instructions and Windows guidance.

Changes

Cohort / File(s) Summary
Installer & Install docs
.codex/INSTALL.md, docs/README.codex.md
Rewrote install flow to clone into ~/.codex/superpowers, create a symlink/junction from ~/.agents/skills~/.codex/superpowers/skills; added verification, update, uninstall steps and Windows PowerShell junction instructions; updated paths to use ~/.agents/skills.
Bootstrap CLI removal
.codex/superpowers-codex, .codex/superpowers-codex.cmd, .codex/superpowers-bootstrap.md
Deleted the Node.js interactive CLI script, removed the Windows .cmd launcher invocation, and removed the bootstrap documentation describing CLI usage, skill precedence, and bootstrap rules.
Skill docs update
skills/writing-skills/SKILL.md
Updated documentation path references from ~/.codex/skills to ~/.agents/skills in personal-skill guidance.

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

🐰 I hopped through folders, nudged links with care,
Bootstraps unburdened, skills found everywhere,
A symlink set, a junction made true,
Clean trees and tidy paths — hooray for the crew!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: migrating from a bootstrap CLI approach to native skill discovery in Codex integration.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/codex-native-skills

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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: Prefer fs.unlinkSync over shelling out to remove the stale symlink.

symlinkPath is constructed from controlled inputs so injection risk is minimal, but using fs.unlinkSync(symlinkPath) (or fs.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 unlinkSync is already imported at the top of the file, simply:

-        execSync(isWindows ? `rmdir "${symlinkPath}"` : `rm "${symlinkPath}"`);
+        unlinkSync(symlinkPath);

Note: You'll need to add unlinkSync to 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, text is 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>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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.

arittr and others added 2 commits February 5, 2026 17:03
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>
@arittr arittr merged commit a72e416 into main Feb 6, 2026
1 check passed
@iam-brain
Copy link

iam-brain commented Feb 6, 2026

   mkdir -p ~/.agents/skills
   ln -s ~/.codex/superpowers/skills ~/.agents/skills/superpowers

in f4db4a7 doesn't look right.. Was that intentional?

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