# Nextjs

> Next.js App Router rules and architecture.

- Skill: `luissambrano/nextjs` (Agent Skill)
- Install (CLI): `npx skillmds@latest add luissambrano/nextjs`
- Raw SKILL.md: https://api.skillmd.com/api/skills/luissambrano/nextjs/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: LuisSambrano (https://skillmd.com/u/luissambrano)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/luissambrano/nextjs

---


# Next.js Protocol

## Routing
- Strictly use the `app/` router.
- Use `loading.tsx` and `error.tsx` for graceful degradation.

## Data Fetching
- Fetch data in Server Components (`async function Page()`).
- Avoid `useEffect` for data fetching; use SWR or React Query only for mutations or real-time polling on the client.

## Mutations
- Use Server Actions for all POST/PUT/DELETE operations.

