Fixed directory structure: routes, feature modules, and shared components are separated, with each feature self-contained
next-agent-rails — Next.js Directory site Template
By Levix0501
A Next.js starter for AI agent collaboration that uses a fixed directory structure, conventions, and preinstalled skills to let agents add features quickly while keeping code style consistent.
Explore the design
Compare the page layouts and mobile experience. Open any screenshot for a closer look.
Actual screenshot captured by the server browser.
All pages & views 2
Screenshots show visual appearance; interactive behavior may differ.
What stands out
A quick read of the recorded project description.
Enforced conventions: AGENTS.md and CLAUDE.md constrain agent behavior, such as prioritizing Server Components, using Bun, and preferring official CLIs
Curated libraries each with a clear role: TanStack Query, nuqs, Zustand, React Hook Form + Zod, Auth.js, etc.
Eight preinstalled agent skills covering Next.js, React, composition patterns, web design guidelines, and shadcn
Native toolchain: Bun, oxlint, oxfmt, Turbopack, etc., with automatic fixes and checks on commit
Includes a public landing page and a protected dashboard example, demonstrating authentication and BFF routes
Template Details
next-agent-rails is a Next.js starter template aimed at keeping architecture and directory structure under control when developing with AI agents. Through a fixed directory structure, enforced conventions, curated libraries, and preinstalled agent skills, it ensures agent-generated code lands in expected locations and follows repository style. The template includes a public landing page and a protected /dashboard example (demo account demo / demo123), and can serve as a starting point for an SEO site or an authenticated dashboard.
On the technical side, the template uses Next.js App Router, React, Tailwind CSS, and TypeScript, and adopts native toolchains such as Bun, Oxc, and Turbopack. The directory structure separates routes, feature modules, shared components, and utilities, with each feature having its own UI, data hooks, server actions, and store. State management conventions: use nuqs for URL/search parameter state, and zustand for cross-component client state. Forms and validation use React Hook Form + Zod, and authentication uses Auth.js.
The template comes with eight preinstalled agent skills covering Next.js best practices, React best practices, composition patterns, web design guidelines, shadcn, and more, locked in skills-lock.json. On commit, Husky + lint-staged automatically run oxlint --fix and oxfmt, and commitlint enforces Conventional Commits.
Usage limitations: the template relies on Bun as the package manager and does not use npm/pnpm/yarn. External backend fetch in the demo is commented out by default; you need to point it to your own service or keep everything within Next.js. Third-party assets such as demo images, fonts, and icons require separate license verification.
Is it right for your project?
Use Cases
- Rapidly developing Next.js applications with AI agents while keeping code structure and style consistent
- Building a public SEO-oriented site or an authenticated dashboard
- Using as an internal team starter to unify development conventions for agents and humans
- A project starting point that needs preconfigured common libraries for state management, form validation, authentication, etc.
Suitable For
- Next.js projects using AI agents for assisted development
- Teams that want a fixed directory structure and conventions to reduce maintenance costs
- Those who need to quickly scaffold a Next.js application including authentication and BFF
- Developers who accept the Bun toolchain and native toolchain
Getting started & customization
Use these recorded setup notes alongside the repository instructions for your chosen version.
- 1
Use bunx degit levix0501/next-agent-rails my-app to get the template, then bun install and bun dev
- 2
Requires the Bun runtime; the template does not use npm/pnpm/yarn
- 3
The demo dashboard login account is demo / demo123
- 4
External backend fetch is commented out by default; configure BACKEND_URL and enable it
- 5
Third-party assets (images, fonts, icons) require separate license verification
License & source material
Usage conditions & limitations
Free to use · keep license noticeThis listing covers the free version under the MIT license in the public repository; the free scope is the code of that version and does not mean external services or third-party assets are free.
Must comply with when using
- Free use, modification, commercial use, and distribution of this version's code are permitted.
- When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
- The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.
Additional costs & items to verify
- Demo images, fonts, icons, and other third-party assets require verification under their respective licenses and cannot be judged solely by the code's MIT license.
- External services such as domains, hosting, databases, payments, or AI may incur additional charges.
- Project conventions require using Bun as the package manager; npm, pnpm, or yarn are prohibited, and the Bun runtime must be installed.
- The template comments out fetch to an external backend by default; you must configure BACKEND_URL to point to your own service, or keep all logic within Next.js.
- The protected /dashboard example uses the demo account demo / demo123 for login and is for example purposes only.
View Original Text Basis
Permission is hereby granted, free of charge
Original License Text
**Use Bun.** `bun install` / `bun add`, respect `bun.lock`. No npm / pnpm / yarn.
Original README
`auth.ts` and `app/api/me` ship with a commented-out `fetch` to an external backend (`BACKEND_URL`), with a bearer token threaded through the session. Point it at your own service, or keep everything inside Next.js.
Original README
https://github.com/Levix0501/next-agent-rails/blob/main/LICENSEhttps://github.com/Levix0501/next-agent-rails/blob/main/README.mdThe repo ships a public landing page and a protected `/dashboard` (sign in with `demo` / `demo123`) as a working example of the rails
Original README
Compiled by DeepSeek based on repository license and README ·2026-10-13. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.
Project checks & description sources
Template Information
- Source platforms
- GitHub
- Documentation and maintenance reference score
- More documented · 85 / 100
- Technologies
- Next.js · Rails · React
- Website type
- Directory site · Starter
How this score is calculated
Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.
What to verify for this project
- Repository update recorded
- 2026-06-03
- Screenshot last checked
- 2026-10-13
A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.
The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.
Use a selection guide →How this description was prepared
AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.
Review declaration: [email protected] · 2026-10-13
Inspect the recorded source material
SHA-256: 2c113409632a21ed20e64ec907729cc5324da34ce0723c01779c027c480ed3f1
2026-10-13T05:07:18.541Z
Source file / repository# next-agent-rails
**Rails for AI agents building with Next.js.** A starter that lets agents
implement features _fast_ — while keeping your architecture and directory
structure on a controlled, predictable track.
Agents are quick, but left alone they sprawl: a new folder convention here, a
different state library there, a one-off pattern in every feature. This starter
makes those decisions up front. A fixed directory structure, enforced
conventions, a curated set of mainstream libraries (each with one clear job),
and preinstalled agent skills mean the code an agent writes lands where you
expect it and looks like the rest of the repo — quick to ship, easy to review.
Use it for SEO-facing sites or authenticated dashboards alike.
Built on Next.js 16 (App Router), React 19, Tailwind CSS v4, and TypeScript,
over an all-native toolchain (Bun, Oxc, Turbopack).
## Getting started
```bash
bunx degit levix0501/next-agent-rails my-app
cd my-app
bun install
bun dev
```
Open [http://localhost:3000](http://localhost:3000). The repo ships a public
landing page and a protected `/dashboard` (sign in with `demo` / `demo123`) as a
working example of the rails — keep what you need, delete the rest, and start
adding features.
### Scripts
```bash
bun dev # dev server (Turbopack)
bun run build # production build
bun run lint # oxlint — errors only
bun run lint:fix # oxlint --fix, then oxfmt
bun run lint:strict # oxlint --deny-warnings (CI)
bun run format # oxfmt — write changes
bun run format:check # oxfmt --check — no writes
```
## On the rails
The conventions every agent (and human) follows are pinned in
[`AGENTS.md`](./AGENTS.md) — and surfaced to Claude Code via `CLAUDE.md`. The
non-negotiables:
- **Use Bun.** `bun install` / `bun add`, respect `bun.lock`. No npm / pnpm / yarn.
- **Server Components first.** Default every component to a Server Component; add
`'use client'` only on the smallest leaf that needs hooks, events, or browser APIs.
- **Official CLI first.** Scaffold through a tool's own CLI (e.g.
`bunx shadcn@latest add <name>`) instead of hand-writing config or pasting source.
- **One home per kind of state.** URL / search-param state → `nuqs`;
cross-component client state → `zustand`. Agents don't reinvent it per feature.
Every commit is auto-fixed and checked: Husky + lint-staged run `oxlint --fix`
and `oxfmt`, and commitlint enforces Conventional Commits.
### Directory structure
```text
src/
app/ # routing only — route groups, layouts, route handlers
(public)/ # unauthenticated, SEO-facing pages
(protected)/ # auth-gated pages (dashboard, …)
api/ # route handlers — a thin BFF in front of your backend
features/ # one self-contained folder per feature
<feature>/
components/ # feature UI
api/ # TanStack Query hooks (queries.ts / mutations.ts)
actions/ # server actions
lib/ # feature-local helpers & types
store.ts # zustand store (when needed)
components/
ui/ # shadcn/ui primitives
layout/ # app-wide providers & chrome
hooks/ # shared hooks
lib/ # shared utils
styles/ # global CSS & design tokens
auth.ts # Auth.js (next-auth) config
proxy.ts # middleware — route protection
```
A feature owns its UI, data hooks, server actions, and store, and reaches the
outside world only through `app/` routes. Adding a feature means adding a
folder — not threading code through the whole tree.
## The stack
Mainstream libraries, picked once, each with one job — so an agent reaches for
the same tool you would. They're wired up in
`src/components/layout/providers.tsx`.
| Concern | Library |
| ---------------------------- | ---------------------------------------------------- |
| Framework | Next.js 16 (App Router) · React 19 |
| Styling | Tailwind CSS v4 |
| UI components | shadcn/ui (Radix, `radix-nova` style) · lucide-react |
| Server state / data fetching | TanStack Query |
| URL / search-param state | nuqs |
| Client state | Zustand |
| Forms + validation | React Hook Form + Zod |
| Auth | Auth.js (next-auth v5) |
| Theming · toasts · progress | next-themes · Sonner · nextjs-toploader |
**Frontend, meet backend.** Route handlers under `app/api` act as a thin BFF:
`auth.ts` and `app/api/me` ship with a commented-out `fetch` to an external
backend (`BACKEND_URL`), with a bearer token threaded through the session. Point
it at your own service, or keep everything inside Next.js.
## Preinstalled skills
[Agent skills](https://www.anthropic.com/news/skills) teach your agent how to
work in _this_ stack. Eight are vendored under `.agents/skills` (symlinked to
`.claude/skills`) and pinned by `skills-lock.json`:
| Skill | Source |
| --------------------------- | ----------- |
| next-best-practices | vercel-labs |
| vercel-react-best-practices | vercel-labs |
| vercel-composition-patterns | vercel-labs |
| web-design-guidelines | vercel-labs |
| find-skills | vercel-labs |
| shadcn | shadcn-ui |
| frontend-design | anthropics |
| skill-creator | anthropics |
## Why it's fast
Every dev-loop tool is a native binary — Bun (Zig) plus the Oxc family
(`oxlint`, `oxfmt`) and Tailwind v4 Oxide, all in Rust. No JS interpreter on the
hot path.
| Stage | Tool | Replaces | Language |
| ------------------- | ------------------------------ | ------------------- | -------- |
| Install / run | `bun` | npm / node | Zig |
| Lint | `oxlint` | ESLint | Rust |
| Format | `oxfmt` | Prettier | Rust |
| Compile JS/TS | SWC (in Next.js) | Babel | Rust |
| Dev server / bundle | Turbopack (Next.js 16 default) | Webpack | Rust |
| CSS engine | Tailwind v4 Oxide | Tailwind v3 PostCSS | Rust |
Real-world ballparks: `bun install` ~25× npm, `oxlint` ~50–100× ESLint,
`oxfmt` ~10–20× Prettier, Turbopack ~10× Webpack cold start. `oxfmt` also handles
import ordering, Tailwind class sorting, and `package.json` key sorting in a
single pass — no extra Prettier plugins needed.
## License
MIT
Explore similar templates
Compare previews and descriptions within the same stack and category.

Next.js SaaS Starter
The official Next.js SaaS starter template, integrating email/password authentication, Stripe Checkout subscriptions, a dashboard with user/team CRUD, basic Owner/Member RBAC, and activity logging.
Next.js · SaaS

Next.js Commerce
Vercel's officially maintained Next.js App Router ecommerce starter with deep Shopify integration, offering a complete product catalog, cart, and checkout flow. Core logic is modular for swapping backends, and community provider versions exist for BigCommerce, Medusa, and Saleor.
Next.js · E-commerce

Next-js-Boilerplate
A developer-first Next.js 16 starter with Tailwind CSS 4 and TypeScript, supporting both App Router and Page Router.
Next.js · Starter

tailwind-nextjs-starter-blog
A Next.js and Tailwind CSS blog starter template using Contentlayer for Markdown/MDX, with built-in SEO, code highlighting, and tags. It targets personal technical blogs and migration from Jekyll/Hugo to React, and supports one-click Vercel deployment.
Next.js · Blog

next-forge
next-forge is a Turborepo-based Next.js template maintained by Vercel, positioned as a starting point for SaaS products.
Next.js · Starter

SaaS-Boilerplate
SaaS-Boilerplate is an open-source SaaS starter template built with Next.js App Router, React 19, TypeScript, Tailwind CSS, and Shadcn UI.
Next.js · SaaS
