agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when writing or reviewing React. Covers component and state design, hook correctness, memoization that is actually needed, data fetching, and the render behavior behind most React performance problems. Trigger on "component re-renders too much", "state is stale in my
Claude Code
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill react --agent claude-code
Codex
$ npx skills add nimadorostkar/Claude-Skills-collection --skill react -a codex -y
Cursor
$ npx skills add nimadorostkar/Claude-Skills-collection --skill react -a cursor -y
Gemini CLI
$ npx skills add nimadorostkar/Claude-Skills-collection --skill react -a gemini-cli -y
GitHub Copilot
$ npx skills add nimadorostkar/Claude-Skills-collection --skill react -a github-copilot -y
OpenCode
$ npx skills add nimadorostkar/Claude-Skills-collection --skill react -a opencode -y
Windsurf
$ npx skills add nimadorostkar/Claude-Skills-collection --skill react -a windsurf -y
name: react description: Use when writing or reviewing React. Covers component and state design, hook correctness, memoization that is actually needed, data fetching, and the render behavior behind most React performance problems. Trigger on "component re-renders too much", "state is stale in my useeffect", "do i need usememo here", "where should this state live". Do not use for server components and App Router caching — see the nextjs skill; for mobile, see the react-native skill. metadata: category: frontend version: 1.0.0 tags: [react, hooks, state, rendering, performance]
Write React where state lives in one place, effects are rare, and re-renders are understood rather than suppressed with memoization applied at random.
1. **Locate the state** — Put it as close to where it is used as possible. Lift only when two siblings need it. Reach for context only when prop drilling exceeds about three levels. 2. **Separate server state from client state** — Data from an API is cache, not state. It has staleness, refetching, and error semantics that `useState` does not model. Use a query library. 3. **Delete unnecessary effects** — An effect that computes a value from props belongs in render. An effect that resets state on a prop change belongs in a `key`. Most `useEffect` calls in a typical codebase should not exist. 4. **Profile before memoizing** — React DevTools Profiler shows what actually re-renders and why. `useMemo` on a cheap computation costs more than it saves. 5. **Make the dependencies honest** — Never silence the exhaustive-deps lint rule. If the array is wrong, the bug is a stale closure, and it will be intermittent.
**An effect that should not exist:**
// Wrong: derived state, an extra render, and a chance to be out of sync.
function Cart({ items }) {
const [total, setTotal] = useState(0);
useEffect(() => {
setTotal(items.reduce((sum, i) => sum + i.price * i.qty, 0));
}, [items]);
return <Total value={total} />;
}
// Right: compute it during render. It is always correct, by construction.
function Cart({ items }) {
const total = items.reduce((sum, i) => sum + i.price * i.qty, 0);
return <Total value={total} />;
}**Server state belongs in a query, not in `useState` plus `useEffect`:**
function OrderList({ status }) {
const { data, isPending, error } = useQuery({
queryKey: ["orders", status],
queryFn: ({ signal }) => fetchOrders(status, { signal }),
staleTime: 30_000,
});
if (isPending) return <Skeleton />;
if (error) return <ErrorState error={error} onRetry={() => refetch()} />;
return <List items={data} />;
}The manual version needs loading state, error state, cancellation on unmount, a race-condition guard when `status` changes mid-flight, and a cache. That is what the library is.
A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory,…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling,…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.