review-static-export

Review Next.js code for server-only APIs and static export compatibility.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/cesau78/cesau-skills --skill review-static-export
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: review-static-export
Source: https://github.com/cesau78/cesau-skills/tree/main/review-static-export
Command: npx skills add https://github.com/cesau78/cesau-skills --skill review-static-export

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reviews Next.js code in tektonology-spa for static export compatibility (output export), avoiding server-only APIs in the client bundle, and build-time data loading patterns. Use when SPA app or config changes, or when skills-advisor recommends this lens.

Core Features & Use Cases

  • Look for server-only APIs in client components or shared code paths: fs, path for runtime IO, dynamic server features without generateStaticParams / SSG patterns where appropriate.
  • Implicit SSR — assumptions that headers(), cookies(), or request-scoped data exist at runtime on static pages.
  • Env misuse — secrets needed only at build vs accidentally exposed to client bundle (NEXT_PUBLIC_*).
  • Routing — features incompatible with static export (verify against Next version docs if introducing new dynamic features).
  • Use Case: The Skill can be used when Next.js static export is required or recommended by the skills-advisor.

Quick Start

Review tektonology-spa for static export readiness and adjust build-time data loading and client-side API usage.

Frequently Asked Questions about review-static-export

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

FAQPage Schema
How do I check if my Next.js app is ready for static export?

Audit your Next.js app for static export readiness by scanning for server-only APIs in client code, implicit SSR usage like headers(), and environment variable exposure that would break the build. Verify build-time data loading patterns to ensure no runtime dependency on server artifacts exists.

Why does Next.js static export fail when using headers or cookies?

Next.js static export fails because headers and cookies are request-scoped server APIs that require a runtime server environment. Static pages are generated at build time, so you must remove these implicit SSR assumptions and switch to build-time data loading patterns to fix the compatibility issue.

Can I use fs and path modules in client-side Next.js components with output export?

You cannot use fs and path for runtime IO in client components with output export because static export eliminates server runtime features. You must replace dynamic server-side file operations with build-time data loading or generateStaticParams patterns to make the site compatible.

How do I prevent exposing environment variable secrets during a Next.js static build?

Prevent environment variable exposure by separating secrets needed only at build time from values exposed to the client bundle. Audit your code to ensure secrets are not accidentally exposed via NEXT_PUBLIC_ prefixes, keeping sensitive data out of the static output.

What Next.js routing features are incompatible with static export?

Routing features that rely on dynamic server-side rendering or request-scoped data are incompatible with static export. You should verify dynamic features against your Next version docs and use generateStaticParams to pre-render dynamic routes at build time instead of relying on server APIs.