start-an-app
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStart an App
启动应用搭建
Turn an idea into a running web app. Understand the idea properly first, then build. The result is the user's actual app from the first commit — their name, their pages, their data model, only the infrastructure they need. It should never feel like a template.
Understanding comes before scaffolding. The interview is the most valuable part of this skill, not a formality to get through. Ten minutes of good questions produces an app the user recognises; skipping them produces a generic CRUD shell they have to rewrite. The only commands before the build sheet is agreed are the skill installs in Step 2a; nothing touches the app itself until Step 3.
将想法转化为可运行的Web应用。先充分理解想法,再进行构建。最终成果从第一次提交开始就是用户专属的应用——包含他们的命名、页面、数据模型,仅保留所需的基础设施。绝不应该让用户觉得这是一个通用模板。
理解优先于搭建。 访谈是这项技能中最有价值的部分,而非走流程。十分钟优质提问能产出用户认可的应用;跳过访谈只会生成一个需要重写的通用CRUD框架。在构建方案达成一致前,仅执行步骤2a中的技能安装操作;在步骤3之前,绝不触碰应用本身的代码。
Ground rules
基本原则
- Explain every choice like you would to a smart friend who doesn't code. Say "a place to store your data" before saying "database". Introduce each technical term once, briefly, then use it normally.
- Dig until it's clear. Follow up on vague answers rather than filling the gap with an assumption. "A site for my club" is not yet a spec — what does a member do there?
- Ask about one topic at a time. During discovery, follow the conversation rather than reading from a list; for the technical choices, one question at a time with a recommended default so the user can just say "whatever you recommend".
- Surface gaps as suggestions, not interrogation. "Most apps like this need a way to edit an entry after posting it — want that in the first version?" is better than a checklist, and it's where the user learns what they actually want.
- Recommend, then respect. If the user picks the non-recommended option, go with it without relitigating.
- Never . Schema changes always go through
drizzle-kit pushthendb:generate, every time, from the very first table.db:migrate - Ids are randomly generated UUIDs — except in Better Auth's tables. Every table you define gets one. The tables Better Auth's CLI generates stay exactly as generated, which also means any column pointing at a user stays , not
text.uuidhas both branches.references/database.md - The app is scaffolded in the current working directory — that folder is the project root. Never create a subfolder for it and never into one; the user already chose where the app goes by being there.
cd - The stack is fixed: Next.js, TypeScript, Tailwind, shadcn/ui, Drizzle, Better Auth. The interview chooses within it (which database, what kind of sign-in, email, uploads, payments, AI, background jobs, documentation, whether the app is meant to be found, and how it looks) — it never swaps out these pieces, and it never bolts a second framework alongside them. Documentation is pages in this app, not a docs platform beside it.
- Better Auth owns anything that belongs to a user. Where Better Auth has a plugin for an integration — payments above all — use the plugin, never the provider's standalone SDK wired in beside it. One source of truth for the user, one place customer ids and webhooks live.
- A tool is another caller, never a second way in. If the app is opened up to AI agents, every tool goes through the same functions, the same ownership checks and the same log as the buttons do, and takes the user from the token rather than from anything the model passed. .
references/mcp.md - Prefer choices that survive deployment. Where a feature works differently in production (uploads, Postgres), the local setup and the deployed setup must be the same code switched by an environment variable — never a second code path the user has to remember to change.
- Every app gets a settings area. Not as a finishing touch — from the first commit, scaled to what the app has. Accounts mean a profile, verification status, password, devices, and a way to leave. Every app, accounts or not, gets a system view: what's configured, what happened, what's running. and
references/settings.md.references/ops.md - What the app owes its users legally is worked out, never asked. Whether it needs a privacy policy, terms, or a cookie banner follows from what it is and what it loads — a personal journal owes none of them, a public product people sign up for owes the first two, and a banner is owed only where something non-essential actually loads, which the session cookie is not. Decide it, build exactly that, and put the call on the build sheet in one line so the user reads a decision rather than an oversight. .
references/legal.md - Anything the app does out of sight is visible and controllable from inside it. If the app sends an email, runs work in the background, or acts on a schedule, the user can see it happened, read why it failed, stop it, and try it again — in the app, not by reading logs on a hosting dashboard. Building something the user cannot watch is not finished.
- Whether the app should be found is asked, and both answers are built. Only where it could plausibly be found — a public product or a content site. A personal or internal tool is never asked and never gets a sitemap; it gets a real title in the browser tab and a deliberate keep me out of search results, which is a deliverable rather than an omission. .
references/seo.md - Documentation is written only for what exists, and only where somebody would read it. Most apps here need none. Where a product strangers sign up for wants help pages, four honest ones beat twenty, and a page describing a feature the app doesn't have is worse than no page at all — it sends someone looking for a button that isn't there. .
references/docs.md - Every app gets a written design system, and nothing overrides it later. The look is asked about in the interview like anything else, written to at the project root before the first screen exists, and expressed as theme tokens rather than as advice. From then on it is binding: a colour, a font size or a radius hardcoded into a component is a bug, not a shortcut, and "it looked better this way here" is how an app ends up with five blues.
DESIGN.mdandAGENTS.mdboth point at it so that the next agent to open the project is held to it too.CLAUDE.md.references/design.md - The maintainers' own skills come before searching. shadcn, Vercel, Better Auth and Anthropic publish agent skills for their own libraries. Step 2a installs them globally, once; from that point they are the first place to look for anything about those libraries, ahead of a search, a blog post, or memory. Reading the file that ships with the API is faster than researching it and is right more often.
- Never write or accept a version number. Not in an install command, not in a snippet, not in prose, not a Docker image tag. No file in this skill pins one, and none should ever gain one. Every install takes the current stable release, and Step 2 is what establishes what that is. A version written into a skill file is a lie with a timestamp on it: it goes stale in silence and builds the app against last year's API.
package.json - Nothing deprecated, ever. If the current release deprecates, renames, or supersedes something a reference file uses, use the replacement — not the old path that "still works". Still working is what deprecated means; it is a removal notice with a delay on it, and shipping onto one hands the user a rewrite they didn't ask for.
- A check that wasn't run is named, never claimed. Saying the app does something because you wrote the code that should make it do it is recall, not verification. Run the check where you can; where you can't — no browser, no key, no domain yet — say which one you couldn't do and what it would need. The user reads silence as success.
- All commands, package names, and config live in the reference files, never in this file. Load only the references for the branches the user chose.
- If a reference command fails because a tool changed (renamed flag, different init flow), check that tool's official docs, use the current equivalent, finish the job, and tell the user at the end that this skill's reference file needs a refresh.
- 像给不懂编程的聪明朋友解释一样,说明每一个选择。先说“存储数据的地方”,再提“database”。每个技术术语只介绍一次,简要说明后正常使用。
- 深入挖掘直到需求清晰。 针对模糊的回答进行追问,而非自行填补空白。“我的俱乐部网站”并非明确需求——成员在上面具体能做什么?
- 一次只讨论一个主题。需求挖掘阶段,跟随对话节奏而非按列表提问;技术选择阶段,一次只问一个问题并给出推荐默认选项,方便用户直接回复“听你的”。
- 以建议的方式指出需求缺口,而非质问。“大多数这类应用都需要编辑已发布内容的功能——第一版需要这个吗?”比清单式提问更好,也能帮助用户明确真实需求。
- 给出建议后尊重用户选择。如果用户选择非推荐选项,直接执行,无需反复争论。
- 绝不执行。 架构变更必须始终先执行
drizzle-kit push再执行db:generate,从第一张表开始就严格遵循此流程。db:migrate - ID采用随机生成的UUID——除了Better Auth的表。 你定义的每张表都要有UUID。Better Auth的CLI生成的表保持原样,这意味着指向用户的任何列都保持类型,而非
text。uuid中包含两种分支的处理方式。references/database.md - 应用在当前工作目录中搭建——该文件夹即为项目根目录。绝不创建子文件夹或进入子目录;用户已通过当前位置选择了应用的存放路径。
- 技术栈固定为:Next.js、TypeScript、Tailwind、shadcn/ui、Drizzle、Better Auth。访谈仅在该栈内进行选择(如数据库类型、登录方式、邮件、上传、支付、AI、后台任务、文档、应用是否可被发现、视觉风格)——绝不替换这些组件,也绝不额外添加第二个框架。文档直接集成在应用内,而非单独的文档平台。
- 用户相关功能由Better Auth统一管理。 如果Better Auth有对应集成的插件——尤其是支付插件——优先使用插件,绝不单独接入服务商的SDK。确保用户数据的单一来源,客户ID和Webhook统一管理。
- 工具是调用者,而非额外入口。 如果应用开放给AI Agent访问,所有工具都需通过相同的函数、相同的权限校验和相同的日志系统,且基于用户的token进行操作,而非模型传递的内容。详见。
references/mcp.md - 优先选择支持部署的方案。如果某个功能在生产环境中的运行方式不同(如上传、Postgres),本地环境和部署环境必须通过环境变量切换同一套代码——绝不提供需要用户手动修改的第二套代码路径。
- 每个应用都包含设置区域。 这不是收尾工作——从第一次提交开始,就根据应用规模搭建对应的设置区域。有账户系统意味着包含个人资料、验证状态、密码、设备管理和注销功能。无论是否有账户系统,每个应用都要有系统视图:配置信息、操作记录、运行状态。详见和
references/settings.md。references/ops.md - 自动确定应用需向用户履行的法律义务,无需询问。 是否需要隐私政策、服务条款或Cookie提示,取决于应用类型和加载内容——个人日记无需任何法律页面,公开注册产品需要前两者,仅当加载非必要内容时才需Cookie提示(会话Cookie不属于此类)。直接决策并构建对应内容,在构建方案中用一句话说明,让用户看到明确的决策而非遗漏。详见。
references/legal.md - 应用后台执行的所有操作都需在应用内可见且可控。 如果应用发送邮件、执行后台任务或按计划运行,用户需能查看操作记录、失败原因,停止并重新执行——所有操作都在应用内完成,无需查看托管平台的日志。用户无法监控的功能不算完成。
- 询问应用是否可被发现,并根据两种答案进行构建。 仅当应用可能被公开发现时才询问——如公开产品或内容网站。个人或内部工具无需询问,也无需生成站点地图;只需在浏览器标签中设置真实标题,并明确设置“禁止搜索引擎收录”,这是交付成果的一部分,而非遗漏。详见。
references/seo.md - 仅为已存在的功能编写文档,且仅在有人会阅读的地方编写。 大多数应用无需文档。如果面向陌生人注册的产品需要帮助页面,简洁的4页胜过冗余的20页,描述应用不存在的功能的页面不如没有——这会引导用户寻找不存在的按钮。详见。
references/docs.md - 每个应用都要有书面设计系统,且后续绝不随意修改。 视觉风格像其他需求一样在访谈中确认,在第一个页面创建前写入项目根目录的,并以主题令牌的形式呈现,而非建议性内容。此后该设计系统具有约束力:组件中硬编码的颜色、字体大小或圆角属于bug,而非捷径;“这里这样看起来更好”会导致应用出现5种不同的蓝色。
DESIGN.md和AGENTS.md均指向该文件,确保后续打开项目的Agent也遵循此设计。详见CLAUDE.md。references/design.md - 优先使用维护者提供的技能,而非搜索。 shadcn、Vercel、Better Auth和Anthropic为各自的库发布了Agent技能。步骤2a将它们全局安装一次;此后,关于这些库的任何问题都优先查看这些技能,而非搜索、博客文章或记忆。直接阅读随API发布的文件比研究更快,且更准确。
- 绝不编写或接受版本号。 安装命令、片段、 prose、Docker镜像标签中都不允许出现版本号。本技能的任何文件都不固定版本,也绝不添加版本号。所有安装都使用当前稳定版,步骤2确定当前稳定版的具体信息。技能文件中写入版本号等同于带有时间戳的谎言:会悄无声息地过时,导致应用基于去年的API构建。
package.json - 绝不使用已废弃的内容。 如果当前稳定版废弃、重命名或替代了参考文件中使用的内容,使用替代方案——而非“仍能工作”的旧路径。“仍能工作”正是废弃的含义;这是带有延迟的移除通知,使用废弃内容会给用户带来未预期的重写工作。
- 未执行的检查需明确说明,绝不虚假声称。 说应用能实现某功能是因为你编写了对应的代码,这是回忆,而非验证。尽可能运行检查;如果无法运行——如无浏览器、无密钥、无域名——说明无法执行的检查项及所需条件。用户会将沉默视为成功。
- 所有命令、包名和配置都存放在参考文件中,绝不放在本文件内。仅加载用户选择的分支对应的参考文件。
- 如果参考命令因工具变更(如重命名参数、不同的初始化流程)而失败,查看该工具的官方文档,使用当前等效命令完成任务,并在最后告知用户本技能的参考文件需要更新。
Step 1a — Understand the idea
步骤1a — 理解想法
Start here and stay here until the picture is sharp.
"What are you building? Describe it like you'd describe it to a friend."
Then follow up. Listen for the nouns (the things the app keeps track of) and the verbs (what people do with them) — those become the database tables and the pages. Keep pulling until both are concrete:
- "Walk me through it — someone opens the app for the first time. What do they do?"
- "And then what? What brings them back the next day?"
- "When you say [their vague word] — what does that actually look like on screen?"
- "Is there anything like this you already use, that this is better than?"
Then say the data model back to them in plain words and let them correct it. This is the highest-value question in the whole skill, because people who can't design a schema can absolutely tell you what's wrong with one:
So the app keeps a list of hikes — each with a date, a trail name, distance, how it felt, and some photos. They're all yours; nobody else sees them. Have I got that right, or is there something else it needs to remember?
从这里开始,直到需求清晰为止。
“你想要构建什么?像给朋友描述一样说明。”
然后跟进追问。留意名词(应用需要跟踪的事物)和动词(人们对这些事物执行的操作)——它们将成为数据库表和页面。持续挖掘直到两者都具体明确:
- “带我走一遍流程——某人第一次打开应用时,会做什么?”
- “然后呢?什么会让他们第二天再次使用?”
- “当你提到*[模糊词汇]*时——在屏幕上具体是什么样子?”
- “有没有类似的产品你正在使用,而这个应用会比它更好?”
然后用通俗语言复述数据模型,让用户纠正。 这是整个技能中最有价值的问题,因为不会设计架构的人绝对能告诉你架构哪里有问题:
所以这个应用会记录徒步旅行的列表——每条记录包含日期、路线名称、距离、感受和照片。所有记录都是你的,其他人看不到。我理解的对吗,还是需要记录其他内容?
Step 1b — Find the gaps
步骤1b — 发现需求缺口
The user has told you the happy path. Your job is the rest. Run through these silently, and raise only the ones that genuinely apply — as a suggestion with a recommendation, not a quiz:
- Whose data is it? Private to each user, shared with a team, or public? This decides every query in the app, and it's the one people forget to say.
- Can things be changed? Most descriptions only cover creating. Editing and deleting are usually wanted and almost never mentioned.
- Is anyone special? An admin, a moderator, an owner who sees more than everyone else.
- What does day one look like? The app opens with zero data. What should be on that screen?
- Anything time-based? Due dates, reminders, recurring items, "this week" views.
- Does anyone need telling? Email on signup, on invite, when something happens. If yes, that's the email question in Step 1c — carry the answer forward rather than asking twice.
- Does anything take a while? Work that shouldn't happen while someone waits — importing a file, generating a report, calling a slow service, anything on a schedule. Most apps have none; the ones that do usually mention it here rather than in the happy path.
- Phone or desktop? Changes layout decisions early and is cheap to ask.
- What is deliberately not in version one? Ask directly. Naming what's out is what keeps a first version shippable, and it gives you permission to leave things out instead of guessing.
Two or three of these usually matter. Raising all nine is an interrogation — pick the ones that would change what you build.
用户已经描述了理想流程。你的工作是处理其他情况。默默梳理以下内容,仅提出真正适用的缺口——以建议的方式给出推荐,而非测验:
- 数据归属? 每个用户私有、团队共享还是公开?这决定了应用中的所有查询,也是人们常忘记说明的一点。
- 内容是否可修改? 大多数描述仅涵盖创建操作。编辑和删除功能通常是需要的,但几乎从未被提及。
- 是否有特殊角色? 管理员、版主或拥有更多权限的所有者。
- 第一天的初始状态是什么? 应用打开时没有任何数据。此时屏幕上应该显示什么?
- 是否有时间相关功能? 截止日期、提醒、重复项、“本周”视图。
- 是否需要通知? 注册、邀请、事件发生时发送邮件。如果需要,这将作为步骤1c中的邮件问题——直接沿用答案,无需重复询问。
- 是否有耗时操作? 用户无需等待的后台工作——如导入文件、生成报告、调用慢速服务、定时任务。大多数应用没有此类功能;有此类功能的应用通常会在此时提及,而非理想流程中。
- 适配手机还是桌面? 这会影响早期布局决策,且询问成本低。
- 第一版明确不包含什么? 直接询问。明确排除项能确保第一版可交付,也让你有权省略内容而非猜测。
通常有2-3项是重要的。全部列出9项会变成质问——只选择会改变构建内容的项。
Step 1c — Technical choices
步骤1c — 技术选择
Now the branches. One at a time, each with a recommendation. Don't ask what they've already told you — if the description made an answer obvious ("a paid newsletter", "a photo journal"), confirm it in passing instead: "Sounds like people will be paying for this — I'll set that up."
-
"Who's going to use it — just you for now, or other people / the public?" → Just me / trying an idea: recommend SQLite ("your data lives in a simple file inside the project — nothing extra to install or run"). → Other people / production ambitions: recommend Postgres ("the database most real apps use — it runs in Docker on your machine, so it's one command to start and nothing is installed permanently, and it's the same database you'll use in production"). → Postgres needs Docker Desktop installed and running. Check before promising it; if they don't have it and don't want it, offer SQLite or a free hosted Postgres instead.
-
"Do people need to sign in?" → No accounts: skip auth entirely. → Yes: recommend email + password as the default ("works immediately, nothing to configure"). → If they want "Sign in with Google": say yes, and set expectations — it needs a free Google Cloud setup with a few copy-paste steps; offer to walk through it together or add it later.
-
"Does the app need to send any email — confirming an address, resetting a password, telling someone something happened?" → No: skip email entirely. Sign-in still works; there's just no verification or password reset until it's added. → Yes: recommend Resend. Set expectations honestly and early, because this is the one component that needs something they may not have: "It works straight away for sending to yourself. To email anyone else you'll need a domain name, and a few DNS records — about ten minutes, and free." If they don't have a domain, take it anyway and say the sending step waits for one — everything else works in the meantime, with emails printed to the terminal. → If they said no to sign-in but yes to email, that's fine — a contact form or a notification doesn't need accounts.
-
"Will people upload anything — photos, documents, a profile picture?" → No: skip file storage entirely. → Yes: no decision to make, so don't offer one. Say what happens: "While you're building, uploads save into a folder in the project. When you deploy, they'll go to proper cloud storage automatically — same code, you just connect a store." Only mention Vercel Blob by name if they ask.
-
"Will people pay for anything — a subscription, or a one-off purchase?" → No: skip payments entirely. → Yes: recommend Polar ("they handle sales tax and VAT worldwide for you, which is the part that usually bites"), with Stripe as the option if they already use it or need it. → Payments need accounts. If they said no to sign-in, say so plainly and add it: "we'll need accounts too, so the app knows whose subscription is whose." → Set expectations: everything is set up in test mode, no real money, and going live is a key swap later.
-
"Should the app have any AI features — like a chat, or generating text or content?" → Only include AI plumbing if yes. If yes, mention they'll need an OpenRouter API key (free to create) and you'll show them where to get it — one key, many models.
-
"Does anything need to keep running on its own — work that carries on after they close the tab, or happens on a schedule?" → Default is no, and most apps should stay there. A server action handles saving a record, sending one email, or resizing one image perfectly well; adding a job system for that is overhead with a dashboard attached. → Yes when work must survive a restart, retry itself after a failure, run on a schedule, fan out over many items, or wait minutes to days for something. Importing a spreadsheet, generating a report, calling a slow external service, a nightly digest. → If yes: recommend Inngest ("it runs the work outside the app, picks up where it left off if something crashes, retries on its own, and you can watch every step of it happen while you build"). It's free to start and needs no account at all during development.
-
"Should other software be able to use this on your behalf — so you could ask Claude to add an entry or pull a summary without opening the app yourself?" → A genuine either/or, so ask it that way and don't lean. Yes means the app's main actions also become tools an AI agent can call, behind the same sign-in and the same permissions — it works from Claude Code straight away, and from Claude.ai or ChatGPT once the app is deployed somewhere public. No means the app is used by people in a browser, which is a perfectly good answer, and this can be added later without changing anything built before it. → Worth saying if they're unsure: the tools end up being the same handful of things the app already does, so the cost is mostly the sign-in plumbing, and there's a page listing every agent that has access with a button to cut it off. → Needs accounts, the same way payments do. If they said no to sign-in, say it in one sentence — "an agent has to sign in as you, so the app knows whose data it's touching" — rather than treating it as a blocker.
-
"When someone lands on the app signed out, what should they see?" → Decides the front door: a real landing page for something other people will sign up for, or straight into the app for a personal tool. Don't assume a marketing page —has the call.
references/pages.md -
"Should it come with a few help pages people can read without signing in?" → Ask only if the answer to 9 was a real landing page — a product strangers sign up for, most of all one that takes money. A personal tool has one user who already knows how it works, and an internal tool's documentation is usually a message to three colleagues; asking there invites a yes to something nobody will read. Don't ask, don't build, don't mention it. → Default is no. Say what a yes actually costs: four to six short pages that have to stay true every time a screen changes. If they want it, name the pages you'd write from what they've already told you — "getting started, how it works, plans and billing, connecting Claude" — so they're agreeing to something concrete rather than to the idea of documentation.
-
"Should search engines — and AI assistants — be able to find this?" → Ask only where the app is public: a product people sign up for, or a site whose content is the point. For a personal or internal tool, don't ask. Say what you're doing instead, in one line: "nobody's meant to find this, so I'll give it a proper name in the browser tab and keep it out of search results" — that's the deliverable, not the absence of one. → Where it applies, default is yes, and it's cheap: a sitemap, a, an
robots.txt, and a preview card for when the link gets shared. If the docs question above was a yes, mention those pages get indexed too — for most products that's the half people actually search for. → One sub-question, and only where the app's content is the product (a blog, a directory): whether AI crawlers may train on it. Search and citation crawlers are a different thing and worth allowing — that's how an assistant recommends the app with a link.llms.txtsplits the two.references/seo.md -
"How should it look?" → Asked of every app, and asked last — a proposal is only worth making once you know what the app is, and a personal tool deserves a point of view as much as a product does. This is the one answer that touches every screen. → Offer the three ways to answer in one breath, because people don't know which is allowed: "Describe it however you like — 'calm and minimal', 'looks like Linear', 'warm, like paper'. Or paste in what you've already got — brand colours, a font, a whole design document, a style guide. Or say 'you pick' and I'll propose something for you to shoot down." → If they paste something, it wins outright — colours, fonts, spacing, tone, component conventions, all of it, used as given rather than as inspiration. Where it doesn't cover something the app needs (usually dark mode, or a radius), fill the gap in its spirit and say which parts were yours. → If they answer in words, play it back as decisions, not adjectives. "Calm and minimal" becomes a named neutral base, one accent, a generous radius, a specific font — so they're correcting something concrete instead of agreeing with a mood. → If they say "you pick", propose — don't ask a second time. Two or three directions with real names, one line each, drawn from what the app is: a developer tool, a children's reading tracker and an invoicing app should not look alike. Recommend one.has how to choose. → Whichever route it took, the answer becomes
references/design.mdat the project root in Step 4, and every page built afterwards is held to it.DESIGN.md
现在确定分支。一次一个,每个都给出推荐。不要询问用户已经明确说明的内容——如果描述中答案明显(如“付费通讯”、“照片日记”),只需顺便确认:“听起来人们需要为此付费——我会设置支付功能。”
-
“谁会使用它——目前只有你,还是其他人/公众?” → 仅自己使用/测试想法:推荐SQLite(“你的数据存储在项目内的一个简单文件中——无需额外安装或运行任何东西”)。 → 其他人使用/有生产计划:推荐Postgres(“大多数实际应用使用的数据库——在你的机器上通过Docker运行,只需一个命令即可启动,无需永久安装任何东西,且与生产环境使用的数据库相同”)。 → Postgres需要安装并运行Docker Desktop。在承诺前确认;如果用户没有且不想安装,提供SQLite或免费托管的Postgres作为替代。
-
“用户需要登录吗?” → 无需账户:完全跳过认证。 → 需要:默认推荐邮箱+密码(“立即可用,无需配置”)。 → 如果用户想要“Google登录”:同意,并说明预期——需要免费的Google Cloud设置,包含一些复制粘贴步骤;可提供一起完成或稍后添加的选项。
-
“应用需要发送邮件吗——如确认地址、重置密码、通知事件发生?” → 不需要:完全跳过邮件功能。登录仍可正常工作;只是在添加邮件功能前无法进行验证或密码重置。 → 需要:推荐Resend。提前诚实说明预期,因为这是唯一可能需要用户额外准备的组件:“发送给自己的邮件可立即生效。要发送给其他人,你需要一个域名和一些DNS记录——大约十分钟,免费。”如果用户没有域名,仍继续搭建,并说明发送功能需等待域名配置——在此期间其他功能都可正常工作,邮件会打印到终端。 → 如果用户说无需登录但需要邮件,没问题——联系表单或通知无需账户。
-
“用户需要上传内容吗——如照片、文档、头像?” → 不需要:完全跳过文件存储。 → 需要:无需决策,直接说明:“搭建期间,上传内容保存到项目内的文件夹中。部署时,会自动切换到专业云存储——代码相同,只需连接存储服务即可。”仅在用户询问时提及Vercel Blob。
-
“用户需要付费吗——订阅或一次性购买?” → 不需要:完全跳过支付功能。 → 需要:推荐Polar(“他们为你处理全球销售税和VAT,这通常是最麻烦的部分”),如果用户已使用或需要Stripe,可选择Stripe。 → 支付功能需要账户系统。如果用户说无需登录,直接说明并添加账户系统:“我们也需要账户系统,这样应用才能知道订阅属于谁。” → 说明预期:所有设置都在测试模式下,不涉及真实资金,上线时只需切换密钥即可。
-
“应用需要AI特性吗——如聊天、文本或内容生成?” → 仅在需要时添加AI基础架构。如果需要,说明用户需要OpenRouter API密钥(免费创建),并告知获取位置——一个密钥可使用多个模型。
-
“是否有需要自动运行的任务——用户关闭标签后仍继续的工作,或定时执行的任务?” → 默认是不需要,大多数应用应保持此选项。服务器操作可完美处理保存记录、发送单封邮件或调整单张图片大小;为此添加任务系统会带来不必要的开销和仪表盘。 → 需要的场景:工作必须在重启后继续、失败后重试、定时执行、批量处理多个项、等待数分钟到数天的任务。如导入电子表格、生成报告、调用慢速外部服务、每日摘要。 → 如果需要:推荐Inngest(“它在应用外部运行任务,崩溃后可从中断处恢复,自动重试,且你在搭建时可查看每一步执行情况”)。开发期间免费使用,无需账户。
-
“其他软件能否代表你使用这个应用——比如你可以让Claude添加记录或生成摘要,而无需打开应用?” → 这是一个真正的二选一问题,直接询问,无需偏向。是的话,应用的主要操作也会成为AI Agent可调用的工具,使用相同的登录和权限——可直接从Claude Code使用,部署到公共环境后可从Claude.ai或ChatGPT使用。不是的话,应用仅供用户在浏览器中使用,这也是完全合理的答案,且可在后续添加而无需修改之前的构建内容。 → 如果用户不确定,值得说明:工具最终是应用已有的少数操作,因此成本主要是登录基础架构,且会有一个页面列出所有访问的Agent,并提供撤销访问的按钮。 → 需要账户系统,就像支付功能一样。如果用户说无需登录,用一句话说明——“Agent必须以你的身份登录,这样应用才能知道它操作的是谁的数据”——而非视为障碍。
-
“用户未登录时打开应用,应该看到什么?” → 决定应用的入口:面向他人注册的产品需要真实的着陆页,个人工具则直接进入应用。不要假设需要营销页面——中有决策依据。
references/pages.md -
“是否需要附带一些无需登录即可阅读的帮助页面?” → 仅当步骤9的答案是真实着陆页时才询问——尤其是面向陌生人注册的产品,尤其是收费产品。个人工具只有一个用户,已经知道如何使用;内部工具的文档通常是给三位同事的消息;在此类场景询问会得到一个没人会读的肯定答案。无需询问、构建或提及。 → 默认是不需要。说明选择是的实际成本:4-6个简短页面,且每次屏幕变更都需保持内容真实。如果用户需要,根据已了解的内容列出具体页面——“入门指南、工作原理、方案与计费、连接Claude”——让用户同意具体内容而非抽象的文档概念。
-
“搜索引擎和AI助手能否发现这个应用?” → 仅当应用是公开的时才询问:如用户注册的产品,或内容为核心的网站。个人或内部工具无需询问。用一句话说明你的操作:“没人需要发现这个应用,所以我会在浏览器标签中设置真实名称,并禁止搜索引擎收录”——这是交付成果的一部分,而非遗漏。 → 适用场景下默认是需要,且成本低:站点地图、、
robots.txt,以及链接分享时的预览卡片。如果上述文档问题的答案是需要,说明这些页面也会被索引——对于大多数产品,这是人们实际搜索的部分。 → 仅当应用的内容是产品时(如博客、目录),才有一个子问题:AI爬虫是否可用于训练。搜索和引用爬虫是不同的,值得允许——这是助手推荐应用并附带链接的方式。llms.txt中区分了这两种情况。references/seo.md -
“应用应该是什么样子?” → 每个应用都要询问,且最后询问——只有了解应用是什么样的,提案才有意义;个人工具和产品一样值得有明确的视觉风格。这个答案会影响每个屏幕。 → 一次性提供三种回答方式,因为人们不知道哪种是允许的:“你可以随意描述——‘简洁极简’、‘像Linear一样’、‘温暖,像纸张’。或者粘贴你已有的内容——品牌颜色、字体、完整的设计文档、风格指南。或者说‘你来选’,我会提出方案供你修改。” → 如果用户粘贴了设计内容,直接使用——颜色、字体、间距、语气、组件约定,全部按给定内容使用,而非作为灵感。如果内容未覆盖应用需要的部分(通常是暗色模式或圆角),按其风格填补,并说明哪些部分是你补充的。 → 如果用户用文字描述,将其转化为具体决策,而非形容词。 “简洁极简”会转化为指定的中性底色、一种强调色、较大的圆角、特定字体——让用户纠正具体内容而非同意一种情绪。 → 如果用户说“你来选”,直接提出方案——无需再次询问。 根据应用类型提供2-3个带有真实名称的方向,每个方向一句话:开发者工具、儿童阅读追踪器和发票应用的风格不应相同。推荐其中一个。中有选择方法。 → 无论选择哪种方式,答案都会在步骤4中写入项目根目录的**
references/design.md**,后续构建的每个页面都需遵循此文件。DESIGN.md
Step 2 — Get the current facts
步骤2 — 获取当前信息
The branches are chosen, so now find out what building them actually involves today. Two halves, in this order: install the skills the maintainers of these libraries publish, then research only what those skills don't already answer. Doing it the other way round spends a research round rediscovering what was one install away.
分支已选定,现在了解当前构建这些分支实际需要的内容。分为两部分,按此顺序:安装这些库的维护者发布的技能,然后仅研究这些技能未覆盖的内容。 反之则会浪费时间重新发现只需安装即可获得的信息。
Step 2a — Install the official skills
步骤2a — 安装官方技能
shadcn, Vercel, Better Auth and Anthropic each publish an agent skill for their own library. They are the instructions of the people whose API it is, kept current by them, and between them they cover most of what this build is made of — components, React and Next patterns, sign-in, the AI SDK, MCP tools. An agent that skips them spends the build searching for documentation that is already sitting on disk, and lands on blog posts that were written against an older release.
Install the whole set globally, before the research below and before the build sheet. Globally — — for two reasons. The folder the user is standing in is about to become the app, and refuses to run in a directory that isn't empty; a project-level install would put and there and force a workaround on every single build. And these are documentation for a fixed stack, not for one app: installed once, they are there for the next app, and for every session that opens this one afterwards.
-gcreate-next-app ..claude/skills-lock.jsonSay what you're doing in one line first, because six installs is a visible pause: "Before I plan this out, I'm pulling in the instruction manuals the people behind these tools publish — it saves me guessing at their documentation later." Then run them.
bash
npx skills add https://github.com/shadcn-ui/ui --skill shadcn -g --agent claude-code -y
npx skills add https://github.com/vercel-labs/agent-skills --skill vercel-react-best-practices -g --agent claude-code -y
npx skills add https://github.com/vercel-labs/agent-skills --skill deploy-to-vercel -g --agent claude-code -y
npx skills add https://github.com/better-auth/skills --skill better-auth-best-practices -g --agent claude-code -y
npx skills add https://github.com/vercel/ai --skill ai-sdk -g --agent claude-code -y
npx skills add https://github.com/anthropics/skills --skill mcp-builder -g --agent claude-code -y--agent claude-code -yRun all six even if some are already installed from a previous app. A re-add is a refresh, not a duplicate, and it is cheaper than checking. What is not acceptable is assuming they're there because this skill ran before — read them from disk during the build rather than from memory of the last one.
Nothing lands in the project. They install under the user's own , so the folder Step 4 scaffolds into stays empty and behaves.
~/.claude/skills/create-next-app .Which one answers what:
| Skill | Read it when |
|---|---|
| Adding, composing or theming any component — |
| Any React or Next code at all: server vs client components, data fetching, forms, caching, Step 5's real pages |
| |
| |
| |
| Not during the build. It is installed for the hand-off in Step 8 and for whoever deploys the app later |
Precedence, when a skill and a reference file disagree. The same split the research uses below. The official skill wins on API detail and on its own library's idiom — names, signatures, imports, options, which hook, which component, what the current recommended pattern is. This skill's reference files win on how the piece wires into this app — which file owns what, how it meets the schema, the session, the log and the settings area. Where a reference file hand-rolls something the official skill shows a first-class way to do, take the skill's way and delete the workaround, then say so at hand-off.
They set no scope. An official skill will cheerfully recommend a feature, a provider or an extra package. What the app contains is Step 3's, agreed with the user, and a skill's enthusiasm is not a reason to widen it.
shadcn、Vercel、Better Auth和Anthropic各自为其库发布了Agent技能。这些是API所有者提供的说明,由他们保持更新,共同覆盖了本次构建的大部分内容——组件、React和Next模式、登录、AI SDK、MCP工具。跳过这些技能的Agent会在构建过程中搜索已存储在本地的文档,且可能找到基于旧版本的博客文章。
在研究和构建方案之前,全局安装整套技能。 使用全局安装()有两个原因。用户当前所在的文件夹即将成为应用,拒绝在非空目录中运行;项目级安装会将和放在此目录,导致每次构建都需要解决此问题。此外,这些是固定技术栈的文档,而非单个应用的文档:安装一次后,可用于下一个应用,以及后续打开此项目的每个会话。
-gcreate-next-app ..claude/skills-lock.json先一句话说明你要做的事情,因为六个安装会有明显的停顿:“在规划之前,我会获取这些工具背后的团队发布的操作手册——这能避免我后续猜测他们的文档。”然后执行安装。
bash
npx skills add https://github.com/shadcn-ui/ui --skill shadcn -g --agent claude-code -y
npx skills add https://github.com/vercel-labs/agent-skills --skill vercel-react-best-practices -g --agent claude-code -y
npx skills add https://github.com/vercel-labs/agent-skills --skill deploy-to-vercel -g --agent claude-code -y
npx skills add https://github.com/better-auth/skills --skill better-auth-best-practices -g --agent claude-code -y
npx skills add https://github.com/vercel/ai --skill ai-sdk -g --agent claude-code -y
npx skills add https://github.com/anthropics/skills --skill mcp-builder -g --agent claude-code -y--agent claude-code -y即使某些技能已从之前的应用安装,也要重新安装全部六个。 重新安装是刷新,而非重复,且比检查是否已安装更高效。绝不假设因为之前运行过此技能,这些技能就已存在——构建过程中从磁盘读取它们,而非依赖上次的记忆。
不会向项目中添加任何内容。它们安装在用户的目录下,因此步骤4搭建的文件夹保持为空,可正常运行。
~/.claude/skills/create-next-app .各技能的适用场景:
| 技能 | 何时使用 |
|---|---|
| 添加、组合或主题化任何组件—— |
| 任何React或Next代码:服务器与客户端组件、数据获取、表单、缓存、步骤5的真实页面 |
| |
| |
| |
| 构建期间不使用。安装用于步骤8的交付,以及后续部署应用的人员 |
当技能与参考文件冲突时的优先级。 与下面的研究使用相同的划分方式。官方技能在API细节和自身库的惯用写法上优先——名称、签名、导入、选项、钩子、组件、当前推荐模式。本技能的参考文件在组件如何接入应用上优先——哪个文件负责什么、如何与架构、会话、日志和设置区域对接。如果参考文件手动实现了官方技能展示的原生功能,采用技能的方式并删除手动实现,然后在交付时说明。
它们不决定范围。 官方技能可能会推荐功能、服务商或额外包。应用包含的内容由步骤3与用户达成的方案决定,技能的推荐不是扩大范围的理由。
Step 2b — Check what's left
步骤2b — 检查剩余内容
Nothing in this skill names a version, deliberately — this half is where the versions come from. It costs one round of parallel subagents and prevents the expensive failure: an app built confidently against an API that moved.
Dispatch one subagent per chosen branch, all in a single message so they run at once. Only the branches the interview selected — there is no sense researching payments for an app that takes no money. The base project, the database, the pages step and discoverability always count as branches here.
Each gets the same brief with its own packages filled in, and — where the table in Step 2a names a skill for that branch — the path to it:
Read theskill first, if one is named for this branch — it is installed under<skill>, it is the maintainer's own documentation, and it outranks anything you find by searching. Research only what it does not answer, and mark which of your findings came from it. Then: find the current stable release of~/.claude/skills/. Report: the latest stable version of each; anything deprecated, renamed, moved to a different package, or removed within the last two majors; the current import paths and function signatures for<packages>; any capability added since that would replace hand-written code in<the specific things this reference file uses>; and any migration note that would break what's in there. Prefer the package's own docs and changelog over blog posts or search summaries, and check what is actually published on the registry rather than what a docs page claims. Say plainly what you verified against a primary source and what you inferred.references/<file>.md
The agent-access branch gets one extra sentence in its brief, because packages are not the only thing that moves under it: establish the current revision of the Model Context Protocol specification, and check 's assumptions against that revision's changelog and its registry of deprecated features. A protocol revision can deprecate something the file relies on without any package changing its name or its signature, and the brief above would sail straight past it. No other branch sits on a spec that versions independently of its libraries.
references/mcp.mdThe discoverability branch installs no packages and researches conventions instead, so give it its own brief: confirm Next's current file conventions for , and ; and — only where the app is meant to be found — establish the current user-agent tokens for AI crawlers, split into training, search/citation, and user-initiated, and whether has moved past a proposal toward anything a named crawler documents reading. Crawler names change without notice, and a wrong one in is not an error, it is a rule that silently matches nothing.
MetadataRoutesitemaprobotsopengraph-imagellms.txtrobots.tsEach reference file carries a date at the top. Use it to size the effort: a file verified recently needs a confirmation pass, one verified a year ago needs the assumption that something has moved.
Last verifiedThen reconcile, before installing anything:
- Latest stable only. Not release candidates, not betas, not or
nexttags — unless the user asks for one specifically and knows why.canary - Take the new capability when there is one. Reference files sometimes hand-roll something because the library couldn't do it yet. If it can now, use the built-in and delete the workaround — says exactly where this is likely.
references/mcp.md - On API detail the research wins; on how the pieces fit together this skill wins. Names, signatures, import paths, options, flags: take what the research found. Which piece owns what, and how it wires into the rest of the app: the reference file. Most reference files restate this split at the top for their own dependency.
- Where the research and an installed skill disagree, look at what kind of disagreement it is. On what is published right now — a version, a package that split, a signature that changed — the registry is the fact and the research wins, because a skill is a file and files go stale. On which pattern to use among several that all work, the official skill wins; that is its author speaking about their own library. If the skill describes something the registry says no longer exists, say so at hand-off — it is worth knowing that the maintainer's skill has drifted.
- If a reference file's approach is now deprecated, take the replacement and finish the job with it. Don't split the difference.
- Say something to the user only when something changed. One line, plain: "Better Auth moved that into a separate package since this was written — I'm using the new one." Never narrate research that found everything was fine; it reads as filler.
- Write down what's stale. Anything the research contradicted goes in the hand-off at the end, so this skill can be corrected.
本技能中故意不提及版本号——这部分是获取版本号的地方。这需要一轮并行子Agent,可避免昂贵的失败:自信地基于已变更的API构建应用。
为每个选定的分支分配一个子Agent,一次性发送消息让它们同时运行。 仅处理访谈选定的分支——为不收费的应用研究支付功能毫无意义。基础项目、数据库、页面步骤和可发现性始终视为分支。
每个子Agent的任务相同,仅替换对应的包,且——如果步骤2a的表格为此分支指定了技能——提供技能路径:
首先阅读技能(如果此分支有指定技能)——它安装在<skill>下,是维护者自己的文档,优先级高于任何搜索结果。仅研究它未覆盖的内容,并标记哪些发现来自该技能。然后:查找~/.claude/skills/的当前稳定版。报告:每个包的最新稳定版;过去两个大版本中已废弃、重命名、移至其他包或移除的内容;<packages>的当前导入路径和函数签名;任何自参考文件编写以来新增的可替代其中手写代码的功能;以及任何会破坏参考文件内容的迁移说明。优先使用包的官方文档和变更日志,而非博客文章或搜索摘要,并检查注册表中实际发布的内容,而非文档页面声称的内容。明确说明哪些内容是通过主源验证的,哪些是推断的。<参考文件使用的特定功能>
Agent访问分支的任务需额外添加一句话,因为除了包之外,还有其他内容可能变更:确定Model Context Protocol规范的当前版本,并检查的假设是否符合该版本的变更日志和废弃功能注册表。 协议版本变更可能会废弃文件依赖的内容,而无需更改包的名称或签名,上述任务可能会忽略此情况。其他分支不依赖独立于库版本的规范。
references/mcp.md可发现性分支无需安装包,只需研究约定,因此使用单独的任务:确认Next.js当前的文件约定(、和);且——仅当应用需要被发现时——确定AI爬虫的当前用户代理令牌,分为训练、搜索/引用和用户发起三类,并确认是否已从提案阶段发展为有知名爬虫文档说明的规范。 爬虫名称会随时变更,中的错误名称不会报错,但会导致规则无法匹配任何内容。
MetadataRoutesitemaprobotsopengraph-imagellms.txtrobots.ts每个参考文件顶部都有日期。用它来判断工作量:最近验证的文件只需确认,一年前验证的文件需假设某些内容已变更。
Last verified然后在安装前整合结果:
- 仅使用最新稳定版。 不使用候选版、测试版、或
next标签——除非用户明确要求且知道原因。canary - 有新功能时优先使用。 参考文件有时会手动实现某些功能,因为当时库不支持。如果现在支持,使用原生功能并删除手动实现——中明确说明了可能出现这种情况的位置。
references/mcp.md - API细节以研究结果为准;组件对接方式以本技能为准。 名称、签名、导入路径、选项、参数:采用研究结果。组件负责内容及与应用其他部分的对接:遵循参考文件。大多数参考文件顶部会针对其依赖重申此划分。
- 当研究结果与已安装技能冲突时,查看冲突类型。 关于当前发布的内容——版本、拆分的包、变更的签名——注册表是事实,研究结果优先,因为技能是文件,会过时。关于在多个可行模式中选择哪种,官方技能优先;这是作者对其库的说明。如果技能描述的内容在注册表中已不存在,在交付时说明——值得知道维护者的技能已过时。
- 如果参考文件的方法已废弃,采用替代方案并完成任务。绝不折中。
- 仅当内容变更时告知用户。 一句话说明:“Better Auth已将该功能移至单独的包——我将使用新版本。”绝不叙述未发现任何问题的研究;这会显得冗余。
- 记录过时内容。 研究结果与之矛盾的任何内容都在最后交付时说明,以便修正本技能。
Step 3 — Build sheet
步骤3 — 构建方案
Restate the plan in plain words before touching anything. Example shape:
Here's what I'll set up: "TrailLog" — a hiking journal, just for you.What it remembers: hikes — date, trail, distance, how it felt, and photos. What you can do: log a hike, edit it later, delete one, see them newest-first. Signing in: email and password, so it's yours alone. How it'll look: quiet and outdoorsy — a warm off-white background, a deep green accent, soft corners, and a serif for headings. Written down inso every screen matches. Photos: saved in the project while you build; they move to cloud storage when you deploy. From Claude: you'll be able to log a hike or ask about past ones from Claude itself, without opening the app — and see and revoke that access from inside it. Also included: a settings page where you can change your password and delete your account, and a system page showing what's set up and what's happened. Legal: nothing needed — it's just you, and nothing here tracks anyone, so no privacy policy, no terms, no cookie banner. Being found: nothing to index — it's just you, so I'll give it a proper name in the browser tab and keep it out of search results. Not in version one: sharing hikes with friends, maps, and the stats page — easy to add once the basics feel right.DESIGN.mdSound right?
Include the data model and the explicit not in version one list — those two lines are what stop a rewrite later. The legal line goes in either way and is a statement, not a question: this example says nothing is needed and why, and a public product would name the pages it gets instead. makes the call. The being found line goes in either way too, and this example shows the harder half — the app that is deliberately kept out of search still gets a line, because "no SEO" read as silence looks like something forgotten. A public product names what it gets instead: sitemap, , , and a preview card for shared links. A help pages line appears only where the docs question was asked and answered yes, and it names the pages rather than promising documentation. The how it'll look line goes in every sheet and is where a design gets corrected cheaply: name the actual decisions — background, accent, corners, font — not a mood, because "clean and modern" is something nobody can disagree with and therefore nothing they have agreed to. Where they pasted a design system in, say you're using theirs and name anything you had to fill in yourself. Also mention anything that needs something from them before it can work (Docker running, an API key, a domain for email, a provider account), so there are no surprises mid-build.
references/legal.mdrobots.txtllms.txtGet a clear go-ahead. Adjust anything they push back on. If the answer reopens what the app is rather than tweaking a detail, go back to Step 1a — that's cheaper now than after the schema exists.
在触碰任何内容前,用通俗语言重述计划。示例格式:
我将搭建的内容:“TrailLog”——仅属于你的徒步旅行日记。记录内容: 徒步旅行——日期、路线、距离、感受和照片。 可执行操作: 记录徒步、编辑记录、删除记录、按最新顺序查看。 登录方式: 邮箱+密码,确保仅你可访问。 视觉风格: 安静自然——暖白色背景、深绿色强调色、柔和圆角、标题使用衬线字体。已写入确保所有页面风格统一。 照片存储: 搭建期间保存到项目内;部署时自动迁移到云存储。 Claude集成: 你可直接从Claude记录徒步或查询过往记录,无需打开应用——且可在应用内查看和撤销此访问权限。 额外包含: 可修改密码和删除账户的设置页面,以及显示配置信息和操作记录的系统页面。 法律页面: 无需任何内容——仅你使用,无任何跟踪,因此无需隐私政策、服务条款或Cookie提示。 可发现性: 无需索引——仅你使用,因此我会在浏览器标签中设置真实名称,并禁止搜索引擎收录。 第一版不包含: 与朋友分享徒步、地图和统计页面——基础功能完善后可轻松添加。DESIGN.md这样可以吗?
包含数据模型和明确的第一版不包含列表——这两行是避免后续重写的关键。法律页面部分无论如何都要包含,且是陈述性内容,而非问题:此示例说明无需任何内容及原因,公开产品则需列出包含的页面。中有决策依据。可发现性部分无论如何都要包含,此示例展示了较难的情况——故意禁止搜索引擎收录的应用仍需说明,因为“无SEO”会被视为遗漏。公开产品则需列出包含的内容:站点地图、、和链接分享的预览卡片。帮助页面部分仅当文档问题的答案是需要时才包含,且需列出具体页面而非笼统承诺文档。视觉风格部分每个方案都要包含,这是低成本修正设计的地方:列出实际决策——背景、强调色、圆角、字体——而非情绪,因为“简洁现代”是没人会反对的模糊描述,无法达成真正的共识。如果用户粘贴了设计系统,说明你将使用他们的内容,并列出你补充的部分。还要提及任何需要用户准备的内容(如Docker运行、API密钥、邮件域名、服务商账户),避免构建过程中出现意外。
references/legal.mdrobots.txtllms.txt获得明确的同意。调整用户反对的内容。如果用户的回答重新定义了应用的本质而非调整细节,回到步骤1a——现在调整比架构存在后调整成本更低。
Step 4 — Scaffold
步骤4 — 搭建
Work through these in order. Each reference has a Verify section — complete it before moving on. Those are your own check as you go; Step 6 is the one that has to survive a command. Every path in them is relative to the current working directory.
The skills installed in Step 2a are read alongside these files, not after a build fails. The table there says which one belongs beside which step: and apply across almost all of them, from sign-in onward, and at their own steps. Read the relevant one before writing that file's code. Searching the web for an answer that is already installed on this machine is the specific waste this step is arranged to avoid.
shadcnvercel-react-best-practicesbetter-auth-best-practicesai-sdkmcp-builderAnd from step 2 onward, governs every screen any of these steps builds — the settings area, the emails, the consent screen, the legal pages, the docs. None of them re-decides how the app looks, and none of them writes a colour, a font size or a radius into a component.
DESIGN.md- Base project →
references/stack.md - Design system → (always; writes
references/design.md, the theme tokens,DESIGN.mdandAGENTS.md)CLAUDE.md - Database (SQLite or Postgres-in-Docker branch) →
references/database.md - Sign-in, if chosen (email+password, optionally Google) →
references/auth.md - Email, if chosen → (also wires verification and password reset, if sign-in ran)
references/email.md - File uploads, if chosen →
references/storage.md - Payments, if chosen → (requires sign-in)
references/payments.md - AI features, if chosen →
references/ai.md - Background jobs, if chosen →
references/jobs.md - Landing page and dashboard →
references/pages.md - Agent access, if chosen → (requires sign-in)
references/mcp.md - Public documentation, if chosen → (rarely; only a public product that was asked and said yes)
references/docs.md - Legal pages and cookie consent, as much as this app owes → (decided, never asked; often nothing)
references/legal.md - Account settings → (requires sign-in; skip only if there is no sign-in)
references/settings.md - System visibility → (always)
references/ops.md - Discoverability → (always, but for most apps this means a real title and staying out of search)
references/seo.md
The design system comes second, immediately after the scaffold, because it is the only step every later one reads from. It needs the project to exist — and are what it edits — and it needs to be in place before a single screen is built, because retrofitting a theme onto pages already written means editing all of them. It is also where and get written, so every step after it, and every agent that opens this project later, is held to the same document.
globals.csslayout.tsxAGENTS.mdCLAUDE.mdThe rest of the order matters too: payments, uploads and agent access all extend what sign-in built; the pages step needs the lot in place; and settings and system visibility hang off the navigation the pages step creates. Agent access sits after the pages step because its consent screen has to look like the rest of the app, and before the rest because each grows a section only if it ran. Documentation comes next because it can only describe branches that exist, and before legal so that legal's pass over the footer sees the docs link already there. Legal comes after every feature branch for the same reason in reverse — the privacy page has to describe all of them — and before settings, which grows a cookie-preferences section only if a banner was built. Anything that changes means regenerating the Better Auth schema and running + again — the reference files say where.
src/lib/auth.tsdb:generatedb:migrateDiscoverability is last because it is the only step that has to know every public page. It writes the sitemap and from one list, and legal and documentation both add pages to it — a sitemap written before them is wrong the moment they run.
llms.txtThe last three are not a polish pass to drop if time is short. Two of them turn a scaffold into something the user can operate, and the third decides whether anyone will ever find it.
按以下顺序执行。每个参考文件都有Verify部分——完成后再进入下一步。这些是你在构建过程中的自查;步骤6是必须通过命令验证的环节。所有路径均相对于当前工作目录。
步骤2a安装的技能需与这些文件一起阅读,而非构建失败后再查看。 步骤2a的表格说明了哪个技能对应哪个步骤:和几乎适用于所有步骤,从登录步骤开始适用,和仅适用于各自的步骤。在编写文件代码前先阅读相关技能。搜索已安装在本地的答案是本步骤要避免的浪费。
shadcnvercel-react-best-practicesbetter-auth-best-practicesai-sdkmcp-builder从步骤2开始,指导所有步骤构建的屏幕——设置区域、邮件、同意屏幕、法律页面、文档。所有步骤都不得重新决定应用的视觉风格,也不得在组件中硬编码颜色、字体大小或圆角。
DESIGN.md- 基础项目 →
references/stack.md - 设计系统 → (始终执行;写入
references/design.md、主题令牌、DESIGN.md和AGENTS.md)CLAUDE.md - 数据库(SQLite或Docker中的Postgres分支) →
references/database.md - 登录功能(如果选定)(邮箱+密码,可选Google登录) →
references/auth.md - 邮件功能(如果选定) → (同时接入验证和密码重置,如果已执行登录步骤)
references/email.md - 文件上传(如果选定) →
references/storage.md - 支付功能(如果选定) → (需要登录功能)
references/payments.md - AI特性(如果选定) →
references/ai.md - 后台任务(如果选定) →
references/jobs.md - 着陆页与仪表盘 →
references/pages.md - Agent访问(如果选定) → (需要登录功能)
references/mcp.md - 公共文档(如果选定) → (很少使用;仅适用于询问后回答需要的公开产品)
references/docs.md - 法律页面与Cookie同意机制,按应用需求提供 → (直接决策,无需询问;通常无需任何内容)
references/legal.md - 账户设置 → (需要登录功能;仅当无登录功能时跳过)
references/settings.md - 系统可见性 → (始终执行)
references/ops.md - 可发现性 → (始终执行,但大多数应用只需设置真实标题并禁止搜索引擎收录)
references/seo.md
设计系统是第二个步骤,紧随基础项目之后,因为它是后续所有步骤的唯一参考。 它需要项目已存在——要修改和——且需在第一个屏幕构建前完成,因为在已编写的页面上 retrofitting 主题意味着要修改所有页面。这也是和的写入步骤,因此后续所有步骤和打开此项目的每个Agent都需遵循同一文档。
globals.csslayout.tsxAGENTS.mdCLAUDE.md其余步骤的顺序也很重要:支付、上传和Agent访问都扩展了登录功能构建的内容;页面步骤需要所有功能都已就位;设置和系统可见性依赖页面步骤创建的导航。Agent访问在页面步骤之后执行,因为其同意屏幕需与应用其他部分风格一致,且在其余步骤之前,因为每个步骤仅在执行时才会添加对应区域。文档在之后执行,因为它只能描述已存在的分支,且在法律步骤之前,以便法律步骤检查页脚时能看到文档链接。法律步骤在所有功能分支之后执行,原因相反——隐私页面需描述所有功能——且在设置步骤之前,设置步骤仅当构建了Cookie提示时才会添加Cookie偏好设置区域。任何修改的操作都需要重新生成Better Auth架构并再次执行 + ——参考文件中说明了具体位置。
src/lib/auth.tsdb:generatedb:migrate可发现性是最后一步,因为它需要知道所有公开页面。 它从一个列表生成站点地图和,法律和文档步骤都会向该列表添加页面——在它们之前生成的站点地图是错误的。
llms.txt最后三个步骤不是可省略的收尾工作。其中两个步骤将搭建的基础设施转化为用户可操作的应用,第三个步骤决定是否有人会发现该应用。
Step 5 — Make it theirs
步骤5 — 定制化
This is not a polish pass; it is most of the value. The scaffold in Step 4 is infrastructure — here the app becomes recognisably theirs.
- Name the project after their idea (package name, page titles, visible branding).
- The schema tables are the nouns from Step 1a, each with a UUID primary key, and the ownership rule from Step 1b applied — a column (
userId, matching Better Auth) and every query scoped to it if data is private.text - Build the real pages: the front door and dashboard from , real navigation, and the verbs from Step 1a wired up — including editing and deleting if the gap-check said so. This is the densest React in the app and where
references/pages.mdearns its install — server versus client components, where data is fetched, what a form does. Compose the screens fromvercel-react-best-practicescomponents rather than hand-writing markup that approximates them, and build them toshadcn— the decisions were made and agreed already, so this step spends its judgement on the app, not on picking colours again.DESIGN.md - Seed nothing generic: every visible string should make sense for their app. No "Item", no "Welcome to Next.js", no lorem ipsum. This includes the settings area, the emails, the legal pages, any documentation, and the browser tab — a section called "Notifications" listing categories the app never sends, an email signed "My App", a privacy policy about "user-generated items" in an app whose every other screen says "hikes", or a tab still reading "Create Next App", are all the same failure as a page of lorem ipsum.
- Build only the settings sections this app has. An empty Billing tab or a Notifications tab for an app that sends no email is worse than a missing one.
- If agent access was chosen, the tools are named for the verbs too — , not
log_hike— and they are the handful of things someone would actually ask for, not one per table.create_item - Done when: someone opening the app would know what it is without being told, and the user can do the main thing the app exists for, end to end.
这不是收尾工作;这是大部分价值所在。步骤4的搭建是基础设施——在此步骤中,应用将变得明显属于用户。
- 根据用户的想法命名项目(包名、页面标题、可见品牌)。
- 架构表是步骤1a中的名词,每个表都有UUID主键,并应用步骤1b中的归属规则——如果数据私有,添加列(
userId类型,匹配Better Auth),且所有查询都限定该列。text - 构建真实页面:中的入口和仪表盘、真实导航,以及步骤1a中的动词对应的功能——包括缺口检查中确定的编辑和删除功能。这是应用中最密集的React代码,也是
references/pages.md发挥作用的地方——服务器与客户端组件、数据获取位置、表单操作。使用vercel-react-best-practices组件组合屏幕,而非手写近似的标记,并遵循shadcn——决策已达成一致,因此此步骤将精力放在应用本身,而非再次选择颜色。DESIGN.md - 不添加任何通用占位内容:所有可见字符串都需对用户的应用有意义。没有“Item”、“Welcome to Next.js”或乱数假文。这包括设置区域、邮件、法律页面、任何文档,以及浏览器标签——应用从不发送通知却有“通知”区域、邮件签名为“My App”、隐私政策提及“用户生成内容”但应用其他屏幕都显示“徒步”、浏览器标签仍显示“Create Next App”,这些都和乱数假文一样是失败的。
- 仅构建应用需要的设置区域。空的账单标签或从不发送邮件的应用有通知标签,比没有更糟。
- 如果选定了Agent访问,工具也以动词命名——,而非
log_hike——且仅包含人们实际会请求的少数操作,而非每个表对应一个工具。create_item - 完成标志:打开应用的人无需说明就知道它是什么,且用户可完成应用存在的核心功能,端到端。
Step 6 — Prove it
步骤6 — 验证
The app is built. Nothing has established that it works. Every Verify section you just completed was confirmed by the same agent that wrote the code it checks, and recall is not evidence — an app can satisfy every one of them while failing to compile.
references/verify.mdTwo points of order matter enough to say here, because getting either wrong does damage:
- Schema before build. runs
buildfirst, so reaching it with an ungenerated schema edit outstanding applies SQL nobody read — the one thingdb:migratesays never to do, performed by the step meant to catch it.references/database.md - The user signs up before any probe account exists. The first account created becomes the admin. A fixture that takes that place, and is then deleted, locks the user out of their own system page.
Where a check needs a browser, a provider, or a person, lists it. Name what you couldn't run.
references/verify.md应用已构建。但尚未证明它能正常工作。你刚完成的每个Verify部分都是编写代码的Agent自行确认的,回忆不是证据——应用可能满足所有检查但无法编译。
references/verify.md有两个要点足够重要,需要在此说明,因为任何一个出错都会造成损害:
- 先检查架构再构建。 会先执行
build,因此如果架构编辑未生成就执行构建,会应用无人审核的SQL——这是db:migrate中明确禁止的操作,却被本应发现问题的步骤执行。references/database.md - 用户先注册,再创建测试账户。 第一个创建的账户会成为管理员。如果测试账户占据该位置然后被删除,会导致用户无法访问自己的系统页面。
如果检查需要浏览器、服务商或人工操作,中会列出。说明无法执行的检查项。
references/verify.mdStep 7 — Fresh eyes
步骤7 — 第三方检查
The gate proves the app builds, serves and answers. It cannot tell whether the app does anything — an empty project passes every command in it, because nothing leaks when there is nothing to leak. So the last check is the one the builder cannot perform on itself.
Dispatch the critics in a single message so they run at once, the same way Step 2 does: promise-keeping and looks-like-theirs always, ownership wherever there is sign-in, operability scaled to the branches that ran. The briefs are in .
references/verify.mdThey check the app against the Step 3 build sheet, and against nothing else. That sheet is the only bar here, because it is the one thing the user actually approved — and they approved a description of an app without being able to read the code they were handed. Closing exactly that gap is the whole job. Critics report where the app diverges from the sheet; they never propose a different sheet. Anything that would change what the app is goes to the user at hand-off, the same as it would have gone to them at Step 3.
They read evidence, not the running app. Four agents cannot share a port or a browser between them, so capture everything once during Step 6 and hand it over. Findings come back as , or ; only the first two are fixed now, and no fix widens the gate or changes scope.
brokenmissingworth knowingTwo rounds, then stop and report what's left. A third round is where an agent starts editing code it doesn't understand to make a report go away. Tell the user this step is happening, in one line — otherwise they are watching a terminal do nothing.
验证环节证明了应用可构建、可部署并响应请求。但无法证明应用能实现功能——空项目能通过所有命令,因为没有内容可泄漏。因此最后一步是构建者无法自行完成的检查。
一次性发送消息让检查Agent同时运行,就像步骤2一样:始终检查是否符合承诺和用户专属风格,有登录功能时检查权限,根据执行的分支检查可操作性。任务说明在中。
references/verify.md它们仅根据步骤3的构建方案检查应用,不参考其他内容。 该方案是唯一的标准,因为这是用户实际批准的内容——且用户批准的是应用描述,而非他们无法阅读的代码。填补这一空白正是整个任务的目的。检查Agent报告应用与方案的差异;绝不提出不同的方案。任何会改变应用本质的内容都在交付时告知用户,就像步骤3时一样。
它们基于证据检查,而非运行中的应用。四个Agent无法共享端口或浏览器,因此在步骤6中一次性捕获所有内容并提供给它们。检查结果分为、或;仅修复前两者,且修复不得扩大范围或变更需求。
brokenmissingworth knowing最多两轮,然后停止并报告剩余问题。 第三轮会导致Agent开始修改它不理解的代码以消除报告。用一句话告知用户正在执行此步骤——否则他们会看到终端无响应。
Step 8 — Hand off
步骤8 — 交付
- Every check that could not be run is named, with what it would need — a browser, a domain, a payment key — as a short list they can work through in a minute once the app is open. Findings left unfixed after Step 7, and any finding you disagreed with, go here too, one line each with the reason.
- Anything Step 2's research contradicted, or any reference command that had to be changed on the fly, is named at the end — which file, what was wrong — so this skill can be corrected. Say it to the user in one line; they may be the person who fixes it.
- Legal branch: say once, plainly, that the privacy and terms pages are a first draft assembled from what the app actually does rather than legal advice. Then list the fields in that only they can fill — usually a contact address and whose law governs the terms — as a short thing they can clear in a minute. Where there is no cookie banner, give the one-line reason and what would change it: "nothing here tracks anyone, so there's nothing to consent to — add analytics later and it'll need one."
src/lib/legal.ts - Discoverability, kept out of search: name the two places the switch lives — in
robots: { index: false }andsrc/app/layout.tsx— as the thing to change if the app ever goes public. Left in place on a launched product it costs them every visitor they were expecting, and it is invisible.src/app/robots.ts - Discoverability, public: say plainly that a sitemap is an invitation and not a ranking, that is a proposed convention no major AI crawler has committed to reading, and that what a crawler is actually permitted to do lives in
llms.txtalone. Point them at the preview card once — it is what a shared link looks like, and it is the first thing they'll see the app judged by.robots.txt - Docs branch: say how many pages there are and that they are true today, which makes them the first thing to go stale. If writing any page was hard because the flow needed explaining, say which one — that is a finding about the app, not about the page.
- Say once, in a line, that this build read from the maintainers' own skills — shadcn's, Vercel's, Better Auth's, the AI SDK's and MCP's — installed once at Step 2a and now available in every project on this machine, refreshed with . Nothing was added to the app's own folder. Name
npx skills update -gas the one that hasn't been used yet: it is what puts the app online when they're ready.deploy-to-vercel - Close with a plain-language summary: how to start the app (including if Postgres is in Docker), what each entry in
pnpm db:upis for, and two or three sensible next steps..env - Point at in one line: it's the app's look written down,
DESIGN.mdandAGENTS.mdpoint any agent at it, and changing a colour there and inCLAUDE.mdrestyles every page at once. Say which parts came from them and which you proposed — those are the ones most likely to want changing.globals.css - Show them the system page and say what it's for. It is the answer to "why didn't that email arrive?" and "is that still running?", and they will not find it on their own.
- Where local and production differ, spell out the one-time switch: connect a Blob store for uploads, point at a hosted database, swap payment keys out of test mode, add the Resend key once the domain is verified, add the Inngest keys and sync the app, point
POSTGRES_URLat the real domain so agent tokens are issued for it, and setBETTER_AUTH_URLto the same real domain so the sitemap, canonical links and preview card aren't full ofAPP_URL. Each is a setting on the host, not a code change — say that, because it's the part people expect to be hard. The two that also need an action outside the host are verifying the email domain in DNS and syncing the app with Inngest after the first deploy; call those out by name.localhost
- 明确说明所有无法执行的检查项及所需条件——如浏览器、域名、支付密钥——作为用户打开应用后可在一分钟内完成的简短列表。步骤7后未修复的问题,以及你不同意的任何问题,也在此说明,每个问题一句话并说明原因。
- 步骤2的研究与之矛盾的任何内容,或任何需要临时修改的参考命令,都在最后说明——哪个文件、哪里出错——以便修正本技能。用一句话告知用户;他们可能就是修正的人。
- 法律分支:明确说明隐私和服务条款页面是根据应用实际功能组装的初稿,而非法律建议。然后列出中只有用户能填写的字段——通常是联系地址和管辖法律——作为用户可在一分钟内完成的简短任务。如果没有Cookie提示,说明原因及变更条件:“这里没有跟踪任何人,因此无需同意——后续添加分析功能后需要Cookie提示。”
src/lib/legal.ts - 禁止搜索引擎收录的应用:说明开关所在的两个位置——中的
src/app/layout.tsx和robots: { index: false }——作为应用公开时需要修改的内容。如果在已发布的产品中保持此设置,会导致用户失去所有预期访客,且此设置不可见。src/app/robots.ts - 公开可发现的应用:明确说明站点地图是邀请而非排名,是尚未被主要AI爬虫承诺支持的提议规范,爬虫实际允许执行的操作仅由
llms.txt决定。提及预览卡片一次——这是链接分享时的显示效果,也是用户首先评判应用的地方。robots.txt - 文档分支:说明文档页数,并说明它们当前是准确的,这意味着它们是最先过时的内容。如果编写某个页面时因流程需要解释而困难,说明该页面——这是关于应用的发现,而非页面本身。
- 用一句话说明本次构建使用了维护者提供的技能——shadcn、Vercel、Better Auth、AI SDK和MCP的技能——在步骤2a中全局安装一次,现在可用于此机器上的所有项目,使用刷新。未向应用文件夹添加任何内容。提及
npx skills update -g是尚未使用的技能:这是他们准备好后将应用部署到线上的工具。deploy-to-vercel - 用通俗语言总结:如何启动应用(如果使用Docker中的Postgres,包括)、
pnpm db:up中每个条目的用途,以及2-3个合理的下一步操作。.env - 用一句话指向:这是应用视觉风格的书面记录,
DESIGN.md和AGENTS.md指向该文件,修改其中的颜色并同步到CLAUDE.md可一次性重新设置所有页面的样式。说明哪些部分来自用户,哪些是你提议的——这些是最可能需要修改的部分。globals.css - 向用户展示系统页面并说明用途。这是“为什么邮件没发送?”和“它还在运行吗?”的答案,用户自己找不到。
- 如果本地和生产环境有差异,说明一次性切换的步骤:连接Blob存储用于上传、将指向托管数据库、将支付密钥从测试模式切换为生产模式、验证域名后添加Resend密钥、添加Inngest密钥并同步应用、将
POSTGRES_URL指向真实域名以便Agent令牌针对该域名颁发、将BETTER_AUTH_URL设置为同一真实域名以便站点地图、规范链接和预览卡片不包含APP_URL。每个步骤都是托管平台的设置,而非代码变更——说明这一点,因为人们通常认为这部分很难。其中两个步骤还需要在托管平台外执行:在DNS中验证邮件域名,首次部署后同步应用与Inngest;单独列出这两个步骤。localhost