frontend-dev-guidelines
Enforces architectural and performance standards for modern React/TypeScript frontend applications.
Install
mkdir -p .claude/skills/frontend-dev-guidelines-dangty1989 && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/19251" && unzip -o skill.zip -d .claude/skills/frontend-dev-guidelines-dangty1989 && rm skill.zipInstalls to .claude/skills/frontend-dev-guidelines-dangty1989
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Opinionated frontend development standards for modern React + TypeScript applications. Covers Suspense-first data fetching, lazy loading, feature-based architecture, MUI v7 styling, TanStack Router, performance optimization, and strict TypeScript practices.Key capabilities
- →Enforce Suspense-first data fetching
- →Implement lazy loading for heavy components and routes
- →Apply strict TypeScript discipline
- →Standardize styling with MUI v7
How it works
It defines strict guidelines for React and TypeScript applications, covering data fetching, code organization, and styling. This ensures consistency and maintainability across the codebase.
Inputs & outputs
When to use frontend-dev-guidelines
- →Structuring frontend projects
- →Optimizing React performance
- →Standardizing component patterns
About this skill
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
useSuspenseQueryis the primary data-fetching hook- No
isLoadingconditionals - 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 typealways- Types are first-class design artifacts
3. When to Use This Skill
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
useSuspenseQueryfor data - No early returns
- Handlers wrapped in
useCallback - Styles inline if <100 lines
- Default export at bottom
- Uses
useMuiSnackbarfor 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
- Types / Props
- Hooks
- Derived values (
useMemo) - Handlers (
useCallback) - Render
- 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: inlinesx>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
useMuiSnackbaronly- No third-party toast libraries
11. Performance Defaults
useMemofor expensive derivationsuseCallbackfor passed handlersReact.memofor 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 not to use it
- →When building applications not based on React or TypeScript
- →When a less opinionated or flexible frontend approach is desired
- →When the project does not prioritize long-term maintenance horizons
Limitations
- →Opinionated and enforceable standards
- →Requires strict adherence to specified technologies and patterns
- →Intended for production React codebases with long-term maintenance horizons
How it compares
This skill provides a highly opinionated and prescriptive set of guidelines for frontend development, contrasting with more flexible or ad-hoc approaches.
Compared to similar skills
frontend-dev-guidelines side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| frontend-dev-guidelines (this skill) | 0 | 5mo | Review | Advanced |
| nextjs-developer | 328 | 2mo | No flags | Advanced |
| frontend-developer | 27 | 3mo | No flags | Intermediate |
| rendering-animate-svg | 13 | 6mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
nextjs-developer
zenobi-us
Expert Next.js developer mastering Next.js 14+ with App Router and full-stack features. Specializes in server components, server actions, performance optimization, and production deployment with focus on building fast, SEO-friendly applications.
frontend-developer
sickn33
Build React components, implement responsive layouts, and handle client-side state management. Masters React 19, Next.js 15, and modern frontend architecture. Optimizes performance and ensures accessibility. Use PROACTIVELY when creating UI components or fixing frontend issues.
rendering-animate-svg
TheOrcDev
Wrap animated SVG elements in a div to enable hardware acceleration. Apply when animating SVG icons or elements, especially in 8-bit retro components with pixel art animations.
nextjs-app-router-patterns
wshobson
Master Next.js 14+ App Router with Server Components, streaming, parallel routes, and advanced data fetching. Use when building Next.js applications, implementing SSR/SSG, or optimizing React Server Components.
router-query-integration
MadAppGang
Use when setting up route loaders or optimizing navigation performance. Integrates TanStack Router with TanStack Query for optimal data fetching. Covers route loaders with query prefetching, ensuring instant navigation, and eliminating request waterfalls.
js-hoist-regexp
TheOrcDev
Hoist RegExp creation outside render or memoize with useMemo(). Apply when using regular expressions in React components or frequently called functions.