Skip to content

Fix: stop the plugin subtree from running the project's skill copy (#523) - #535

Open
abdulwahabone wants to merge 4 commits into
mainfrom
fix/523-plugin-scripts-path
Open

Fix: stop the plugin subtree from running the project's skill copy (#523)#535
abdulwahabone wants to merge 4 commits into
mainfrom
fix/523-plugin-scripts-path

Conversation

@abdulwahabone

@abdulwahabone abdulwahabone commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Fixes #523.

The ./plugin subtree shipped 44 markdown instructions pointing at node .claude/skills/impeccable/scripts/..., a path inside the user's project: a plugin-only install got MODULE_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 (new scripts/lib/plugin-paths.js, called from build.js right after the plugin copy; .md files only, hook-admin.mjs keeps its project-scoped paths on purpose). The plugin copy drops the Bash(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) fails build:release if the source wording the rewrite keys on changes. Rebased on main and adapted to #544's base-directory Setup wording.

Validation: bun run test green, including the plugin loader E2E installing the rewritten subtree into a real sandboxed Claude Code; new tests/plugin-paths.test.js (10 tests); zero project-relative script paths remain in plugin markdown (was 44). The regenerated plugin/**/*.md files are included intentionally and rebuild byte-identically from bun run build:release.

Drafted with AI assistance; reviewed and submitted by a maintainer.

Made with Cursor

@github-actions github-actions Bot added waiting on contributor Waiting for the PR author to respond or make changes blocked: merge conflicts PR cannot merge until conflicts are resolved labels Aug 7, 2026
abdulwahabone and others added 3 commits August 10, 2026 14:40
)

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
abdulwahabone force-pushed the fix/523-plugin-scripts-path branch from 407c8fd to e4362ed Compare August 10, 2026 09:45
@abdulwahabone
abdulwahabone marked this pull request as ready for review August 10, 2026 09:46
@abdulwahabone
abdulwahabone requested a review from pbakaus as a code owner August 10, 2026 09:46
@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown

Greptile Summary

The 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 Bash(node ...) preapproval.

Confidence Score: 5/5

No 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.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the plugin-paths test suite and confirmed all 10 tests passed.
  • Compared the prior and current generated plugin frontmatter against the repository-controlled script path and noted that legacy checks were removed while only Bash(npx impeccable *) remains.
  • Built the project and verified the rewrite guard was preserved, with the build completing successfully.
  • Captured the validation script source and all observed command outputs as evidence and archived them for audit.
  • Recorded the before and after evidence records showing the configuration state changes, including the legacy flags and the limited tool set.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (2): Last reviewed commit: "Drop the node pre-approval from the plug..." | Re-trigger Greptile

Comment thread plugin/skills/impeccable/SKILL.md Outdated
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>
@github-actions github-actions Bot added ready to merge Passing, resolved, and ready for a maintainer merge decision blocked: merge conflicts PR cannot merge until conflicts are resolved needs maintainer review Ready for a maintainer to review or decide and removed blocked: merge conflicts PR cannot merge until conflicts are resolved waiting on contributor Waiting for the PR author to respond or make changes ready to merge Passing, resolved, and ready for a maintainer merge decision labels Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked: merge conflicts PR cannot merge until conflicts are resolved needs maintainer review Ready for a maintainer to review or decide

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dual install: the plugin runs the project's older skill copy without any warning (split from #496)

1 participant