Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

bklit-ui-migrate

БесплатноЗапускает вложенные скриптыНе проверен

Migrate an app's charts from Recharts or TanStack Charts to Bklit UI. Detects Recharts usage — direct `recharts` imports or shadcn/ui's…

bklitот bklit★ 2 058 звёзд на GitHub

Об этом скилле

Recharts / TanStack Charts → Bklit UI migration

Bklit charts are shadcn registry components: npx shadcn@latest add @bklit/<slug> copies source into the user's project and the code imports it from their own alias, e.g. @/components/charts/line-chart. Never import from @bklitui/ui/charts — that is bklit's private monorepo package.

Work through the steps in order. Do not start rewriting before the inventory (step 1) and classification (step 2) have been shown to the user.

References

File Use it for
references/component-map.md Recharts component → bklit export, registry slug, import path
references/prop-map.md Prop-by-prop mapping, units, defaults
references/shadcn-chart.md ChartContainer / ChartConfig / ChartTooltipContent / ChartLegendContent, var(--color-*), full before/after
references/examples.md Before/after: multi-line, stacked bar, horizontal bar, donut, radar, gradient area, tiny line/area/bar → sparklines, TanStack KPI sparkline
references/tanstack-charts.md TanStack Charts (@tanstack/charts): marks → sparklines (well covered) and full charts (high-level only)
rules/gaps.md Features with no bklit prop — workaround or keep Recharts (Incorrect/Correct)
scripts/detect-recharts.mjs Zero-dependency inventory + classification (Recharts, shadcn wrapper, TanStack Charts, tiny charts → sparkline)

Docs for each chart: https://bklit.com/docs/components/<slug>.

Ground rules

  1. Never invent props. If a Recharts prop has no row in prop-map.md, it is a gap — read rules/gaps.md. bklit has no tickFormatter on XAxis, no domain on YAxis, no stackId, no layout, no connectNulls, no syncId.
  2. Line / Area / Composed / Scatter are time-series charts. x values must be Dates (or ISO strings / epoch ms). Categorical x → BarChart or a workaround. Tiny charts are sparklines. One series, no axes / grid / legend, rendered small → LineSparkline / AreaSparkline / BarSparkline from @bklit/sparkline (x is row order, so no dates needed). Do not rebuild them with LineChart + hidden chrome.
  3. Preserve data, colours and labels. Same series, same colours (resolved from ChartConfig), same human labels in tooltip and legend.
  4. One file at a time, typecheck after each.
  5. Ask before any "needs workaround" conversion — it changes how the chart looks or reads.
  6. Leave "keep Recharts" charts untouched. A partial migration is a valid outcome.

Step 1 — Detect and inventory

Run the detector from the project root (Node ≥ 18, no install):

node <skill-dir>/scripts/detect-recharts.mjs . --format=table   # human table
node <skill-dir>/scripts/detect-recharts.mjs .                  # full JSON

It walks source files (skipping node_modules, .next, dist, build, dot-dirs), finds recharts imports (named or import * as RechartsPrimitive), shadcn wrapper imports and @tanstack/charts imports (each defineChart(...) is one chart with "library": "@tanstack/charts"), and reports per file: components used, each chart root with line number, notable props (stackId, layout="vertical", syncId, XAxis type="number", Treemap, LabelList, ErrorBar, custom shape/content, Brush, …), the proposed bklit target, slugs to install, and a classification. Charts it reads as sparklines carry "sparkline": true and target @bklit/sparkline; axis-less charts of unknown size get a note suggesting it. shadcnWrappers[].importedBy lists who still imports components/ui/chart.tsx. It never throws; unreadable paths go in errors.

The script is a heuristic (it cannot see data values or axes built in helper functions). Open every listed file and confirm before presenting. Show the user a table:

File Recharts / shadcn components Chart type bklit target Class
components/chart-area-interactive.tsx:51 AreaChart, Area, CartesianGrid, XAxis, ChartContainer, ChartTooltip(Content), ChartLegend(Content) Area (stacked) AreaChart needs workaround
components/storage-treemap.tsx:25 Treemap, Tooltip, ResponsiveContainer Treemap — keep Recharts

Also check components.json: confirm the @bklit registry ("registries": { "@bklit": "https://ui.bklit.com/r/{name}.json" }) and note aliases.components — it decides the import prefix (default @/components → files land in components/charts/).

Step 2 — Classify and confirm

For every chart, state one of:

  • Clean — every component and prop maps (see component-map.md, prop-map.md). Data may still need a reshape (pie, radar, radial, ring).
  • Needs workaround — convertible with a compromise. Typical: categorical or numeric x on a time-series chart,
Полный SKILL.md на GitHub

Установить bklit-ui-migrate в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

evals/evals.jsonevals/files/bar-layout-vertical/components/browser-share.tsxevals/files/bar-layout-vertical/package.jsonevals/files/donut-pie-center/components/plan-mix.tsxevals/files/donut-pie-center/package.jsonevals/files/line-multi-series/components/traffic-chart.tsxevals/files/line-multi-series/package.jsonevals/files/radar-normalize/components/skills-radar.tsxevals/files/radar-normalize/package.jsonevals/files/recharts-tiny/components/kpi-sparklines.tsxevals/files/recharts-tiny/package.jsonevals/files/scatter-numeric-x/components/height-weight.tsxevals/files/scatter-numeric-x/package.jsonevals/files/shadcn-area-interactive/components/chart-area-interactive.tsxevals/files/shadcn-area-interactive/components/ui/chart.tsxevals/files/shadcn-area-interactive/package.jsonevals/files/shadcn-stacked-bar/components/chart-bar-stacked.tsxevals/files/shadcn-stacked-bar/components/ui/chart.tsxevals/files/shadcn-stacked-bar/package.jsonevals/files/tanstack-sparkline/components/revenue-kpi.tsxevals/files/tanstack-sparkline/package.jsonevals/files/treemap-keep/components/monthly-bars.tsxevals/files/treemap-keep/components/storage-treemap.tsxevals/files/treemap-keep/package.jsonreferences/component-map.mdreferences/examples.mdreferences/prop-map.mdreferences/shadcn-chart.mdreferences/tanstack-charts.mdrules/gaps.mdscripts/detect-recharts.mjs

FAQ

Что делает скилл bklit-ui-migrate?

Migrate an app's charts from Recharts or TanStack Charts to Bklit UI. Detects Recharts usage — direct `recharts` imports or shadcn/ui's `components/ui/chart.tsx` wrapper (ChartContainer, ChartConfig, ChartTooltipContent, ChartLegendContent) — and `@tanstack/charts` definitions (defineChart with lineY / areaY / barY marks), inventories every chart, classifies each as clean / needs workaround / keep, installs the matching `@bklit/*` shadcn registry items, and rewrites each chart with the equivalent bklit components while preserving data, colours, and labels. Tiny axis-less charts (Recharts "Tiny" line/area/bar charts, TanStack KPI sparklines) become LineSparkline / AreaSparkline / BarSparkline. Use when the user asks to replace, migrate, convert, or port Recharts, shadcn charts, or TanStack Charts to bklit, to swap sparklines or tiny charts, to remove the recharts or @tanstack/charts dependency, or asks what it would take to switch chart libraries.

Как установить скилл bklit-ui-migrate?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bklit-ui-migrate запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить bklit-ui-migrate с