Skip to content
Back to skills

Nextjs Performance

ASecurity

Next.js critical performance fixes. Prevents async waterfalls, reduces bundle size, secures Server Actions, and ensures correct production builds. Use when writing React components, data fetching, Server Actions, or optimizing bundle size.

  • 4 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 9, 2026
developmentreactnextjsdockerfrontendperformance

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add Saisagar7779/Resume-Matcher --skill nextjs-performance --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Nextjs Performance?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Nextjs Performance
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/saisagar7779-nextjs-performance-resume-matcher/badge)](https://www.skillsdirectory.com/skills/saisagar7779-nextjs-performance-resume-matcher)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: nextjs-performance
description: |
  Next.js critical performance fixes. Prevents async waterfalls, reduces bundle size, secures Server Actions, and ensures correct production builds. Use when writing React components, data fetching, Server Actions, or optimizing bundle size.
---

# Next.js Performance

## Before Writing Code

1. Read `docs/agent/architecture/nextjs-critical-fixes.md` for full patterns
2. Check existing components in `apps/frontend/components/`

## Critical Rules

### Waterfalls

- Use `Promise.all()` for independent fetches
- Wrap slow data in `<Suspense>` boundaries
- Defer `await` into branches where needed

```tsx
// WRONG
const resumes = await fetchResumes();
const jobs = await fetchJobs();

// RIGHT
const [resumes, jobs] = await Promise.all([fetchResumes(), fetchJobs()]);
```

### Bundle Size

- **NO barrel imports**: `import X from 'lucide-react'` is WRONG
- **YES direct imports**: `import X from 'lucide-react/dist/esm/icons/x'`
- Use `next/dynamic` for heavy components (editors, charts, PDF)
- Defer analytics with `ssr: false`

```tsx
import dynamic from 'next/dynamic';
const HeavyEditor = dynamic(() => import('./HeavyEditor'), { ssr: false });
```

### Server Actions

- **ALWAYS** check auth INSIDE the action, not just middleware
- Verify resource ownership before mutations

### Production Build

- Run `npm run build && npm run start`, NOT `npm run dev`
- Docker must use standalone output

## Pre-PR Checklist

```
[ ] No sequential awaits for independent data
[ ] Icons imported directly (not barrel)
[ ] Heavy components use next/dynamic
[ ] Server Actions have auth inside
[ ] Suspense around slow fetches
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.