NexityGuides

Next.js Sanity starter with an agent layer

Chris Lojniewski · 9 min read

Nexity Base is an open source Next.js 16 and Sanity Studio 6 starter with an agent layer for Claude Code, Codex, and Cursor. Its create-section skill builds sections from project instructions, design rules, and brand files, then calls read-only reviewers to check the work.

This guide is for developers and engineering managers selecting a marketing website starter. Product facts describe the Nexity repository at commit 84d9f58; the comparison uses the official Sanity template at commit 505b13a. All sources were read on November 22, 2026.

What is in Nexity Base

Nexity Base combines a Next.js application, Sanity Studio, a page builder, and project files for coding agents. Nexity is an open source system for starting and growing AI-native websites on Next.js + Sanity. An AI-native website is one that people and AI agents run from one repository and one CMS.

Pagepro makes Nexity and publishes it under the MIT license. Nexity Base is the unbranded starter in the repository’s base/ folder.

The starter is a pnpm workspace with 2 packages:

  • web/ contains the Next.js application, using the App Router, Tailwind CSS 4, and TypeScript.
  • studio/ contains the standalone Sanity Studio and the schemas that web/ imports.

Production serves only the embedded Studio at /admin, so editors use one domain and one sign-in. The standalone Studio runs on port 3333 during local work.

next-sanity is the official Sanity toolkit for Next.js. Nexity Base uses it for the embedded Studio, visual editing, draft mode, live content, and the webhook that refreshes pages after publication.

The feature overview describes the editing and publication features:

  • Visual editing with click-to-edit and a preview of unpublished changes.
  • Publication without a rebuild: a webhook refreshes only affected pages.
  • Redirects and rewrites managed in the Studio, taking effect about two minutes after publication.
  • Cookie consent, Google Tag Manager, and a contact form that sends email through Resend.

The Sections Gallery shows each section type with sample content. The Meridian theme is the demo site in the repository: Nexity Base with the design and content of a fictional company, and the same Studio tools.

The Sections Gallery in the Styleguide tool: filters for the 6 groups and cards for Content, Feature block, Feature grid, Bento grid, Split sections, and Stats, each with a badge such as 3 in use or Not used yet.
The Sections Gallery in the Studio of the Meridian theme: each section type with sample content and the number of places that use it.

Nexity Base also serves llms.txt, an index for AI agents, and a Markdown twin of each page at the same URL with .md. The Meridian demo publishes its index at https://meridian.nexity.build/llms.txt.

A plain text file with the heading Nexity, a note that each page is also served as Markdown, a list of pages, and the heading of the blog list. Each line has a title and a URL that ends in .md, and most lines have a short description.
The llms.txt file of the Meridian demo on November 22, 2026. Each entry links to the Markdown twin of a page.

For the marketer’s view, read Sanity website builder: build pages from sections.

What the agent layer gives a coding agent

The agent layer in Nexity Base is the repository file set that tells a coding agent how to build in the project and checks its work. Instructions, design rules, and brand rules guide changes; skills run repeatable workflows; read-only agents review, audit, or propose alt text.

The Nexity README describes these files:

FilePurpose
AGENTS.mdArchitecture, commands, conventions, and checklists
DESIGN.mdDesign tokens, section anatomy, and visual rules
BRAND.mdAudience, voice, messages, and approved names and numbers
.agents/skills/<name>/SKILL.mdA repeatable workflow in the open Agent Skills format
.agents/agents/<name>.mdA read-only agent with a fixed checklist and output format

Codex and Cursor read AGENTS.md directly. Claude Code reads it through CLAUDE.md, which imports it. Skills live in .agents/skills/; Claude Code uses the symbolic link .claude/skills/. In Claude Code, invoke a skill as /create-section; in Codex, use $create-section.

SkillTask
project-setupGuides setup from the start command to the live site
create-sectionAdds or extends a section type
sanity-module-catalogCaptures section screenshots for the Studio insert menu
link-fixFinds and fixes dataset links after a dry run
generate-altsProposes alt text and writes approved text to drafts
sanity-optimizationsAudits queries, images, and caching; estimates Sanity and Vercel usage
pr-writeupWrites pull request descriptions with screenshots and a test plan
work-humanizerEdits text; third-party work under an MIT license
A GitHub folder listing with 8 folders: create-section, generate-alts, link-fix, pr-writeup, project-setup, sanity-module-catalog, sanity-optimizations, and work-humanizer.
The folder base/.agents/skills of the Nexity repository on November 22, 2026: one folder for each of the 8 skills.

Marketing skills such as brand-kit and internal-links install as a separate plugin and are not included in Nexity Base.

Claude Code runs the read-only agents as subagents with their own context. Other coding agents read the files and follow their checklists. Each agent header allows Read, Grep, Glob, Bash, with no Edit or Write tool. The available Bash tool makes “read-only” a behavioral rule rather than a technical lock.

web/AGENTS.md also contains Next.js managed instructions pointing to framework documentation in node_modules/next/dist/docs/. The optional Sanity Agent Toolkit supplies Sanity skills and MCP configuration; the Nexity agent installer does not install it.

Nexity Base compared with the official Sanity template

Nexity Base and the official Clean Next.js + Sanity app both ship project instructions for coding agents. The differences include the page builder, Studio deployment, content types, and the workflows and reviewers available to an agent. The table compares the repository versions recorded at the start of this guide.

PropertyOfficial Sanity templateNexity Base
Next.js in package.json^16.2.7^16.4.6
Sanity Studio in the Studio package^5.31.1^6.22.0
Studio deploymentSeparate application, deployed by your teamEmbedded at /admin
Page builder2 section types: call to action and info section23 section types
Content types4 document types: Page, Post, Person, Settings15 editor-managed types, including pages, blog, case studies, podcast, redirects, and shared sections
Project instructionsRoot AGENTS.mdAGENTS.md in the root, web/, and studio/
Design and brand filesNoneDESIGN.md and BRAND.md
Skills1: sanity-live-cache-components8
Read-only agentsNone9: 5 reviewers, 3 auditors, and 1 agent that proposes alt text
Search outputXML sitemap; no robots.txt route, JSON-LD, or llms.txtXML sitemap, robots.txt, JSON-LD, llms.txt, and Markdown twins

The official template’s AGENTS.md includes Next.js managed instructions, the project layout, commands, links to Sanity documentation and MCP setup, and an instruction to ask before deployment. Its skills-lock.json records the source and hash of its skill.

The official template is the smaller base. Nexity Base gives a new developer more to learn, including its section types and 9 documents in docs/agents/. Compare the contents of the agent files when selecting a starter; an AGENTS.md filename alone does not describe what it provides.

Start a project from Nexity Base

A Nexity Base project needs Node.js 22.12 or newer, pnpm 12.15, and a Sanity account. The start command includes the agent layer. Nexity Base ships no sample content, so the website initially shows a Next steps screen until you publish the required documents.

npm create sanity@latest -- --template Pagepro/nexity/base
  1. Run the start command.
  2. Go to the new project folder and run pnpm dev. It starts the website and the standalone Studio.
  3. Open http://localhost:3000.
  4. Open http://localhost:3000/admin. Publish 4 documents: Site settings, Header, Footer, and a page with the slug /.
  5. Reload the site. The Next steps screen disappears when the 4 documents are published.
  6. Run pnpm agent:doctor to check the agent layer.

For a full design and sample content, start from the Meridian theme and select a new dataset:

npm create sanity@latest -- --template Pagepro/nexity/theme-meridian

Then run the seed command in the new project folder; it imports Meridian content and replaces documents with the same IDs:

pnpm seed

Follow the starter README for launch tasks: the revalidation secret, deployment, the Sanity blueprint, and applying your brand. The project-setup skill guides setup and stops for confirmation after each step.

Replace the neutral defaults in DESIGN.md with your design system and fill in BRAND.md before launch. The setup skill can fill in the brand file with you through a short interview.

How a coding agent adds a section in Nexity Base

