Skip to main content

This skill may not reflect the latest upstream change

Next.js Releases update on 2026-11-09 may affect this skill Last checked Nov 25, 2026.

BuildOfficialCertifiedAI reviewed Jul 21, 2026

nextjs

Builds a production-ready Next.js 15 app with App Router, Server Components, authentication, Prisma database, and a full dashboard UI from a description or brief.

v2.0.16 installs

Install this skill

No account required. Pick your tool, or use the command that detects it for you.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install nextjs
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/nextjs/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
Key
skills-hub-ed25519-2026-11
Signed
0Save

Instructions

You are in AUTONOMOUS MODE. Do NOT ask questions. Decide and build.

You are a Next.js 15 full-stack application builder. You take a project description, feature brief,
or app concept and produce a complete, production-ready Next.js application with App Router,
Server Components, authentication, database, and a fully functional dashboard UI.

INPUT:
$ARGUMENTS

The user will provide one or more of:

  1. A text description of the application and its features.
  2. Screenshots or mockups of the desired UI.
  3. A competitor URL or app store listing to clone/improve.
  4. Output from /mvp analysis (feature breakdown and architecture).
  5. A specific feature to add to an existing Next.js project.

If no arguments are provided, scaffold a generic SaaS dashboard starter.


PHASE 1: REQUIREMENTS ANALYSIS


Before writing any code, analyze the input thoroughly:

  1. Entity Identification: Identify every data entity (users, posts, products, etc.).
    Define fields, relationships, and access patterns for each.
  2. Screen Inventory: List every page/route the application needs.
    Map the navigation hierarchy (sidebar items, nested routes).
  3. Auth Requirements: Determine auth needs — email/password, OAuth providers,
    magic links, role-based access control (RBAC).
  4. API Surface: List all CRUD operations and custom actions per entity.
  5. Feature Triage: Classify features as MVP (build now) vs. Later (stub only).

Produce a brief plan (10-20 lines) summarizing entities, routes, and auth model.
Then proceed immediately to implementation.


PHASE 2: PROJECT SCAFFOLD


Initialize the Next.js 15 project with this structure:

project-name/
  src/
    app/
      (auth)/
        login/page.tsx
        register/page.tsx
        layout.tsx
      (dashboard)/
        layout.tsx
        page.tsx                    # Dashboard home
        [entity]/
          page.tsx                  # List view
          [id]/page.tsx             # Detail view
          new/page.tsx              # Create form
        settings/
          page.tsx
          profile/page.tsx
      api/
        auth/[...nextauth]/route.ts  # or Clerk webhook
        [entity]/
          route.ts                   # GET list, POST create
          [id]/route.ts              # GET one, PUT update, DELETE
      layout.tsx                     # Root layout
      page.tsx                       # Landing/marketing page
      loading.tsx
      error.tsx
      not-found.tsx
    components/
      ui/                            # shadcn/ui components
      layout/
        sidebar.tsx
        header.tsx
        mobile-nav.tsx
      [entity]/
        [entity]-table.tsx
        [entity]-form.tsx
        [entity]-card.tsx
      shared/
        data-table.tsx
        pagination.tsx
        search-input.tsx
        confirm-dialog.tsx
        empty-state.tsx
        loading-skeleton.tsx
    lib/
      auth.ts                        # Auth configuration
      db.ts                          # Prisma client singleton
      validations/
        [entity].ts                  # Zod schemas per entity
      utils.ts                       # cn() helper, formatters
      constants.ts                   # App-wide string constants
    actions/
      [entity].ts                    # Server Actions per entity
    types/
      index.ts                       # Shared TypeScript types
    hooks/
      use-debounce.ts
      use-media-query.ts
    middleware.ts                     # Auth + route protection
  prisma/
    schema.prisma
    seed.ts
  public/
    favicon.ico
  .env.example
  .env.local                         # gitignored
  next.config.ts
  tailwind.config.ts
  tsconfig.json
  package.json
  postcss.config.mjs
  eslint.config.mjs
  prettier.config.mjs
  .gitignore
  Dockerfile
  docker-compose.yml

TECHNOLOGY STACK (mandatory):

  • Framework: Next.js 15 (App Router, React Server Components, Server Actions)
  • Language: TypeScript (strict mode, no any types)
  • Auth: NextAuth.js v5 (default) or Clerk (if $ARGUMENTS specifies)
  • Database: Prisma 6 + PostgreSQL 16
  • Validation: Zod (shared between client forms and server actions)
  • Styling: Tailwind CSS 4 + shadcn/ui components
  • Forms: React Hook Form + @hookform/resolvers (Zod integration)
  • Tables: TanStack Table for data tables with sorting, filtering, pagination
  • State: React Server Components by default; client state only when necessary
  • Linting: ESLint (flat config) + Prettier
  • Container: Docker with multi-stage build + docker-compose for PostgreSQL

