create-new-project

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

create-new-project

创建新项目

When to use

使用场景

Use this skill whenever the user wants to start a new web app using the standard stack:
  • Next.js (App Router) + TypeScript
  • Tailwind CSS + shadcn/ui
  • Supabase (Postgres, Auth, Storage, Realtime)
  • Deploy on Vercel
  • API routes in Next.js for internal + third-party integrations
当用户想要使用以下标准技术栈启动新Web应用时,使用此技能:
  • Next.js (App Router) + TypeScript
  • Tailwind CSS + shadcn/ui
  • Supabase (Postgres、身份验证、存储、实时功能)
  • 部署至Vercel
  • 用于内部及第三方集成的Next.js API路由

What you must ask (minimal)

必须询问的内容(最少项)

Ask only what is necessary:
  1. Project name (kebab-case recommended)
  2. Package manager: pnpm (default) / npm
  3. Supabase mode:
    • "local-first" (init Supabase locally + migrations)
    • "cloud-only" (create env placeholders; user will link later)
If the user explicitly wants external integrations, confirm:
  • "public API for third-party order creation" yes/no (default: yes)
仅询问必要信息:
  1. 项目名称(推荐使用短横线分隔的kebab-case格式)
  2. 包管理器:pnpm(默认)/ npm
  3. Supabase模式:
    • "local-first"(本地初始化Supabase + 迁移脚本)
    • "cloud-only"(创建环境变量占位符;用户后续自行关联)
如果用户明确需要外部集成,请确认:
  • 是否需要「用于第三方订单创建的公开API」(默认:是)

Execution plan (do this in order)

执行步骤(按顺序操作)

  1. Create the project folder using the script (pick the right OS reminder):
    • macOS/Linux/Git-Bash/WSL:
      bash scripts/create-new-project.sh <name>
    • Windows PowerShell:
      powershell -ExecutionPolicy Bypass -File scripts/create-new-project.ps1 -Name <name>
  2. Ensure the scaffold includes:
    • Next.js app (App Router) + Tailwind
    • shadcn/ui initialized
    • Supabase client helpers (server + browser)
    • .env.example
      +
      .env.local
      placeholders (never commit secrets)
    • Supabase migration file with baseline schema for orders/sales (multi-tenant ready)
    • Example API routes:
      • /api/v1/orders
        (authenticated internal)
      • /api/v1/public/orders
        (API key for third-party callers)
  3. After generation, run:
    • install deps (if not already)
    • pnpm dev
      (or npm) quick smoke test
    • if Supabase CLI present and local-first:
      supabase init
      and confirm migration file exists
  4. Output to the user:
    • what was created (high-level)
    • exact next steps to connect Supabase Cloud + Vercel env vars
    • how to call the public API endpoint from another system
  1. 使用脚本创建项目文件夹(根据操作系统选择对应提示):
    • macOS/Linux/Git-Bash/WSL:
      bash scripts/create-new-project.sh <name>
    • Windows PowerShell:
      powershell -ExecutionPolicy Bypass -File scripts/create-new-project.ps1 -Name <name>
  2. 确保模板包含以下内容:
    • Next.js应用(App Router)+ Tailwind
    • 已初始化的shadcn/ui
    • Supabase客户端工具(服务端 + 浏览器端)
    • .env.example
      +
      .env.local
      环境变量占位符(切勿提交敏感信息)
    • 包含订单/销售基准架构的Supabase迁移文件(支持多租户)
    • 示例API路由:
      • /api/v1/orders
        (需身份验证的内部接口)
      • /api/v1/public/orders
        (供第三方调用的API密钥验证接口)
  3. 项目生成后,执行以下操作:
    • 安装依赖(若未自动安装)
    • 运行
      pnpm dev
      (或npm dev)进行快速冒烟测试
    • 若已安装Supabase CLI且采用local-first模式:执行
      supabase init
      并确认迁移文件存在
  4. 向用户输出以下内容:
    • 已创建的内容(概要)
    • 关联Supabase Cloud + Vercel环境变量的具体后续步骤
    • 如何从其他系统调用公开API端点

Guardrails

注意事项

  • Do NOT add next-themes/react-day-picker unless versions are compatible with the chosen React/Next baseline.
  • Do NOT commit
    .env.local
    , Supabase service role keys, or Vercel tokens.
  • Keep the project "boring": simple, predictable, production-ready defaults.
  • 除非与所选React/Next基础版本兼容,否则请勿添加next-themes/react-day-picker。
  • 请勿提交
    .env.local
    、Supabase服务角色密钥或Vercel令牌。
  • 保持项目「简洁实用」:采用简单、可预测的生产就绪默认配置。

References

参考资料

  • See
    references/STACK.md
    for backend/API model on Vercel + Supabase.
  • See
    references/DB_SCHEMA.sql
    for schema + RLS-ready patterns.
  • 查看
    references/STACK.md
    获取Vercel + Supabase的后端/API模型。
  • 查看
    references/DB_SCHEMA.sql
    获取架构及支持RLS的实现模式。