A new section type in Nexity Base touches the schema, query, component, and several registries. The create-section skill follows the new section checklist, which has 13 steps after checking for an existing section. The workflow includes model decisions, implementation, registration, and review.

For example, request: “Add a section with a row of customer logos and one quote under them.” This guide groups the work into 5 steps:

  1. The skill compares the request with existing sections and asks you to choose whether to reuse a section, extend one, or build a new type.
  2. It reads DESIGN.md for appearance and BRAND.md for copy. While BRAND.md is the empty template, it writes placeholder copy.
  3. It builds the component, schema, and query from the 2 or 3 closest sections in the code.
  4. It registers the section, adds it to the Sections Gallery, and writes its JSON-LD entry and Markdown version.
  5. It asks you to restart the Studio and development server, checks one instance in the Studio, and reports.

During steps 1 to 4, the skill calls up to 5 read-only reviewers: those below, plus link-reviewer when the section has links or buttons.

ReviewerWhen it runsWhat it checks
content-model-architectBefore the schema, when 2 types fit or the content model is unclearReuse, extend, or new type; content model shape
styling-fidelity-reviewerAfter the componentTailwind and token rules; agreement with DESIGN.md
sanity-schema-reviewerAfter the schemaConventions in studio/AGENTS.md
groq-parity-reviewerAfter the queryAgreement between the schema, GROQ query, and component props

Four of the 5 reviewers return a verdict and findings with severity, file and line, rule, and fix. The content-model-architect returns a content model recommendation.

A diagram in three panels. Left: a request to add a section, and the files that the agent reads first: AGENTS.md (how to build), DESIGN.md (how it looks), BRAND.md (what it says). Middle: the new section with its font, spacing, and color marked as checked. Right: the styling-fidelity-reviewer with 4 checks against DESIGN.md and its result, a verdict of PASS or ISSUES FOUND.
An illustration from the Nexity README: a request goes to the create-section skill, which reads the 3 files and builds the section. Then styling-fidelity-reviewer checks the section against DESIGN.md.

A section registered in schemaTypes/index.ts but missing from fragments/sections.ts compiles and passes type checking, yet never appears in the Studio insert menu. The groq-parity-reviewer looks for this silent failure.

Nexity Base catches 3 other gaps through type errors. The following check fails until the section is registered in the Sections Gallery and has both a JSON-LD entry and a Markdown version:

pnpm typecheck
The insert menu of the sections field in Sanity Studio: a search box, filters for All, Hero, Content, Lists, and Shared, and a grid of section thumbnails such as Hero, Feature block, Feature grid, and Bento grid.
The insert menu of the sections field in the Studio of the Meridian theme. A section type that is in schemaTypes/index.ts and not in fragments/sections.ts is missing from this grid.

A developer reviews the result before it goes live. The agent layer does not replace code review.

Limits of Nexity Base and when it fits

Nexity Base projects do not update themselves, and some features need additional configuration or tools. Before selecting the starter, account for maintenance, language requirements, and the dependencies of the skills you plan to use. The known limitations describe these constraints.

  • Your project is your own copy and does not update itself. Merging upstream would conflict with your changes. The README recommends giving your coding agent the commits since project creation and applying the ones you want.
  • Skills and read-only agents update separately from a local Nexity clone with pnpm agent:update --source <checkout>. The update stops if you have edited a managed file and has no overwrite option.
  • The starter has no multi-language support.
  • The newsletter form is interface only. It stores and sends nothing until you connect an email provider.
  • Some skills need additional tools. sanity-module-catalog needs a browser the agent can control. pr-writeup needs that browser and Python with Pillow, or ImageMagick. link-fix and generate-alts need a Sanity token with write access. The agent installer does not install these tools.
  • The repository documents deployment to Vercel only.
Your projectFit
Marketing website with many page layouts, built with coding agentsNexity Base
Site with a content model and sections designed by your teamOfficial Sanity template
Site in several languagesNexity Base needs your own multi-language work
Existing Next.js and Sanity projectCopy individual skills and read-only agents using the README’s manual setup
Team without coding agentsNexity Base still works; developers can follow the Markdown checklists in docs/agents/

Next steps with Nexity Base