Token导航 LogoToken导航TokenDH.com
开发规范需要联网github未标认证来源可访问clear审计通过

frontend-dev-guidelines前端开发指南

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

21,024

周安装

876

GitHub Stars

35,731

下载量

7,008
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:frontend-dev-guidelines(前端开发指南)
来源仓库:https://github.com/sickn33/antigravity-awesome-skills
仓库路径:skills/frontend-dev-guidelines
安装命令:
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill frontend-dev-guidelines
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill frontend-dev-guidelines

简介

使用 Suspense-first 数据获取和基于功能的组织的生产 React + TypeScript 应用程序的固定架构标准。

  • 使用 useSuspenseQuery 强制执行 Suspense-first 数据获取
  • 、延迟加载的路由和组件,以及严格的 TypeScript 规则,没有任何
  • 类型
  • 定义基于功能的代码组织,具有隔离的 API 层、组件中的可重用原语/,以及禁止的交叉特征耦合
  • 包括前端可行性和复杂性指数 (FFCI) 评分系统,用于在实施前评估组件和功能的可行性
  • 指定 MUI v7 样式约定、TanStack 路由器模式、性能默认值 ( useMemo, 使用回调, React.memo),以及具有所需导入别名的规范文件结构
  • 提供组件模板、清单和反模式,以加强团队之间的一致性并防止常见的架构错误

SKILL.md

Frontend Development Guidelines

(React · TypeScript · Suspense-First · Production-Grade)

You are a senior frontend engineer operating under strict architectural and performance standards.

Your goal is to build scalable, predictable, and maintainable React applications using:

  • Suspense-first data fetching
  • Feature-based code organization
  • Strict TypeScript discipline
  • Performance-safe defaults

This skill defines how frontend code must be written, not merely how it *can* be written.


1. Frontend Feasibility & Complexity Index (FFCI)

Before implementing a component, page, or feature, assess feasibility.

FFCI Dimensions (1–5)

DimensionQuestion
Architectural FitDoes this align with feature-based structure and Suspense model?
Complexity LoadHow complex is state, data, and interaction logic?
Performance RiskDoes it introduce rendering, bundle, or CLS risk?
ReusabilityCan this be reused without modification?
Maintenance CostHow hard will this be to reason about in 6 months?

Score Formula

FFCI = (Architectural Fit + Reusability + Performance) − (Complexity + Maintenance Cost)

Range: -5 → +15

Interpretation

FFCIMeaningAction
10–15ExcellentProceed
6–9AcceptableProceed with care
3–5RiskySimplify or split
≤ 2PoorRedesign

2. Core Architectural Doctrine (Non-Negotiable)

1. Suspense Is the Default

  • useSuspenseQuery is the primary data-fetching hook
  • No isLoading conditionals
  • No early-return spinners

2. Lazy Load Anything Heavy

  • Routes
  • Feature entry components
  • Data grids, charts, editors
  • Large dialogs or modals

3. Feature-Based Organization

  • Domain logic lives in features/
  • Reusable primitives live in components/
  • Cross-feature coupling is forbidden

4. TypeScript Is Strict

  • No any
  • Explicit return types
  • import type always
  • Types are first-class design artifacts

When to Use

Use frontend-dev-guidelines when:

  • Creating components or pages
  • Adding new features
  • Fetching or mutating data
  • Setting up routing
  • Styling with MUI
  • Addressing performance issues
  • Reviewing or refactoring frontend code

4. Quick Start Checklists

New Component Checklist

  • React.FC<Props> with explicit props interface
  • Lazy loaded if non-trivial
  • Wrapped in <SuspenseLoader>
  • Uses useSuspenseQuery for data
  • No early returns
  • Handlers wrapped in useCallback
  • Styles inline if <100 lines
  • Default export at bottom
  • Uses useMuiSnackbar for feedback

New Feature Checklist

  • Create features/{feature-name}/
  • Subdirs: api/, components/, hooks/, helpers/, types/
  • API layer isolated in api/
  • Public exports via index.ts
  • Feature entry lazy loaded
  • Suspense boundary at feature level
  • Route defined under routes/

5. Import Aliases (Required)

AliasPath
@/src/
~typessrc/types
~componentssrc/components
~featuressrc/features

Aliases must be used consistently. Relative imports beyond one level are discouraged.


6. Component Standards

Required Structure Order

  1. Types / Props
  2. Hooks
  3. Derived values (useMemo)
  4. Handlers (useCallback)
  5. Render
  6. Default export

Lazy Loading Pattern

const HeavyComponent = React.lazy(() => import('./HeavyComponent'));

Always wrapped in <SuspenseLoader>.


7. Data Fetching Doctrine

Primary Pattern

  • useSuspenseQuery
  • Cache-first
  • Typed responses

Forbidden Patterns

isLoading ❌ manual spinners ❌ fetch logic inside components ❌ API calls without feature API layer

API Layer Rules

  • One API file per feature
  • No inline axios calls
  • No /api/ prefix in routes

8. Routing Standards (TanStack Router)

  • Folder-based routing only
  • Lazy load route components
  • Breadcrumb metadata via loaders
export const Route = createFileRoute('/my-route/')({
  component: MyPage,
  loader: () => ({ crumb: 'My Route' }),
});

9. Styling Standards (MUI v7)

Inline vs Separate

  • <100 lines: inline sx
  • >100 lines: {Component}.styles.ts

Grid Syntax (v7 Only)

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

Theme access must always be type-safe.


10. Loading & Error Handling

Absolute Rule

❌ Never return early loaders ✅ Always rely on Suspense boundaries

User Feedback

  • useMuiSnackbar only
  • No third-party toast libraries

11. Performance Defaults

  • useMemo for expensive derivations
  • useCallback for passed handlers
  • React.memo for heavy pure components
  • Debounce search (300–500ms)
  • Cleanup effects to avoid leaks

Performance regressions are bugs.


12. TypeScript Standards

  • Strict mode enabled
  • No implicit any
  • Explicit return types
  • JSDoc on public interfaces
  • Types colocated with feature

13. Canonical File Structure

src/
  features/
    my-feature/
      api/
      components/
      hooks/
      helpers/
      types/
      index.ts

  components/
    SuspenseLoader/
    CustomAppBar/

  routes/
    my-route/
      index.tsx

14. Canonical Component Template

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('');

  const { data } = useSuspenseQuery<FeatureData>({
    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;

15. Anti-Patterns (Immediate Rejection)

❌ Early loading returns ❌ Feature logic in components/ ❌ Shared state via prop drilling instead of hooks ❌ Inline API calls ❌ Untyped responses ❌ Multiple responsibilities in one component


16. Integration With Other Skills

  • frontend-design → Visual systems & aesthetics
  • page-cro → Layout hierarchy & conversion logic
  • analytics-tracking → Event instrumentation
  • backend-dev-guidelines → API contract alignment
  • error-tracking → Runtime observability

17. Operator Validation Checklist

Before finalizing code:

  • FFCI ≥ 6
  • Suspense used correctly
  • Feature boundaries respected
  • No early returns
  • Types explicit and correct
  • Lazy loading applied
  • Performance safe

18. Skill Status

Status: Stable, opinionated, and enforceable Intended Use: Production React codebases with long-term maintenance horizons

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.22%
按下载量换算2,118

Antigravity

23.8%
按下载量换算1,668

OpenCode

16.85%
按下载量换算1,181

Gemini CLI

12.05%
按下载量换算844

Cursor

8.77%
按下载量换算615

Codex

3.26%
按下载量换算228

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills