johnku2011/boilerplates-with-ai-skills/nextjs-app-router
Claude Code and agent skill by johnku2011/boilerplates-with-ai-skills
- community
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-routerSKILL.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
- Add a route by creating
app/<segment>/page.tsx; addlayout.tsxfor shared
UI and loading.tsx/error.tsx for states.
- Keep components as React Server Components unless they need state, effects, or
browser APIs. Add "use client" only to those leaf components.
- Fetch data in server components with
async/await; avoid client-side
fetching for initial render when the server can do it.
- Put API endpoints in
app/api/<name>/route.tsusing the WebRequest/
Response APIs.
- Verify with
npm run build(catches server/client boundary and type errors).
Data Fetching
- Prefer
fetchin Server Components with Next.js caching options (cache,
next.revalidate) documented in code comments when non-default.
- Use
loading.tsxfor 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, …) fromroute.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.tsxthin; move logic into small, typed functions undersrc/or
colocated lib/.
- Prefer
next/linkandnext/imageover raw anchors/images. - Colocate tests for pure helpers; run
npm run buildbefore 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.tsxfiles 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
- SKILL.md in the repositoryCheckingboilerplates/nextjs-app/skills/nextjs-app-router/SKILL.md
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
[](https://verified-skill.com/skills/johnku2011/boilerplates-with-ai-skills/nextjs-app-router)