ワンクリックで
best-practices
React + Vite performance optimization and best practices guidelines
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
React + Vite performance optimization and best practices guidelines
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
TDD-based feature workflow with 9 phases - loads directly into session (no installation)
Auto-send Slack notifications when TodoWrite tasks complete. Includes task summary, file changes, execution time, and repository context. Supports config file (no env vars needed) and manual `/devnogari:slack-notify` trigger.
Project-specific best practices - auto-loads based on detected project type
Kotlin Coroutines with Spring Boot/WebFlux performance optimization and best practices guidelines
Flutter performance optimization and clean architecture patterns. This skill should be used when writing, reviewing, or refactoring Flutter/Dart code to ensure optimal performance patterns. Triggers on tasks involving Flutter widgets, state management, async patterns, memory management, or architecture design.
Go + Gin performance optimization and idiomatic patterns with mandatory Uber fx DI. Contains 48 rules across 8 categories, prioritized by impact for automated code generation and review.
SOC 職業分類に基づく
| name | best-practices |
| description | React + Vite performance optimization and best practices guidelines |
| license | MIT |
| metadata | {"author":"devnogari","project_type":"react-vite","extends":"vercel-react-best-practices"} |
Performance optimization and best practices for React applications using Vite.
This skill extends /vercel-react-best-practices - Vercel's official 45-rule guide for React performance.
When working on React code, always invoke /vercel-react-best-practices first for comprehensive patterns, then apply Vite-specific optimizations below.
This skill activates when:
For these patterns, use /vercel-react-best-practices:
async-* rulesbundle-* rulesrerender-* rulesjs-* rules| # | Category | Priority | Typical Impact |
|---|---|---|---|
| 1 | Bundle Optimization | CRITICAL | 200-800ms load time reduction |
| 2 | Re-render Prevention | HIGH | 2-10x render performance |
| 3 | State Management | HIGH | Memory & render efficiency |
| 4 | Async Patterns | MEDIUM | Network efficiency |
| 5 | Component Patterns | MEDIUM | Maintainability & performance |
Avoid barrel imports:
// ❌ INCORRECT - imports entire library
import { Button, Input } from '@/components'
// ✅ CORRECT - imports only what's needed
import { Button } from '@/components/Button'
import { Input } from '@/components/Input'
Dynamic imports for large components:
// ❌ INCORRECT - loads immediately
import { HeavyChart } from './HeavyChart'
// ✅ CORRECT - loads on demand
const HeavyChart = lazy(() => import('./HeavyChart'))
Memoize expensive computations:
// ❌ INCORRECT - recalculates every render
const sortedItems = items.sort((a, b) => a.name.localeCompare(b.name))
// ✅ CORRECT - only recalculates when items change
const sortedItems = useMemo(
() => items.sort((a, b) => a.name.localeCompare(b.name)),
[items]
)
Stable callback references:
// ❌ INCORRECT - new function every render
<Button onClick={() => handleClick(id)} />
// ✅ CORRECT - stable reference
const handleButtonClick = useCallback(() => handleClick(id), [id])
<Button onClick={handleButtonClick} />
Colocate state with usage:
// ❌ INCORRECT - state too high in tree
function App() {
const [modalOpen, setModalOpen] = useState(false)
return <DeepChild modalOpen={modalOpen} />
}
// ✅ CORRECT - state near usage
function ModalContainer() {
const [modalOpen, setModalOpen] = useState(false)
return <Modal open={modalOpen} />
}
Split state by update frequency:
// ❌ INCORRECT - unrelated state together
const [state, setState] = useState({ user: null, theme: 'dark', count: 0 })
// ✅ CORRECT - independent state
const [user, setUser] = useState(null)
const [theme, setTheme] = useState('dark')
const [count, setCount] = useState(0)
See individual rule files in rules/ directory:
bundle-optimization.mdrerender-prevention.mdstate-management.mdasync-patterns.mdcomponent-patterns.mdvite-specific.mdWhen writing or reviewing React code:
These patterns are Vite-specific and extend the Vercel best practices:
Configure optimizeDeps:
// vite.config.ts
export default defineConfig({
optimizeDeps: {
include: ['react', 'react-dom', 'lodash-es'],
exclude: ['@my-org/heavy-lib']
}
})
Use manual chunks for code splitting:
// vite.config.ts
export default defineConfig({
build: {
rollupOptions: {
output: {
manualChunks: {
vendor: ['react', 'react-dom'],
ui: ['@radix-ui/react-dialog', '@radix-ui/react-dropdown-menu']
}
}
}
}
})
When implementing React features:
/vercel-react-best-practices for comprehensive React patternsbundle-* and async-* rules/vercel-react-best-practices → React patterns (45 rules)
↓
This skill → Vite-specific config & chunking