shadcn-errors-cli-sync-mismatch

Preview shadcn CLI changes with --dry-run and --diff before overwriting.

Updated May 19, 2026
One-click install
npx skills add https://github.com/Impertio-Studio/shadcn-ui-Claude-Skill-Package --skill shadcn-errors-cli-sync-mismatch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shadcn-errors-cli-sync-mismatch
Source: https://github.com/Impertio-Studio/shadcn-ui-Claude-Skill-Package/tree/main/skills/source/shadcn-errors/shadcn-errors-cli-sync-mismatch
Command: npx skills add https://github.com/Impertio-Studio/shadcn-ui-Claude-Skill-Package --skill shadcn-errors-cli-sync-mismatch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill prevents the shadcn CLI from silently wiping your local changes when you re-run shadcn add with overwrite, especially when upstream components change and you need to recover customizations safely.

Core Features & Use Cases

  • Diff-first overwrite workflow: Use --dry-run and --diff to preview exactly what the CLI will change before any destructive write.
  • Choose the right sync strategy: Apply one of three approaches—vendor snapshot, diff-merge, or fork—to match how much you customized and how frequently upstream changes.
  • Preserve customizations safely: Move custom variants and extensions into *-extensions.tsx so re-adds and migrations do not delete them, and maintain clear documentation for each component’s sync policy.
  • Migration and hygiene guardrails: Run migrations like migrate icons and migrate radix with clean git state to avoid tangled diffs you can’t confidently resolve.

Quick Start

First make your git working tree clean, then run pnpm dlx shadcn@latest add <component> --diff to review the upstream changes before applying overwrite.

Frequently Asked Questions about shadcn-errors-cli-sync-mismatch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent shadcn CLI from overwriting my custom component edits?

To prevent shadcn CLI from overwriting your custom edits, enforce a clean git status and use `add --dry-run` and `add --diff` to preview upstream changes before applying `--overwrite`.

What is the best way to update shadcn components without losing local variants?

The best way to update shadcn components without losing local variants is to move custom extensions into `*-extensions.tsx` files, ensuring re-adds and migrations do not delete your customizations.

Why does running shadcn add overwrite break my custom UI components?

Running shadcn add with overwrite breaks custom UI components because the CLI silently wipes local changes when upstream components change, requiring diff-merge or fork strategies to recover customizations safely.

Can I preview shadcn CLI changes before applying them to my project?

Yes, you can preview shadcn CLI changes by running `pnpm dlx shadcn@latest add <component> --diff` to review exact upstream modifications before executing any destructive write operations.

When should I use vendor snapshot vs diff-merge for shad component migrations?

Choose between vendor snapshot, diff-merge, or fork strategies for shadcn component migrations based on how much you customized the component and how frequently the upstream changes occur.

Do I need a clean git working tree before running shadcn migrations?

Yes, you need a clean git working tree before running shadcn migrations like `migrate icons` or `migrate radix` to avoid tangled diffs you cannot confidently resolve during component updates.