Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

next — Claude Code skill: what it does, how to install

Converts JSON specs into Next.js apps with routes, layouts, SSR, and metadata. Handy when building AI-generated multi-page apps with @json-render/next.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add vercel-labs/json-render --skill next -a claude-code
Open on GitHub

What next does

This skill guides the agent on using @json-render/next to turn a NextAppSpec schema into a functional Next.js application. It sets up route definitions with standard patterns such as dynamic segments /blog/[slug] or catch-all paths, while managing page metadata and layouts.

Server rendering runs via createNextApp from @json-render/next/server. This helper exposes an async Page Server Component alongside generateMetadata and generateStaticParams. Server-side data fetching happens through loaders, which merge fetched data into the page state before hydration inside NextAppProvider.

Every layout requires a Slot component. If it is missing, page content cannot render. Running this setup also requires installing three packages: @json-render/core, @json-render/react, and @json-render/next.

What it helps with

  • generate Next.js route trees and pages from JSON specifications
  • configure server-side rendering and metadata with createNextApp
  • wire dynamic routes and catch-all paths into NextAppSpec
  • set up server-side data loaders for Server Components

Example prompts for the agent

  • Generate a NextAppSpec config with a dynamic /blog/[slug] route and server loaders
  • Wire up app/[[...slug]]/page.tsx and layout.tsx using @json-render/next
  • Add a shell layout to spec.ts with a Slot element and Link navigation

How to install next

1Skills CLI (Vercel)

npx skills add vercel-labs/json-render --skill next -a claude-code

2Manually: put the files in place

~/.claude/skills/next/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/next/

From the same set20

The whole set →
react vercel-labs This skill turns json-render JSON specs into React component trees. Use it when building JSON-driven UIs or defining a component catalog for generated specs. Claude Code CX Codex Cursor +1 16,300installs core vercel-labs Defines the schema and component catalog for json-render and builds the system prompt that makes an AI emit JSON UI specs. Claude Code CX Codex Cursor +1 15,000installs codegen vercel-labs Utilities for generating code from json-render UI trees. Build custom code exporters for Next.js, Remix, and other frameworks, traverse specs, and serialize props. Claude Code CX Codex Cursor +1 8,900installs devtools vercel-labs Debug panel for json-render apps: component tree, state editor, actions log, streaming patches, and element picker. Claude Code CX Codex Cursor +1 8,300installs directives vercel-labs Pre-built directives for json-render: formatting, math, string handling, i18n. Wire them into your catalog and renderer with one import. Claude Code CX Codex Cursor +1 8,000installs mcp vercel-labs This skill helps build MCP servers that render interactive json-render UIs in Claude, ChatGPT, Cursor, and VS Code. Claude Code CX Codex Cursor +1 5,800installs react-native vercel-labs This skill turns JSON specs into native React Native mobile UIs. Use it when screens need state bindings, conditional visibility, and actions. Claude Code CX Codex Cursor +1 3,200installs remotion-best-practices vercel-labs This skill gives coding agents Remotion guidance for React projects, from animation and audio to compositions and video parameters. Use it while building or editing Remotion code. Claude Code CX Codex Cursor +1 1,500installs

Similar

interaction-design Seth Hobson This skill helps design microinteractions, transitions, and feedback states. Use it when polishing a UI or building loading and gesture patterns. Claude Code CX Codex Cursor 16,146installs design-system-patterns Seth Hobson Guides the design of design tokens, theme switching, and component library architecture. Use it when establishing shared UI foundations for a project. Claude Code CX Codex Cursor 15,953installs unocss Anthony Fu A skill that gives the agent reference material on UnoCSS configuration, rules, shortcuts and presets. Useful when setting up UnoCSS or reusing Tailwind knowledge in it. Claude Code CX Codex Cursor +1 16,000installs react-best-practices mastra-ai 27 React performance and quality rules, priority-ordered: from eliminating request waterfalls to strict typing. Claude Code CX Codex Cursor +1 2,800installs react-native-design Seth Hobson This skill guides React Native styling, navigation, and Reanimated animations. Use it when building cross-platform mobile apps or platform-specific screens. Claude Code CX Codex Cursor 15,522installs frontend-design official anthropics This skill guides intentional visual design for new interfaces and redesigns. Use it when a generic generated UI is not enough. Claude Code Claude.ai 1,025,790installs design-taste-frontend Leonxlnx This skill directs the design of public pages and work screens, then checks the result in a browser through screenshots. Use it when an interface feels generic or unfinished. Claude Code CX Codex Cursor +1 673,100installs prototype Matt Pocock Creates throwaway prototypes for checking state logic or exploring UI before committing the decision to the main codebase. Claude Code 986,201installs

Questions about next

How do I install next in Claude Code?

Run npx skills add vercel-labs/json-render --skill next -a claude-code in your terminal.

What does the next skill do?

It teaches coding assistants how to construct complete Next.js applications directly from JSON specs using @json-render/next.

What packages are required for @json-render/next?

Install @json-render/core, @json-render/react, and @json-render/next using npm.

Source text

SKILL.md · Apache-2.0
---
name: next
description: Next.js renderer for json-render that turns JSON specs into full Next.js applications with routes, layouts, SSR, and metadata. Use when working with @json-render/next, building Next.js apps from JSON specs, or creating AI-generated multi-page applications.
---

# @json-render/next

Next.js renderer that converts JSON specs into full Next.js applications with routes, pages, layouts, metadata, and SSR support.

## Quick Start

```bash
npm install @json-render/core @json-render/react @json-render/next
```

### 1. Define Your Spec

```typescript
// lib/spec.ts
import type { NextAppSpec } from "@json-render/next";

export const spec: NextAppSpec = {
  metadata: {
    title: { default: "My App", template: "%s | My App" },
    description: "A json-render Next.js application",
  },
  layouts: {
    main: {
      root: "shell",
      elements: {
        shell: { type: "Container", props: {}, children: ["nav", "slot"] },
        nav: { type: "NavBar", props: { links: [
          { href: "/", label: "Home" },
          { href: "/about", label: "About" },
        ]}, children: [] },
        slot: { type: "Slot", props: {}, children: [] },
      },
    },
  },
  routes: {
    "/": {
      layout: "main",
      metadata: { title: "Home" },
      page: {
        root: "hero",
        elements: {
          hero: { type: "Card", props: { title: "Welcome" }, children: [] },
        },
      },
    },
    "/about": {
      layout: "main",
      metadata: { title: "About" },
      page: {
        root: "content",
        elements: {
          content: { type: "Card", props: { title: "About Us" }, children: [] },
        },
      },
    },
  },
};
```

### 2. Create the App

```typescript
// lib/app.ts
import { createNextApp } from "@json-render/next/server";
import { spec } from "./spec";

export const { Page, generateMetadata, generateStaticParams } = createNextApp({
  spec,
  loaders: {
    // Server-side data loaders (optional)
    loadPost: async ({ slug }) => {
      const post = await getPost(slug as string);
      return { post };
    },
  },
});
```

### 3. Wire Up Route Files

```tsx
// app/[[...slug]]/page.tsx
export { Page as default, generateMetadata, generateStaticParams } from "@/lib/app";
```

```tsx
// app/[[...slug]]/layout.tsx
import { NextAppProvider } from "@json-render/next";
import { registry, handlers } from "@/lib/registry";

export default function Layout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        <NextAppProvider registry={registry} handlers={handlers}>
          {children}
        </NextAppProvider>
      </body>
    </html>
  );
}
```

## Key Concepts

### NextAppSpec

The top-level spec defines an entire Next.js application:

- **metadata**: Root-level SEO metadata (title template, description, OpenGraph)
- **layouts**: Reusable layout element trees (each must include a `Slot` component)
- **routes**: Route definitions keyed by URL pattern
- **state**: Global initial state shared across all routes

### Route Patterns

Routes use Next.js URL conventions:

- `"/"` -- home page
- `"/about"` -- static route
- `"/blog/[slug]"` -- dynamic segment
- `"/docs/[...path]"` -- catch-all segment
- `"/settings/[[...path]]"` -- optional catch-all segment

### Layouts

Layouts wrap page content. Every layout MUST include a `Slot` component where page content will be rendered. Layouts are defined once in `spec.layouts` and referenced by routes via the `layout` field.

### Built-in Components

- **Slot**: Placeholder in layouts where page content is rendered
- **Link**: Client-side navigation link (wraps `next/link`)

### Built-in Actions

- **setState**: Update state value. Params: `{ statePath, value }`
- **pushState**: Append to array. Params: `{ statePath, value, clearStatePath? }`
- **removeState**: Remove from array by index. Params: `{ statePath, index }`
- **navigate**: Client-side navigation. Params: `{ href }`

### Data Loaders

Server-side async functions that run in the Server Component before rendering. Results are merged into the page's initial state.

```typescript
createNextApp({
  spec,
  loaders: {
    loadPost: async ({ slug }) => {
      const post = await db.post.findUnique({ where: { slug } });
      return { post };
    },
  },
});
```

### SSR

Pages are server-rendered automatically. The `createNextApp` `Page` component is an async Server Component that:

1. Matches the route from the spec
2. Runs server-side data loaders
3. Generates metadata
4. Passes the resolved spec to the client renderer for hydration

### Entry Points

- `@json-render/next` -- Client components (NextAppProvider, PageRenderer, Link)
- `@json-render/next/server` -- Server utilities (createNextApp, matchRoute, schema)

## API Reference

### Server Exports (`@json-render/next/server`)

- `createNextApp(options)` -- Create Page, generateMetadata, generateStaticParams
- `schema` -- Custom schema for Next.js apps (for AI catalog generation)
- `matchRoute(spec, pathname)` -- Match a URL to a route spec
- `resolveMetadata(spec, route)` -- Resolve metadata for a route
- `slugToPath(slug)` -- Convert catch-all slug array to pathname
- `collectStaticParams(spec)` -- Collect static params for all routes

### Client Exports (`@json-render/next`)

- `NextAppProvider` -- Context provider for registry and handlers
- `PageRenderer` -- Renders a page spec with optional layout
- `NextErrorBoundary` -- Error boundary component
- `NextLoading` -- Loading state component
- `NextNotFound` -- Not-found component
- `Link` -- Built-in navigation component (wraps next/link)

© vercel-labs · Apache-2.0 · vercel-labs/json-render

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor