Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add Casper-Studios/casper-marketplace --skill react-best-practicesgit clone --depth 1 https://github.com/Casper-Studios/casper-marketplaceWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/casper-studios/casper-marketplace/react-best-practices)<a href="https://agentmods.dev/skills/casper-studios/casper-marketplace/react-best-practices"><img src="https://agentmods.dev/badge/skills/casper-studios/casper-marketplace/react-best-practices.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00032 | $0.00844 |
| Opus 5 | $0.00016 | $0.00422 |
| Sonnet 5 | $0.00006 | $0.00169 |
| Haiku 4.5 | $0.00003 | $0.00084 |
Grade A, and why
react-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 49 lines — stays where its author put it; the contents beside it link to each section on GitHub.
React Best Practices
Treat React as a declarative projection of owned state: derive what can be calculated, render every state explicitly, and isolate effects to synchronization with external systems so components remain predictable and easy to change.
Library Sources
- GitHub repository ID:
react/react - Context7 library ID:
/facebook/react - DeepWiki repository ID:
react/react
Use Context7 for current documentation and DeepWiki for implementation details.
References
Read the references that apply to the current task before writing or reviewing React component, state, rendering, effect, data-loading, or form code.
- Own mutable state narrowly and derive every value that its inputs already prove.
- Keep computable values out of state so they cannot drift from their inputs.
- Place mutable state at the smallest shared owner, lifting it only for sibling consumers.
- Represent exclusive UI modes as one valid-state set, not contradictory flags.
- Use a functional state update for transitions derived from the same state so queued transitions compose and callbacks do not capture a render snapshot.
- Let changed domain identity create a new state lifetime through remounting, not field-by-field reset effects.
- Remove hidden UI through conditional mounting when it must discard local state, focus, or other child lifetime state.
- Render explicit states and compose components around their owned contracts.
- Make JSX absence and branch conditions explicit rather than relying on truthiness.
- Establish context ownership only when one subsystem owns state or behavior consumed across multiple depths.
- Preserve the complete platform contract in native element props instead of maintaining an incomplete handwritten prop surface.
- Express passive layout content through children composition; reserve render callbacks for owner-provided behavior.
- Restrict effects and memoization to their actual ownership boundaries.
- Reserve effects for reactive external-system synchronization.
- Memoize every pure render-time computation worse than O(1), including scalar and O(log n) work; keep O(1) derivations inline.
- Split independent caches with atomic memoization so unrelated inputs do not invalidate each other.
- Compute synchronized values during render instead of using derived-state effects, preventing stale intermediate UI and a second writable source of truth.
- Keep event work in the handler that receives the action instead of routing it through state and an effect.
- Keep ordered work in one event, query, or server-operation owner to avoid effect chains that obscure sequencing and failures.
- Treat form input and submission state as form-wide contracts.
- Decode then validate at the form boundary so mutations never receive raw transport input.
- Model pending, success, and failure as a form-wide operation, not as one button's state.
- Treat missing submitter identity as valid unless distinct buttons select the operation; then validate it as form input instead of throwing or inventing a default.
What ships with it
21 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- agents/openai.yaml 150 B
- LICENSE.txt 16 KB
- references/atomic-memoization.md 1.5 KB
- references/avoid-derived-state-effects.md 1.7 KB
- references/avoid-effect-chains.md 1.0 KB
- references/children-composition.md 1.1 KB
- references/conditional-mounting.md 1.1 KB
- references/context-ownership.md 1.1 KB
- references/derive-values.md 1.2 KB
- references/event-work.md 1018 B
- references/explicit-rendering.md 971 B
- references/external-system-effects.md 2.9 KB
- references/form-validation.md 1.1 KB
- references/functional-state-updates.md 1.3 KB
- references/manual-memoization.md 1.3 KB
- references/native-element-props.md 1.3 KB
- references/reset-state-by-remounting.md 1.0 KB
- references/scope-state.md 792 B
- references/state-machines.md 2.2 KB
- references/submission-state.md 1.6 KB
- references/submitter-identity.md 972 B
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago Changed · +4 lines · -40 tokens per session a963bf4b75d3
- 8d ago First seen · 45 lines · 72 tokens per session scan A 32f3121ecd62
react-best-practices is a skill published in the GitHub repository Casper-Studios/casper-marketplace (12 stars, last pushed 3d ago), licensed MPL-2.0. It adds 32 tokens to every session and 844 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
chakra-ui-builder
Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…
material-ui-tailwind
Integrates Material UI with Tailwind CSS v4 using cascade layers (enableCssLayer, @layer order) and documents Tailwind v3 interoperability (preflight, important, injectFirst, portals). Use when combining MUI with Tailwind utilities, slotProps className, or theme token bridges.
r3f-best-practices
React Three Fiber (R3F) and Poimandres ecosystem best practices. Use when writing, reviewing, or optimizing R3F code. Triggers on tasks involving @react-three/fiber, @react-three/drei, zustand, @react-three/postprocessing, @react-three/rapier, or leva.
create-site
Creates a new Power Pages code site (SPA) using React, Angular, Vue, or Astro. Guides through the full process from initial concept to deployed site: requirements discovery, scaffolding, component planning, design, implementation, validation, and deployment. Use when the user wants to create, build, or scaffold a new…
fast-typescript-check
Keep www-sacred's TypeScript fast to type-check and fast to run. Use when touching the ASCII/canvas animation components (the only real per-frame code here), tightening type-check wall-clock, or auditing a change for runtime or compiler regressions. Scoped to this repo — a React 19 / Next.js 16 component library plus…
menu-testing-ssr
Server rendering and testing for react-horizontal-scrolling-menu: the library is client-only ('use client' required in React Server Components, else "createContext is not a function"), SSR first paint is controlled by the useIsVisible defaultValue argument (canonical ('first', true) / ('last', false))…