johnku2011/boilerplates-with-ai-skills/nextjs-app-router

Claude Code and agent skill by johnku2011/boilerplates-with-ai-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when adding pages, layouts, route handlers, or data fetching in this Next.js App Router project, to follow server-first conventions correctly.

Install

npx vskill@latest install johnku2011/boilerplates-with-ai-skills/nextjs-app-router

SKILL.md

The same SKILL.md was published earlier as johnku2011/boilerplates-with-ai-skills/nextjs-app-router.

Next.js App Router

Overview

Build features the App Router way: server components by default, client components only when needed, and colocated routes under app/.

Process

  1. Add a route by creating app/<segment>/page.tsx; add layout.tsx for shared

UI and loading.tsx/error.tsx for states.

  1. Keep components as React Server Components unless they need state, effects, or

browser APIs. Add "use client" only to those leaf components.

  1. Fetch data in server components with async/await; avoid client-side

fetching for initial render when the server can do it.

  1. Put API endpoints in app/api/<name>/route.ts using the Web Request/

Response APIs.

  1. Verify with npm run build (catches server/client boundary and type errors).

Data Fetching

  • Prefer fetch in Server Components with Next.js caching options (cache,

next.revalidate) documented in code comments when non-default.

  • Use loading.tsx for slow segments; avoid blocking the entire page.
  • Mutations: Server Actions or Route Handlers — validate input server-side.

Route Handlers

  • Export named HTTP functions (GET, POST, …) from route.ts.
  • Return Response.json() with correct status codes.
  • Never import client-only modules into route.ts.

Guidelines

  • Never import server-only modules (fs, secrets, DB clients) into client

components.

  • Read secrets from environment variables on the server only; never expose them

via NEXT_PUBLIC_* unless they are truly public.

  • Keep page.tsx thin; move logic into small, typed functions under src/ or

colocated lib/.

  • Prefer next/link and next/image over raw anchors/images.
  • Colocate tests for pure helpers; run npm run build before claiming done.

Deployment

See the shared deploy-vercel skill when shipping to Vercel.

Anti-patterns

  • Marking entire pages "use client" to avoid thinking about server boundaries.
  • Fetching secrets or private APIs from the browser.
  • Giant page.tsx files mixing UI, data access, and validation.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
240
Repository forks
24
7-day trend score
27

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/johnku2011/boilerplates-with-ai-skills/nextjs-app-router/badge)](https://verified-skill.com/skills/johnku2011/boilerplates-with-ai-skills/nextjs-app-router)

Something wrong with this skill or its page? Tell us.