react-frontend

react-frontend is a skill for Claude Code, Codex from iliaal/whetstone. It costs 57 tokens per session (1,585 once invoked), scanned A, original, MIT.

A set of guidance for building front ends with React, TypeScript, and Next.js, tools commonly used to create web interfaces. It covers components, application state, data fetching, performance, and Next.js App Router patterns.

In plain words
What is it for?
Use it when creating React components, managing state, loading data, improving performance, or building pages with the Next.js App Router.
Why use it?
It helps an agent choose consistent, type-safe ways to structure React interfaces and avoid common mistakes with hooks, effects, and server-side features.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/iliaal/whetstone/react-frontend
Any agent
npx skills add iliaal/whetstone --skill react-frontend
Clone the repo
git clone --depth 1 https://github.com/iliaal/whetstone

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-frontend

README.md
[![agentmods](https://agentmods.dev/badge/skills/iliaal/whetstone/react-frontend.svg)](https://agentmods.dev/skills/iliaal/whetstone/react-frontend)
Your own site
<a href="https://agentmods.dev/skills/iliaal/whetstone/react-frontend"><img src="https://agentmods.dev/badge/skills/iliaal/whetstone/react-frontend.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,585 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00057 $0.01585
Opus 5 $0.00028 $0.00792
Sonnet 5 $0.00011 $0.00317
Haiku 4.5 $0.00006 $0.00159

Measured 4d ago against content hash ad24a6a3942e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

react-frontend 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 4d 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, { cache: 'force-cache' })` — static
distillery/generated-skills/react-frontend/SKILL.md · 122 lines

How it starts

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

React Frontend

Component TypeScript

  • Extend native elements with ComponentPropsWithoutRef<'button'>, add custom props via intersection
  • Use React.ReactNode for children, React.ReactElement for single element, render prop (data: T) => ReactNode
  • Discriminated unions for variant props — TypeScript narrows automatically in branches
  • Generic components: <T> with keyof T for column keys, T extends { id: string } for constraints
  • Event types: React.MouseEvent<HTMLButtonElement>, FormEvent<HTMLFormElement>, ChangeEvent<HTMLInputElement>
  • as const for custom hook tuple returns
  • useRef<HTMLInputElement>(null) for DOM (use ?.), useRef<number>(0) for mutable values
  • Explicit useState<User | null>(null) for unions/null
  • useReducer actions as discriminated unions: { type: 'set'; payload: number } | { type: 'reset' }
  • useContext null guard: throw in custom useX() hook if context is null

Effects Decision Tree

Effects are escape hatches — most logic should NOT use effects.

Need Solution
Derived value from props/state Calculate during render (useMemo if expensive)
Reset state on prop change key prop on component
Respond to user event Event handler
Notify parent of state change Call onChange in event handler, or fully controlled component
Chain of state updates Calculate all next state in one event handler
Sync with external system Effect with cleanup

Effect rules:

  • Never suppress the linter — fix the code instead
  • Use updater functions (setItems(prev => [...prev, item])) to remove state dependencies
  • Move objects/functions inside effects to stabilize dependencies
  • useEffectEvent for non-reactive values (e.g., theme in a connection effect)
  • Always return cleanup for subscriptions, connections, listeners
  • Data fetching: use ignore flag pattern or React Query

State Management

Local UI state       → useState, useReducer
Shared client state  → Zustand (simple) | Redux Toolkit (complex)
Atomic/granular      → Jotai
Server/remote data   → React Query (TanStack Query)
URL state            → nuqs, router search params
Form state           → React Hook Form

Read the full file on GitHub · 122 lines

Files

What ships with it

1 file 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.

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. 4d ago First seen · 122 lines · 57 tokens per session scan A ad24a6a3942e

Subscribe to this mod's changes

react-frontend is a skill published in the GitHub repository iliaal/whetstone (32 stars, last pushed 5d ago), licensed MIT. It adds 57 tokens to every session and 1,585 once invoked, about $0.0003 per session on Opus 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-08-30.

Related

Other skills, from other repositories

tanstack-form-composition

Migrate a React @tanstack/react-form codebase from the prop-drilled useForm + erased-form-type pattern to the official createFormHook composition API (useAppForm / withForm / field.X). Use when a project threads a form object (often cast to an any-erased type like ReactFormExtendedApi ) through field-wrapper…

suxrobGM/jobpilot · 158 tokens

stitch-nextjs-components

Converts a Stitch screen, a local HTML file, or a URL into production-ready Next.js 15 App Router components — Server vs Client split, dark mode via CSS variables, TypeScript strict, ARIA, and responsive mobile-first layout. Only the Stitch route needs an API key.

gabelul/stitch-kit · 64 tokens

frontend

Use when building React components, optimizing performance, analyzing bundle sizes, scaffolding projects, implementing accessibility, reviewing frontend code quality, performing visual overhauls, or designing UI/UX systems.

Joncik91/ucai · 40 tokens

react-application-structure

Establishes or reviews the directory layout, feature boundaries, state design, routing approach, and data-fetching conventions for a React 18+ TypeScript application. Invoked when the user asks to structure a React app, set up a scalable architecture, or review React project organization.

soulcodex/agentic · 63 tokens

next-application-structure

Establishes or reviews directory layout, server/client boundaries, routing, data-fetching strategy, and testing structure for Next.js 14+ App Router TypeScript applications. Invoked when the user asks to structure a Next app, set App Router conventions, or review architecture for React parity.

soulcodex/agentic · 64 tokens

react-component-design

Designs or reviews React component APIs. Handles prop drilling decisions, composition patterns, controlled/uncontrolled contracts, and minimal public API surfaces for React 18+ TypeScript components. Invoked when creating new components, refactoring existing ones, or reviewing component contracts.

soulcodex/agentic · 56 tokens