
Frontend Engineer
- 289 installs
- 20 repo stars
- Updated March 21, 2026
- siviter-xyz/dot-agent
frontend-engineer is an agent skill that encodes modern React and TypeScript frontend patterns—including Suspense, useSuspenseQuery, TanStack Router, and MUI v7—for developers building production UI with lazy loading and
About
frontend-engineer is a dot-agent skill that gives coding agents a comprehensive React/TypeScript playbook emphasizing Suspense-based data fetching, lazy-loaded routes, and strict feature-folder organization. The skill documents eight core principles: lazy-load heavy routes and DataGrids, use SuspenseLoader instead of early-return spinners, prefer useSuspenseQuery for new data fetching, organize features under api/, components/, hooks/, helpers/, and types/ subdirectories, split styles at the 100-line threshold, and enforce import aliases (@/, ~types, ~components, ~features) with TypeScript strict mode and no any. Developers reach for frontend-engineer when creating pages, wiring TanStack Router routes, styling MUI v7 components, or optimizing bundle size in a React SPA. The dot-agent repo keeps SKILL.md under 200 lines with deeper references loaded on demand. Install with npx skills add siviter-xyz/dot-agent --skill frontend-engineer for Cursor, Claude Code, Codex, and other Agent Skills–compatible harnesses.
- frontend-engineer
Frontend Engineer by the numbers
- 289 all-time installs (skills.sh)
- +8 installs in the week ending Jul 27, 2026 (Skillselion tracking)
- Ranked #1,367 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
- Data as of Jul 27, 2026 (Skillselion catalog sync)
npx skills add https://github.com/siviter-xyz/dot-agent --skill frontend-engineerAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 289 |
|---|---|
| repo stars | ★ 20 |
| Last updated | March 21, 2026 |
| Repository | siviter-xyz/dot-agent ↗ |
How do you structure React Suspense data fetching?
Use frontend-engineer for development tasks
Who is it for?
React/TypeScript developers standardizing Suspense-first data fetching, TanStack Router navigation, and feature-folder architecture in a growing SPA codebase.
Skip if: Backend API design, native mobile SwiftUI work, or teams on Vue, Angular, or legacy class-component React without Suspense support.
When should I use this skill?
The user creates React components or pages, wires TanStack Query or Router, styles MUI components, or asks about Suspense lazy-loading patterns.
What you get
Feature modules with api/, components/, hooks/, helpers/, and types/ folders, lazy-loaded routes, SuspenseLoader boundaries, and TypeScript-strict React components.
- Feature module scaffolding
- Suspense-wrapped route components
- Typed API service files
By the numbers
- Documents 8 core frontend engineering principles in SKILL.md
- Splits component styles at 100 lines: inline below, separate file above
- dot-agent keeps SKILL.md files under 200 lines with references/ on demand
Files
Frontend Engineer
Comprehensive guide for modern React development, emphasizing Suspense-based data fetching, lazy loading, proper file organization, and performance optimization.
When to Use
- Creating new components or pages
- Building new features
- Fetching data with TanStack Query
- Setting up routing with TanStack Router
- Styling components
- Performance optimization
- Organizing frontend code
- TypeScript best practices
Quick Start
New Component Checklist
- [ ] Use
React.FC<Props>pattern with TypeScript - [ ] Lazy load if heavy component:
React.lazy(() => import()) - [ ] Wrap in
<SuspenseLoader>for loading states - [ ] Use
useSuspenseQueryfor data fetching - [ ] Import aliases:
@/,~types,~components,~features - [ ] Styles: Inline if <100 lines, separate file if >100 lines
- [ ] Use
useCallbackfor event handlers passed to children - [ ] Default export at bottom
- [ ] No early returns with loading spinners
- [ ] Use notification system for user feedback
New Feature Checklist
- [ ] Create
features/{feature-name}/directory - [ ] Create subdirectories:
api/,components/,hooks/,helpers/,types/ - [ ] Create API service file:
api/{feature}Api.ts - [ ] Set up TypeScript types in
types/ - [ ] Create route in
routes/{feature-name}/index.tsx - [ ] Lazy load feature components
- [ ] Use Suspense boundaries
- [ ] Export public API from feature
index.ts
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. TypeScript First: Strict mode, no any type
Implementation Workflow
When implementing frontend code:
- Check for existing workflow patterns (spec-first, TDD, etc.) and follow them
- Ensure code passes CI checks (types, tests, lint) before committing
- Group related changes with tests in atomic commits
References
For detailed guidance, see:
references/component-patterns.md- Modern React component patternsreferences/data-fetching.md- Suspense-based data fetchingreferences/file-organization.md- Feature-based organizationreferences/styling-guide.md- Styling patterns and best practicesreferences/routing-guide.md- TanStack Router patternsreferences/performance.md- Performance optimizationreferences/typescript-standards.md- TypeScript best practices
Component Patterns
Modern React components use:
React.FC<Props>for type safetyReact.lazy()for code splitting- SuspenseLoader for loading states
- Named const + default export pattern
Key Concepts
- Lazy load heavy components (DataGrid, charts, editors)
- Always wrap lazy components in Suspense
- Use SuspenseLoader component (with fade animation)
- Component structure: Props → Hooks → Handlers → Render → Export
Example
import React, { useState, useCallback } from 'react';
import { Box, Paper } from '@mui/material';
import { useSuspenseQuery } from '@tanstack/react-query';
import { SuspenseLoader } from '~components/SuspenseLoader';
import type { FeatureData } from '~types/feature';
interface MyComponentProps {
id: number;
onAction?: () => void;
}
export const MyComponent: React.FC<MyComponentProps> = ({ id, onAction }) => {
const [state, setState] = useState<string>('');
const { data } = useSuspenseQuery({
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;Data Fetching
PRIMARY PATTERN: useSuspenseQuery
- Use with Suspense boundaries
- Cache-first strategy (check grid cache before API)
- Replaces
isLoadingchecks - Type-safe with generics
API Service Layer
- Create
features/{feature}/api/{feature}Api.ts - Use
apiClientaxios instance - Centralized methods per feature
- Route format:
/form/route(NOT/api/form/route)
Example
import { useSuspenseQuery } from '@tanstack/react-query';
import { featureApi } from '../api/featureApi';
const { data } = useSuspenseQuery({
queryKey: ['feature', id],
queryFn: () => featureApi.getFeature(id),
});CRITICAL RULE: No Early Returns
// ❌ NEVER - Causes layout shift
if (isLoading) {
return <LoadingSpinner />;
}
// ✅ ALWAYS - Consistent layout
<SuspenseLoader>
<Content />
</SuspenseLoader>Why: Prevents Cumulative Layout Shift (CLS), better UX
File Organization
features/ vs components/
features/: Domain-specific (posts, comments, auth)components/: Truly reusable (SuspenseLoader, CustomAppBar)
Feature Subdirectories
features/
my-feature/
api/ # API service layer
components/ # Feature components
hooks/ # Custom hooks
helpers/ # Utility functions
types/ # TypeScript typesImport Aliases
| Alias | Resolves To | Example |
|---|---|---|
@/ | src/ | import { apiClient } from '@/lib/apiClient' |
~types | src/types | import type { User } from '~types/user' |
~components | src/components | import { SuspenseLoader } from '~components/SuspenseLoader' |
~features | src/features | import { authApi } from '~features/auth' |
Performance Optimization
Optimization Patterns
useMemo: Expensive computations (filter, sort, map)useCallback: Event handlers passed to childrenReact.memo: Expensive components- Debounced search (300-500ms)
- Memory leak prevention (cleanup in useEffect)
Code Splitting
- Split code by route or feature
- Lazy load components and assets
- Use dynamic imports
Example
const HeavyComponent = React.lazy(() => import('./HeavyComponent'));
<Suspense fallback={<SuspenseLoader />}>
<HeavyComponent />
</Suspense>Routing Guide
TanStack Router - Folder-Based
- Directory:
routes/my-route/index.tsx - Lazy load components
- Use
createFileRoute - Breadcrumb data in loader
Example
import { createFileRoute } from '@tanstack/react-router';
import { lazy } from 'react';
const MyPage = lazy(() => import('@/features/my-feature/components/MyPage'));
export const Route = createFileRoute('/my-route/')({
component: MyPage,
loader: () => ({ crumb: 'My Route' }),
});Styling Guide
Inline vs Separate
- <100 lines: Inline
const styles: Record<string, SxProps<Theme>> - >100 lines: Separate
.styles.tsfile
Primary Method
- Use
sxprop for MUI components - Type-safe with
SxProps<Theme> - Theme access:
(theme) => theme.palette.primary.main
MUI v7 Grid
<Grid size={{ xs: 12, md: 6 }}> // ✅ v7 syntax
<Grid xs={12} md={6}> // ❌ Old syntaxExample
import type { SxProps, Theme } from '@mui/material';
const styles: Record<string, SxProps<Theme>> = {
container: {
p: 2,
backgroundColor: (theme) => theme.palette.background.paper,
},
};TypeScript Standards
Standards
- Strict mode, no
anytype - Explicit return types on functions
- Type imports:
import type { User } from '~types/user' - Component prop interfaces with JSDoc
Example
import type { User } from '~types/user';
interface MyComponentProps {
/** User ID to display */
userId: number;
/** Optional callback */
onAction?: () => void;
}
export const MyComponent: React.FC<MyComponentProps> = ({ userId, onAction }) => {
// Implementation
};Related skills
How it compares
Pick frontend-engineer over generic React skills when you need opinionated TanStack Suspense, Router, and MUI v7 conventions in one checklist.
FAQ
What data-fetching pattern does frontend-engineer recommend?
frontend-engineer recommends useSuspenseQuery as the primary data-fetching pattern for new React code, wrapped in SuspenseLoader boundaries instead of early-return loading spinners that cause layout shift.
How should features be organized per frontend-engineer?
frontend-engineer prescribes a features/{feature-name}/ directory with api/, components/, hooks/, helpers/, and types/ subfolders, plus a public index.ts export and a TanStack Router route under routes/.
How do you install frontend-engineer from dot-agent?
Install frontend-engineer with npx skills add siviter-xyz/dot-agent --skill frontend-engineer, optionally targeting Cursor or Claude Code with --agent flags. The skill loads SKILL.md and on-demand references/ content.