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★ 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
- Never invent props. If a Recharts prop has no row in
prop-map.md, it is a gap — readrules/gaps.md. bklit has notickFormatteronXAxis, nodomainonYAxis, nostackId, nolayout, noconnectNulls, nosyncId. - Line / Area / Composed / Scatter are time-series charts. x values must be
Dates (or ISO strings / epoch ms). Categorical x →BarChartor a workaround. Tiny charts are sparklines. One series, no axes / grid / legend, rendered small →LineSparkline/AreaSparkline/BarSparklinefrom@bklit/sparkline(x is row order, so no dates needed). Do not rebuild them withLineChart+ hidden chrome. - Preserve data, colours and labels. Same series, same colours (resolved from
ChartConfig), same human labels in tooltip and legend. - One file at a time, typecheck after each.
- Ask before any "needs workaround" conversion — it changes how the chart looks or reads.
- 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,
Установить bklit-ui-migrate в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
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 запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic