AgentSkillsCN

frontend-dev-guidelines

React/TypeScript应用的前端开发指南。涵盖现代开发模式,包括Suspense、懒加载、useSuspenseQuery、以features目录进行文件组织、MUI v7样式设计、TanStack Router路由框架、性能优化,以及TypeScript最佳实践。当您创建组件、页面、功能模块,或进行数据获取、样式设计、路由配置,亦或是处理前端代码时,不妨采用这一方法。

SKILL.md
--- frontmatter
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.

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 Actions

📋 Checklists

⚡ Cheatsheets


📚 Topic Guides


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

Related Skills

  • error-tracking: Error tracking with Sentry
  • backend-dev-guidelines: Backend API patterns