nextjs

Configure App Router and Pages Router usage for Next.js SSR and CSR workflows.

9|1|Updated Feb 1, 2026
One-click install
npx skills add https://github.com/calcosmic/Aether --skill nextjs-calcosmic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs
Source: https://github.com/calcosmic/Aether/tree/main/.aether/skills-codex/domain/nextjs
Command: npx skills add https://github.com/calcosmic/Aether --skill nextjs-calcosmic

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Next.js projects often struggle with choosing the right routing model and data-fetching patterns. This skill provides clear guidance on when to use App Router vs Pages Router, proper server/client component usage, and performance optimizations to keep SSR/CSR workflows efficient.

Core Features & Use Cases

  • App Router vs Pages Router decision guidance for scalable projects.
  • Server Components vs Client Components best practices for data loading and interactivity.
  • Data fetching, caching, and Server Actions strategies for robust UI.
  • Route handlers and API route conventions aligned with Next.js patterns.
  • Performance and SEO considerations including image optimization and caching strategies.

Quick Start

Analyze your Next.js project to determine the router pattern and apply the guidelines to structure components, data loading, and routes for optimum performance.

Frequently Asked Questions about nextjs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
When should I use the Next.js App Router versus the Pages Router?

Choose the Next.js App Router for scalable projects requiring advanced server components and nested layouts, while using the Pages Router for simpler, legacy routing patterns. The decision depends on your project's complexity and specific data-fetching needs.

How do I manage Server Components and Client Components for data fetching?

Use Server Components for direct data fetching to keep client-side JavaScript minimal, and switch to Client Components only when you need interactivity. This pattern optimizes SSR workflows and maintains robust UI performance.

What is the best way to handle caching and Server Actions in Next.js?

The best way to handle caching in Next.js is aligning Server Actions with robust data-fetching strategies to manage revalidation. This approach ensures efficient performance and keeps your UI data fresh without unnecessary fetches.

How do I structure API routes and route handlers in Next.js?

Structure Next.js API routes by following route handler conventions aligned with App Router or Pages Router patterns. This ensures your endpoints handle SSR and CSR data requests efficiently while maintaining project scalability.

Does Next.js provide built-in image optimization for performance and SEO?

Yes, Next.js provides built-in image optimization to automatically resize and serve images efficiently. Implementing this alongside proper caching strategies significantly improves both page load performance and overall SEO.