Fix: stop the plugin subtree from running the project's skill copy (#523) - #535
Open
abdulwahabone wants to merge 4 commits into
Open
Fix: stop the plugin subtree from running the project's skill copy (#523)#535abdulwahabone wants to merge 4 commits into
abdulwahabone wants to merge 4 commits into
Conversation
) The ./plugin subtree copied dist/claude-code output verbatim, so its 44 markdown instructions said `node .claude/skills/impeccable/scripts/...`, a path inside the user's project. A plugin-only install got MODULE_NOT_FOUND; a dual install silently ran the project's older skill copy with zero indication anything was wrong. There is no literal path that works for plugins (CLAUDE_PLUGIN_ROOT is hook-only), so the build now rewrites the plugin subtree's markdown to the `<skill-base-dir>` form SKILL.md already carried as a fallback, and scopes the allowed-tools rule to `Bash(node */skills/impeccable/scripts/*)` so it pre-approves the skill's own install path instead of the project's. Drafted with AI assistance, reviewed by a maintainer. Co-authored-by: Cursor <cursoragent@cursor.com>
The parenthetical and allowed-tools replacements key on exact source text; a reworded SKILL.src.md would make them silently no-op. The build now verifies the rewritten plugin SKILL.md carries the <skill-base-dir> definition and the install-path allowed-tools rule, and stops otherwise. Drafted with AI assistance, reviewed by a maintainer. Co-authored-by: Cursor <cursoragent@cursor.com>
PR #544 moved SKILL.src.md's Setup step 1 to lead with <skill-base-dir> and name the project path as the fallback, so the parenthetical the rewrite keyed on no longer exists. The rewrite now swaps the fallback sentence instead: a plugin install has no working project fallback, and every instruction in the plugin copy already carries the token. AI-assisted change, reviewed by a maintainer. Co-authored-by: Cursor <cursoragent@cursor.com>
abdulwahabone
force-pushed
the
fix/523-plugin-scripts-path
branch
from
August 10, 2026 09:45
407c8fd to
e4362ed
Compare
abdulwahabone
marked this pull request as ready for review
August 10, 2026 09:46
Greptile SummaryThe plugin now runs bundled helpers from its loaded skill directory and removes the broad Node-script permission. The previously reported wildcard permission issue was disproved by executing the same matching repository-controlled script path against the current generated plugin: its frontmatter contains no Confidence Score: 5/5No blocking failure remains. The matching repository-controlled script path was exercised against the current plugin configuration, which contains no Node-script preapproval; focused rewrite tests and the plugin-generating build also completed successfully.
What T-Rex did
Reviews (2): Last reviewed commit: "Drop the node pre-approval from the plug..." | Re-trigger Greptile |
Greptile's review proved Bash(node */skills/impeccable/scripts/*) auto-approves any same-shaped path anywhere on disk, and no frontmatter rule can bind approval to the loaded plugin root. The plugin ships no node pre-approval; script runs go through the normal Bash confirmation. AI-assisted change, reviewed by a maintainer. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #523.
The
./pluginsubtree shipped 44 markdown instructions pointing atnode .claude/skills/impeccable/scripts/..., a path inside the user's project: a plugin-only install gotMODULE_NOT_FOUND, and a dual install silently ran the project's older skill copy.The build now rewrites the plugin subtree's markdown to the
node <skill-base-dir>/scripts/...form (newscripts/lib/plugin-paths.js, called frombuild.jsright after the plugin copy;.mdfiles only,hook-admin.mjskeeps its project-scoped paths on purpose). The plugin copy drops theBash(node ...)pre-approval entirely: no frontmatter rule can bind approval to the loaded plugin root, and a wildcard pattern would auto-approve same-shaped paths outside the plugin, so script runs go through the normal Bash confirmation. A drift guard (verifyPluginSkillRewrite) failsbuild:releaseif the source wording the rewrite keys on changes. Rebased on main and adapted to #544's base-directory Setup wording.Validation:
bun run testgreen, including the plugin loader E2E installing the rewritten subtree into a real sandboxed Claude Code; newtests/plugin-paths.test.js(10 tests); zero project-relative script paths remain in plugin markdown (was 44). The regeneratedplugin/**/*.mdfiles are included intentionally and rebuild byte-identically frombun run build:release.Drafted with AI assistance; reviewed and submitted by a maintainer.
Made with Cursor