Nextjs App Router
Deep Next.js App Router workflow—layouts, routing, Server vs Client Components, data fetching and caching, revalidation, streaming, and deployment (Node, ser...
mikeclaw007
@mikeclaw007
Install
$ openclaw skills install @mikeclaw007/nextjs-app-routerNext.js App Router (Deep Workflow)
App Router changes mental models: where code runs, what is cached, and how HTML streams. Defaults differ from Pages Router—call that out explicitly.
When to Offer This Workflow
Trigger conditions:
- New App Router project or migration from pages/
- Confusion Server vs Client Components; hooks errors
- Stale data, wrong cache, need ISR semantics
Initial offer:
Use six stages: (1) route & layout model, (2) Server vs Client boundaries, (3) data fetching & cache, (4) revalidation & tags, (5) streaming & UX, (6) deployment & runtime. Confirm Next version and hosting (Vercel self, etc.).
Stage 1: Route & Layout Model
Goal: app/ directory = nested layouts + col ocated routes.
Practices
layout.tsxfor shared UI and providers (client where needed)page.tsxis leaf UI per segmentloading.tsx,error.tsx,not-foundfor UX boundaries
Exit condition: URL tree matches folder tree mental model.
Stage 2: Server vs Client Components
Goal: Default Server Components; use client only where interactivity needs browser APIs or state.
Rules of thumb
- Data fetch on server by default (async components)
- Leaf interactive islands as client components
- Prop serialization: only JSON-serializable props across boundary
Exit condition: List of client components and why.
Stage 3: Data Fetching & Cache
Goal: fetch cache semantics (force-cache vs no-store vs revalidate) explicit per call.
Practices
- Align with auth: no-store or request memoization patterns for user-specific data
- Parallel fetch where possible to avoid waterfalls
Exit condition: Per-route data dependency graph (simple diagram).
Stage 4: Revalidation & Tags
Goal: Fresh when needed without DDOS origin.
Practices
revalidatePath/revalidateTagfrom server actions or route handlers- Webhook-triggered revalidation for CMS
Exit condition: Invalidation owner and trigger documented.
Stage 5: Streaming & UX
Goal: Suspense boundaries with meaningful fallbacks; a11y for loading.
Practices
- Avoid waterfall inside suspense trees (sequential awaits)
Stage 6: Deployment & Runtime
Goal: Node vs edge runtime per route segment when using edge.
Practices
- Edge cannot use all Node APIs—verify compat
- ISR on serverless may need warming or cron revalidate
Final Review Checklist
- Layouts and route segments match product IA
- Server/Client split justified; props serializable
- Fetch cache and auth story correct per route
- Revalidation path defined for CMS/dynamic data
- Streaming/suspense without accidental waterfalls
- Runtime (edge vs node) matches dependencies
Tips for Effective Guidance
- Refer to current Next.js docs for default fetch caching — defaults changed across versions.
- Middleware for auth redirects — mind matcher performance.
- Colocation of tests and Storybook for client components helps isolation.
Handling Deviations
- Pages Router legacy: map equivalents (getServerSideProps → async RSC) carefully.
- Turbopack / Webpack — different perf profiles in dev.
Top skills in this category
Openclaw Command Center
@jontsaiMission control dashboard for OpenClaw - real-time session monitoring, LLM usage tracking, cost intelligence, and system vitals. View all your AI agents in o...
Interview Simulator
@wscatsSimulates mock interviews for any role and experience level with tailored technical, behavioral, and case questions plus detailed feedback and scoring.
moltbook-interact
@lunarcmdInteract with Moltbook social network for AI agents. Post, reply, browse, and analyze engagement. Use when the user wants to engage with Moltbook, check their feed, reply to posts, or track their activity on the agent social network.
Web Development
@ivangdavilaBuild, debug, and deploy websites using HTML, CSS, JavaScript, and modern frameworks following production best practices.
Baidu Wenku AI picture book of video
@ide-rea百度文库AI绘本是一个基于人工智能制作绘本视频的工具,支持生成静态绘本和动态绘本(URL输出)。能帮助文本内容创作者们在缺乏绘画技能的情况下,快速生成精美绘本视频,提高内容生产效率。无论是在儿童教育、亲子互动、品牌营销,还是在社交媒体内容创作等领域都能应用。