shadcn-add

Enforce React, TypeScript, and Tailwind v4 cleanup after adding shadcn components.

5.4k|168|Updated May 7, 2018
One-click install
npx skills add https://github.com/remeda/remeda --skill shadcn-add
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shadcn-add
Source: https://github.com/remeda/remeda/tree/main/.agents/skills/shadcn-add
Command: npx skills add https://github.com/remeda/remeda --skill shadcn-add

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents inconsistent React and Tailwind patterns from creeping into new shadcn UI components by enforcing repo-specific cleanup and modernization rules immediately after adding components.

Core Features & Use Cases

  • Remove outdated React usage: drops global React namespace imports, React. type prefixes, export blocks, and any "use client" directives to match the project’s preferred component style.
  • Fix TypeScript exactOptionalPropertyTypes pitfalls: addresses issues caused by exact optional props during destructuring or prop handling.
  • Modernize Tailwind v4 data/size patterns: converts Tailwind v4 incompatible attribute and arbitrary value patterns to the repo’s expected conventions, then organizes imports for correctness.

Quick Start

Run the cleanup for the newly added shadcn component and apply the required import, React, exactOptionalPropertyTypes, and Tailwind v4 refactor rules to the files under src/components/ui.

Frequently Asked Questions about shadcn-add

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

FAQPage Schema
How do I clean up shadcn UI components after adding them to my React project?

To clean up shadcn UI components, you need to remove outdated React namespace imports and "use client" directives, fix exactOptionalPropertyTypes destructuring issues, and modernize Tailwind v4 patterns. This ensures newly added files remain consistent with your repository's preferred style.

Why does exactOptionalPropertyTypes break shadcn component destructuring?

The exactOptionalPropertyTypes TypeScript configuration causes shadcn component destructuring issues because it strictly checks optional props. Fixing this requires correcting the prop handling logic during the component refactor process to prevent type errors when passing undefined values.

What is the best way to modernize Tailwind v4 data and size conventions in new components?

The best way to modernize Tailwind v4 conventions is to convert incompatible attribute patterns and arbitrary values to the expected data-* and size-* formats. This modernization happens during the follow-up refactor after adding new UI components.

Does adding shadcn components require removing React namespace imports?

Yes, adding shadcn components often requires removing React namespace imports and React. type prefixes. Dropping these global imports, along with "use client" directives, aligns the new files with a modern, repo-specific component style.

How do I sort imports correctly after refactoring shadcn UI files?

You sort imports correctly by applying the Organize Imports feature after refactoring shadcn UI files. This step happens last, ensuring import correctness and consistency once React usage and Tailwind v4 patterns are updated.

Can I automate React cleanup and Tailwind v4 modernization for src/components/ui?

Yes, you can automate React cleanup and Tailwind v4 modernization for src/components/ui by applying dedicated refactor rules. This removes outdated directives and converts Tailwind attributes immediately after introducing new files via the add CLI command.