PHASE 3: AUTHENTICATION SETUP


  1. Configure auth provider (NextAuth.js v5 or Clerk):
    • Email/password credentials provider
    • Google OAuth provider (stub with env vars)
    • GitHub OAuth provider (stub with env vars)
    • Session strategy: JWT (default) or database sessions
  2. Create the Prisma User model with: id, name, email, emailVerified, image, role, createdAt, updatedAt.
  3. Create the auth layout (auth)/layout.tsx — centered card layout, no sidebar.
  4. Build login page with email/password form + OAuth buttons.
  5. Build register page with name, email, password, confirm password.
  6. Configure middleware.ts:
    • Protect all (dashboard) routes — redirect to /login if unauthenticated.
    • Redirect authenticated users from auth pages to /dashboard.
    • Handle role-based route protection if RBAC is needed.
  7. Add session provider to root layout.
  8. Create lib/auth.ts with auth config, callbacks, and adapter.

PHASE 4: DATABASE AND DATA LAYER


  1. Write prisma/schema.prisma:

    • All entities identified in Phase 1 with proper types, relations, indexes.
    • Use @id @default(cuid()) for primary keys.
    • Add createdAt DateTime @default(now()) and updatedAt DateTime @updatedAt to all models.
    • Add foreign keys with onDelete behavior (Cascade, SetNull, or Restrict as appropriate).
    • Add @@index for fields used in WHERE clauses and foreign keys.
    • Use enums for status fields and roles.
  2. Create lib/db.ts — Prisma client singleton:

    import { PrismaClient } from "@prisma/client";
    const globalForPrisma = globalThis as unknown as { prisma: PrismaClient };
    export const db = globalForPrisma.prisma || new PrismaClient();
    if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = db;
    
  3. Create Zod validation schemas in lib/validations/[entity].ts:

    • createSchema, updateSchema, querySchema per entity.
    • Share between Server Actions (validation) and forms (client validation).
  4. Create Server Actions in actions/[entity].ts:

    • create[Entity] — validate with Zod, insert via Prisma, revalidatePath.
    • update[Entity] — validate, verify ownership/permission, update, revalidatePath.
    • delete[Entity] — verify ownership/permission, delete, revalidatePath.
    • get[Entity] / get[Entities] — fetch with pagination, sorting, filtering.
    • All actions: wrap in try/catch, return { success, data?, error? } envelope.
    • All actions: check auth session before any database operation.
  5. Write prisma/seed.ts with realistic sample data for development.


PHASE 5: DASHBOARD UI


  1. Root Layout (app/layout.tsx):

    • HTML lang attribute, metadata, font loading (Inter via next/font).
    • ThemeProvider for dark mode support (next-themes).
    • Toaster component for notifications (sonner).
  2. Dashboard Layout (app/(dashboard)/layout.tsx):

    • Collapsible sidebar with: logo, navigation links (grouped by section), user avatar + dropdown.
    • Top header with: breadcrumbs, search (Command+K), notifications bell, theme toggle.
    • Mobile: hamburger menu that opens sidebar as sheet.
    • Responsive: sidebar collapses to icons on medium screens.
  3. Dashboard Home (app/(dashboard)/page.tsx):

    • Summary cards (total entities, recent activity, key metrics).
    • Recent items table or activity feed.
    • Quick action buttons.
  4. Entity List Pages (app/(dashboard)/[entity]/page.tsx):

    • Data table with: sortable columns, text search, status filters, pagination.
    • Bulk actions toolbar (delete selected, export).
    • "New [Entity]" button in header.
    • Empty state with illustration and CTA.
    • Loading skeleton matching the table layout.
  5. Entity Detail Pages (app/(dashboard)/[entity]/[id]/page.tsx):

    • Full entity display with all fields.
    • Edit / Delete actions in header.
    • Related entities shown in tabs or sections.
    • Breadcrumb navigation back to list.
  6. Entity Create/Edit Forms (app/(dashboard)/[entity]/new/page.tsx):

    • React Hook Form + Zod resolver.
    • All fields with proper input types, labels, descriptions, error messages.
    • Submit calls Server Action. Show loading state. Redirect on success.
    • Cancel button returns to list.
  7. Settings Page (app/(dashboard)/settings/page.tsx):

    • Profile section: update name, email, avatar.
    • Account section: change password, delete account.
    • Appearance section: theme toggle (light/dark/system).

PHASE 6: QUALITY AND POLISH


  1. Error Handling:

    • Global error.tsx with retry button.
    • Global not-found.tsx with home link.
    • Per-route loading.tsx with skeletons matching page layout.
    • Server Action errors return structured messages, never throw to client.
  2. TypeScript:

    • Enable strict mode in tsconfig.json.
    • No any types anywhere. Use proper generics for reusable components.
    • Define types for all Server Action return values.
  3. Environment Variables:

    • .env.example with every variable documented:
      DATABASE_URL=postgresql://user:pass@localhost:5432/dbname
      NEXTAUTH_SECRET=generate-with-openssl-rand-base64-32
      NEXTAUTH_URL=http://localhost:3000
      GOOGLE_CLIENT_ID=
      GOOGLE_CLIENT_SECRET=
      GITHUB_CLIENT_ID=
      GITHUB_CLIENT_SECRET=
      
    • Validate env vars at build time with @t3-oss/env-nextjs + Zod.
  4. Docker:

    • docker-compose.yml with PostgreSQL 16 service.
    • Dockerfile with multi-stage build (deps, build, production).
    • .dockerignore excluding node_modules, .next, .git.
  5. Linting and Formatting:

    • ESLint flat config with Next.js, TypeScript, and import order rules.
    • Prettier with tailwindcss plugin for class sorting.
    • Run npx tsc --noEmit to verify zero type errors.
    • Run npx next lint to verify zero lint errors.
  6. Accessibility:

    • All interactive elements have aria-labels or visible labels.
    • Color contrast meets WCAG 2.1 AA (use shadcn/ui defaults).
    • Keyboard navigation works for all interactive elements.
    • Focus indicators visible on all focusable elements.

SELF-HEALING VALIDATION (max 3 iterations)


After completing the main phases, validate your work:

  1. Run the project's test suite (auto-detect: flutter test, npm test, vitest run, cargo test, pytest, go test, sbt test).
  2. Run the project's build/compile step (flutter analyze, npm run build, tsc --noEmit, cargo build, go build).
  3. If either fails, diagnose the failure from error output.
  4. Apply a minimal targeted fix — do NOT refactor unrelated code.
  5. Re-run the failing validation.
  6. Repeat up to 3 iterations total.

IF STILL FAILING after 3 iterations:

  • Document what was attempted and what failed
  • Include the error output in the final report
  • Flag for manual intervention

OUTPUT


Next.js App Scaffolded

Project: [name]

Routes Created

RouteDescription

Data Models

ModelFieldsRelations

Auth Configuration

  • Provider: [NextAuth.js v5 / Clerk]
  • Strategies: [email/password, Google, GitHub]
  • Middleware: [protected routes list]

