Agent skill · Frontend

nextjs-patterns

Next.js best practices, server components, app router patterns, caching strategies, and full-stack architecture

Cosmic Stack3,294★ · 2 repos on radarProfile →
claude-codeMIT
Install
npx skills add cosmicstack-labs/mercury-agent-skills --skill nextjs-patterns --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 8 KB
Bundled scripts: none
Version: 1.0.0
Declared author: cosmicstack-labs
Path: categories/frontend/nextjs-patterns/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 364
Language: JavaScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Next.js Patterns Comprehensive guide to building production-grade Next.js applications with the App Router, Server Components, and modern React patterns. ## Core Architecture ### App Router vs Pages Router | Aspect | App Router | Pages Router | |--------|-----------|--------------| | **Components** | Server Components by default | Client Components only | | **Routing** | File-system based with layout nesting | File-system based, flat | | **Data Fetching** | Server-side fetch, `use`, cache primitives | `getServerSideProps`, `getStaticProps` | | **Loading States** | `loading.js` files | Manual implementation | | **Error Handling** | `error.js` files | Manual implementation | | **Streaming** | Built-in with Suspense boundaries | Not supported | ### Project Structure ``` my-app/ ├── app/ │ ├── layout.tsx # Root layout │ ├── page.tsx # Home page │ ├── loading.tsx # Root loading state │ ├── error.tsx # Root error boundary │ ├── not-found.tsx # 404 page │ ├── (auth)/ # Route group │ │ ├── login/page.tsx │ │ └── register/page.tsx │ ├── dashboard/ │ │ ├── layout.tsx # Dashboard layout │ │ ├── page.tsx # Dashboard home │ │ ├── loading.tsx │ │ └── settings/ │ │ └── page.tsx │ └── api/ │ └──

What's inside
Steps it walks through
  1. Core Architecture
  2. App Router vs Pages Router
  3. Project Structure
  4. Server Components (RSC)
  5. When to Use Server vs Client
  6. Composing Server and Client Components
  7. Data Fetching Patterns
  8. Server-Side Data Fetching
  9. Revalidation Strategies
  10. Streaming with Suspense
  11. Route Handlers & API Patterns
  12. Common Patterns
  13. Route Groups for Organization
  14. Middleware for Auth
More from mercury-agent-skills
All skills →
About this skill
What does the nextjs-patterns skill do?

Next.js best practices, server components, app router patterns, caching strategies, and full-stack architecture

How do I install it?

Run `npx skills add cosmicstack-labs/mercury-agent-skills --skill nextjs-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From cosmicstack-labs/mercury-agent-skills, a repository with 364 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going