Langsung ke konten
Skillpedia
Website & UI (frontend)33k Β· #8758

frontend-dev-guidelines

Fungsinya

Skill ini memberikan agent AI Anda serangkaian pedoman pengembangan React modern. Skill ini ditujukan untuk pengembang aplikasi React yang menginginkan struktur yang konsisten dan performa yang baik.

Kapan dipakai

  • βœ“Saat Anda membuat komponen, halaman, atau fitur React baru.
  • βœ“Saat Anda mengambil data, mengatur routing, atau memberi gaya komponen dengan MUI.
  • βœ“Saat Anda ingin meningkatkan performa aplikasi React.

Link skill

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/frontend-dev-guidelines/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/frontend-dev-guidelines/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBuat halaman faktur baru di aplikasi React saya yang memuat data dan mengikuti struktur file kami.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mengikuti daftar periksa untuk komponen dan fitur, termasuk lazy loading, pengambilan data berbasis Suspense, dan tata letak folder yang sudah ditetapkan. Setelah itu, agent menulis kode yang sesuai dengan pola tersebut.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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

Alias Resolves To Example
@/ src/ import { apiClient } from '@/lib/apiClient'
~types src/types import type { User } from '~types/user'
~components src/components import { SuspenseLoader } from '~components/SuspenseLoader'
~features src/features import { 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


πŸ“Š 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, SxProp
Pertanyaan umum

Pendekatan pengambilan data apa yang digunakan?

Skill menggunakan pengambilan data berbasis Suspense dengan TanStack Query dan useSuspenseQuery.

Pustaka gaya apa yang dicakup?

Skill mencakup gaya MUI versi 7.

Bagaimana folder fitur diatur?

Setiap fitur memiliki folder sendiri dengan subfolder untuk pemanggilan API, komponen, hook, helper, dan tipe.

Detail

Deskripsi asli dari pembuat

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.

repo: davila7/claude-code-templates

Popularitas

Bintang GitHub
33k
Peringkat
#8758
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa