Skill/command documentation examples using `!`cmd`` syntax are live-executed on load

Status Closed — not planned
Maintainer reply None cached
Activity 1 comment · opened Sep 12, 2026 · closed Sep 12, 2026

Summary

Loading a skill (or slash command) whose Markdown body contains the literal bash-execution
syntax ` !command ` — used purely as a documentation example of that syntax, not as an
actual instruction — causes the harness to execute it as a real command.

Repro

  1. Invoke the built-in plugin-dev:command-development skill (ships with the official

claude-plugins-official marketplace, plugin-dev plugin).

  1. Its SKILL.md and several references/*.md files illustrate the frontmatter bash-execution

feature with lines like:
``
Run tests: !
npm test $1
``
intended purely as documentation of the syntax for someone authoring a different command.

  1. On load, the harness parses ` !npm test $1 ` and executes it for real in the current

working directory.

Observed impact

In a non-Node working directory (a git worktree with no package.json), this produced a real,
user-visible shell error:

npm error code ENOENT
npm error path .../package.json

The user had done nothing to trigger npm test — it fired purely from loading the skill's own
documentation.

Why this is surprising

Slash-command authors reasonably expect that showing ` !cmd as a *quoted example* inside
prose (e.g. inside a fenced code block, or after "Run tests:") is inert — the same way a
markdown file can safely contain the literal text
rm -rf /` in a code sample without it running.
Instead, execution appears to trigger on any occurrence of the pattern in loaded content,
regardless of whether it's inside a fenced code block, a quoted example, or genuine live command
substitution in a real command file.

Suggested fix

Only treat ` !... ` as live command substitution when it appears in a slash-command
definition file being invoked as a command (not in arbitrary loaded skill reference/doc
content), and/or never execute it when it appears inside a fenced code block.

Evidence

  • Files containing the pattern as documentation (not live commands), e.g.:
  • plugins/cache/claude-plugins-official/plugin-dev/*/skills/command-development/SKILL.md:492
  • .../references/advanced-workflows.md:115,154,531
  • .../references/documentation-patterns.md:168
  • .../examples/simple-commands.md:100

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