React Composition Patterns
vercel-labs/openreview
Rules for structuring React components with composition instead of boolean props, covering compound components, lifted state, variants and React 19 changes.
Combine React's official "You Might Not Need an Effect" guidance with this project's stricter no direct useEffect stance.
$ npx skills add waynesutton/markdown-site --skill react-effect-decision -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install waynesutton/markdown-site react-effect-decision --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/waynesutton/markdown-site.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/react-effect-decision .claude/skills/react-effect-decision && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "react-effect-decision" agent skill from https://github.com/waynesutton/markdown-site/tree/main/.claude/react-effect-decision into .claude/skills/react-effect-decision/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "react-effect-decision", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/waynesutton/markdown-site/tree/main/.claude/react-effect-decisionType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add waynesutton/markdown-site --skill react-effect-decision -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install waynesutton/markdown-site react-effect-decision --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/waynesutton/markdown-site.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/react-effect-decision .agents/skills/react-effect-decision && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "react-effect-decision" agent skill from https://github.com/waynesutton/markdown-site/tree/main/.claude/react-effect-decision into .agents/skills/react-effect-decision/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "react-effect-decision", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add waynesutton/markdown-site --skill react-effect-decision -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install waynesutton/markdown-site react-effect-decision --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/waynesutton/markdown-site.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/react-effect-decision .cursor/skills/react-effect-decision && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "react-effect-decision" agent skill from https://github.com/waynesutton/markdown-site/tree/main/.claude/react-effect-decision into .cursor/skills/react-effect-decision/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "react-effect-decision", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/waynesutton/markdown-site.git --path .claude/react-effect-decision--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add waynesutton/markdown-site --skill react-effect-decision -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install waynesutton/markdown-site react-effect-decision --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/waynesutton/markdown-site.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/react-effect-decision .gemini/skills/react-effect-decision && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "react-effect-decision" agent skill from https://github.com/waynesutton/markdown-site/tree/main/.claude/react-effect-decision into .gemini/skills/react-effect-decision/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "react-effect-decision", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install waynesutton/markdown-site react-effect-decisionInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add waynesutton/markdown-site --skill react-effect-decision -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/waynesutton/markdown-site.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/react-effect-decision .github/skills/react-effect-decision && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "react-effect-decision" agent skill from https://github.com/waynesutton/markdown-site/tree/main/.claude/react-effect-decision into .github/skills/react-effect-decision/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "react-effect-decision", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add waynesutton/markdown-site --skill react-effect-decision -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install waynesutton/markdown-site react-effect-decision --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/waynesutton/markdown-site.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/react-effect-decision .opencode/skills/react-effect-decision && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "react-effect-decision" agent skill from https://github.com/waynesutton/markdown-site/tree/main/.claude/react-effect-decision into .opencode/skills/react-effect-decision/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "react-effect-decision", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
react-effect-decisionCombine React's official "You Might Not Need an Effect" guidance with this project's stricter no direct useEffect stance.
React Effect Decision is an agent skill from waynesutton/markdown-site. Combine React's official "You Might Not Need an Effect" guidance with this project's stricter no direct useEffect stance. Use when writing, reviewing, or refactoring React components that might reach for useEffect, derived state, event relays, reset logic, subscriptions, or client fetching.
Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Frontend & Design, covering React components and Refactoring. It works with React. The repository describes itself as: An open-source publishing framework built for AI agents and developers to ship websites, docs, or blogs. Write markdown, sync from the terminal. Your content is instantly… The licence is MIT.
8 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 3872c59. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
react.devFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
React Effect Decision loads about 1.9k tokens when it runs. Until then it costs about 78 tokens; SKILL.md has 902 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from waynesutton/markdown-site at commit 3872c59, republished under its MIT licence (© waynesutton). 902 words, ~1,883 tokens.
.claude/skills/react-effect-decision/SKILL.md (or your agent's skills folder).Default rule for this project: do not reach for direct useEffect first.
Most effect usage in React code is a sign that the component is syncing state that should be derived during render, routing an event through state, or resetting local state in a way React already models better.
This skill merges:
useEffect preferenceBefore writing any effect, ask these in order:
keyuseMemouseSyncExternalStore or a focused custom hookIf you answer yes to any of 1 through 5, do not write a direct useEffect.
React allows effects for real external synchronization. This project is stricter:
useEffect in components whenever a clearer pattern existskey remounts, memoization, query libraries, Convex hooks, and focused custom hooksuseMountEffect wrapper instead of sprinkling raw useEffect through feature codeExample wrapper:
import { useEffect } from "react";
export function useMountEffect(effect: () => void | (() => void)) {
useEffect(effect, []);
}Use that only for one time external setup like DOM focus, third party widgets, or browser API listeners that belong to the component lifecycle.
Bad smell:
useEffect(() => setX(deriveFromY(y)), [y])Do this instead:
function TodoList({ todos, showActive }: Props) {
const activeTodos = todos.filter((todo) => !todo.completed);
const visibleTodos = showActive ? activeTodos : todos;
return <List items={visibleTodos} />;
}If it can be calculated from existing inputs, keep it out of state.
useMemoIf the calculation is pure and expensive, memoize it instead of syncing it into state:
const visibleTodos = useMemo(
() => getVisibleTodos(todos, showActive),
[todos, showActive],
);Use memoization only when there is real repeated work to skip.
Bad smell:
Do this instead:
function PurchaseButton({ product }: Props) {
async function handleClick() {
await addToCart(product);
showNotification(`Added ${product.name}`);
}
return <button onClick={handleClick}>Buy</button>;
}If the work happens because the user clicked, submitted, dragged, or selected, keep it in the handler.
key, not effect choreographyBad smell:
useEffect(() => setFormState(initialFromProps), [id])Do this instead:
function EditContact({ contact, onSave }: Props) {
return <EditContactForm key={contact.id} contact={contact} onSave={onSave} />;
}If a different entity should feel like a fresh component instance, give the inner component a key.
If you cannot derive it and do not want a full remount, adjust the state during render of the same component before children render stale data.
Prefer these, in order:
keyBad smell:
fetch(...).then(setState) inside a component effectPreferred options:
Example custom hook pattern:
function useSearchResults(url: string) {
const [data, setData] = useState<Result[] | null>(null);
useEffect(() => {
let ignore = false;
fetch(url)
.then((response) => response.json())
.then((json) => {
if (!ignore) {
setData(json);
}
});
return () => {
ignore = true;
};
}, [url]);
return data;
}That is still less preferred than a dedicated query layer, but better than scattering raw fetch effects across components.
useSyncExternalStoreFor browser or third party stores, prefer the React built in subscription model:
function useOnlineStatus() {
return useSyncExternalStore(
subscribe,
() => navigator.onLine,
() => true,
);
}This is clearer and safer than mirroring an external mutable source through ad hoc effect code.
An effect or useMountEffect is appropriate when the component must synchronize with something outside React:
When you use one, document the external system in a comment or nearby helper.
If you are about to write useEffect, check:
keyuseSyncExternalStoreIf you cannot name the external system, you probably do not need an effect.
Use these during review:
key={entityId} remove the reset logic entirelyThe safest path in this repo is simple:
keySources:
© waynesutton, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/react-effect-decision of waynesutton/markdown-site.
Open the folder on GitHubat commit 3872c59
React Effect Decision next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| React Effect Decision this skillwaynesutton/markdown-site | 628 | — | ~1.9k | Automated safety check: Pass | MIT | |
| React Composition Patternsvercel-labs/openreview | 1.7k | 58 repos | ~721 | Automated safety check: Pass | MIT | |
| Vercel React Best Practicessanity-io/sanity | 6.4k | 130 repos | ~1.6k | Automated safety check: Pass | MIT | |
| Dify Component Writing Guidelanggenius/dify | 158k | — | ~626 | Automated safety check: Pass | Custom licence | |
| React Best Practicesmastra-ai/mastra | 29k | — | ~1.9k | Automated safety check: Pass | Custom licence | |
| No Use Effectfastrepl/anarlog | 9.4k | — | ~825 | Automated safety check: Pass | MIT |
vercel-labs/openreview
Rules for structuring React components with composition instead of boolean props, covering compound components, lifted state, variants and React 19 changes.
sanity-io/sanity
React and Next.js performance optimization guidelines from Vercel Engineering.
langgenius/dify
Use when implementing or refactoring React/TypeScript components and the task requires decisions about component ownership, feature boundaries, state, data…
mastra-ai/mastra
React performance optimization guidelines from Mastra Engineering.
fastrepl/anarlog
Avoid direct React useEffect usage when writing or reviewing React components and hooks.
JNTMTMTM/eIsland
Refactor a monolithic React component file into a standardized module structure with components/, hooks/, utils/, types/, and config/ subdirectories.
waynesutton/markdown-site
Integrate Convex static self hosting into existing apps using the latest upstream instructions from get-convex/self-hosting every time.
waynesutton/markdown-site
Integrate and maintain Robelest Convex Auth in apps by always checking upstream before implementation.
waynesutton/markdown-site
Plan and execute Convex schema migrations safely, including adding fields, creating tables, and data transformations.
waynesutton/markdown-site
Guide for when to use and when not to use return validators in Convex functions.
waynesutton/markdown-site
Run convex-doctor static analysis, interpret findings, and fix issues across security, performance, correctness, schema, and architecture categories.
waynesutton/markdown-site
Initialize a new Convex project from scratch or add Convex to an existing app.
Works with
Categories
Combine React's official "You Might Not Need an Effect" guidance with this project's stricter no direct useEffect stance. React Effect Decision is an agent skill from waynesutton/markdown-site. Combine React's official "You Might Not Need an Effect" guidance with this project's stricter no direct useEffect stance.
React Effect Decision fits situations like: refactoring React components that might reach for useEffect; client fetching.
Run `npx skills add waynesutton/markdown-site --skill react-effect-decision -a claude-code`. Or copy the skill folder (.claude/react-effect-decision in waynesutton/markdown-site) into .claude/skills/react-effect-decision in your project. Claude Code loads it when a task matches its description.
Run `npx skills add waynesutton/markdown-site --skill react-effect-decision -a codex`. Or copy the skill folder (.claude/react-effect-decision in waynesutton/markdown-site) into .agents/skills/react-effect-decision in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add waynesutton/markdown-site --skill react-effect-decision -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/react-effect-decision, .gemini/skills/react-effect-decision, .github/skills/react-effect-decision and .opencode/skills/react-effect-decision in your project.
SKILL.md names no scripts, command-line tools or credentials: React Effect Decision is instructions for the agent only.
SKILL.md names 1 domain. As links in the text: react.dev. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
React Effect Decision is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with React Effect Decision: React Composition Patterns (vercel-labs/openreview, 1.7k stars), Vercel React Best Practices (sanity-io/sanity, 6.4k stars), Dify Component Writing Guide (langgenius/dify, 158k stars) and React Best Practices (mastra-ai/mastra, 29k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
waynesutton (a GitHub user) maintains it in waynesutton/markdown-site, which has 628 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on May 20, 2026.
Source: waynesutton/markdown-site on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.