trove-react
/trove-react
React 19 coding conventions and performance patterns. Auto-activates when working with React/TypeScript files. Covers hooks, state management, TanStack Query, Zustand, immutable updates, and component conventions. Use when: react component; react hooks; tanstack query; zustand state.
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 2
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 08.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- SKILL.md zawiera komentarze HTML (2). Nie widać ich w podglądzie Markdown, a model je czyta.
What it does and when to use it
React 19 coding conventions and performance patterns. Auto-activates when working with React/TypeScript files. Covers hooks, state management, TanStack Query, Zustand, immutable updates, and component conventions. Use when: react component; react hooks; tanstack query; zustand state.
Original author description
React 19 coding conventions and performance patterns. Auto-activates when working with React/TypeScript files. Covers hooks, state management, TanStack Query, Zustand, immutable updates, and component conventions. Use when: react component; react hooks; tanstack query; zustand state.
How it works
- Session Init
- Immutable State Updates (CRITICAL)
- Zustand Selectors (CRITICAL)
- Component Patterns
- TanStack Query
- Error Boundaries
- AI Gotchas
SKILL.md preview
---
name: trove-react
description: "React 19 coding conventions and performance patterns. Auto-activates when working with React/TypeScript files. Covers hooks, state management, TanStack Query, Zustand, immutable updates, and component conventions. Use when: react component; react hooks; tanstack query; zustand state."
---
<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->
<!-- Regenerate: bun run build:skills -->
## Session Init
This skill ships Trove conventions. Prefer existing project patterns over generic best practices when they conflict.
# React 19 Conventions
## Immutable State Updates (CRITICAL)
React StrictMode double-invokes state updaters. Mutating objects causes duplicated side effects.
```typescript
// BAD — mutation causes bugs in StrictMode
setMessages(prev => {
prev[prev.length - 1].text += content; // MUTATION!
return [...prev];
});
// GOOD — immutable update
setMessages(prev => {
const updated = [...prev];
const lastIndex = updated.length - 1;
updated[lastIndex] = { ...updated[lastIndex], text: updated[lastIndex].text + content };
return updated;
});
```
## Zustand Selectors (CRITICAL)
Always use selectors — never destructure the store directly:
```typescript
// BAD — subscribes to entire store, re-renders on ANY change
const { darkMode } = useGlobalStore();
// GOOD — subscribes only to darkMode
const darkMode = useGlobalStore(state => state.darkMode);
// GOOD — multiple values with useShallow
import { useShallow } from 'zustand/shallow';
const { username, email } = useUserStore(
useShallow(state => ({ username: state.username, email: state.email }))
);
```
## Component Patterns
- Prefer function components with hooks
- Use `React.memo()` only when profiling shows re-render cost
- Extract custom hooks for reusable logic
- Keep components under 200 lines — split into sub-components
## TanStack Query
```typescript
// Queries — always provide staleTime
const { data, isLoading } = useQuery({
queryKey: ['users', userId],
queryFn: () => fetchUser(userId),
staleTime: 5 * 60 * 1000,
});
// Mutations — invalidate related queries on success
const mutation = useMutation({
mutationFn: updateUser,
onSuccess: () => queryClient.invalidateQueries({ queryKey: ['users'] }),
});
```
## Error Boundaries
Wrap route-level components with error boundaries. Never let errors crash the full app.
## AI Gotchas
- **useEffect dependencies**: Always include all referenced values in the dependency array
- **Ref vs State**: Use `useRef` for values that don't trigger re-renders (timers, DOM refs)
- **Key prop**: Use stable, unique IDs — never use array index as key for dynamic lists
- **Event handlers**: Define inline only for simple logic; extract for complex handlers
Versions
The database has no other skills named trove-react.
Identical content appears in 3 other GitHub folders. We show one copy with the highest score.
Database snapshot: 13.11.2026 · package version 075992dc50bc (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100tanstack-query-zustand
Patterns for TanStack Query + Axios (server state) and Zustand (UI state) in this React SPA. Use when writing data fetching, mutations, cache invalidation, pagination, or global state; when deciding where a piece of state belongs; or when touching files that import from… - 100react-ops
React development patterns, hooks, state management, Server Components, and performance optimization. Use for: react, hooks, useState, useEffect, jsx, tsx, server components, RSC, zustand, react query, component patterns, react testing library, error boundary, suspense, react 19. - 95state
State management knowledge base - Zustand, TanStack Query, React Context, optimistic updates. Use when managing client state, implementing server state with caching, or choosing a state management solution. - 100set-up-state-management
Use when adding state management to a frontend project - TanStack Query for server state, Zustand (React) or Pinia (Vue) for UI state, a hard boundary between them, a typed query-key factory and a fetch seam. - 95state-management-advisor
Choose and implement React state management solutions including Context, Zustand, Redux Toolkit, TanStack Query, and Jotai. Use when selecting state management, implementing global state, or managing server state in React applications. - 100react-typescript-engineering
Implementation standards for the React 18 + TypeScript + Vite frontend - state ownership, data fetching with TanStack Query, Zustand boundaries, WebSocket stream handling, error boundaries, and typing the API layer. Use when writing components, hooks, stores, or API clients in apps/web.