Implements global state management in React using TanStack Store. Covers createStore, useStore with selectors, derived stores, batch updates, shallow comparison, and async atoms.
Ships in frontend. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Framework-agnostic reactive data store with a React adapter. Install @tanstack/react-store.
Create a writable store with an initial value, or a readonly derived store with a getter function.
import { createStore } from "@tanstack/react-store";
// Writable store
const countStore = createStore(0);
countStore.setState(() => 1);
console.log(countStore.state); // 1
// Object store
const appStore = createStore({ dogs: 0, cats: 0 });
// Derived (readonly) store — auto-updates when dependencies change
const doubled = createStore(() => countStore.state * 2);
store.state / store.get() — read current valuestore.setState((prev) => next) — update with updater fn (not available on derived/readonly stores)store.subscribe((value) => void) — listen to changes, returns { unsubscribe }Access the previous derived value via the prev argument:
const sum = createStore<number>((prev) => count.state + (prev ?? 0));
Batch multiple setState calls; subscribers fire once at the end:
import { batch } from "@tanstack/react-store";
batch(() => {
countStore.setState(() => 1);
countStore.setState(() => 2);
});
Subscribe a React component to a store. Accepts a selector for fine-grained re-renders.
import { createStore, useStore } from "@tanstack/react-store";
const store = createStore({ dogs: 0, cats: 0 });
function Display({ animal }: { animal: "dogs" | "cats" }) {
// Only re-renders when state[animal] changes
const count = useStore(store, (state) => state[animal]);
return <div>{`${animal}: ${count}`}</div>;
}
Signature:
function useStore<TAtom extends AnyAtom | undefined, T>(
atom: TAtom,
selector: (snapshot: AtomState) => T,
compare?: (a: T, b: T) => boolean,
): T;
atom — store or atom instanceselector — derive the slice of state needed (keeps re-renders minimal)compare — optional custom equality check (default: Object.is)Use shallow as the compare function when selecting objects/arrays to avoid unnecessary re-renders:
import { useStore, shallow } from "@tanstack/react-store";
const items = useStore(store, (s) => s.items, shallow);
Call setState outside of React — no hooks needed:
const updateState = (animal: string) => {
store.setState((state) => ({
...state,
[animal]: state[animal] + 1,
}));
};
useStore to avoid full-state re-renders.shallow — when selecting objects/arrays, pass shallow as the compare fn.setState calls in batch() to notify subscribers once.createStore(() => ...) for computed values instead of manually keeping stores in sync.setState updater must return a new reference (spread objects/arrays).unsubscribe() returned by store.subscribe() when done.For detailed type signatures and advanced APIs (atoms, async atoms, observers), see references/api-reference.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
/frontend:tanstack-react-storefrom frontend
npx claudepluginhub fellipeutaka/leon --plugin frontend34 skills in this plugin
/ai-sdkAnswer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat"./baseline-uiQuickly deslop UI code by fixing spacing, hierarchy, typography, and small layout issues. Use when the interface needs a fast cleanup or polish pass./canvas-designCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations./vercel-composition-patternsReact composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes./denjiManage SVG icons as framework components using Denji CLI. Use when the user needs to add, remove, list, export, import, or manage SVG icons in React, Preact, Solid, Qwik, Vue, or Svelte projects. Triggers include requests to "add an icon", "set up icons", "manage SVG icons", "remove an icon", "list icons", "export icons", "import icons", "dry-run icon add", or any task involving Iconify icons as framework components./design-labConduct design interviews, generate five distinct UI variations in a temporary design lab, collect feedback, and produce implementation plans. Use when the user wants to explore UI design options, redesign existing components, or create new UI with multiple approaches to compare.