Skip to content
Back to skills

Nextjs

ASecurity

Build, review, and refactor Next.js (App Router) frontend projects with TypeScript. Use for tasks like creating pages/layouts, routing, server components vs client components, data fetching patterns, UI component structure, forms/validation, auth integration points, env vars, linting/testing, and production deployment readiness.

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 28, 2026
developmenttypescriptshellnextjstestingapifrontend

Works with

  • cli
  • api

Security analysis

A100/100

Scanned May 28, 2026

npx -y skills add muzhicaomingwang/ai-ideas --skill nextjs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Nextjs?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Nextjs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/muzhicaomingwang-nextjs/badge)](https://www.skillsdirectory.com/skills/muzhicaomingwang-nextjs)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: nextjs
description: Build, review, and refactor Next.js (App Router) frontend projects with TypeScript. Use for tasks like creating pages/layouts, routing, server components vs client components, data fetching patterns, UI component structure, forms/validation, auth integration points, env vars, linting/testing, and production deployment readiness.
---

# nextjs

Use this skill to implement or review a Next.js frontend in a consistent, production-friendly way.

## Defaults (unless repo dictates otherwise)

- Next.js App Router (`app/`)
- TypeScript
- Server Components by default; add `"use client"` only when needed
- CSS: Tailwind if already present; otherwise follow existing styling approach

## Workflow

1) Identify project mode
- New app: decide App Router vs Pages Router (prefer App Router unless constrained).
- Existing app: follow current structure, conventions, and tooling.

2) Establish app structure (App Router)
- `app/layout.tsx`: global shell (providers, fonts, nav).
- `app/page.tsx`: landing page.
- Route groups for domains: `app/(dashboard)/...`, `app/(marketing)/...`.
- Shared UI: `components/` (reusable), `app/**/_components/` (route-scoped).
- Types/utilities: `lib/` (fetchers, helpers), `types/`.

3) Server vs client boundaries
- Prefer Server Components for data loading and initial render.
- Use Client Components for: event handlers, stateful UI, browser APIs, client-only libraries.
- Keep props serializable across the boundary; avoid passing functions/classes.

4) Data fetching patterns
- Prefer colocated server fetchers in `lib/` and call them from Server Components.
- Use `fetch()` with Next caching semantics when appropriate.
- Handle loading and errors with `loading.tsx` / `error.tsx` per route segment.

5) Forms and validation
- Use server actions when appropriate; otherwise route handlers (`app/api/...`) + client submit.
- Validate on server; optionally mirror on client.

6) Env vars & config
- Document required env vars; use `process.env.X`.
- Only expose public vars with `NEXT_PUBLIC_` prefix.

7) Quality gates
- Run `lint` and `typecheck` (and tests if present).
- Ensure accessibility basics: labels, focus states, keyboard navigation.
- Avoid breaking route segments/URLs; add redirects when changing paths.

## Output expectations when making changes

- Keep diffs small and localized.
- Prefer composition over complex shared state.
- Add a short usage note (routes added, env vars, how to run) when you introduce new capabilities.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.