sickn33/agentic-awesome-skills / plugins/aasb-web-app/skills/react-best-practices
react-best-practices
VerifiedComprehensive performance optimization guide for React and Next.js applications, adapted from Vercel’s published guidance. Use when writing new React components or Next.js pages, implementing data fetching (client or server-side), or reviewing code for performance issues.
rules/bundle-barrel-imports.md
View on GitHub---
title: Avoid Barrel File Imports
impact: CRITICAL
impactDescription: workload-dependent import overhead
tags: bundle, imports, tree-shaking, barrel-files, performance
---
## Use Public Package Exports and Measure Imports
Barrel entry points can increase module graph analysis or cold-start work, especially for externalized packages. Tree-shaking and package-import transforms can remove unused exports in supported bundlers; measure the production build before changing imports.
**Example:**
```tsx
// Use documented public exports; do not reach into package-private dist paths.
import { Check, X, Menu } from 'lucide-react'
import Button from '@mui/material/Button'
```
Next.js optimizePackageImports configuration and built-in optimized package lists vary by version. Check the installed framework’s documentation rather than assuming a manual configuration is needed. No generic timing or size reduction is promised.
Reference: https://vercel.com/blog/how-we-optimized-package-imports-in-next-js
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |