Skills install scope - #174
Conversation
|
@codex review |
🦋 Changeset detectedLatest commit: 4bf4dbd The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
72b6438 to
32fa6cf
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 72b6438518
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ]; | ||
| if (usesClaude(cwd)) { | ||
| const skillRoot = `.claude/skills/${skill.name}`; | ||
| for (const skillRoot of projectSkillRoots(cwd, skill.name)) { |
There was a problem hiding this comment.
Validate the universal root before clearing its sentinel
When a checkout contains .agents/skills/bunny-cli as a symlink to a directory outside the project, this newly unconditional loop passes it to writeSkillFiles, which executes rmSync(root/SKILL.md) before the first assertWriteWithin check. Consequently, bunny skills install can delete an external SKILL.md and only then reject the symlink; validate the root or sentinel path before removing it.
AGENTS.md reference: AGENTS.md:L1370-L1370
Useful? React with 👍 / 👎.
| for (const skillRoot of [ | ||
| `${UNIVERSAL_SKILL_DIR}/${name}`, | ||
| `.claude/skills/${name}`, |
There was a problem hiding this comment.
Preserve global skills during home-directory project removal
When the current directory is the user's home and a legitimate global installation exists, default bunny skills remove resolves this newly added project root to ~/.agents/skills/<name> and deletes it even though --global was not requested. Project installs into the home directory are now refused, and older project installs never wrote .agents/skills, so removing this path there can only erase the global installation; skip this root when cwd is home or require global scope.
AGENTS.md reference: AGENTS.md:L1371-L1371
Useful? React with 👍 / 👎.
writeSkillFiles removed root/SKILL.md before any boundary check, so a checkout with .agents/skills/<name> symlinked outside the project could get an external SKILL.md deleted on the way to the symlink being rejected. The project install now always walks that root, which widened the exposure, so the sentinel path is validated before it is removed. Scopeless removal in the home directory resolved the project roots to ~/.agents/skills/<name> and ~/.claude/skills/<name>, which are the global install, and deleted them without --global. It now strips only the AGENTS.md block there, which is the one home artifact --global cannot reach.
No description provided.