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.
Add this skill
npx mdskills install sickn33/frontend-dev-guidelinesComprehensive, opinionated React/TypeScript standards with clear architectural doctrine and actionable patterns
(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:
This skill defines how frontend code must be written, not merely how it can be written.
Before implementing a component, page, or feature, assess feasibility.
| 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? |
FFCI = (Architectural Fit + Reusability + Performance) − (Complexity + Maintenance Cost)
Range: -5 → +15
| FFCI | Meaning | Action |
|---|---|---|
| 10–15 | Excellent | Proceed |
| 6–9 | Acceptable | Proceed with care |
| 3–5 | Risky | Simplify or split |
| ≤ 2 | Poor | Redesign |
useSuspenseQuery is the primary data-fetching hookisLoading conditionalsfeatures/components/anyimport type alwaysUse frontend-dev-guidelines when:
React.FC with explicit props interfaceuseSuspenseQuery for datauseCallback
Always wrapped in ``.
---
## 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' }),
});
100 lines: {Component}.styles.ts // ✅
// ❌
Theme access must always be type-safe.
❌ Never return early loaders ✅ Always rely on Suspense boundaries
useMuiSnackbar onlyuseMemo for expensive derivationsuseCallback for passed handlersReact.memo for heavy pure componentsPerformance regressions are bugs.
anysrc/
features/
my-feature/
api/
components/
hooks/
helpers/
types/
index.ts
components/
SuspenseLoader/
CustomAppBar/
routes/
my-route/
index.tsx
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 = ({ id, onAction }) => {
const [state, setState] = useState('');
const { data } = useSuspenseQuery({
queryKey: ['feature', id],
queryFn: () => featureApi.getFeature(id),
});
const handleAction = useCallback(() => {
setState('updated');
onAction?.();
}, [onAction]);
return (
{/* Content */}
);
};
export default MyComponent;
❌ 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
Before finalizing code:
Status: Stable, opinionated, and enforceable Intended Use: Production React codebases with long-term maintenance horizons
Install via CLI
npx mdskills install sickn33/frontend-dev-guidelinesFrontend Dev Guidelines is a free, open-source AI agent skill. 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.
Install Frontend Dev Guidelines with a single command:
npx mdskills install sickn33/frontend-dev-guidelinesThis downloads the skill files into your project and your AI agent picks them up automatically.
Frontend Dev Guidelines works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Codex, Gemini Cli, Amp, Roo Code, Goose, Opencode, Trae, Qodo, Command Code. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.