Agent skill

Nextjs Best Practices

by xenitV1 in xenitV1/Antigravity-Workflows

Next.js App Router principles. An agent skill from xenitV1/Antigravity-Workflows.

MITAuto-check passedFrontend & Design

Install Nextjs Best Practices

skills CLI
$ npx skills add xenitV1/Antigravity-Workflows --skill nextjs-best-practices -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install xenitV1/Antigravity-Workflows nextjs-best-practices --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/xenitV1/Antigravity-Workflows.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/nextjs-best-practices .claude/skills/nextjs-best-practices && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
nextjs-best-practices
GitHub stars
130
Used in
9 other repos
Token cost
~905 tokens
SKILL.md length
311 words
Files
1
Skills in repo
42
Repo updated
First seen
Licence
MIT

At a glance

Next.js App Router principles. An agent skill from xenitV1/Antigravity-Workflows.

  • Works in 10 steps: Server vs Client Components → Data Fetching Patterns → Routing Principles → …
  • Frontend & Design work in your project
  • SKILL.md covers 1. Server vs Client Components, 2. Data Fetching Patterns, 3. Routing Principles and 4. API Routes, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Nextjs Best Practices is an agent skill from xenitV1/Antigravity-Workflows. Next.js App Router principles. Server Components, data fetching, routing patterns.

Its SKILL.md is about 910 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design. It works with Next.js. The licence is MIT.

When your agent uses it

  • Frontend & Design work in your project

Example prompts

  • “/nextjs-best-practices”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Edit, Glob, Grep

Workflow steps

10 steps, taken from the step headings in SKILL.md.

  1. Server vs Client Components
  2. Data Fetching Patterns
  3. Routing Principles
  4. API Routes
  5. Performance Principles
  6. Metadata
  7. Caching Strategy
  8. Server Actions
  9. Anti-Patterns
  10. Project Structure

What it can do on your machine

Read from SKILL.md and the folder at commit f0a1fa7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Nextjs Best Practices loads about 905 tokens when it runs. Until then it costs about 26 tokens; SKILL.md has 311 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~26
When it runs · the whole SKILL.md, loaded when a task matches
~905

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from xenitV1/Antigravity-Workflows at commit f0a1fa7, republished under its MIT licence (© xenitV1). 311 words, ~905 tokens.

