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 sergiodxa/agent-skills --skill frontend-react-best-practicesgit clone --depth 1 https://github.com/sergiodxa/agent-skillsWrote 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/sergiodxa/agent-skills/frontend-react-best-practices)<a href="https://agentmods.dev/skills/sergiodxa/agent-skills/frontend-react-best-practices"><img src="https://agentmods.dev/badge/skills/sergiodxa/agent-skills/frontend-react-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/sergiodxa/agent-skills/frontend-react-best-practices"><img src="https://agentmods.dev/badge/skills/sergiodxa/agent-skills/frontend-react-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Socket pass
- Snyk pass
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.00048 | $0.03134 |
| Opus 5 | $0.00024 | $0.01567 |
| Sonnet 5 | $0.00010 | $0.00627 |
| Haiku 4.5 | $0.00005 | $0.00313 |
Grade A, and why
frontend-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 10d 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 — 540 lines — stays where its author put it; the contents beside it link to each section on GitHub.
React Best Practices
Performance optimization and composition patterns for React components. Contains 33 rules across 6 categories focused on reducing re-renders, optimizing bundles, component composition, and avoiding common React pitfalls.
When to Apply
Reference these guidelines when:
- Writing new React components
- Reviewing code for performance issues
- Refactoring existing React code
- Optimizing bundle size
- Working with hooks and state
Rules Summary
Bundle Size Optimization (CRITICAL)
bundle-barrel-imports - @rules/bundle-barrel-imports.md
Import directly from source, avoid barrel files.
// Bad: loads entire library (200-800ms)
import { Check, X } from "lucide-react";
// Good: loads only what you need
import Check from "lucide-react/dist/esm/icons/check";
import X from "lucide-react/dist/esm/icons/x";
bundle-conditional - @rules/bundle-conditional.md
Load modules only when feature is activated.
useEffect(() => {
if (enabled && typeof window !== "undefined") {
import("./heavy-module").then((mod) => setModule(mod));
}
}, [enabled]);
bundle-preload - @rules/bundle-preload.md
Preload on hover/focus for perceived speed.
<button
onMouseEnter={() => import("./editor")}
onFocus={() => import("./editor")}
onClick={openEditor}
>
Open Editor
</button>
Re-render Optimization (MEDIUM)
rerender-functional-setstate - @rules/rerender-functional-setstate.md
Use functional setState for stable callbacks.
// Bad: stale closure risk, recreates on items change
const addItem = useCallback(
(item) => {
setItems([...items, item]);
},
[items],
);
// Good: always uses latest state, stable reference
const addItem = useCallback((item) => {
setItems((curr) => [...curr, item]);
}, []);
rerender-derived-state-no-effect - @rules/rerender-derived-state-no-effect.md
Derive state during render, not in effects.
// Bad: extra state and effect, extra render
const [fullName, setFullName] = useState("");
useEffect(() => {
setFullName(firstName + " " + lastName);
}, [firstName, lastName]);
// Good: derived directly during render
const fullName = firstName + " " + lastName;
What ships with it
36 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.
- rules/bundle-barrel-imports.md 1.8 KB
- rules/bundle-conditional.md 966 B
- rules/bundle-preload.md 1.1 KB
- rules/client-localstorage-schema.md 2.0 KB
- rules/client-passive-event-listeners.md 1.6 KB
- rules/composition-avoid-boolean-props.md 2.9 KB
- rules/composition-avoid-overabstraction.md 2.2 KB
- rules/composition-children-over-render-props.md 3.5 KB
- rules/composition-compound-components.md 4.0 KB
- rules/composition-explicit-variants.md 3.9 KB
- rules/composition-state-provider.md 4.5 KB
- rules/composition-typescript-namespaces.md 4.5 KB
- rules/fault-tolerant-error-boundaries.md 1.1 KB
- rules/hooks-limit-useeffect.md 4.6 KB
- rules/hooks-useeffect-named-functions.md 4.4 KB
- rules/rendering-animate-svg-wrapper.md 1.1 KB
- rules/rendering-client-only.md 553 B
- rules/rendering-conditional-render.md 938 B
- rules/rendering-content-visibility.md 817 B
- rules/rendering-hoist-jsx.md 770 B
- rules/rendering-hydration-no-flicker.md 2.2 KB
- rules/rendering-hydration-suppress-warning.md 826 B
- rules/rendering-svg-precision.md 588 B
- rules/rendering-use-hydrated.md 650 B
- rules/rendering-usetransition-loading.md 2.0 KB
- rules/rerender-dependencies.md 833 B
- rules/rerender-derived-state-no-effect.md 1.2 KB
- rules/rerender-derived-state.md 726 B
- rules/rerender-functional-setstate.md 2.6 KB
- rules/rerender-lazy-state-init.md 2.0 KB
- rules/rerender-memo-with-default-value.md 1.1 KB
- rules/rerender-memo.md 939 B
- rules/rerender-move-effect-to-event.md 1.2 KB
- rules/rerender-simple-expression-in-memo.md 1019 B
- rules/rerender-transitions.md 1.0 KB
- rules/rerender-use-ref-transient-values.md 1.7 KB
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.
- 10d ago First seen · 540 lines · 48 tokens per session scan A 082218d7ae8c
frontend-react-best-practices is a skill published in the GitHub repository sergiodxa/agent-skills (90 stars, last pushed 7mo ago), licensed MIT. It adds 48 tokens to every session and 3,134 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.
dashboard-widgets
Author a dashboard widget — a small React component backed by named LangWatchQL queries — from a plain question. Discovers the analytics schema, writes the queries, writes the widget file, saves it, then proves it renders. Use when asked to build, prototype, or iterate on a custom chart widget, or to add a widget…
assistant-ui-primitives
Guide for assistant-ui UI primitives - ThreadPrimitive, ComposerPrimitive, MessagePrimitive. Use when customizing chat UI components.
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…