Skip to content

[bug]: skills: SKILL.md's inline "info --json" exits 1 in monorepos, so the whole skill fails to load #11271

Description

@angelo-manalo

Describe the bug

skills/shadcn/SKILL.md injects project context at load time with an inline shell command:

!`npx shadcn@latest info --json`

In a monorepo, shadcn info run from the repo root exits 1 (by design — it prints {"error": "monorepo_root", ...} and asks for -c). Claude Code's skill loader treats a non-zero exit from an inline !`…` command as fatal for the whole skill: Skill(shadcn) returns an error and zero content — none of the rules, workflow, or CLI reference load.

The failure is invisible in practice: to the agent, a skill that returns nothing looks like a skill with nothing to say, so it silently builds UI without any of the skill's rules. Every monorepo project hits this on every session.

A one-line fix on the machine-level copy works: append || true so the probe's stdout (the monorepo_root JSON, which helpfully lists the workspace targets) is injected instead of killing the load — the agent then re-runs info -c <workspace> itself, which the skill's own Workflow section already suggests. Happy to submit a PR.

Affected component/components

skills (skills/shadcn/SKILL.md), CLI info

How to reproduce

  1. npx shadcn@latest init --name my-app --preset base-nova --monorepo
  2. Install the skill in Claude Code (npx skills add shadcn/ui)
  3. In a Claude Code session at the monorepo root, invoke the shadcn skill
  4. The skill errors and returns no content

Codesandbox/StackBlitz link

Not applicable — reproducible with the CLI's own monorepo template, steps above.

Logs

<error>Shell command failed for pattern "!`npx shadcn@latest info --json`": [stderr]
{
  "error": "monorepo_root",
  "message": "You are running info from a monorepo root. Use the -c flag to specify a workspace.",
  "targets": [ "apps/web", "packages/ui" ]
}</error>

System Info

Windows 11, pnpm 10.x, shadcn 4.14.1, Claude Code (skill loaded via .claude/skills)

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions