Agent skill

React Frontend Development Guidelines

by diet103 in diet103/claude-code-infrastructure-showcase

Guidelines for React 18 and TypeScript apps covering Suspense data fetching, lazy loading, feature folders, MUI v7 styling, TanStack Router and performance.

MITAuto-check passedFrontend & Design

Install React Frontend Development Guidelines

skills CLI
$ npx skills add diet103/claude-code-infrastructure-showcase --skill frontend-dev-guidelines -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install diet103/claude-code-infrastructure-showcase frontend-dev-guidelines --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/diet103/claude-code-infrastructure-showcase.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/frontend-dev-guidelines .claude/skills/frontend-dev-guidelines && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
frontend-dev-guidelines
GitHub stars
10k
Used in
2 other repos
Token cost
~2.9k tokens
SKILL.md length
709 words
Files
11
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Guidelines for React 18 and TypeScript apps covering Suspense data fetching, lazy loading, feature folders, MUI v7 styling, TanStack Router and performance.

  • Works in 8 steps: Lazy Load Everything Heavy: Routes,… → Suspense for Loading: Use… → useSuspenseQuery: Primary data fetching… → …
  • Creating a new React component or page in this stack
  • SKILL.md covers Purpose, When to Use This Skill, Quick Start and Import Aliases Quick Reference, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The guide is written for React 18, TypeScript, MUI v7 and TanStack Router and Query, and tells the agent to adapt the principles for a different stack. It emphasizes Suspense-based data fetching with useSuspenseQuery, lazy loading heavy components behind a SuspenseLoader, a features directory layout, performance work and TypeScript standards.

A new component checklist asks for the React.FC pattern with typed props, lazy loading for heavy components, import aliases such as @/, ~types, ~components and ~features, inline styles under 100 lines and a separate file above that, useCallback for handlers passed to children, a default export at the bottom, no early returns with loading spinners, and useMuiSnackbar for notifications. A feature checklist sets up a features folder with api, components, hooks, helpers and types subfolders, an API service file, a route and a public index export.

Ten resource files go deeper on common patterns, complete examples, component patterns, data fetching, file organization, loading and error states, performance, routing, styling and TypeScript standards.

When your agent uses it

  • Creating a new React component or page in this stack
  • Setting up a new feature folder with API, hooks and types
  • Fetching data with TanStack Query and Suspense
  • Styling components with MUI v7

Example prompts

  • “Create a settings page for notification preferences using Suspense and useSuspenseQuery.”
  • “Set up a new billing feature folder with its API service, types and lazy-loaded route.”
  • “Refactor this component so loading uses a Suspense boundary instead of an early-return spinner.”

Requirements

  • A React 18, TypeScript and MUI v7 project, ideally with TanStack Router and Query

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. Lazy Load Everything Heavy: Routes, DataGrid, charts, editors
  2. Suspense for Loading: Use SuspenseLoader, not early returns
  3. useSuspenseQuery: Primary data fetching pattern for new code
  4. Features are Organized: api/, components/, hooks/, helpers/ subdirs
  5. Styles Based on Size: <100 inline, >100 separate
  6. Import Aliases: Use @/, ~types, ~components, ~features
  7. No Early Returns: Prevents layout shift
  8. useMuiSnackbar: For all user notifications

What it can do on your machine

Read from SKILL.md and the folder at commit 07f75ce. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

React Frontend Development Guidelines loads about 2.9k tokens when it runs. Until then it costs about 101 tokens; SKILL.md has 709 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~101
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from diet103/claude-code-infrastructure-showcase at commit 07f75ce, republished under its MIT licence (© diet103). 709 words, ~2,858 tokens.

Download SKILL.mdSave it as .claude/skills/frontend-dev-guidelines/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.
name
frontend-dev-guidelines
description
Frontend development guidelines for React/TypeScript applications. Modern patterns including Suspense, lazy loading, useSuspenseQuery, file organization with features directory, MUI v7 styling, TanStack Router, performance optimization, and TypeScript best practices. Use when creating components, pages, features, fetching data, styling, routing, or working with frontend code.

Frontend Development Guidelines

Purpose

Comprehensive guide for modern React development, emphasizing Suspense-based data fetching, lazy loading, proper file organization, and performance optimization.

Written for React 18 + TypeScript + MUI v7 + TanStack Router/Query. Different stack? Adapt the principles - see CLAUDE_INTEGRATION_GUIDE.md in the repo root.

When to Use This Skill

  • Creating new components or pages
  • Building new features
  • Fetching data with TanStack Query
  • Setting up routing with TanStack Router
  • Styling components with MUI v7
  • Performance optimization
  • Organizing frontend code
  • TypeScript best practices

Quick Start

New Component Checklist

Creating a component? Follow this checklist:

  • Use React.FC<Props> pattern with TypeScript
  • Lazy load if heavy component: React.lazy(() => import())
  • Wrap in <SuspenseLoader> for loading states
  • Use useSuspenseQuery for data fetching
  • Import aliases: @/, ~types, ~components, ~features
  • Styles: Inline if <100 lines, separate file if >100 lines
  • Use useCallback for event handlers passed to children
  • Default export at bottom
  • No early returns with loading spinners
  • Use useMuiSnackbar for user notifications
New Feature Checklist

Creating a feature? Set up this structure:

  • Create features/{feature-name}/ directory
  • Create subdirectories: api/, components/, hooks/, helpers/, types/
  • Create API service file: api/{feature}Api.ts
  • Set up TypeScript types in types/
  • Create route in routes/{feature-name}/index.tsx
  • Lazy load feature components
  • Use Suspense boundaries
  • Export public API from feature index.ts

Import Aliases Quick Reference

AliasResolves ToExample
@/src/import { apiClient } from '@/lib/apiClient'
~typessrc/typesimport type { User } from '~types/user'
~componentssrc/componentsimport { SuspenseLoader } from '~components/SuspenseLoader'
~featuressrc/featuresimport { authApi } from '~features/auth'

Defined in: vite.config.ts lines 180-185


Common Imports Cheatsheet

typescript
// React & Lazy Loading
import React, { useState, useCallback, useMemo } from 'react';
const Heavy = React.lazy(() => import('./Heavy'));

// MUI Components
import { Box, Paper, Typography, Button, Grid } from '@mui/material';
import type { SxProps, Theme } from '@mui/material';

// TanStack Query (Suspense)
import { useSuspenseQuery, useQueryClient } from '@tanstack/react-query';

// TanStack Router
import { createFileRoute } from '@tanstack/react-router';

// Project Components
import { SuspenseLoader } from '~components/SuspenseLoader';

// Hooks
import { useAuth } from '@/hooks/useAuth';
import { useMuiSnackbar } from '@/hooks/useMuiSnackbar';

// Types
import type { Post } from '~types/post';

Topic Guides

🎨 Component Patterns

Modern React components use:

  • React.FC<Props> for type safety
  • React.lazy() for code splitting
  • SuspenseLoader for loading states
  • Named const + default export pattern

Key Concepts:

  • Lazy load heavy components (DataGrid, charts, editors)
  • Always wrap lazy components in Suspense
  • Use SuspenseLoader component (with fade animation)
  • Component structure: Props → Hooks → Handlers → Render → Export

📖 Complete Guide: resources/component-patterns.md


📊 Data Fetching

PRIMARY PATTERN: useSuspenseQuery

  • Use with Suspense boundaries
  • Cache-first strategy (check grid cache before API)
  • Replaces isLoading checks
  • Type-safe with generics

API Service Layer:

  • Create features/{feature}/api/{feature}Api.ts
  • Use apiClient axios instance
  • Centralized methods per feature
  • Route format: /form/route (NOT /api/form/route)

📖 Complete Guide: resources/data-fetching.md


📁 File Organization

features/ vs components/:

  • features/: Domain-specific (posts, comments, auth)
  • components/: Truly reusable (SuspenseLoader, CustomAppBar)

Feature Subdirectories:

features/
  my-feature/
    api/          # API service layer
    components/   # Feature components
    hooks/        # Custom hooks
    helpers/      # Utility functions
    types/        # TypeScript types

📖 Complete Guide: resources/file-organization.md


🎨 Styling

Inline vs Separate:

  • <100 lines: Inline const styles: Record<string, SxProps<Theme>>
  • 100 lines: Separate .styles.ts file

Primary Method:

  • Use sx prop for MUI components
  • Type-safe with SxProps<Theme>
  • Theme access: (theme) => theme.palette.primary.main

MUI v7 Grid:

typescript
<Grid size={{ xs: 12, md: 6 }}>  // ✅ v7 syntax
<Grid xs={12} md={6}>             // ❌ Old syntax

📖 Complete Guide: resources/styling-guide.md


🛣️ Routing

TanStack Router - Folder-Based:

  • Directory: routes/my-route/index.tsx
  • Lazy load components
  • Use createFileRoute
  • Breadcrumb data in loader

Example:

typescript
import { createFileRoute } from '@tanstack/react-router';
import { lazy } from 'react';

const MyPage = lazy(() => import('@/features/my-feature/components/MyPage'));

export const Route = createFileRoute('/my-route/')({
    component: MyPage,
    loader: () => ({ crumb: 'My Route' }),
});

📖 Complete Guide: resources/routing-guide.md


Show full SKILL.md (295 more words)Show less
⏳ Loading & Error States

CRITICAL RULE: No Early Returns

typescript
// ❌ NEVER - Causes layout shift
if (isLoading) {
    return <LoadingSpinner />;
}

// ✅ ALWAYS - Consistent layout
<SuspenseLoader>
    <Content />
</SuspenseLoader>

Why: Prevents Cumulative Layout Shift (CLS), better UX

Error Handling:

  • Use useMuiSnackbar for user feedback
  • NEVER react-toastify
  • TanStack Query onError callbacks

📖 Complete Guide: resources/loading-and-error-states.md


⚡ Performance

Optimization Patterns:

  • useMemo: Expensive computations (filter, sort, map)
  • useCallback: Event handlers passed to children
  • React.memo: Expensive components
  • Debounced search (300-500ms)
  • Memory leak prevention (cleanup in useEffect)

📖 Complete Guide: resources/performance.md


📘 TypeScript

Standards:

  • Strict mode, no any type
  • Explicit return types on functions
  • Type imports: import type { User } from '~types/user'
  • Component prop interfaces with JSDoc

📖 Complete Guide: resources/typescript-standards.md


🔧 Common Patterns

Covered Topics:

  • React Hook Form with Zod validation
  • DataGrid wrapper contracts
  • Dialog component standards
  • useAuth hook for current user
  • Mutation patterns with cache invalidation

📖 Complete Guide: resources/common-patterns.md


📚 Complete Examples

Full working examples:

  • Modern component with all patterns
  • Complete feature structure
  • API service layer
  • Route with lazy loading
  • Suspense + useSuspenseQuery
  • Form with validation

📖 Complete Guide: resources/complete-examples.md


Navigation Guide

Need to...Read this resource
Create a componentcomponent-patterns.md
Fetch datadata-fetching.md
Organize files/foldersfile-organization.md
Style componentsstyling-guide.md
Set up routingrouting-guide.md
Handle loading/errorsloading-and-error-states.md
Optimize performanceperformance.md
TypeScript typestypescript-standards.md
Forms/Auth/DataGridcommon-patterns.md
See full examplescomplete-examples.md

Core Principles

  1. Lazy Load Everything Heavy: Routes, DataGrid, charts, editors
  2. Suspense for Loading: Use SuspenseLoader, not early returns
  3. useSuspenseQuery: Primary data fetching pattern for new code
  4. Features are Organized: api/, components/, hooks/, helpers/ subdirs
  5. Styles Based on Size: <100 inline, >100 separate
  6. Import Aliases: Use @/, ~types, ~components, ~features
  7. No Early Returns: Prevents layout shift
  8. useMuiSnackbar: For all user notifications

Quick Reference: File Structure

src/
  features/
    my-feature/
      api/
        myFeatureApi.ts       # API service
      components/
        MyFeature.tsx         # Main component
        SubComponent.tsx      # Related components
      hooks/
        useMyFeature.ts       # Custom hooks
        useSuspenseMyFeature.ts  # Suspense hooks
      helpers/
        myFeatureHelpers.ts   # Utilities
      types/
        index.ts              # TypeScript types
      index.ts                # Public exports

  components/
    SuspenseLoader/
      SuspenseLoader.tsx      # Reusable loader
    CustomAppBar/
      CustomAppBar.tsx        # Reusable app bar

  routes/
    my-route/
      index.tsx               # Route component
      create/
        index.tsx             # Nested route

