Next.jsRailsReact目录站启动器

next-agent-rails — Next.js 目录站模板

作者 Levix0501

一个面向 AI 代理协作的 Next.js 启动器,通过固定目录结构、约定和预装技能,让代理快速添加功能且代码风格统一。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

2 个预览视图
桌面端首页1 / 2
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 2

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-13查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

固定目录结构:路由、功能模块、共享组件分离,每个功能自包含

02

强制约定:通过 AGENTS.md 和 CLAUDE.md 约束代理行为,如 Server Components 优先、使用 Bun、官方 CLI 优先

03

精选库各司其职:TanStack Query、nuqs、Zustand、React Hook Form + Zod、Auth.js 等

04

预装八个代理技能,覆盖 Next.js、React、组合模式、Web 设计指南和 shadcn

05

原生工具链:Bun、oxlint、oxfmt、Turbopack 等,提交时自动修复和检查

06

包含公开着陆页和受保护 dashboard 示例,演示认证和 BFF 路由

模板详细介绍

next-agent-rails 是一个基于 Next.js 的启动器模板,目标是在使用 AI 代理开发时保持架构和目录结构可控。它通过固定目录结构、强制约定、精选库和预装代理技能,让代理生成的代码落在预期位置并符合仓库风格。模板包含公开着陆页和受保护的 /dashboard 示例(演示账号 demo / demo123),可作为 SEO 站点或认证仪表盘的起点。

技术栈方面,模板使用 Next.js App Router、React、Tailwind CSS 和 TypeScript,并采用 Bun、Oxc、Turbopack 等原生工具链。目录结构将路由、功能模块、共享组件和工具分开,每个功能拥有自己的 UI、数据钩子、服务端操作和 store。状态管理约定:URL/搜索参数状态使用 nuqs,跨组件客户端状态使用 zustand。表单与验证使用 React Hook Form + Zod,认证使用 Auth.js。

模板预装了八个代理技能,涵盖 Next.js 最佳实践、React 最佳实践、组合模式、Web 设计指南、shadcn 等,并锁定在 skills-lock.json 中。提交时通过 Husky + lint-staged 自动运行 oxlint --fix 和 oxfmt,commitlint 强制 Conventional Commits。

使用限制:模板依赖 Bun 作为包管理器,不使用 npm/pnpm/yarn。演示中的外部后端 fetch 默认注释,需要指向自己的服务或保持全部在 Next.js 内。演示图片、字体、图标等第三方素材需单独核对许可。

Next.jsRailsReact目录站启动器

适合你的项目吗?

适用场景

  • 使用 AI 代理快速开发 Next.js 应用,同时保持代码结构和风格一致
  • 构建面向 SEO 的公开站点或需要认证的仪表盘
  • 作为团队内部启动器,统一代理和人类的开发约定
  • 需要预置状态管理、表单验证、认证等常见库的项目起点

适合人群

  • 使用 AI 代理辅助开发的 Next.js 项目
  • 希望固定目录结构和约定以降低维护成本的团队
  • 需要快速搭建包含认证和 BFF 的 Next.js 应用
  • 接受 Bun 工具链和原生工具链的开发者

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    使用 bunx degit levix0501/next-agent-rails my-app 获取模板,然后 bun install 和 bun dev

  2. 2

    需要安装 Bun 运行时,模板不使用 npm/pnpm/yarn

  3. 3

    演示 dashboard 登录账号为 demo / demo123

  4. 4

    外部后端 fetch 默认注释,需配置 BACKEND_URL 并启用

  5. 5

    第三方素材(图片、字体、图标)需单独核对许可

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
  • 项目约定必须使用 Bun 作为包管理器,禁止使用 npm、pnpm 或 yarn,需安装 Bun 运行时。
  • 模板默认注释掉对外部后端的 fetch,需自行配置 BACKEND_URL 指向自有服务,或保持全部逻辑在 Next.js 内。
  • 受保护的 /dashboard 示例使用演示账号 demo / demo123 登录,仅作示例用途。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

**Use Bun.** `bun install` / `bun add`, respect `bun.lock`. No npm / pnpm / yarn.

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.

README 原文

The repo ships a public landing page and a protected `/dashboard` (sign in with `demo` / `demo123`) as a working example of the rails

README 原文
https://github.com/Levix0501/next-agent-rails/blob/main/LICENSEhttps://github.com/Levix0501/next-agent-rails/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-13。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 85 / 100
技术栈
Next.js · Rails · React
网站类型
目录站 · 启动器
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-06-03
截图检查日期
2026-10-13

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

审核声明: [email protected] · 2026-10-13

查看当时使用的来源资料

SHA-256: 2c113409632a21ed20e64ec907729cc5324da34ce0723c01779c027c480ed3f1

2026-10-13T05:07:18.541Z

来源文件 / 仓库
# 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
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。