Scaffold Nextjs 标志

Scaffold Nextjs

社区
mblode
scaffold-nextjs

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.

Add to TypingMind

概览

发布者mblode
代码仓库agent-skills
技能名称scaffold-nextjs
星标数
118
复刻数
11
附带文件
4
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 4 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 mblode 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Scaffold Nextjs AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/mblode/agent-skills/tree/main/skills/scaffold-nextjs
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mblode/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/scaffold-nextjs .claude/skills/scaffold-nextjs
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Scaffold Nextjs,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Scaffold Nextjs。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Scaffold Nextjs 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

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 (use codebase-architecture), building a page inside an existing app, or choosing visual direction and palettes (use ui-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

FileRead When
references/app-setup.mdPhase 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.mdPhase 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.mdPhase 7 and 8: GitHub, Vercel, CI workflow, metadataBase, verification, security.txt, favicon, OG image, validation checklist

Scaffold Workflow

Copy this checklist to track progress:

text
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):

VariableExampleDefaultUsed in
{{name}}acme-webnone (required)Root package.json, directory name, README
{{description}}Marketing site for Acmenone (required)App package.json, README
{{repo}}acme-corp/acme-webnone (required)GitHub remote URL
{{domain}}acme.comnone (ask if missing)Vercel custom domain, metadataBase
{{author}}Your Namenone (required)package.json author
{{year}}2026current yearLICENSE

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:

  1. Generate root package.json, turbo.json, lefthook.yml, knip.json, and .gitignore from the templates. Delete apps/web/lefthook.yml; git only reads the copy next to .git.
  2. Update apps/web/package.json scripts to the turbo-compatible block and remove its prepare script (the root one installs the hooks).
  3. Verify apps/web/next.config.ts still has reactCompiler: true, cacheComponents: true, and partialPrefetching: true.
  4. Write the root AGENTS.md and CLAUDE.md from the template. Keep the Phase 5.1 design-system lint paragraph in apps/web/AGENTS.md outside the Next-managed markers, including ultracite fix / ultracite fix --codex.
  5. Run npm install from the root, then npm run dev once from the coding agent's shell. When Next 16.3 detects a coding agent in the environment it appends its managed nextjs-agent-rules block to apps/web/AGENTS.md (and creates apps/web/CLAUDE.md as @AGENTS.md if missing). Commit it. From a plain terminal nothing is written; that is fine, the block arrives on the agent's first run.
  6. Verify npm run check, npm run build, and npx lefthook run pre-commit --all-files pass from the root, then npm run start -w web and 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:

bash
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; adding src/ 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 with false; setting it to true is noise that reads like a requirement.
  • Expect raw tsc diagnostics from the CLI checker: no Next.js code frames, and the full tsconfig.json project is checked (tests and .next/dev/types included), so a type error in a file next build used to skip now blocks the build. If you add node --test files later, either keep them type-clean or add **/*.test.ts to tsconfig.json exclude.
  • A green next build does not mean navigation is instant. Instant navigation validation runs in development only (validationLevel: 'warning') and never fails the build, so validate in next dev and read the overlay.
  • With cacheComponents: true, any route segment that exports dynamic, dynamicParams, revalidate, or fetchCache fails the build; runtime, maxDuration, instant, and prefetch remain valid. That includes route handlers such as a hand-written robots.txt/route.ts. Put the data access in a separate 'use cache' function with cacheLife, called from the page or the GET; the directive cannot sit on the GET export 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.
  • generateStaticParams must return at least one param under Cache Components; an empty array raises empty-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 off body or html, including a body:has(.marker) rule, leaks onto the next route. Own backgrounds per route, and key any theme switch off usePathname() in React rather than a class on body. 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.json being 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), use after() from next/server rather 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.root is not needed here. Turbopack infers the workspace root from the lockfile; set it only when linked packages live outside the repo.
  • next dev appends a managed <!-- BEGIN:nextjs-agent-rules --> block to the AGENTS.md next to the next package (so apps/web/, not the root), and writes CLAUDE.md as @AGENTS.md only 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-compiler installs babel-plugin-react-compiler as a devDependency. With experimental.turbopackRustReactCompiler on it is unused; remove it after Phase 2.2 so nobody reads it as a requirement.
  • ultracite init --skip-install writes check and fix scripts, sets "type": "module", and adds oxlint, oxfmt, lefthook, and @shadcn/lint (the last from --js-plugins). It writes no prepare script (that happens in the install step it skipped). Pin those tools to the versions the first npm install resolves before committing, and let the root prepare own hook installation. Confirm ultracite is ≥ 7.12 (npm ls ultracite --depth=0); older CLIs reject --js-plugins @shadcn/lint or skip the preset. JS plugins need Oxlint ≥ 1.80 and Node ≥ 20.19; if the plugin fails to load, bump oxlint rather than dropping shadcn from extends.
  • No ESLint or Prettier. Ultracite owns lint and format via Oxlint + Oxfmt; a stray .eslintrc makes the editor disagree with the lefthook pre-commit hook. Pass --js-plugins @shadcn/lint to ultracite init (Ultracite ≥ 7.12). That is how 7.12 registers ultracite/oxlint/shadcn. Do not replace that preset with jsPlugins: ["@shadcn/lint"] plus a starter-only shadcn/no-restyle block.
  • Keep Ultracite's extends (core, next, react) and ignorePatterns, and add shadcn. Replacing oxlint.config.ts with a README .oxlintrc.json example drops the framework presets. Keep jsPlugins: shadcn.jsPlugins on the root config: Oxlint already loads the plugin from the preset, but Knip only reads jsPlugins off the root and otherwise flags @shadcn/lint as unused.
  • The preset turns shadcn/no-restyle, no-arbitrary-values, and require-static-classes off inside **/components/ui/**. Do not duplicate that override unless components.json aliases.ui points 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 inside apps/web), or npx ultracite check from apps/web. Running ultracite, oxlint, or oxfmt from the repo root finds no oxlint.config.ts there and lints with defaults, which disagrees with the hook and skips the shadcn preset. Remaining design-system findings after ultracite fix can go to npx ultracite fix --codex (or --claude) from apps/web.
  • No manual git hooks. Lefthook owns them; husky or another hook manager double-runs or skips fixes.
  • lefthook.yml lives at the repo root, next to .git. A copy inside apps/web/ is read only when lefthook is invoked from that directory, which the git hook never does. The root file scopes each job with root: "apps/web/" so staged paths are passed relative to the workspace, where oxlint.config.ts and oxfmt.config.ts live.
  • The hook runs oxfmt and oxlint as two jobs with their own globs, not ultracite 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. The oxfmt glob includes md and mdx so it inspects what format:check inspects.
  • No app dependencies in the root package.json (root holds only turbo, ultracite, and lefthook); they break workspace isolation and turbo cache keys. @shadcn/lint stays in apps/web with oxlint.config.ts. Pin the same ultracite version (≥ 7.12) at the root and in apps/web so config resolution cannot drift.
  • Never run npx shadcn@latest add @blode/... before npx shadcn@latest registry add @blode=...; the unregistered namespace makes the add fail.
  • Never import from lucide-react; blode-icons-react is Blode UI's icon library and mixed imports bundle two icon sets. shadcn init writes "iconLibrary": "lucide" into components.json; change it to blode-icons-react before adding components, and replace any generated lucide-react import 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.ts is 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.ts referenced from tsconfig.json.
  • Next.js loads .env.local from the app directory (apps/web/), not the turborepo root. vercel env pull apps/web/.env.local is the pull command, and only NEXT_PUBLIC_ variables reach the browser, inlined at build time.
  • node --test runs a test file directly, where the @/ alias does not resolve; test files and the modules they import use relative paths, and a test script globs lib/**/*.test.ts rather than naming one file, or a new test is never executed while the gate reports green.
  • The root .gitignore ignores .claude/ but un-ignores .claude/knowledge/ (and apps/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/web in Settings > General.

Skill Handoffs

WhenRun
After deployment, optimise SEOseo
Before launch, audit UI qualityui-design (Audit mode)
Before launch, add motion and animationui-animation

Maintenance only: evals/evals.json contains regression scenarios for changes to this skill; it does not load during a user task.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Scaffold Nextjs AI 技能有什么作用?

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.

为什么在 TypingMind 中使用 Scaffold Nextjs?

因为您只需安装一次,就能搭配任何模型使用。Scaffold Nextjs 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Scaffold Nextjs?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/mblode/agent-skills/tree/main/skills/scaffold-nextjs。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Scaffold Nextjs?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Scaffold Nextjs 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Scaffold Nextjs 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Scaffold Nextjs AI 技能免费吗?

是的。mblode 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