server-page

Bind routes to templates by centralizing data-fetching logic for SSR, SSG, or ISR.

Updated Apr 27, 2026
One-click install
npx skills add https://github.com/grvpanchal/elegant-opencode --skill server-page
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: server-page
Source: https://github.com/grvpanchal/elegant-opencode/tree/main/skills/server-page
Command: npx skills add https://github.com/grvpanchal/elegant-opencode --skill server-page

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pages often carry data-fetching logic inside routes, causing bloated components and fragile templates. This Skill helps you cleanly separate data fetching from presentation by guiding when to use SSR, SSG, or ISR and how to wire getServerSideProps/getStaticProps to your templates.

Core Features & Use Cases

  • Keeps pages thin by moving data-fetching to dedicated route logic.
  • Guides correct rendering strategies (SSR/SSG/ISR) per page and scenario.
  • Ensures props flow cleanly from route handlers to templates with minimal leakage into UI components.

Quick Start

Create a new route file, decide between SSR, SSG, or ISR, and wire getServerSideProps or getStaticProps to pass props to your template.

Frequently Asked Questions about server-page

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

FAQPage Schema
How do I separate data-fetching logic from templates in Next.js pages?

Separate data-fetching from templates by centralizing logic in route handlers. Use getServerSideProps or getStaticProps to fetch data and pass props to dumb templates, keeping pages thin and preventing fragile, bloated UI components.

When should I use SSR, SSG, or ISR for my Next.js routes?

Choose SSR for dynamic data per request, SSG for static content at build time, and ISR for static content with periodic updates. Selecting the correct rendering strategy ensures optimal caching, proper 404 handling, and clean prop passing.

What is the best way to wire getServerSideProps and getStaticProps to page templates?

Wire getServerSideProps and getStaticProps by fetching required data inside these route handlers and passing it as props to your templates. This enforces minimal leakage into UI components and keeps your presentation layer clean.

Why do my Next.js pages become bloated and how can I keep them thin?

Pages become bloated when data-fetching logic resides inside routes. Keep pages thin by moving data-fetching to dedicated route logic using getServerSideProps or getStaticProps, ensuring templates remain dumb and only handle presentation.

Does centralizing data-fetching logic handle 404 errors and caching considerations?

Centralizing data-fetching logic handles 404 errors and caching considerations within route handlers. By evaluating rendering strategies like SSR, SSG, or ISR, it ensures proper error handling and cache management before passing props.