본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)5.5k · #14802

migrate-radix-to-base

하는 일

이 스킬은 React 프로젝트를 Radix UI에서 Base UI로 마이그레이션하는 방법을 에이전트에게 가르칩니다. shadcn 스타일의 래퍼 컴포넌트와 그 사용처를 한 번에 하나씩 업데이트하고, 진행하면서 빌드를 확인합니다.

사용하는 경우

  • ✓React 프로젝트가 Radix UI에서 Base UI로 바꾸려고 할 때.
  • ✓아코디언 같은 단일 shadcn 컴포넌트를 Base UI로 옮겨야 하는 경우.
  • ✓팀이 무엇이 바뀌었고 무엇을 매핑하지 못했는지 마이그레이션 보고서를 원할 때.

스킬 링크

https://github.com/yournextstore/yournextstore/blob/main/.agents/skills/migrate-radix-to-base/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/yournextstore/yournextstore/blob/main/.agents/skills/migrate-radix-to-base/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 shadcn 프로젝트의 아코디언 컴포넌트를 Radix에서 Base UI로 옮기고, 빌드가 계속 통과하도록 해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 프로젝트 설정을 확인하고 깨끗한 기준 빌드를 만든 뒤, Radix와 나란히 Base UI를 설치하고 컴포넌트를 하나씩 옮깁니다. 가능하면 shadcn CLI를 쓰고, 매핑이 불분명하면 Base UI 타입 파일을 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Radix UI -> Base UI migration

You migrate shadcn wrappers, hand-rolled radix compositions, and their consumers to @base-ui/react, keeping the project buildable at every step. Be precise; never guess a mapping. When a prop or part is not in these reference files, check node_modules/@base-ui/react/**/*.d.ts before transforming, and record gaps in the report.

Preflight (always)

  1. npx shadcn@latest info --json (or the project's runner): gives the current base, STYLE (e.g. radix-lyra), tailwind version, aliases, installed components, and package manager. Trust it over inference.
  2. Detect the package manager (packageManager field / lockfile: pnpm-lock.yaml, bun.lock, yarn.lock, package-lock.json) and use IT for every install. Never leave a stale lockfile.
  3. Require a clean git tree; work on a branch; one commit per component.
  4. Baseline check BEFORE touching dependencies: run the project's typecheck/build so pre-existing failures are never attributed to you.
  5. Install @base-ui/react alongside radix. Radix packages are removed only after the LAST component is migrated (both coexist fine).

Strategy: golden pair first, transformation engine second

  • Golden pair via the CLI (preferred). If the project is shadcn with a known style (radix-<style>), the shadcn CLI itself is the golden-pair executor:
    1. Classify each ui wrapper FIRST: diff the user's file against its stock origin, using the components.json style VERBATIM in the URL (https://ui.shadcn.com/r/styles/<style>/<component>.json, files[0].content). This works for prefixed styles (radix-nova) AND legacy unprefixed ones (new-york, new-york-v4, default), which are all still served.
    2. WHOLE-PROJECT mode: flip components.json style radix-<style> -> base-<style> now. PROGRESSIVE mode: do NOT flip yet (the project is still mostly radix; the flip happens once, after the last component); fetch base variants directly by URL instead (https://ui.shadcn.com/r/styles/base-<style>/<component>.json).
    3. PRISTINE wrappers, whole-project mode: shadcn add <component> --overwrite delivers the base variant with the project's exact icon/font/preset resolution. Never bulk --all --overwrite; go component by component, or you drown in unrelated registry version drift. PROGRESSIVE mode: never use --overwrite (it destroys the original that consumers still import); write the fetched base variant content to <component>-base.tsx instead.
    4. CUSTOMIZED wrappers: fetch the base variant and replay the user's diff onto it (their customizations must SURVIVE; --overwrite would destroy them). Mechanical implementation that works at scale: git merge-file user.tsx radix-golden.tsx base-golden.tsx (three-way merge, radix golden as ancestor) auto-resolves most files; hand-resolve conflicts with the reference tables.
    5. MANDATORY leftover sweep on EVERY golden-pair file, including ones that merged "clean": grep -n "radix-ui\|@radix-ui\|IconPlaceholder" per file. The registry sometimes reorders functions between variants, which makes three-way merges report zero conflicts while leaving stale radix hunks in place. A clean merge is NOT proof of a clean file. This is more reliable than reconstructing transforms; use it whenever the pair exists. Consumer/app code has no CLI mechanism: always hand-migrate it against consumer-props.md.
  • Legacy styles (new-york, new-york-v4, default): classification only, no replay. These have no base counterpart (there is no base-new-york), and retargeting onto a base-<style> variant would restyle the user's app. Use the radix golden ONLY to detect customizations, then run the transformation engine on the user's OWN file: rewire primitives, keep their exact classes, apply class-mapping renames. Their look stays theirs. At the end of a legacy whole-project migration, FLAG (do not fix): the style name still reads as radix to the CLI, so future shadcn add will deliver radix variants; the user decides whether to switch style or add manually.
  • Transformation engine (fallback). Hand-rolled radix code, non-shadcn projects, unknown styles: transform using universal-patterns.md (imports in BOTH forms: radix-ui and @radix-ui/react-*; asChild->render with the worked example; Portal>Positioner>Popup; the positioner FORWARD rule; part renames)
자주 묻는 질문

Radix를 바로 제거하나요?

아닙니다. 스킬은 마지막 컴포넌트를 옮긴 후에야 Radix 패키지를 제거한다고 설명합니다.

매핑되지 않는 속성이 있으면 어떻게 하나요?

스킬은 Base UI 타입 파일을 확인하고, 그 공백을 보고서에 기록하라고 설명합니다.

어떤 패키지 관리자를 감지하나요?

스킬은 잠금 파일에서 감지한 프로젝트 자체의 패키지 관리자를 쓰라고 설명합니다.

상세 정보

작성자의 원본 설명

Migrates React projects and components from Radix UI to Base UI. Use when asked to migrate from radix, move to base-ui, convert radix primitives, or switch a shadcn project's base library. Handles single components ("migrate accordion") and whole projects.

repo: yournextstore/yournextstore

인기도

GitHub 스타
5.5k
순위
#14802
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