react-rules

React and component patterns.

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/dlupiak/claude-session-dashboard/react-rules
Any agent
npx skills add dlupiak/claude-session-dashboard --skill react-rules
Clone the repo
git clone --depth 1 https://github.com/dlupiak/claude-session-dashboard

Made for: Claude Code, Codex.

Per session 8 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 463 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00008 $0.00463
Opus 5 $0.00004 $0.00231
Sonnet 5 $0.00002 $0.00093
Haiku 4.5 $0.00001 $0.00046

Measured yesterday against content hash 6390b5b4721e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

react-rules 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 yesterday.

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.

.claude/skills/react-rules/SKILL.md · 44 lines

What it actually says

React Rules

Components

  • Use named exports, not default exports: export function AgentCard() {}
  • One component per file for route-level components
  • Co-locate small helper components in the same file
  • Use className with Tailwind — no CSS modules or styled-components

Data Fetching

  • Use TanStack Query (useQuery, useSuspenseQuery) for all data fetching
  • Server Functions for mutations via useMutation
  • Never use useEffect for data fetching
  • Prefetch on the server with queryClient.prefetchQuery in route loaders

State

  • URL state first (search params via TanStack Router)
  • Server state via TanStack Query (no Redux, no Zustand)
  • Local UI state only with useState — keep it minimal
  • Form state with controlled components or useForm

Patterns

  • Suspense boundaries at route level, not per-component
  • Error boundaries for slice-level error handling
  • Compose with props, not render props or HOCs
  • Use shadcn/ui components — don't build custom UI primitives

File Naming

  • Route files: route.tsx (TanStack Router file-based routing)
  • UI components: PascalCase.tsx or grouped in ui.tsx within a slice
  • Hooks: use-kebab-case.ts (must start with use prefix — enforced by architecture tests)

Slice Boundaries (enforced by automated tests)

  • Never import a component from another feature's ui/ directory directly
  • Shared UI primitives go in src/components/ui/ (shadcn convention)
  • Cross-slice data: import hooks/types from the other slice's model.ts facade, not from internal files
  • Route files must be thin — compose from slice hooks and components, don't import from domain/ or infra/ directly
  • Example: import { useAgents } from '@/features/registry/model' (correct) vs import { useAgents } from '@/features/registry/hooks/useAgents' (wrong from outside registry)
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. yesterday First seen · 44 lines · 8 tokens per session scan A 6390b5b4721e

Subscribe to this mod's changes

react-rules is a skill published in the GitHub repository dlupiak/claude-session-dashboard (66 stars, last pushed 2d ago), licensed MIT. It adds 8 tokens to every session and 463 once invoked, about $0.0000 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-09-01.

Related

Other skills, from other repositories

react-artifact

Author app-like designs in React/JSX and bundle them in-sandbox into the same single self-contained HTML artifact Design Studio delivers. Use when the design needs real state, complex interactivity, or component reuse beyond what vanilla JS comfortably handles.

juspay/xyne-spaces · 53 tokens

nerv-ui

Build original, accessible React command-center interfaces with the published @mdrbx/nerv-ui component library. Use for dashboards, monitoring terminals, operational tools, authentication screens, or sharp industrial HUD-style UI in React, Vite, or Next.js.

mdrbx/nerv-ui · 54 tokens

react-frontend

React architecture patterns, TypeScript, Next.js, hooks, and testing. Use when working with React component structure, state management, Next.js routing, Vitest, React Testing Library, or reviewing React code. For visual design and aesthetic direction, use frontend-design instead.

iliaal/ai-skills · 58 tokens

react-frontend

React, TypeScript, and Next.js patterns for frontend development. Use when building React components, managing state, fetching data, optimizing performance, or working with Next.js App Router. Covers React 18-19, hooks, Server Components, and type-safe patterns.

iliaal/whetstone · 57 tokens

testing-react

Writes React/TypeScript tests using Vitest and React Testing Library. Use when "write react tests", "vitest", "component test", "hook test", "RTL", "testing library", "snapshot test", or testing React components, hooks, and utilities.

iliaal/whetstone · 57 tokens

create-react-modlet

Create React components or hooks following the modlet pattern in this project. Use when creating any new component or hook in panel/src/components/. Modlets are self-contained folders with index.ts, implementation, tests, and optional types.

bitovi/convey · 50 tokens