Skip to content
▸ rails for agents

Rails for AI agents building with Next.js.

Let agents ship features fast — on rails that keep your architecture and directory structure under control. Fixed structure, enforced conventions, curated libraries, preinstalled skills.

~/ — bash

# get started in seconds

$ bunx degit levix0501/next-agent-rails my-app

$ bun dev

// SECTION 01 — GET STARTED

One command. Two minutes.

Scaffold the repo, install, and start building. Ships with a public landing and a protected dashboard as a working example of the rails.

getting-started.sh

# 1. clone & install

$ bunx degit levix0501/next-agent-rails my-app

$ cd my-app && bun install

# 2. run the dev server

$ bun dev

# 3. ship

$ bun run build && vercel deploy

Demo dashboard login demo / demo123 · auto-fix on save with bun run lint:fix

// SECTION 02 — ON THE RAILS

Guardrails, not handcuffs.

A fixed directory structure and a short list of conventions keep agent output predictable and easy to review — no sprawl, no surprise patterns.

src/
app/ # routing · route groups · handlers
(public)/ # SEO-facing pages
(protected)/ # auth-gated pages
api/ # thin BFF → your backend
features/<feature>/ # components · api · actions · lib · store
components/ # ui/ (shadcn) · layout/ (providers)
lib/ hooks/ styles/ # shared utils · hooks · tokens
auth.ts proxy.ts # auth · route-protection middleware
01

Use Bun

bun install / bun add, respect bun.lock. No npm, pnpm, or yarn.

02

Server Components first

Default to Server Components; push 'use client' down to the smallest leaf that needs it.

03

Official CLI first

Scaffold through a tool's own CLI (bunx shadcn@latest add …), never by hand.

04

One home per state

URL state → nuqs, client state → zustand. No per-feature reinvention.

// SECTION 03 — THE STACK

Picked once, not per feature.

Mainstream libraries, each with one job — so your agent reaches for the same tool you would. Already wired up in providers.

Framework
Next.js 16 · React 19
Styling
Tailwind CSS v4
UI
shadcn/ui · Radix · lucide
Server state
TanStack Query
URL state
nuqs
Client state
Zustand
Forms
React Hook Form · Zod
Auth
Auth.js (next-auth)
// SECTION 04 — SKILLS PREINSTALLED

8 skills, locked & ready.

Open the project. Your agent already knows how to do these things.

next-best-practices
vercel-labs
vercel-react-best-practices
vercel-labs
vercel-composition-patterns
vercel-labs
shadcn
shadcn-ui
frontend-design
anthropics
web-design-guidelines
vercel-labs
find-skills
vercel-labs
skill-creator
anthropics
// SECTION 05 — WHY IT'S FAST

No JavaScript on the hot path.

Every dev-loop tool is a native binary — Bun (Zig) plus the Oxc family and Tailwind Oxide, all in Rust.

StageToolReplacesLang
Install / runbunnpm / nodeZig
LintoxlintESLintRust
FormatoxfmtPrettierRust
Compile JS/TSSWCBabelRust
Bundle / devTurbopackWebpackRust
CSS engineTailwind v4 OxideTailwind v3 PostCSSRust