Modern Component Template (Quick Copy)

typescript
import React, { useState, useCallback } from 'react';
import { Box, Paper } from '@mui/material';
import { useSuspenseQuery } from '@tanstack/react-query';
import { featureApi } from '../api/featureApi';
import type { FeatureData } from '~types/feature';

interface MyComponentProps {
    id: number;
    onAction?: () => void;
}

export const MyComponent: React.FC<MyComponentProps> = ({ id, onAction }) => {
    const [state, setState] = useState<string>('');

    const { data } = useSuspenseQuery({
        queryKey: ['feature', id],
        queryFn: () => featureApi.getFeature(id),
    });

    const handleAction = useCallback(() => {
        setState('updated');
        onAction?.();
    }, [onAction]);

    return (
        <Box sx={{ p: 2 }}>
            <Paper sx={{ p: 3 }}>
                {/* Content */}
            </Paper>
        </Box>
    );
};

export default MyComponent;

For complete examples, see resources/complete-examples.md


  • error-tracking: Error tracking with Sentry (applies to frontend too)
  • backend-dev-guidelines: Backend API patterns that frontend consumes

Skill Status: Modular structure with progressive loading for optimal context management

© diet103, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 10 other files in .agents/skills/frontend-dev-guidelines of diet103/claude-code-infrastructure-showcase.

  • SKILL.md
  • resources/common-patterns.md
  • resources/complete-examples.md
  • resources/component-patterns.md
  • resources/data-fetching.md
  • resources/file-organization.md
  • resources/loading-and-error-states.md
  • resources/performance.md
  • resources/routing-guide.md
  • resources/styling-guide.md
  • resources/typescript-standards.md

Open the folder on GitHubat commit 07f75ce

Used in 2 other repositories

We found 5 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in diet103/claude-code-infrastructure-showcase, which our catalogue first saw on October 7, 2026.

Compare with similar skills

React Frontend Development Guidelines next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

React Frontend Development Guidelines compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
React Frontend Development Guidelines this skilldiet103/claude-code-infrastructure-showcase10k2 repos~2.9kAutomated safety check: PassMIT
React ExpertJeffallan/claude-skills12k—~1.4kAutomated safety check: PassMIT
React Devdavila7/claude-code-templates32k2 repos~2.6kAutomated safety check: PassMIT
Typescript Rulesshinpr/claude-code-workflows690—~1.8kAutomated safety check: PassMIT
Senior Frontendalirezarezvani/claude-skills28k5 repos~3.9kAutomated safety check: PassMIT
Senior Frontendborghei/Claude-Skills874—~1.7kAutomated safety check: PassMIT

Similar skills

  • React Expert

    Jeffallan/claude-skills

    Builds React 19 components in TypeScript with Server Components, useActionState forms, custom hooks and state libraries, checked with tsc and React Testing Library.

    12k GitHub stars~1.4k tokensUpdated 3 days ago
    Frontend & DesignAuto-check passed
  • React Dev

    davila7/claude-code-templates

    This skill should be used when building React components with TypeScript, typing hooks, handling events, or when React TypeScript, React 19, Server Components are mentioned.

    32k GitHub starsUsed in 2 repos~2.6k tokens
    Frontend & DesignAuto-check passed
  • Typescript Rules

    shinpr/claude-code-workflows

    React/TypeScript frontend development rules including type safety, component design, state management, and error handling.

    690 GitHub stars~1.8k tokensUpdated 6 days ago
    Frontend & DesignAuto-check passed
  • Senior Frontend

    alirezarezvani/claude-skills

    Frontend development skill for React, Next.js, TypeScript, and Tailwind CSS applications.

    28k GitHub starsUsed in 5 repos~3.9k tokens
    Frontend & DesignAuto-check passed
  • Senior Frontend

    borghei/Claude-Skills

    Frontend development for React, Next.js, TypeScript, and Tailwind CSS.

    874 GitHub stars~1.7k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Walks through adding a Wagmi feature across its layers: a Viem-based core action, TanStack Query options, and React and Vue bindings.

    6.8k GitHub stars~3.8k tokensUpdated 5 days ago
    DevelopmentAuto-check passed

