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.5 | $0.00019 | $0.01254 |
| Sonnet 5.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 3mo 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.
- 3mo 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 (92 stars, last pushed 10mo ago), licensed MIT. It adds 48 tokens to every session and 3,134 once invoked, about $0.0002 per session on Opus 5.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.
frontend-react-best-practices compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| frontend-react-best-practicessergiodxa/agent-skills | Skill | 92 | 10mo ago | MIT | A | 48 | Claude Code, Codex |
| build-ghost-appTryGhost/Ghost | Skill | 56k | today | MIT | A | 44 | Claude Code, Codex |
| material-ui-tailwindmui/material-ui | Skill | 99k | yesterday | MIT | A | 67 | Claude Code |
| fuzzy-rankingTanStack/table | Skill | 29k | today | MIT | A | 62 | Claude Code, Codex |
| r3f-best-practiceszebbern/claude-code-guide | Skill | 4.7k | yesterday | MIT | A | 74 | Claude Code, Codex |
| git-safetytamagui/tamagui | Skill | 14k | yesterday | MIT | A | 42 | Claude Code |
| remotion-best-practicesguanyang/open-agent-hub | Skill | 1.0k | yesterday | MIT | A | 116 | Claude Code |