agentleFS
DobroslavRadosavljevicDobroslavRadosavljevic/cabrakan/.agents/skills/tanstack-charts/SKILL.md

tanstack-charts

Skill1 starsChanged 3 months agoMITView on GitHub

Build, review, debug, migrate, or plan TanStack Charts pre-alpha charting with current docs. Use for @tanstack/charts, @tanstack/charts/react, @tanstack/charts/react-native, @tanstack/charts/scales/*, defineChart, svgAnimation, motion(), tooltip/portal, layout stack/group, groupBy/binX/rollingWindow/rank/normalize/fold/waterfall/mosaic, lineY, areaY, barY, boxY, violinY, waffleY, ridgelineY, differenceY, linearRegressionY, rect, cell, dot, hexagon, crosshair, whenFocused, decorative, facet, polar, geoShape, treemap, sunburst, sankeyDiagram, hexbin, contour, brushX, zoomX, keyedSelection, Chart, Canvas, grammar-of-graphics marks/channels/scales, and migrations from Recharts, Chart.js, ECharts, Observable Plot, archived react-charts, @tanstack/react-charts, @tanstack/charts-scales, or TanStack Charts 0.0.x–0.13.x.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill when work touches TanStack Charts, especially mark composition, transforms, compact vs D3 scales, React Chart, SSR, …

    line 8
  2. Very specific:

    Treat the library as pre-alpha (0.14.0 at skill refresh).

    line 10
  3. Distinctive:

    Keep rows in their natural shape.

    line 28
  4. Very specific:

    Default SVG animation option is svgAnimation, not animate.

    line 33
  5. Distinctive:

    Default to SVG. Import polar, geo, Canvas, export, motion, spatial, hierarchy, network, brush/zoom only through exact subpaths.

    line 39
  6. Very specific:

    Prefer built-in marks (boxY, waffleY, violinY, composites) before createMark.

    line 40
  7. Distinctive:

    Prefer the repo's existing checks.

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

TanStack Charts

Use this skill when work touches TanStack Charts, especially mark composition, transforms, compact vs D3 scales, React Chart, SSR, tooltips/focus, Canvas, optional motion(), React Native, spatial/hierarchy/network entries, or migrations.

Treat the library as pre-alpha (0.14.0 at skill refresh). Official docs say it is not ready for production use. Verify current docs and the npm latest version before relying on edge APIs. Prefer official docs / GitHub tag v0.14.0 over stale search or archived react-charts.

Workflow

  1. Confirm the stack is the new TanStack Charts on the unified package:
    • Correct: bun add @tanstack/charts plus framework peers. Import Chart from @tanstack/charts/react, scales from @tanstack/charts/scales/linear (and /band, /point, /ordinal).
    • Compatibility only: @tanstack/react-charts, @tanstack/charts-scales, and other @tanstack/*-charts adapter packages still exist for existing apps. Do not add them to new code.
    • Wrong: unscoped react-charts, or options / primaryAxis / secondaryAxes / UserSerie.
  2. Refresh versions and URLs from source-map.md.
  3. Installation, defineChart, scales, axes, tooltip extensions: setup-core.md.
  4. Marks, decorative, polar/geo, composites: marks-composition.md.
  5. Eager transforms vs mark layout: transforms-layouts.md.
  6. Adapters, sizing, focus, crosshair, brush/zoom/cursor/selection, motion, SSR: frameworks-interaction.md.
  7. Testing, large data, Canvas, custom marks, AI checks, migrations: production-patterns.md.

Implementation Judgment

  • A chart is a composition of marks, not a chart-type component. Prefer the smallest mark set that answers the question.
  • Keep rows in their natural shape. Do not invent a library-owned series wrapper.
  • Install one package: @tanstack/charts. Compact scales: exact @tanstack/charts/scales/* (no /scales barrel). Import and declare every d3-* the application source uses. Pass factories for inferred domains, or configured instances for fixed domains. Never assign pixel ranges to positional scales the chart owns.
  • Both positional scales are required when marks materialize those dimensions.
  • Axis presentation lives under axis / axis.ticks / axis.tickLabels. axis: false hides a guide and keeps the scale. Set the axis to null only when no mark uses that dimension.
  • Memoize the complete defineChart(...) against every captured value. Definition identity is the update boundary. Responsive { chart: ({ width }) => …, svgAnimation, tooltip, … } retains outer options.
  • Default SVG animation option is svgAnimation, not animate. motion() ignores svgAnimation and reads definition-level motion.
  • Bars/areas with a single length channel stack implicitly. Use layout: group() for side-by-side bars; layout: stack({ order, offset }) only when order/offset must be explicit; y1/y2 or x1/x2 opts out.
  • Native tooltips: tooltip from @tanstack/charts/tooltip. Escape clipping with portal from @tanstack/charts/tooltip/portal. React renderTooltipBody requires @tanstack/charts/react/tooltip. Grouped rows default to visual mark order.
  • Channel and transform accessors use (datum, { index, data }), not (datum, index, data).
  • Rolling transforms: rollingWindow, not window. Reducer helper: delta, not difference.
  • Supply ariaLabel on every mounted chart. Use focus: false to omit generated focus geometry; focusRing: false when authored focus marks replace the ring; focusDisabled when an app gesture owns the surface. Radial grouped focus: focusGroupAngle from @tanstack/charts/polar.
  • Default to SVG. Import polar, geo, Canvas, export, motion, spatial, hierarchy, network, brush/zoom only through exact subpaths.
  • Prefer built-in marks (boxY, waffleY, violinY, composites) before createMark. Wrap a sibling layer with decorative(...) when only one layer should own hit-testing.

Verification

Prefer the repo's existing checks. For meaningful Charts work, include the relevant subset:

  • Package check: @tanstack/charts on 0.14.x (or the project's pin). New code imports adapters/scales from that package, not @tanstack/react-charts / @tanstack/charts-scales.
  • Typecheck for channels, scales, axis options, tooltip host brands, motion, ChartPoint callbacks—no unexpected casts.
  • createChartScene / renderChartSvg for domains, geometry, keys, a11y markup.
  • Interaction tests: focus, keyboard, tooltip, selection, brush/zoom, resize, empty data, destroy.
  • Light/dark smoke when theme tokens or tooltip surface CSS change.
  • SSR/hydration smoke for initialWidth, formatters, Canvas shells, idPrefix.
  • Bundle measurement when adding polar, geo, Canvas, export, motion, spatial, hierarchy, network, or extra D3 modules.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.