Download SKILL.mdSave it as .claude/skills/nextjs-best-practices/SKILL.md (or your agent's skills folder).
name
nextjs-best-practices
description
Next.js App Router principles. Server Components, data fetching, routing patterns.
allowed-tools
Read, Write, Edit, Glob, Grep

Next.js Best Practices

Principles for Next.js App Router development.


1. Server vs Client Components

Decision Tree
Does it need...?
│
├── useState, useEffect, event handlers
│   └── Client Component ('use client')
│
├── Direct data fetching, no interactivity
│   └── Server Component (default)
│
└── Both? 
    └── Split: Server parent + Client child
By Default
TypeUse
ServerData fetching, layout, static content
ClientForms, buttons, interactive UI

2. Data Fetching Patterns

Fetch Strategy
PatternUse
DefaultStatic (cached at build)
RevalidateISR (time-based refresh)
No-storeDynamic (every request)
Data Flow
SourcePattern
DatabaseServer Component fetch
APIfetch with caching
User inputClient state + server action

3. Routing Principles

File Conventions
FilePurpose
page.tsxRoute UI
layout.tsxShared layout
loading.tsxLoading state
error.tsxError boundary
not-found.tsx404 page
Route Organization
PatternUse
Route groups (name)Organize without URL
Parallel routes @slotMultiple same-level pages
Intercepting (.)Modal overlays

4. API Routes

Route Handlers
MethodUse
GETRead data
POSTCreate data
PUT/PATCHUpdate data
DELETERemove data
Best Practices
  • Validate input with Zod
  • Return proper status codes
  • Handle errors gracefully
  • Use Edge runtime when possible

5. Performance Principles

Image Optimization
  • Use next/image component
  • Set priority for above-fold
  • Provide blur placeholder
  • Use responsive sizes
Bundle Optimization
  • Dynamic imports for heavy components
  • Route-based code splitting (automatic)
  • Analyze with bundle analyzer

6. Metadata

Static vs Dynamic
TypeUse
Static exportFixed metadata
generateMetadataDynamic per-route
Essential Tags
  • title (50-60 chars)
  • description (150-160 chars)
  • Open Graph images
  • Canonical URL

7. Caching Strategy

Cache Layers
LayerControl
Requestfetch options
Datarevalidate/tags
Full routeroute config
Revalidation
MethodUse
Time-basedrevalidate: 60
On-demandrevalidatePath/Tag
No cacheno-store

8. Server Actions

Use Cases
  • Form submissions
  • Data mutations
  • Revalidation triggers
Best Practices
  • Mark with 'use server'
  • Validate all inputs
  • Return typed responses
  • Handle errors

9. Anti-Patterns

❌ Don't✅ Do
'use client' everywhereServer by default
Fetch in client componentsFetch in server
Skip loading statesUse loading.tsx
Ignore error boundariesUse error.tsx
Large client bundlesDynamic imports

10. Project Structure

app/
├── (marketing)/     # Route group
│   └── page.tsx
├── (dashboard)/
│   ├── layout.tsx   # Dashboard layout
│   └── page.tsx
├── api/
│   └── [resource]/
│       └── route.ts
└── components/
    └── ui/

Remember: Server Components are the default for a reason. Start there, add client only when needed.

© xenitV1, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/nextjs-best-practices of xenitV1/Antigravity-Workflows.

Open the folder on GitHubat commit f0a1fa7

Used in 9 other repositories

We found 22 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 9 other GitHub owners. This page covers the copy in xenitV1/Antigravity-Workflows, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Nextjs Best Practices next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Nextjs Best Practices compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Nextjs Best Practices this skillxenitV1/Antigravity-Workflows1309 repos~905Automated safety check: PassMIT
Chakra UI v3 Builderchakra-ui/chakra-ui41k—~3.1kAutomated safety check: PassMIT
React View Transitions Guidevercel-labs/next-beats16810 repos~3.1kAutomated safety check: PassMIT
Website ClonerJCodesMore/ai-website-cloner-template36k—~1.7kAutomated safety check: PassMIT
Wcag Audit PatternsvmDeshpande/ai-agent-automation17811 repos~610Automated safety check: PassApache-2.0
Vercel React Best Practicessanity-io/sanity6.4k129 repos~1.6kAutomated safety check: PassMIT

Similar skills

  • Chakra UI v3 Builder

    chakra-ui/chakra-ui

    Builds responsive, accessible Chakra UI v3 components and layouts, sets up Chakra in new or existing projects, and designs themes with tokens, semantic tokens and recipes.

    41k GitHub stars~3.1k tokensUpdated 3 days ago
    Frontend & DesignAuto-check passed
  • React View Transitions Guide

    vercel-labs/next-beats

    Official

    Guides implementing animated page and state transitions in React with the native View Transition API, covering shared elements, list reorders and directional navigation.

    168 GitHub starsUsed in 10 repos~3.1k tokens
    Frontend & DesignAuto-check passed
  • Website Cloner

    JCodesMore/ai-website-cloner-template

    Rebuilds existing web pages as editable local code that matches their content, assets, responsive layout and interactions, including Framer sites and animated pages.

    36k GitHub stars~1.7k tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • Wcag Audit Patterns

    vmDeshpande/ai-agent-automation

    Conduct WCAG 2.2 accessibility audits with automated testing, manual verification, and remediation guidance.

    178 GitHub starsUsed in 11 repos~610 tokens
    Frontend & DesignAuto-check passed
  • Official

    React and Next.js performance optimization guidelines from Vercel Engineering.

    6.4k GitHub starsUsed in 129 repos~1.6k tokens
    Frontend & DesignAuto-check passed
  • Turnstile Spin

    cloudflare/skills

    Official

    Set up, repair, or migrate to Cloudflare Turnstile bot verification in an existing frontend and backend, including server-side Siteverify.

    3k GitHub starsUsed in 4 repos~7.2k tokens
    Frontend & DesignAuto-check: notes

More from xenitV1/Antigravity-Workflows

All 42 skills in this repo
  • Parallel Agents

    xenitV1/Antigravity-Workflows

    Native multi-agent orchestration using Claude Code's Agent Tool.

    130 GitHub starsUsed in 9 repos~1.3k tokens
    Auto-check passed
  • Mobile Design

    xenitV1/Antigravity-Workflows

    Mobile-first design thinking and decision-making for iOS and Android apps.

    130 GitHub starsUsed in 2 repos~3.7k tokens
    Auto-check: notes
  • Bash Linux

    xenitV1/Antigravity-Workflows

    Bash/Linux terminal patterns. An agent skill from xenitV1/Antigravity-Workflows.

    130 GitHub starsUsed in 8 repos~1k tokens
    Auto-check: notes
  • Performance Profiling

    xenitV1/Antigravity-Workflows

    Performance profiling principles. An agent skill from xenitV1/Antigravity-Workflows.

    130 GitHub starsUsed in 8 repos~772 tokens
    Auto-check: notes
  • Plan Writing

    xenitV1/Antigravity-Workflows

    Structured task planning with clear breakdowns, dependencies, and verification criteria.

    130 GitHub starsUsed in 8 repos~994 tokens
    Auto-check passed
  • Behavioral Modes

    xenitV1/Antigravity-Workflows

    AI operational modes (brainstorm, implement, debug, review, teach, ship, orchestrate).

    130 GitHub starsUsed in 7 repos~1.3k tokens
    Auto-check passed

Works with

Questions about Nextjs Best Practices

What does Nextjs Best Practices do?

Next.js App Router principles. An agent skill from xenitV1/Antigravity-Workflows. Nextjs Best Practices is an agent skill from xenitV1/Antigravity-Workflows.js App Router principles.

When should I use Nextjs Best Practices?

Nextjs Best Practices fits situations like: frontend & Design work in your project.

How do I install Nextjs Best Practices in Claude Code?

Run `npx skills add xenitV1/Antigravity-Workflows --skill nextjs-best-practices -a claude-code`. Or copy the skill folder (skills/nextjs-best-practices in xenitV1/Antigravity-Workflows) into .claude/skills/nextjs-best-practices in your project. Claude Code loads it when a task matches its description.

How do I install Nextjs Best Practices in Codex?

Run `npx skills add xenitV1/Antigravity-Workflows --skill nextjs-best-practices -a codex`. Or copy the skill folder (skills/nextjs-best-practices in xenitV1/Antigravity-Workflows) into .agents/skills/nextjs-best-practices in your project. Codex loads it when a task matches its description.

Can I use Nextjs Best Practices in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add xenitV1/Antigravity-Workflows --skill nextjs-best-practices -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/nextjs-best-practices, .gemini/skills/nextjs-best-practices, .github/skills/nextjs-best-practices and .opencode/skills/nextjs-best-practices in your project.

What does Nextjs Best Practices need to run?

SKILL.md names no scripts, command-line tools or credentials: Nextjs Best Practices is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Edit, Glob, Grep.

Does Nextjs Best Practices access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Nextjs Best Practices safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Nextjs Best Practices use?

Nextjs Best Practices is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Nextjs Best Practices use?

About 905 tokens (SKILL.md is roughly 3.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Nextjs Best Practices?

Skills that share tags, products or a category with Nextjs Best Practices: Chakra UI v3 Builder (chakra-ui/chakra-ui, 41k stars), React View Transitions Guide (vercel-labs/next-beats, 168 stars), Website Cloner (JCodesMore/ai-website-cloner-template, 36k stars) and Wcag Audit Patterns (vmDeshpande/ai-agent-automation, 178 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Nextjs Best Practices?

xenitV1 (a GitHub user) maintains it in xenitV1/Antigravity-Workflows, which has 130 GitHub stars. The repository holds 42 skills in this directory. The repository was last updated on January 14, 2026.

Source: xenitV1/Antigravity-Workflows on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.