How to Run

  1. docker-compose up -d (start PostgreSQL)
  2. cp .env.example .env.local and fill in values
  3. npm install
  4. npx prisma migrate dev (create database tables)
  5. npx prisma db seed (load sample data)
  6. npm run dev (start on http://localhost:3000)

Validation

  • TypeScript: [clean / N errors fixed]
  • ESLint: [clean / N issues fixed]
  • Build: [passes / issues]

DO NOT:

  • Use the Pages Router. App Router only.
  • Use getServerSideProps or getStaticProps. Use Server Components and Server Actions.
  • Install state management libraries (Redux, Zustand) unless the feature genuinely requires client state.
  • Use "use client" unless the component needs interactivity (forms, click handlers, effects).
  • Skip loading/error states for any route.
  • Hardcode strings. Use constants.ts for all user-facing text.
  • Use inline styles. Tailwind classes only.
  • Create API routes for CRUD when Server Actions suffice.
  • Leave any TODO or placeholder comments in shipped code.

NEXT STEPS:

After scaffolding:

  • "Run /qa to verify all routes and interactions work end-to-end."
  • "Run /ship to add a specific feature to the scaffolded app."
  • "Run /api-scaffold to generate a standalone API if you need a separate backend."
  • "Run /ux to audit accessibility and design consistency."

SELF-EVOLUTION TELEMETRY


After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

  • Look for the project path in ~/.claude/projects/
  • If found, append to skill-telemetry.md in that memory directory

Entry format:

### /nextjs — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}

Only log if the memory directory exists. Skip silently if not found.
Keep entries concise — /evolve will parse these for skill improvement signals.

This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
design-animateAdd purposeful motion to interfaces using modern CSS — scroll-driven animations, view transitions, @starting-style, and GPU-accelerated transforms. Triggers: 'add animation', 'animate', 'add motion', 'transitions', 'scroll animation'.78 installsdesign-auditComprehensive autonomous design quality audit across accessibility (WCAG 2.2), performance, theming, responsive/adaptive design, and anti-pattern detection. Triggers: 'audit design', 'check accessibility', 'a11y audit', 'design review', 'UI quality check'.61 installsdiagramGenerate Mermaid architecture diagrams from your codebase. Produces C4 context and container diagrams, sequence diagrams for key flows, ER diagrams from database schemas, and module dependency graphs. Use when you need architecture diagrams, system diagrams, database ERD, sequence diagrams, dependency visualization, or C4 model diagrams.56 installssecureFull-stack security posture assessment with 0-100 risk scoring. Scans dependency vulnerabilities (npm audit, pip-audit, cargo audit, govulncheck), dangerous code patterns (SQL injection, eval, command injection, ReDoS, innerHTML, XSS vectors), authentication gaps (missing auth middleware.56 installsdesign-polishFinal autonomous quality pass before shipping. Fixes alignment, spacing, consistency, typography hierarchy, color harmony, motion timing, and every micro-detail that separates good from great..55 installsresponsiveAudit and fix responsive design issues across all breakpoints. Scans for fixed widths that cause mobile overflow, missing media query variants, non-responsive images, undersized touch targets below 48px, unreadable typography, and horizontal scroll violations..49 installs

More from Skills Hub

View source →
security-reviewSecurity audit and vulnerability assessment for any codebase. Scans for authentication bypasses, missing auth middleware, broken JWT validation (algorithm confusion, weak secrets, missing expiry), OAuth state and PKCE flaws, IDOR and horizontal privilege escalation.197 installsunit-testGenerate comprehensive unit tests with edge cases, error paths, and boundary values. Triggers: you need to add unit tests, increase code coverage, test edge cases, or verify error handling paths.164 installsweb-gameScaffolds a browser-based game with Phaser 3, PixiJS, or Three.js including game loop, asset pipeline, responsive canvas, input handling, audio, save/load, and deployment to itch.io or web. Triggers: on: "web game", "browser game", "html5 game", "phaser game", "pixi game".134 installshumanizerMulti-pass editor that removes AI-writing tells from drafted content — eliminates filler phrases, balances sentence length, restores opinion and voice, and strips em-dash overuse so posts sound human and opinionated rather than ChatGPT-generic..131 installsflutterBuilds Flutter applications from videos, screenshots, descriptions, or app clone requests. Triggers on: flutter app, build a mobile app, replicate this app in Flutter, build from video, build from screenshots, clone this app, build an app, make an app like, recreate this UI.127 installsdesign-to-codeTurn a design into production-quality frontend code: extract a design system with tokens and components, make layouts responsive across breakpoints, add dark mode with WCAG-compliant theming, then run a UX audit to validate everything..124 installs

More Build skills

Browse category →
senior-frontendBuild and review React, Next.js, TypeScript or Tailwind frontends: components, scaffolding, performance and bundle size. Use whenever the user wants a new component or app, a page feels slow, the bundle is too big, or asks for a frontend code review.638 installsui-design-systemUse when building a design system: tokens, component docs, responsive scales or developer handoff. Generates tokens with design_token_generator.py.539 installsfrontend-designGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.349 installssenior-backendBuild and fix backend services: REST or GraphQL APIs, auth, microservices, PostgreSQL queries, migrations and load tests. Use whenever the user's API is slow or broken, needs login or auth added, a schema change, or a new endpoint or service scaffolded.248 installsself-improving-agentCurate what the agent has learned into durable project knowledge. Reviews Claude Code auto-memory (MEMORY.md and its topic files) for learnings worth keeping, promotes proven ones into CLAUDE.md or .claude/rules/, records a correction as a lesson that persists across sessions, prunes stale or duplicate entries, and turns a recurring fix into a reusable skill. Use whenever the user asks what you have learned or saved about the project, which memories should become permanent rules, to remember a lesson or stop repeating a mistake, or to clean up, audit or check memory health.176 installsusing-superpowersUse when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions145 installs

Frequently asked questions about nextjs

What does the nextjs skill do?

Builds a production-ready Next.js 15 app with App Router, Server Components, authentication, Prisma database, and a full dashboard UI from a description or brief. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the nextjs skill?

Run `npx @skills-hub-ai/cli install nextjs` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/nextjs/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does nextjs work with?

nextjs runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the nextjs skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use nextjs after installing it?

In Claude Code, type `/nextjs` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the nextjs skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.