scaffold-nextjs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseScaffold Next.js
Next.js脚手架搭建
Scaffold a Next.js turborepo with full tooling, GitHub, and Vercel deployment.
搭建配备完整工具链、支持GitHub和Vercel部署的Next.js turborepo。
Reference Files
参考文件
| File | Read When |
|---|---|
| Default: create-next-app flags, shadcn + Blode registry setup, Agentation, Ultracite commands and code patches |
| Default: root package.json, turbo.json, biome.jsonc, .gitignore, knip.json, next.config.ts |
| After Phase 6: GitHub setup, Vercel deployment, favicon, OG images, pre-launch checklist |
| 文件 | 读取时机 |
|---|---|
| 默认读取:包含create-next-app参数、shadcn + Blode registry配置、Agentation、Ultracite命令和代码补丁 |
| 默认读取:包含根目录package.json、turbo.json、biome.jsonc、.gitignore、knip.json、next.config.ts的配置 |
| 第6阶段后读取:包含GitHub配置、Vercel部署、favicon、OG图片、上线前检查清单 |
Scaffold Workflow
脚手架搭建流程
Copy this checklist to track progress:
text
Scaffold progress:
- [ ] Phase 1: Gather project info
- [ ] Phase 2: Create Next.js app
- [ ] Phase 3: Install Blode UI components
- [ ] Phase 4: Install Agentation
- [ ] Phase 5: Install Ultracite
- [ ] Phase 6: Convert to Turborepo
- [ ] Phase 7: GitHub and Vercel setup
- [ ] Phase 8: Pre-launch checklist复制以下检查清单来跟进进度:
text
Scaffold progress:
- [ ] Phase 1: Gather project info
- [ ] Phase 2: Create Next.js app
- [ ] Phase 3: Install Blode UI components
- [ ] Phase 4: Install Agentation
- [ ] Phase 5: Install Ultracite
- [ ] Phase 6: Convert to Turborepo
- [ ] Phase 7: GitHub and Vercel setup
- [ ] Phase 8: Pre-launch checklistPhase 1: Gather project info
第1阶段:收集项目信息
Collect from the user (ask only what was not provided):
| Variable | Example | Default | Used in |
|---|---|---|---|
| | -- (required) | Root package.json, directory name, README |
| | -- (required) | App package.json, README |
| | — (required) | GitHub remote URL |
| | — (ask if not provided) | Vercel custom domain, metadataBase |
| | — (required) | package.json author |
| | current year | LICENSE |
向用户收集以下信息(仅询问未提供的内容):
| 变量 | 示例 | 默认值 | 使用位置 |
|---|---|---|---|
| | -- (必填) | 根目录package.json、目录名称、README |
| | -- (必填) | 应用package.json、README |
| | — (必填) | GitHub远程仓库URL |
| | — (未提供则询问) | Vercel自定义域名、metadataBase |
| | — (必填) | package.json作者信息 |
| | 当前年份 | LICENSE |
Phase 2: Create Next.js app
第2阶段:创建Next.js应用
Load .
references/app-setup.mdFollow the create-next-app setup in .
references/app-setup.mdConfirm the app runs with .
npm run dev加载。
references/app-setup.md按照中的create-next-app配置步骤操作。
references/app-setup.md执行确认应用可正常运行。
npm run devPhase 3: Install Blode UI components
第3阶段:安装Blode UI组件
Load .
references/app-setup.mdInitialize shadcn and register the Blode UI component library as described in the reference. Always use for icon imports (never ).
blode-icons-reactlucide-react加载。
references/app-setup.md按照参考文档中的说明初始化shadcn并注册Blode UI组件库。始终使用导入图标(禁止使用)。
blode-icons-reactlucide-reactPhase 4: Install Agentation
第4阶段:安装Agentation
Load .
references/app-setup.mdInstall the package and patch with the dev-only component as described in the reference. Optionally add Google Analytics using .
app/layout.tsx<Agentation />@next/third-parties加载。
references/app-setup.md按照参考文档中的说明安装对应包,并在中添加仅开发环境使用的组件。可选择使用接入Google Analytics。
app/layout.tsx<Agentation />@next/third-partiesPhase 5: Install Ultracite
第5阶段:安装Ultracite
Load .
references/app-setup.mdRemove the default biome config and initialize Ultracite as described in the reference.
加载。
references/app-setup.md按照参考文档中的说明删除默认biome配置并初始化Ultracite。
Phase 6: Convert to Turborepo
第6阶段:转换为Turborepo结构
Load .
references/turbo-configs.md- Create root directory structure and move the app into .
apps/web/ - Generate root ,
package.json,turbo.json.biome.jsonc - Generate .
knip.json - Generate root .
.gitignore - Ensure has these scripts:
apps/web/package.json"lint": "biome check .""lint:fix": "biome check --write .""format": "biome format --write .""format:check": "biome format .""check-types": "tsc --noEmit""test": "vitest run""test:watch": "vitest"
- Verify has
apps/web/next.config.ts.reactCompiler: true - Run from root.
npm install - Verify works from root (turbo runs apps/web).
npm run dev
加载。
references/turbo-configs.md- 创建根目录结构,将应用移动到目录下。
apps/web/ - 生成根目录下的、
package.json、turbo.json。biome.jsonc - 生成。
knip.json - 生成根目录下的。
.gitignore - 确保有以下脚本:
apps/web/package.json"lint": "biome check .""lint:fix": "biome check --write .""format": "biome format --write .""format:check": "biome format .""check-types": "tsc --noEmit""test": "vitest run""test:watch": "vitest"
- 确认已配置
apps/web/next.config.ts。reactCompiler: true - 在根目录执行。
npm install - 在根目录执行确认可正常启动(turbo会运行apps/web下的应用)。
npm run dev
Phase 7: GitHub and Vercel setup
第7阶段:配置GitHub和Vercel
Load .
references/deploy-and-launch.mdFollow the GitHub and Vercel setup steps in the reference.
加载。
references/deploy-and-launch.md按照参考文档中的GitHub和Vercel配置步骤操作。
Phase 8: Pre-launch checklist
第8阶段:上线前检查清单
Load .
references/deploy-and-launch.mdGenerate a favicon package using RealFaviconGenerator, add OG images, then hand off to other skills.
加载。
references/deploy-and-launch.md使用RealFaviconGenerator生成favicon包,添加OG图片,之后移交至其他技能处理。
Placeholder Reference
占位符参考
All templates use syntax. Do a final sweep to catch missed placeholders.
{{variable}}| Placeholder | Source |
|---|---|
| Project name (kebab-case) |
| One-line project description |
| GitHub owner/repo |
| Custom domain for Vercel |
| Author name |
| Current year |
所有模板均使用语法,请最终检查确认没有遗漏的占位符。
{{variable}}| 占位符 | 来源 |
|---|---|
| 项目名称(短横线分隔格式) |
| 项目单行描述 |
| GitHub 所有者/仓库名 |
| Vercel自定义域名 |
| 作者名称 |
| 当前年份 |
Anti-patterns
反模式
- Do not use src/ directory -- create-next-app flag disables it
- Do not use ESLint -- Biome via Ultracite replaces it
- Do not call biome directly -- use or
ultracite fixultracite check - Do not configure git hooks manually -- Ultracite sets up husky and lint-staged automatically
- Do not put app dependencies in root package.json -- only devDependencies (turbo, ultracite)
- Do not skip the Blode registry setup step (see ) before adding Blode components
references/app-setup.md - Do not use in scaffolded UI code -- use
lucide-reactblode-icons-react - Do not create apps/web manually -- create-next-app first, then move
- 请勿使用src/目录 -- create-next-app参数已禁用该配置
- 请勿使用ESLint -- 基于Ultracite的Biome已替代该工具
- 请勿直接调用biome命令 -- 请使用或
ultracite fixultracite check - 请勿手动配置git钩子 -- Ultracite会自动设置husky和lint-staged
- 请勿将应用依赖放在根目录package.json中 -- 仅可放置开发依赖(turbo、ultracite)
- 请勿在添加Blode组件前跳过Blode registry配置步骤(详见)
references/app-setup.md - 请勿在脚手架生成的UI代码中使用-- 请使用
lucide-reactblode-icons-react - 请勿手动创建apps/web目录 -- 先执行create-next-app,再移动文件
Skill Handoffs
技能移交
| When | Run |
|---|---|
| After deployment, optimise SEO | |
| Before launch, audit UI quality | |
| Before launch, add motion and animation | |
| 触发时机 | 执行命令 |
|---|---|
| 部署完成后,优化SEO | |
| 上线前,审核UI质量 | |
| 上线前,添加动效和动画 | |