More from diet103/claude-code-infrastructure-showcase

  • Claude Code Skill Developer Guide

    diet103/claude-code-infrastructure-showcase

    A guide to creating and managing Claude Code skills with auto-activation: skill-rules.json triggers, hooks, enforcement levels, YAML frontmatter and progressive disclosure.

    10k GitHub starsUsed in 10 repos~3.5k tokens
    Auto-check passed
  • Node Backend Development Guidelines

    diet103/claude-code-infrastructure-showcase

    Sets layered architecture and coding rules for Node.js, Express and TypeScript microservices, covering routes, controllers, services, repositories, Prisma, Sentry and Zod.

    10k GitHub starsUsed in 2 repos~2k tokens
    Auto-check passed
  • Sentry v8 Error Tracking

    diet103/claude-code-infrastructure-showcase

    Enforces that every error in a service is captured to Sentry v8, with patterns for controllers, routes, cron jobs and database performance spans instead of console logging alone.

    10k GitHub starsUsed in 2 repos~2.3k tokens
    Auto-check: notes
  • Verify Setup Health Check

    diet103/claude-code-infrastructure-showcase

    Run the infrastructure health check and fix anything that fails

    10k GitHub stars~363 tokensUpdated 2 mo ago
    Auto-check passed

Questions about React Frontend Development Guidelines

What does React Frontend Development Guidelines do?

Guidelines for React 18 and TypeScript apps covering Suspense data fetching, lazy loading, feature folders, MUI v7 styling, TanStack Router and performance. The guide is written for React 18, TypeScript, MUI v7 and TanStack Router and Query, and tells the agent to adapt the principles for a different stack. It emphasizes Suspense-based data fetching with useSuspenseQuery, lazy loading heavy components behind a SuspenseLoader, a features directory layout, performance work and TypeScript standards.

When should I use React Frontend Development Guidelines?

React Frontend Development Guidelines fits situations like: creating a new React component or page in this stack; setting up a new feature folder with API, hooks and types; fetching data with TanStack Query and Suspense; styling components with MUI v7.

How do I install React Frontend Development Guidelines in Claude Code?

Run `npx skills add diet103/claude-code-infrastructure-showcase --skill frontend-dev-guidelines -a claude-code`. Or copy the skill folder (.agents/skills/frontend-dev-guidelines in diet103/claude-code-infrastructure-showcase) into .claude/skills/frontend-dev-guidelines in your project. Claude Code loads it when a task matches its description.

How do I install React Frontend Development Guidelines in Codex?

Run `npx skills add diet103/claude-code-infrastructure-showcase --skill frontend-dev-guidelines -a codex`. Or copy the skill folder (.agents/skills/frontend-dev-guidelines in diet103/claude-code-infrastructure-showcase) into .agents/skills/frontend-dev-guidelines in your project. Codex loads it when a task matches its description.

Can I use React Frontend Development Guidelines in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add diet103/claude-code-infrastructure-showcase --skill frontend-dev-guidelines -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/frontend-dev-guidelines, .gemini/skills/frontend-dev-guidelines, .github/skills/frontend-dev-guidelines and .opencode/skills/frontend-dev-guidelines in your project.

What does React Frontend Development Guidelines need to run?

SKILL.md names no scripts, command-line tools or credentials: React Frontend Development Guidelines is instructions for the agent only. Our summary lists: A React 18, TypeScript and MUI v7 project, ideally with TanStack Router and Query.

Does React Frontend Development Guidelines access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is React Frontend Development Guidelines safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does React Frontend Development Guidelines use?

React Frontend Development Guidelines is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does React Frontend Development Guidelines use?

About 2.9k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to React Frontend Development Guidelines?

Skills that share tags, products or a category with React Frontend Development Guidelines: React Expert (Jeffallan/claude-skills, 12k stars), React Dev (davila7/claude-code-templates, 32k stars), Typescript Rules (shinpr/claude-code-workflows, 690 stars) and Senior Frontend (alirezarezvani/claude-skills, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains React Frontend Development Guidelines?

diet103 (a GitHub user) maintains it in diet103/claude-code-infrastructure-showcase, which has 10,030 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on July 13, 2026.

Source: diet103/claude-code-infrastructure-showcase on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.