Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
mrgoonie avatar

Frontend Dev Guidelines

  • 343 installs
  • 2.2k repo stars
  • Updated April 3, 2026
  • mrgoonie/claudekit-skills

This is a copy of frontend-dev-guidelines by davila7 - installs and ranking accrue to the original listing.

frontend-dev-guidelines is a Claude skill that applies React and TypeScript frontend conventions—including Suspense, TanStack Router, and MUI v7—for developers who need consistent component, routing, and data-fetching pa

About

frontend-dev-guidelines is a mrgoonie claudekit-skills playbook for modern React and TypeScript frontend development inside Claude Code and compatible agents. It promotes Suspense-based data fetching with `useSuspenseQuery`, lazy loading via `React.lazy`, feature-based directory layouts under `features/{name}/`, and TanStack Router route files under `routes/`. Styling guidance targets MUI v7 with inline styles under 100 lines and separate files when components exceed that threshold. Import aliases such as `@/`, `~types`, `~components`, and `~features` keep modules organized, while `useMuiSnackbar` replaces ad-hoc loading spinners and early-return patterns. Topic guides cover data fetching, routing, performance, file organization, loading and error boundaries, and TypeScript best practices. Developers reach for this skill when creating components, pages, or features and want Claude-generated code to match production-grade React conventions instead of generic snippets.

  • Component conventions
  • State patterns
  • A11y defaults
  • Styling rules
  • Performance habits

Frontend Dev Guidelines by the numbers

  • 343 all-time installs (skills.sh)
  • +3 installs in the week ending Jul 26, 2026 (Skillselion tracking)
  • Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/mrgoonie/claudekit-skills --skill frontend-dev-guidelines

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs343
repo stars2.2k
Last updatedApril 3, 2026
Repositorymrgoonie/claudekit-skills

What React TypeScript patterns should Claude follow for frontend?

Apply consistent frontend conventions for components, state, styling, accessibility, and performance while building UI features in Claude-assisted projects.

Who is it for?

React TypeScript developers using Claude who want enforced Suspense, TanStack Router, and MUI v7 patterns across new UI features.

Skip if: Teams on Vue, Svelte, or backend-only services without React component or routing work.

When should I use this skill?

User creates React components, pages, routes, data fetching, or styling and needs claudekit frontend conventions applied.

What you get

Feature-scoped React components, TanStack routes, Suspense boundaries, and MUI v7 styled UI following project conventions.

  • Convention-compliant React components
  • Feature folder structure
  • TanStack Router route files

By the numbers

  • Recommends splitting component styles into separate files when exceeding 100 lines
  • Documents 4 import aliases: @/, ~types, ~components, ~features

Files

SKILL.mdMarkdownGitHub ↗

Frontend Development Guidelines

Purpose

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

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

// 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](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](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](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:

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

[📖 Complete Guide: resources/styling-guide.md](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:

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](resources/routing-guide.md)

---

⏳ Loading & Error States

CRITICAL RULE: No Early Returns

// ❌ 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](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](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](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](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](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)

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

---

Related Skills

  • 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

Related skills

How it compares

Use frontend-dev-guidelines for React/TanStack/MUI architecture rules; use frontend-design when the priority is distinctive visual UI rather than code structure conventions.

FAQ

Which data fetching pattern does frontend-dev-guidelines prefer?

frontend-dev-guidelines prefers `useSuspenseQuery` with Suspense boundaries instead of early-return loading spinners, plus `React.lazy` for heavy components wrapped in suspense fallbacks.

How should frontend-dev-guidelines organize new features?

frontend-dev-guidelines creates `features/{feature-name}/` with `api/`, `components/`, `hooks/`, `helpers/`, and `types/` subfolders, plus a route file under `routes/{feature-name}/index.tsx` using TanStack Router.

Frontend Developmentfrontendtestingdocs

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.