A spawned agent never loads SKILL.md, so the <skill-base-dir> token
Setup defines is undefined in the one context that must act on it
(review finding). Claude Code substitutes ${CLAUDE_PLUGIN_ROOT} inline
anywhere in plugin agent content, so the agents directory now gets its
own rewrite emitting the quoted variable form; the skill and reference
files keep the token, which the main thread's base-directory report
resolves.
Drafted with AI assistance, reviewed by a maintainer.
Co-authored-by: Cursor <cursoragent@cursor.com>
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.
The build now rewrites the plugin subtree's markdown after the copy:
- Every script instruction takes the quoted `node "<skill-base-dir>/
scripts/..."` form (quoted because the loaded plugin directory can
contain spaces), resolving against the base directory the runtime
reports, since no literal path works for plugins (CLAUDE_PLUGIN_ROOT
is hook-only).
- Setup step 1 loses its project-path fallback clause: a plugin install
has no working project fallback, that path being the bug itself.
- The `Bash(node .claude/skills/impeccable/scripts/*)` allowed-tools
entry is dropped rather than widened: a wildcard such as
`node */skills/impeccable/scripts/*` would auto-approve any
same-shaped path anywhere on disk (per review), and frontmatter has
no variable bound to the plugin root. Script runs go through the
normal Bash confirmation.
- A build-time guard fails build:release when SKILL.src.md's wording
drifts past the rewrite, when a node pre-approval reappears, or when
any project-relative scripts path survives in the plugin SKILL.md.
Drafted with AI assistance, reviewed by a maintainer.
Co-authored-by: Cursor <cursoragent@cursor.com>