nextjs
Next.js web production guidance for App Router architecture, server/client boundaries, caching strategy, and runtime behavior.
- License 许可
- MIT
- 最近更新
- 2026-09-14
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- nextjs
- agents
- [ "coder", "sidekick-reviewer", "architect", "feature-designer", "feature-reviewer", "planner", "ask", "builder", "orchestrator" ]
- detect
- { "files": [ "next.config.js", "next.config.mjs", "next.config.ts" ], "content": [ { "file": "package.json", "contains": "\"next\"" } ] }
- description
- Next.js web production guidance for App Router architecture, server/client boundaries, caching strategy, and runtime behavior.
03 SKILL.md 正文
Scope
- In scope: Next.js web app architecture with App Router, Server/Client Component boundaries, data fetching/caching, and production-ready routing/error patterns.
- Out of scope: generic React fundamentals already covered by the
reactskill, non-Next bundler tooling, and backend platform operations.
Invariants
- Prefer Server Components by default; add
"use client"only for browser APIs, local interactivity, or client-only libraries. - Keep data access and secrets on the server boundary (Route Handlers, Server Actions, server-only modules).
- Use
next/linkfor internal navigation and preserve App Router file conventions (layout.tsx,loading.tsx,error.tsx,not-found.tsx). - Define caching behavior intentionally (
fetchcache options, revalidation strategy, dynamic/static rendering) instead of relying on implicit defaults. - Treat metadata, images, and fonts as first-class performance work
(
generateMetadata,next/image,next/font).
Validation Checklist
- Read the official docs before implementing non-trivial behavior:
- Validate server/client boundary decisions for each new route segment.
- Verify route-level UX states exist where relevant (
loading,error,not-found). - Run project validation commands (build + tests) and ensure no Next.js runtime warnings are introduced.
Failure Handling
- If an implementation requires breaking App Router conventions, stop and document the constraint before proceeding.
- If rendering or cache mode is ambiguous, choose explicit configuration and record the reason in code-level docs.
- If a feature leaks server-only logic to client bundles, block the change until the boundary is corrected.
High-Value Next.js Practices
- Use nested layouts to avoid duplicating shell UI and to enable partial rendering.
- Keep Server Actions small and side-effect focused; validate inputs at the action boundary.
- Use route handlers for HTTP integration boundaries and normalize error responses.
- Prefer incremental, route-segment level optimization over app-wide toggles.
04 同仓库更多 Skills
unslop
Perform sequential slop-cleanup edits in bounded changed-file scope with behavior-preserving rules; do not use for read-only scanning.
unslop-reviewer
Run a read-only, pass-ordered slop scan covering abstraction and locally fixable boundary findings; never edit files.
unslop-coder
Apply unslop-reviewer findings as targeted in-scope code edits in pass order; do not run discovery/scanning in this skill.
serena
Semantic code retrieval, editing, refactoring and debugging tools using LSP servers
read-image
guidance to read images in a lightweight fashion using cwebp
playwright-cli
Drive browser UI checks with playwright-cli commands, snapshots, and test/debug workflows; do not use for backend-only or non-browser tasks.