frontend-dev-guidelines
You are a senior frontend engineer operating under strict architectural and performance standards. Use when creating components or pages, adding new features, or fetching or mutating data.
About this skill
This skill transforms the AI agent into a highly proficient senior frontend engineer, enforcing a comprehensive set of architectural and performance standards. The agent is guided to build scalable, predictable, and maintainable React applications, rigorously adhering to a Suspense-first data fetching paradigm, feature-based code organization, and strict TypeScript discipline. It prioritizes performance-safe defaults and production-grade development practices, ensuring all generated or evaluated frontend code meets rigorous quality benchmarks for modern web development.
Best use case
Ensuring the generation or evaluation of high-quality, standardized, and performant frontend code for React applications. It helps maintain architectural consistency, enforce best practices, and achieve production-readiness for web projects.
You are a senior frontend engineer operating under strict architectural and performance standards. Use when creating components or pages, adding new features, or fetching or mutating data.
Frontend code (React, TypeScript) that is architecturally sound, highly performant, scalable, predictable, maintainable, and adheres to specified modern development best practices, including Suspense-first patterns and feature-based organization.
Practical example
Example input
Design a new user profile page component in React that fetches user data from `/api/profile` and displays their name, email, and a list of recent activities. Ensure it's Suspense-first, uses TypeScript, and follows feature-based organization principles.
Example output
Generated React/TypeScript code for a `UserProfilePage` component, utilizing React Suspense for data fetching from `/api/profile`. The component will be structured within a `features/user-profile` directory, incorporate explicit TypeScript interfaces for props and state, and apply performance-safe patterns for rendering and data presentation. Includes placeholders for activity list data.
When to use this skill
- When an AI agent is tasked with designing or creating new React components or pages, implementing new features, refactoring existing frontend code, or formulating data fetching and mutation strategies. It is ideal for scenarios requiring strict adherence to code quality, performance, maintainability, and modern web development standards.
When not to use this skill
- For tasks unrelated to frontend development, especially those not involving React, TypeScript, or modern web architecture. It should not be used for rapid prototyping where strict standards might impede initial exploration or for quick, throwaway proofs-of-concept without long-term maintainability concerns.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/frontend-dev-guidelines/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How frontend-dev-guidelines Compares
| Feature / Agent | frontend-dev-guidelines | Standard Approach |
|---|---|---|
| Platform Support | Claude | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | easy | N/A |
Frequently Asked Questions
What does this skill do?
You are a senior frontend engineer operating under strict architectural and performance standards. Use when creating components or pages, adding new features, or fetching or mutating data.
Which AI agents support this skill?
This skill is designed for Claude.
How difficult is it to install?
The installation complexity is rated as easy. You can find the installation instructions above.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# 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)
| Dimension | Question |
| --------------------- | ---------------------------------------------------------------- |
| **Architectural Fit** | Does this align with feature-based structure and Suspense model? |
| **Complexity Load** | How complex is state, data, and interaction logic? |
| **Performance Risk** | Does it introduce rendering, bundle, or CLS risk? |
| **Reusability** | Can this be reused without modification? |
| **Maintenance Cost** | How hard will this be to reason about in 6 months? |
### Score Formula
```
FFCI = (Architectural Fit + Reusability + Performance) − (Complexity + Maintenance Cost)
```
**Range:** `-5 → +15`
### Interpretation
| FFCI | Meaning | Action |
| --------- | ---------- | ----------------- |
| **10–15** | Excellent | Proceed |
| **6–9** | Acceptable | Proceed with care |
| **3–5** | Risky | Simplify or split |
| **≤ 2** | Poor | Redesign |
---
## 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)
| Alias | Path |
| ------------- | ---------------- |
| `@/` | `src/` |
| `~types` | `src/types` |
| `~components` | `src/components` |
| `~features` | `src/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
```ts
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
```ts
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)
```tsx
<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
```ts
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.Related Skills
frontend-ui-dark-ts
A modern dark-themed React UI system using Tailwind CSS and Framer Motion. Designed for dashboards, admin panels, and data-rich applications with glassmorphism effects and tasteful animations.
frontend-mobile-development-component-scaffold
You are a React component architecture expert specializing in scaffolding production-ready, accessible, and performant components. Generate complete component implementations with TypeScript, tests, s
cc-skill-frontend-patterns
Frontend development patterns for React, Next.js, state management, performance optimization, and UI best practices.
new-rails-project
Create a new Rails project
makepad-widgets
Version: makepad-widgets (dev branch) | Last Updated: 2026-01-19 > > Check for updates: https://crates.io/crates/makepad-widgets
makepad-splash
CRITICAL: Use for Makepad Splash scripting language. Triggers on: splash language, makepad script, makepad scripting, script!, cx.eval, makepad dynamic, makepad AI, splash 语言, makepad 脚本
makepad-dsl
CRITICAL: Use for Makepad DSL syntax and inheritance. Triggers on: makepad dsl, live_design, makepad inheritance, makepad prototype, "<Widget>", "Foo = { }", makepad object, makepad property, makepad DSL 语法, makepad 继承, makepad 原型, 如何定义 makepad 组件
javascript-typescript-typescript-scaffold
You are a TypeScript project architecture expert specializing in scaffolding production-ready Node.js and frontend applications. Generate complete project structures with modern tooling (pnpm, Vite, N
fp-backend
Functional programming patterns for Node.js/Deno backend development using fp-ts, ReaderTaskEither, and functional dependency injection
fastapi-templates
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
fastapi-router-py
Create FastAPI routers following established patterns with proper authentication, response models, and HTTP status codes.
dotnet-backend
Build ASP.NET Core 8+ backend services with EF Core, auth, background jobs, and production API patterns.