scaffold-nextjs
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "scaffold-nextjs":https://skillpi.com/zh/skills/deepskill-7bfe253592a4a824f258e0d348aaa834dd49bdf3d1d47160b6d300e041690719。安装前核对上游来源和版本:https://github.com/mblode/agent-skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
搭建包含 Blode UI、图标、Ultracite、工作区钩子以及 GitHub/Vercel 配置的 Next.js Turborepo。当需要“创建一个 Next.js 项目”“引导一个 Turborepo”或“启动新的 Web 应用”时使用;在现有应用中添加页面请改用 ui-design;创建 CLI 工具请改用 scaffold-cli。
介绍来源: third_party · mblode · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 适合谁
- 来源文档未说明。
- 输入和输出
- 来源文档未说明。
- 软件、账号及付费要求
- 翻译待完成,请参阅来源文档。
- 限制与区别
- 来源文档未说明。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: scaffold-nextjs
description: "Scaffolds a Next.js turborepo with Blode UI, icons, Ultracite (oxlint/shadcn), workspace hooks, and GitHub/Vercel setup. Use when asked to \"create a Next.js project\", \"bootstrap a turborepo\", or \"start a new web app\". For a page in an existing app use ui-design; for a CLI use scaffold-cli."
compatibility: Requires a shell, Git, Node.js, pnpm, and package registry access.Scaffold Next.js
Scaffold a Next.js turborepo with full tooling, GitHub, and Vercel deployment.
- IS: bootstrapping a brand-new Next.js turborepo end to end: app creation, Blode UI, Ultracite with
ultracite/oxlint/shadcn, turborepo conversion, GitHub, and Vercel. - IS NOT: scaffolding a TypeScript CLI or npm package (use
scaffold-cli), designing folder structure or module contracts for an existing app (usecodebase-architecture), building a page inside an existing app, or choosing visual direction and palettes (useui-design).
The references encode the house stack and dependency order. Verify version-sensitive flags against the installed CLI and bundled documentation; update a proven incompatible template rather than forcing stale flags. Where a Next.js question comes up that the references do not answer, read the bundled docs at node_modules/next/dist/docs/ in the app (they match the installed version) rather than training data.
Reference Files
| File | Read When |
|---|---|
references/app-setup.md |
Phase 2: create-next-app flags, TypeScript 7 upgrade, Instant Navigations, shadcn + Blode registry, icons, Agentation, Ultracite 7.12+ with ultracite/oxlint/shadcn, move into apps/web/ |
references/turbo-configs.md |
Phase 6: root package.json, turbo.json, root lefthook.yml, .gitignore, knip.json, workspace scripts, next.config.ts, root and app AGENTS.md |
references/deploy-and-launch.md |
Phase 7 and 8: GitHub, Vercel, CI workflow, metadataBase, verification, security.txt, favicon, OG image, validation checklist |
Scaffold Workflow
Copy this checklist to track progress:
Scaffold progress:
- [ ] Phase 1: Gather project info
- [ ] Phase 2: Create Next.js app
- [ ] Phase 2.1: Upgrade to TypeScript 7
- [ ] Phase 2.2: Turn on Instant Navigations
- [ ] Phase 3: Install Blode UI components and icons
- [ ] Phase 4: Install Agentation
- [ ] Phase 5: Install Ultracite
- [ ] Phase 5.1: Enable ultracite/oxlint/shadcn
- [ ] Phase 6: Convert to Turborepo
- [ ] Phase 7: GitHub and Vercel setup
- [ ] Phase 8: Pre-launch checklist
- [ ] Validation: run the checklist in deploy-and-launch.md
Phase 1: Gather project info
Collect from the user (ask only for what is missing):
| Variable | Example | Default | Used in |
|---|---|---|---|
{{name}} |
acme-web |
none (required) | Root package.json, directory name, README |
{{description}} |
Marketing site for Acme |
none (required) | App package.json, README |
{{repo}} |
acme-corp/acme-web |
none (required) | GitHub remote URL |
{{domain}} |
acme.com |
none (ask if missing) | Vercel custom domain, metadataBase |
{{author}} |
Your Name |
none (required) | package.json author |
{{year}} |
2026 |
current year | LICENSE |
Phase 2: Create Next.js app
Run the create-next-app command from references/app-setup.md exactly as written (it pins linter, React Compiler, and package-manager flags). Confirm the app loads on the port reported by the server. Use a free task-owned port when 3000 is occupied.
Phase 2.1: Upgrade to TypeScript 7
TypeScript 7 section of references/app-setup.md: install typescript@^7 and confirm npm run build type-checks through tsc. No config accompanies it.
Phase 2.2: Turn on Instant Navigations
Instant Navigations section of references/app-setup.md: set cacheComponents, partialPrefetching, and experimental.turbopackRustReactCompiler in next.config.ts. Cheap here and expensive later, so do it before any route exists. Read the authoring rules in that section before Phase 3; they govern how every page is written.
Phase 3: Install Blode UI components and icons
Blode UI section of references/app-setup.md: shadcn init, register the @blode namespace, set iconLibrary in components.json, install blode-icons-react, then add components.
Phase 4: Install Agentation
Agentation section of references/app-setup.md: install the package, patch app/layout.tsx with the dev-only <Agentation /> guard. Optionally add Google Analytics via @next/third-parties.
Phase 5: Install Ultracite
Ultracite section of references/app-setup.md: run ultracite@latest init with the exact flags listed, including --js-plugins @shadcn/lint (Ultracite ≥ 7.12). Verify with npx ultracite fix and npx ultracite check. The lefthook.yml it writes is temporary; Phase 6 replaces it with a root-level one.
Phase 5.1: Enable ultracite/oxlint/shadcn
ultracite/oxlint/shadcn section of references/app-setup.md: confirm init wrote import shadcn from "ultracite/oxlint/shadcn" into extends alongside core/next/react. If it did not, add that import (and jsPlugins: shadcn.jsPlugins). Do not hand-roll jsPlugins: ["@shadcn/lint"] or a starter-only no-restyle rule. The preset already turns shadcn/no-restyle off inside **/components/ui/**; add a matching override only when aliases.ui is a different path.
Phase 6: Convert to Turborepo
Move the app into apps/web/ (commands at the end of references/app-setup.md), then from references/turbo-configs.md:
- Generate root
package.json,turbo.json,lefthook.yml,knip.json, and.gitignorefrom the templates. Deleteapps/web/lefthook.yml; git only reads the copy next to.git. - Update
apps/web/package.jsonscripts to the turbo-compatible block and remove itspreparescript (the root one installs the hooks). - Verify
apps/web/next.config.tsstill hasreactCompiler: true,cacheComponents: true, andpartialPrefetching: true. - Write the root
AGENTS.mdandCLAUDE.mdfrom the template. Keep the Phase 5.1 design-system lint paragraph inapps/web/AGENTS.mdoutside the Next-managed markers, includingultracite fix/ultracite fix --codex. - Run
npm installfrom the root, thennpm run devonce from the coding agent's shell. When Next 16.3 detects a coding agent in the environment it appends its managednextjs-agent-rulesblock toapps/web/AGENTS.md(and createsapps/web/CLAUDE.mdas@AGENTS.mdif missing). Commit it. From a plain terminal nothing is written; that is fine, the block arrives on the agent's first run. - Verify
npm run check,npm run build, andnpx lefthook run pre-commit --all-filespass from the root, thennpm run start -w weband load the home page from the production build.
Phase 7: GitHub and Vercel setup
From references/deploy-and-launch.md: create the GitHub repo with gh, deploy to Vercel, attach {{domain}}.
Phase 8: Pre-launch checklist
From references/deploy-and-launch.md: add the CI workflow, set metadataBase to https://{{domain}}, register the site with Search Console and Bing, add security.txt, the favicon package, and the OG image, then run the validation checklist at the end of that file. Done only when every validation item passes; "the site loads" is not sufficient evidence.
Placeholder Reference
Templates use {{variable}} syntax. Before Phase 7, sweep for missed placeholders:
grep -rn '{{' --include='*.json' --include='*.ts' --include='*.tsx' --include='*.md' --include='*.yml' .
A {{name}} left in package.json fails npm install (invalid-name error); a {{domain}} left in metadata ships broken OG URLs. Two placeholders in the root package.json template are not gathered in Phase 1: {{ultracite_version}} is copied from the ultracite entry that ultracite init wrote into apps/web/package.json, and {{npm_version}} is the output of npm --version.
Gotchas
- No
src/directory. The scaffold uses--no-src-dir; addingsrc/later breaks the@/*alias and every shadcn component path. - Never set
experimental.useTypeScriptCli. Since 16.3 the CLI checker is the default, and the flag exists only to switch it back off withfalse; setting it totrueis noise that reads like a requirement. - Expect raw
tscdiagnostics from the CLI checker: no Next.js code frames, and the fulltsconfig.jsonproject is checked (tests and.next/dev/typesincluded), so a type error in a filenext buildused to skip now blocks the build. If you addnode --testfiles later, either keep them type-clean or add**/*.test.tstotsconfig.jsonexclude. - A green
next builddoes not mean navigation is instant. Instant navigation validation runs in development only (validationLevel: 'warning') and never fails the build, so validate innext devand read the overlay. - With
cacheComponents: true, any route segment that exportsdynamic,dynamicParams,revalidate, orfetchCachefails the build;runtime,maxDuration,instant, andprefetchremain valid. That includes route handlers such as a hand-writtenrobots.txt/route.ts. Put the data access in a separate'use cache'function withcacheLife, called from the page or theGET; the directive cannot sit on theGETexport itself. 'use cache'is in-memory per instance on serverless hosts, so on Vercel a cached value computed in one function invocation is not seen by the next. The docs' answer is'use cache: remote'for anything that must be shared; use it for the data behind the sitemap and any list page, and keep plain'use cache'for values that are cheap to recompute.generateStaticParamsmust return at least one param under Cache Components; an empty array raisesempty-generate-static-params. Unlisted params get the App Shell on first visit and upgrade in the background.- Cache Components keep the previous route's DOM mounted (React
<Activity>), so a background or theme hung offbodyorhtml, including abody:has(.marker)rule, leaks onto the next route. Own backgrounds per route, and key any theme switch offusePathname()in React rather than a class onbody. Dropdowns and form state also survive navigation; clean them up in an effect or derive them from the URL. - Never add
output: "standalone". It is for self-hosting, and on Vercel it stops.next/next-server.js.nft.jsonbeing written, so the build compiles every page and then dies in Vercel's onBuildComplete. - Never set
runtime = "edge"; it is deprecated in 16 and Cache Components requires Node.js. For work that must outlive the response (analytics, logging), useafter()fromnext/serverrather than a floating promise, which Node can cut off the moment the response goes out. - Add no Turbopack cache config.
turbopackFileSystemCacheForDev,turbopackFileSystemCacheForBuild, and memory eviction ('auto') are on by default in 16.3. turbopack.rootis not needed here. Turbopack infers the workspace root from the lockfile; set it only when linked packages live outside the repo.next devappends a managed<!-- BEGIN:nextjs-agent-rules -->block to theAGENTS.mdnext to thenextpackage (soapps/web/, not the root), and writesCLAUDE.mdas@AGENTS.mdonly when neither file exists. It runs only when a coding agent is detected in the environment (next/dist/server/lib/generate-agent-files.js), so a plain terminal never triggers it. Reverting it only recreates the diff on the next agent run; commit it, and keep project instructions outside the markers.create-next-app --react-compilerinstallsbabel-plugin-react-compileras a devDependency. Withexperimental.turbopackRustReactCompileron it is unused; remove it after Phase 2.2 so nobody reads it as a requirement.ultracite init --skip-installwritescheckandfixscripts, sets"type": "module", and addsoxlint,oxfmt,lefthook, and@shadcn/lint(the last from--js-plugins). It writes nopreparescript (that happens in the install step it skipped). Pin those tools to the versions the firstnpm installresolves before committing, and let the rootprepareown hook installation. Confirmultraciteis ≥ 7.12 (npm ls ultracite --depth=0); older CLIs reject--js-plugins @shadcn/lintor skip the preset. JS plugins need Oxlint ≥ 1.80 and Node ≥ 20.19; if the plugin fails to load, bumpoxlintrather than droppingshadcnfromextends.- No ESLint or Prettier. Ultracite owns lint and format via Oxlint + Oxfmt; a stray
.eslintrcmakes the editor disagree with the lefthook pre-commit hook. Pass--js-plugins @shadcn/linttoultracite init(Ultracite ≥ 7.12). That is how 7.12 registersultracite/oxlint/shadcn. Do not replace that preset withjsPlugins: ["@shadcn/lint"]plus a starter-onlyshadcn/no-restyleblock. - Keep Ultracite's
extends(core,next,react) andignorePatterns, and addshadcn. Replacingoxlint.config.tswith a README.oxlintrc.jsonexample drops the framework presets. KeepjsPlugins: shadcn.jsPluginson the root config: Oxlint already loads the plugin from the preset, but Knip only readsjsPluginsoff the root and otherwise flags@shadcn/lintas unused. - The preset turns
shadcn/no-restyle,no-arbitrary-values, andrequire-static-classesoff inside**/components/ui/**. Do not duplicate that override unlesscomponents.jsonaliases.uipoints elsewhere; then add a matching override for that path or the plugin reports definition files for styling themselves. - Run lint and format through the workspace scripts: root
npm run check/npm run fix(turbo runs them insideapps/web), ornpx ultracite checkfromapps/web. Runningultracite,oxlint, oroxfmtfrom the repo root finds nooxlint.config.tsthere and lints with defaults, which disagrees with the hook and skips the shadcn preset. Remaining design-system findings afterultracite fixcan go tonpx ultracite fix --codex(or--claude) fromapps/web. - No manual git hooks. Lefthook owns them; husky or another hook manager double-runs or skips fixes.
lefthook.ymllives at the repo root, next to.git. A copy insideapps/web/is read only when lefthook is invoked from that directory, which the git hook never does. The root file scopes each job withroot: "apps/web/"so staged paths are passed relative to the workspace, whereoxlint.config.tsandoxfmt.config.tslive.- The hook runs
oxfmtandoxlintas two jobs with their own globs, notultracite fix. Ultracite exits non-zero when the staged set contains no lintable JS/TS file, so a CSS-only or Markdown-only commit fails the hook outright; two jobs let lefthook skip whichever has nothing to do. Theoxfmtglob includesmdandmdxso it inspects whatformat:checkinspects. - No app dependencies in the root
package.json(root holds onlyturbo,ultracite, andlefthook); they break workspace isolation and turbo cache keys.@shadcn/lintstays inapps/webwithoxlint.config.ts. Pin the sameultraciteversion (≥ 7.12) at the root and inapps/webso config resolution cannot drift. - Never run
npx shadcn@latest add @blode/...beforenpx shadcn@latest registry add @blode=...; the unregistered namespace makes the add fail. - Never import from
lucide-react;blode-icons-reactis Blode UI's icon library and mixed imports bundle two icon sets.shadcn initwrites"iconLibrary": "lucide"intocomponents.json; change it toblode-icons-reactbefore adding components, and replace any generatedlucide-reactimport paths. - Never create
apps/web/by hand. Scaffold at the root first, then move it in Phase 6; hand-building skips create-next-app defaults (Tailwind wiring, alias config). next-env.d.tsis generated and belongs in.gitignore(create-next-app already lists it). Do not commit it or edit it; custom declarations go in a separate.d.tsreferenced fromtsconfig.json.- Next.js loads
.env.localfrom the app directory (apps/web/), not the turborepo root.vercel env pull apps/web/.env.localis the pull command, and onlyNEXT_PUBLIC_variables reach the browser, inlined at build time. node --testruns a test file directly, where the@/alias does not resolve; test files and the modules they import use relative paths, and a test script globslib/**/*.test.tsrather than naming one file, or a new test is never executed while the gate reports green.- The root
.gitignoreignores.claude/but un-ignores.claude/knowledge/(andapps/web/.claude/). Knowledge files are the memory these skills mine; experiment output is what the ignore is for. - Check the Vercel Root Directory before dashboard deploys. On a 404 or wrong app, set Root Directory to
apps/webin Settings > General.
Skill Handoffs
| When | Run |
|---|---|
| After deployment, optimise SEO | seo |
| Before launch, audit UI quality | ui-design (Audit mode) |
| Before launch, add motion and animation | ui-animation |
Maintenance only: evals/evals.json contains regression scenarios for changes to this skill; it does not load during a user task.
当前收录版本
0.0.1
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供端到端的 Next.js Turborepo 脚手架,集成 Blode UI、Ultracite、GitHub 和 Vercel 配置
- 解决现代 Web 应用开发的完整初始化痛点,显著提升开发效率
待提升项
-
description写错位置 原报告严重程度:轻微
顶层 frontmatter 中 description 为空,实际描述内容在 skill_body 内部
改进建议:将 description 内容移至顶层 frontmatter 的 description 字段
亮点
- 触发词覆盖全面,包括'create a Next.js project'、'bootstrap a turborepo'等变体
- 明确区分了与其他技能(ui-design、scaffold-cli)的边界
待提升项
-
缺少 When to Use 章节 原报告严重程度:轻微
文档中未显式包含 When to Use 章节
改进建议:添加 When to Use 章节以明确使用场景
-
frontmatter不完整 原报告严重程度:轻微
顶层 frontmatter 缺少 When to Use 字段
改进建议:在顶层 frontmatter 中添加 When to Use 字段
亮点
- Phase 划分清晰,步骤详细,包含端到端示例
- 提供了完整的脚手架工作流程检查清单
待提升项
-
引用文件缺失 原报告严重程度:轻微
SKILL.md 引用了 references/app-setup.md、references/turbo-configs.md、references/deploy-and-launch.md 等文件,但未包含在 ZIP 包中
改进建议:确保所有被引用的参考文件都包含在 Skill 包中
亮点
- 工具来源明确,参数正确,覆盖主要异常情况
- 包含详细的 Gotchas 部分,预防常见执行问题
- 不可逆操作有确认机制(如验证步骤)
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 79, 93, 94, 112, 130 行
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
翻译待完成,请参阅来源文档。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。