nextjs-app-router

nextjs-app-router is a skill for Claude Code, Codex from desilokesh1/antigravity-fullstack-hq. It costs 37 tokens per session (768 once invoked), scanned A, original, MIT.

A skill for building Next.js applications with the App Router, Next.js's folder-based system for pages, layouts, loading states, errors, and data access. It covers server and browser components, server actions, routing, and data fetching.

In plain words
What is it for?
Use it to structure routes, choose between server and client components, implement server actions, fetch data, and handle loading, errors, and missing pages.
Why use it?
It provides established ways to decide where code runs and how application pages and data operations should be organized.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to structure routes, choose between server and client components, implement server actions, fetch data, and handle loading, errors, and missing pages.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/desilokesh1/antigravity-fullstack-hq/nextjs-app-router
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add desilokesh1/antigravity-fullstack-hq --skill nextjs-app-router
Clone the repo
git clone --depth 1 https://github.com/desilokesh1/antigravity-fullstack-hq

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nextjs-app-router

README.md
[![agentmods](https://agentmods.dev/badge/skills/desilokesh1/antigravity-fullstack-hq/nextjs-app-router/github.svg)](https://agentmods.dev/skills/desilokesh1/antigravity-fullstack-hq/nextjs-app-router)
Your own site
<a href="https://agentmods.dev/skills/desilokesh1/antigravity-fullstack-hq/nextjs-app-router"><img src="https://agentmods.dev/badge/skills/desilokesh1/antigravity-fullstack-hq/nextjs-app-router/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nextjs-app-router

Your own site · 80×15
<a href="https://agentmods.dev/skills/desilokesh1/antigravity-fullstack-hq/nextjs-app-router"><img src="https://agentmods.dev/badge/skills/desilokesh1/antigravity-fullstack-hq/nextjs-app-router.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 768 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.00768
Opus 5.5 $0.00015 $0.00307
Sonnet 5.5 $0.00007 $0.00154
Haiku 4.5 $0.00004 $0.00077

Measured 1mo ago against content hash 780e32f68998, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

nextjs-app-router scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

fetch(url, { next: { revalidate: 60 } })
skills/nextjs-app-router/SKILL.md · 156 lines

How it starts

The opening of the file, as written. The whole thing — 156 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Next.js App Router Patterns

Project Structure

app/
├── (auth)/                 # Route Group
│   ├── login/page.tsx
│   ├── register/page.tsx
│   └── layout.tsx
├── (dashboard)/
│   ├── layout.tsx
│   ├── page.tsx
│   └── [projectId]/
│       └── page.tsx
├── api/
│   └── webhooks/route.ts
├── layout.tsx
├── page.tsx
├── loading.tsx
├── error.tsx
└── not-found.tsx

Server vs Client Components

Decision Tree

  • Need interactivity (onClick, useState)? -> 'use client'
  • Need browser APIs? -> 'use client'
  • Otherwise -> Server Component (default)

Server Component

// No directive needed - Server Component by default
import { prisma } from '@/lib/db'

export default async function UsersPage() {
  const users = await prisma.user.findMany()
  return <UserList users={users} />
}

Client Component

'use client'

import { useState } from 'react'

export function Counter() {
  const [count, setCount] = useState(0)
  return <button onClick={() => setCount(c => c + 1)}>{count}</button>
}

Server Actions

// lib/actions/users.ts
'use server'

import { revalidatePath } from 'next/cache'
import { redirect } from 'next/navigation'

export async function createUser(formData: FormData) {
  const email = formData.get('email') as string
  
  await prisma.user.create({ data: { email } })
  
  revalidatePath('/users')
  redirect('/users')
}

Using in Forms

import { createUser } from '@/lib/actions/users'

export function CreateUserForm() {
  return (
    <form action={createUser}>
      <input name="email" type="email" required />
      <button type="submit">Create</button>
    </form>
  )
}

Data Fetching

Parallel Fetching

export default async function Dashboard() {
  const [user, posts] = await Promise.all([
    getUser(),
    getPosts()
  ])
  
  return <DashboardView user={user} posts={posts} />
}

Streaming with Suspense

import { Suspense } from 'react'

export default function Page() {
  return (
    <div>
      <h1>Dashboard</h1>
      <Suspense fallback={<Loading />}>
        <SlowComponent />
      </Suspense>
    </div>
  )
}

Read the full file on GitHub · 156 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 156 lines · 37 tokens per session scan A 780e32f68998

Subscribe to this mod's changes

nextjs-app-router is a skill published in the GitHub repository desilokesh1/antigravity-fullstack-hq (2 stars, last pushed 14d ago), licensed MIT. It adds 37 tokens to every session and 768 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.