react-best-practices

react-best-practices is a skill for Claude Code, Codex from saajunaid/caddis-plugin. It costs 27 tokens per session (1,639 once invoked), scanned A, original, MIT.

A set of guidelines for modern React development, covering hooks, component structure, application state, speed, and TypeScript integration. React is a JavaScript library for building user interfaces from reusable components.

In plain words
What is it for?
Use it when designing React components, managing state, improving rendering performance, or adding TypeScript to a React project.
Why use it?
It helps developers make React code easier to maintain and avoid common problems with state, component design, and performance.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when designing React components, managing state, improving rendering performance, or adding TypeScript to a React project.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/saajunaid/caddis-plugin/react-best-practices
Install

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.

Any agent
npx skills add saajunaid/caddis-plugin --skill react-best-practices
Clone the repo
git clone --depth 1 https://github.com/saajunaid/caddis-plugin

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for react-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/react-best-practices/github.svg)](https://agentmods.dev/skills/saajunaid/caddis-plugin/react-best-practices)
Your own site
<a href="https://agentmods.dev/skills/saajunaid/caddis-plugin/react-best-practices"><img src="https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/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.

agentmods 80×15 button for react-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/saajunaid/caddis-plugin/react-best-practices"><img src="https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/react-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,639 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00027 $0.01639
Opus 5.5 $0.00011 $0.00656
Sonnet 5.5 $0.00005 $0.00328
Haiku 4.5 $0.00003 $0.00164

Measured 1mo ago against content hash 574b63f94972, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

react-best-practices scanned grade A with 1 finding 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 1mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

fetch(url, { signal: controller.signal })
.github/skills/frontend/react-best-practices/SKILL.md · 270 lines

How it starts

The opening of the file, as written. The whole thing — 270 lines — stays where its author put it; the contents beside it link to each section on GitHub.

React Best Practices

Modern React development guidelines for building maintainable, performant applications.

When to Use

  • Building React applications (Next.js, Vite, CRA)
  • Reviewing React code for quality
  • Optimizing React app performance
  • Learning modern React patterns (hooks, server components)

Steps

Step 1: Component Structure

Functional Components Only
// Prefer: Arrow function with explicit return type
const UserCard: React.FC<UserCardProps> = ({ name, email, avatar }) => {
  return (
    <div className="user-card">
      <img src={avatar} alt={`${name}'s avatar`} />
      <h3>{name}</h3>
      <p>{email}</p>
    </div>
  );
};

// Props interface (always define)
interface UserCardProps {
  name: string;
  email: string;
  avatar: string;
  onSelect?: (email: string) => void;
}
File Organization
src/
├── components/       # Reusable UI components
│   ├── Button/
│   │   ├── Button.tsx
│   │   ├── Button.test.tsx
│   │   └── index.ts
│   └── ...
├── hooks/            # Custom hooks
├── pages/            # Route-level components
├── services/         # API calls
├── types/            # Shared TypeScript types
└── utils/            # Utility functions

Step 2: Hooks Patterns

useState -- Keep State Minimal
// Good: derive values instead of storing them
const [items, setItems] = useState<Item[]>([]);
const totalPrice = items.reduce((sum, item) => sum + item.price, 0); // Derived

// Bad: redundant state
const [items, setItems] = useState<Item[]>([]);
const [totalPrice, setTotalPrice] = useState(0); // Don't do this
useEffect -- Cleanup and Dependencies
useEffect(() => {
  const controller = new AbortController();

  async function fetchData() {
    try {
      const res = await fetch(`/api/users/${userId}`, { signal: controller.signal });
      const data = await res.json();
      setUser(data);
    } catch (err) {
      if (!controller.signal.aborted) setError(err);
    }
  }

  fetchData();
  return () => controller.abort(); // Cleanup
}, [userId]); // Only re-run when userId changes

Read the full file on GitHub · 270 lines

Changes

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.

  1. 1mo ago First seen · 270 lines · 27 tokens per session scan A 574b63f94972

Subscribe to this mod's changes

react-best-practices is a skill published in the GitHub repository saajunaid/caddis-plugin (0 stars, last pushed 2d ago), licensed MIT. It adds 27 tokens to every session and 1,639 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.