Bklit Studio Skill (chart development)
Monorepo contributors only. Use this skill automatically whenever you build, edit, or prototype a chart — before shipping via bklit-ship.
Studio at /studio is the single development surface: full editor shell, component tree, properties, motion, codegen, and registry previews. Do not scaffold apps/web/app/playground/.
When to use (auto-trigger)
- Build, prototype, or edit a chart (new or existing)
- Tune props, layers, data, styling, or animation
- Mentions Studio,
/studio, registry preview, or chart controls
- Work continues from a prior playground task → use Studio instead
Quick start
pnpm dev # repo root
Open http://localhost:3000/studio (optional query: ?chart=line-chart).
| Task |
URL |
| Edit existing chart |
/studio?chart=<slug> — slugs in packages/studio/src/chart-slugs.ts |
| Profit/loss line mode |
/studio?chart=line-chart&lineChartMode=profitLoss |
Editor layout
| Region |
Purpose |
| Left |
Chart type (in full Studio), layer list, data controls, animation |
| Center |
Canvas, rulers, resizable frame, replay/scramble |
| Right |
Properties for the selected layer |
Pane rules: animation → left (motionPanel on chart config); per-layer props → right; visibility → eye icon on layer (uses hiddenComponents in URL state).
Where to implement (existing charts)
Edit the chart in packages/studio and packages/ui — not apps/web/components/playground/.
| Concern |
Path |
| Chart preview + codegen |
packages/studio/src/lib/registry.tsx (render, generateCode) |
| Layer tree (components panel) |
packages/studio/src/lib/studio-components.ts (resolve*Components) |
| Control groups (properties) |
packages/studio/src/lib/registry-control-groups.ts |
| URL / default state |
packages/studio/src/lib/studio-parsers.ts |
| Chart UI |
packages/ui/src/charts/ |
| Slugs |
packages/studio/src/chart-slugs.ts + studioRegistry in registry.tsx |
| Studio-only previews |
packages/studio/src/components/charts/*-studio-preview.tsx |
Patterns in registry.tsx render
Reuse committed helpers (do not reimplement):
StudioChartShell + studioCartesianLegendItems — legend grid + showLegend
StudioVisibleLayer + componentId — ties render to layer visibility (line.grid, line.series.0, …)
getStudioCssRevealPropsForPreview — motion / reveal
isStudioComponentVisible(state, componentId) — conditional children
seriesStrokePropsFromState, fadeEdgesPropValue, chartTooltipPropsFromState
Reference implementation: lineConfig.render in registry.tsx.
New chart (not in registry yet)
- Implement component(s) in
packages/ui/src/charts/ (minimal API first).
- Add slug to
packages/studio/src/chart-slugs.ts.
- Add
StudioChartConfig to studioRegistry in registry.tsx:
render(state, ctx) — preview inside EditorChartFrame via StudioShell
resolveComponents in studio-components.ts
controlGroups / resolveControlGroups
generateCode for the code sheet
- Open
/studio?chart=<new-slug> and iterate.
- When stable, follow bklit-ship for docs, gallery, shadcn registry.
Adding a prop or layer
- Add key to
StudioUrlState / defaultStudioState in studio-parsers.ts if missing.
- Add control(s) on the right layer in
registry-control-groups.ts or per-component controlGroups in studio-components.ts.
- Wire prop in
registry.tsx render (and in packages/ui chart code).
- If the prop affects animation → ensure
motionPanel: true on chart config.
- Verify in Studio: layer list, visibility toggle, properties, replay.
Shipping
When the API is stable, read .agents/skills/bklit-ship/SKILL.md — prototype code should already live in packages/ui + packages/studio; no playground route to migrate.
Deprecated: /playground
The local /playground route and bklit-playground skill are deprecated. /playground redirects to /studio. Do not copy playground-editor-shell or apps/web/components/playground/ for new work.
File reference
| Item |
Path |
| Studio app route |
apps/web/app/studio/page.tsx (StudioShell) |
| Studio package |
packages/studio/ |
| Studio skill |
.agents/skills/bklit-studio/SKILL.md |
| Ship checklist |
.agents/skills/bklit-ship/SKILL.md |
| Performance audit |
.agents/skills/bklit-studio-chart-performance/SKILL.md |
1---2name: bklit-studio3description: bklit-ui monorepo contributors only. Use automatically when building or editing charts, tuning props/animation, or prototyping in Studio (/studio). Replaces the deprecated local /playground route.4---5
6# Bklit Studio Skill (chart development)
7
8**Monorepo contributors only.** Use this skill **automatically** whenever you build, edit, or prototype a chart — before shipping via **bklit-ship**.
9
10Studio at **`/studio`** is the single development surface: full editor shell, component tree, properties, motion, codegen, and registry previews. Do **not** scaffold `apps/web/app/playground/`.
11
12## When to use (auto-trigger)
13
14- Build, prototype, or edit a chart (new or existing)
15- Tune props, layers, data, styling, or animation
16- Mentions Studio, `/studio`, registry preview, or chart controls
17- Work continues from a prior playground task → use Studio instead
18
19## Quick start
20
21```bash
22pnpm dev # repo root
23```
24
25Open **http://localhost:3000/studio** (optional query: `?chart=line-chart`).
26
27| Task | URL |
28|------|-----|
29| Edit existing chart | `/studio?chart=<slug>` — slugs in `packages/studio/src/chart-slugs.ts` |
30| Profit/loss line mode | `/studio?chart=line-chart&lineChartMode=profitLoss` |
31
32## Editor layout
33
34| Region | Purpose |
35|--------|---------|
36| **Left** | Chart type (in full Studio), layer list, data controls, animation |
37| **Center** | Canvas, rulers, resizable frame, replay/scramble |
38| **Right** | Properties for the **selected layer** |
39
40**Pane rules:** animation → left (`motionPanel` on chart config); per-layer props → right; visibility → eye icon on layer (uses `hiddenComponents` in URL state).
41
42## Where to implement (existing charts)
43
44Edit the chart in **`packages/studio`** and **`packages/ui`** — not `apps/web/components/playground/`.
45
46| Concern | Path |
47|---------|------|
48| Chart preview + codegen | `packages/studio/src/lib/registry.tsx` (`render`, `generateCode`) |
49| Layer tree (components panel) | `packages/studio/src/lib/studio-components.ts` (`resolve*Components`) |
50| Control groups (properties) | `packages/studio/src/lib/registry-control-groups.ts` |
51| URL / default state | `packages/studio/src/lib/studio-parsers.ts` |
52| Chart UI | `packages/ui/src/charts/` |
53| Slugs | `packages/studio/src/chart-slugs.ts` + `studioRegistry` in `registry.tsx` |
54| Studio-only previews | `packages/studio/src/components/charts/*-studio-preview.tsx` |
55
56### Patterns in `registry.tsx` render
57
58Reuse committed helpers (do not reimplement):
59
60- `StudioChartShell` + `studioCartesianLegendItems` — legend grid + `showLegend`
61- `StudioVisibleLayer` + `componentId` — ties render to layer visibility (`line.grid`, `line.series.0`, …)
62- `getStudioCssRevealPropsForPreview` — motion / reveal
63- `isStudioComponentVisible(state, componentId)` — conditional children
64- `seriesStrokePropsFromState`, `fadeEdgesPropValue`, `chartTooltipPropsFromState`
65
66Reference implementation: `lineConfig.render` in `registry.tsx`.
67
68## New chart (not in registry yet)
69
701. Implement component(s) in `packages/ui/src/charts/` (minimal API first).
712. Add slug to `packages/studio/src/chart-slugs.ts`.
723. Add `StudioChartConfig` to `studioRegistry` in `registry.tsx`:
73 - `render(state, ctx)` — preview inside `EditorChartFrame` via `StudioShell`
74 - `resolveComponents` in `studio-components.ts`
75 - `controlGroups` / `resolveControlGroups`
76 - `generateCode` for the code sheet
774. Open `/studio?chart=<new-slug>` and iterate.
785. When stable, follow **bklit-ship** for docs, gallery, shadcn registry.
79
80## Adding a prop or layer
81
821. Add key to `StudioUrlState` / `defaultStudioState` in `studio-parsers.ts` if missing.
832. Add control(s) on the right layer in `registry-control-groups.ts` or per-component `controlGroups` in `studio-components.ts`.
843. Wire prop in `registry.tsx` `render` (and in `packages/ui` chart code).
854. If the prop affects animation → ensure `motionPanel: true` on chart config.
865. Verify in Studio: layer list, visibility toggle, properties, replay.
87
88## Shipping
89
90When the API is stable, read `.agents/skills/bklit-ship/SKILL.md` — prototype code should already live in `packages/ui` + `packages/studio`; no playground route to migrate.
91
92## Deprecated: `/playground`
93
94The local **`/playground`** route and **`bklit-playground`** skill are deprecated. `/playground` redirects to `/studio`. Do not copy `playground-editor-shell` or `apps/web/components/playground/` for new work.
95
96## File reference
97
98| Item | Path |
99|------|------|
100| Studio app route | `apps/web/app/studio/page.tsx` (`StudioShell`) |
101| Studio package | `packages/studio/` |
102| Studio skill | `.agents/skills/bklit-studio/SKILL.md` |
103| Ship checklist | `.agents/skills/bklit-ship/SKILL.md` |
104| Performance audit | `.agents/skills/bklit-studio-chart-performance/SKILL.md` |