Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/dokhacgiakhoa-frontend-dev-guidelines/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -19% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 14% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 56% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 78% | 0% |
(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<Props> with explicit props interface<SuspenseLoader>useSuspenseQuery for datauseCallbackuseMuiSnackbar for feedbackfeatures/{feature-name}/api/, components/, hooks/, helpers/, types/api/index.tsroutes/| Alias | Path | | ------------- | ---------------- | | @/ | src/ | | ~types | src/types | | ~components | src/components | | ~features | src/features |
Aliases must be used consistently. Relative imports beyond one level are discouraged.
useMemo)useCallback)tsconst HeavyComponent = React.lazy(() => import('./HeavyComponent'));
Always wrapped in <SuspenseLoader>.
useSuspenseQuery❌ isLoading ❌ manual spinners ❌ fetch logic inside components ❌ API calls without feature API layer
/api/ prefix in routestsexport const Route = createFileRoute('/my-route/')({ component: MyPage, loader: () => ({ crumb: 'My Route' }), });
<100 lines: inline sx>100 lines: {Component}.styles.tstsx<Grid size={{ xs: 12, md: 6 }} /> // ✅ <Grid xs={12} md={6} /> // ❌
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.tsxtsimport 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;
❌ 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
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 31,215 | 21,787 | -30% | 1 | 1 | 0% | 6,713 | 5,447 | -19% | 0 | 0 | — |
case-02 | fail→fail | 18,478 | 21,973 | +19% | 1 | 1 | 0% | 3,705 | 5,790 | +56% | 0 | 0 | — |
case-03 | fail→pass | 27,221 | 27,786 | +2% | 1 | 1 | 0% | 5,790 | 6,841 | +18% | 0 | 0 | — |
case-04 | fail→pass | 21,548 | 17,357 | -19% | 1 | 1 | 0% | 5,582 | 6,361 | +14% | 0 | 0 | — |
case-05 | fail→pass | 19,699 | 12,841 | -35% | 1 | 1 | 0% | 3,166 | 4,942 | +56% | 0 | 0 | — |
case-06 | fail→fail | 35,675 | 31,542 | -12% | 1 | 1 | 0% | 5,817 | 7,804 | +34% | 0 | 0 | — |
case-07 | fail→pass | 23,526 | 22,472 | -4% | 1 | 1 | 0% | 3,284 | 5,834 | +78% | 0 | 0 | — |
case-08 | fail→pass | 10,123 | 7,450 | -26% | 1 | 1 | 0% | 1,496 | 3,615 | +142% | 0 | 0 | — |
case-09 | fail→pass | 17,202 | 16,968 | -1% | 1 | 1 | 0% | 2,992 | 5,070 | +69% | 0 | 0 | — |
case-10 | fail→pass | 18,635 | 16,300 | -13% | 1 | 1 | 0% | 2,959 | 5,834 | +97% | 0 | 0 | — |
case-11 | fail→pass | 23,249 | 18,718 | -19% | 1 | 1 | 0% | 4,912 | 6,100 | +24% | 0 | 0 | — |
case-12 | pass→pass | 20,744 | 21,089 | +2% | 1 | 1 | 0% | 3,694 | 5,915 | +60% | 0 | 0 | — |
case-13 | pass→pass | 12,607 | 16,435 | +30% | 1 | 1 | 0% | 3,159 | 6,136 | +94% | 0 | 0 | — |
case-14 | pass→pass | 13,293 | 14,199 | +7% | 1 | 1 | 0% | 2,496 | 4,849 | +94% | 0 | 0 | — |
case-15 | fail→pass | 35,470 | 28,085 | -21% | 1 | 1 | 0% | 8,218 | 7,266 | -12% | 0 | 0 | — |
case-16 | fail→pass | 19,800 | 21,295 | +8% | 1 | 1 | 0% | 3,571 | 7,092 | +99% | 0 | 0 | — |
case-17 | fail→pass | 17,468 | 20,082 | +15% | 1 | 1 | 0% | 3,734 | 6,097 | +63% | 0 | 0 | — |
case-18 | pass→pass | 16,814 | 13,626 | -19% | 1 | 1 | 0% | 2,595 | 5,097 | +96% | 0 | 0 | — |
case-19 | fail→pass | 17,664 | 23,172 | +31% | 1 | 1 | 0% | 3,484 | 7,488 | +115% | 0 | 0 | — |
case-20 | fail→pass | 13,508 | 12,851 | -5% | 1 | 1 | 0% | 3,269 | 5,206 | +59% | 0 | 0 | — |
case-21 | pass→pass | 14,405 | 13,139 | -9% | 1 | 1 | 0% | 2,556 | 5,020 | +96% | 0 | 0 | — |
case-22 | pass→pass | 10,187 | 10,469 | +3% | 1 | 1 | 0% | 1,636 | 4,329 | +165% | 0 | 0 | — |
case-23 | pass→pass | 18,506 | 20,114 | +9% | 1 | 1 | 0% | 2,867 | 6,540 | +128% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +61 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.