.cursor/skills/deploy/SKILL.md
Guides Vercel deployment and PWA setup for petconnect-app. Use when deploying to Vercel, configuring PWA, adding to home screen, or troubleshooting deployment/auth/AI issues.
npx skillsauth add Aafff623/pet-adoption-app deployInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
触发词:部署、Vercel、PWA、发布、上线、vercel 部署、PWA 安装
pet-adoption-app)main| 配置项 | 值 |
|--------|-----|
| Framework Preset | Vite(自动检测) |
| Build Command | npm run build |
| Output Directory | dist |
| Root Directory | ./ |
项目已有 vercel.json,可覆盖上述配置。
在 Vercel → Settings → Environment Variables 添加:
| Key | 必填 | 说明 |
|-----|:----:|------|
| VITE_SUPABASE_URL | 是 | Supabase 项目 URL |
| VITE_SUPABASE_ANON_KEY | 是 | Supabase Anon Key |
| VITE_LLM_PROVIDER | 否 | deepseek / doubao / gemini,默认 deepseek |
| VITE_DOUBAO_API_KEY | doubao 时 | 豆包 API Key |
| VITE_DOUBAO_MODEL_ID | doubao 时 | 豆包推理接入点 ID(ep-xxx 或预置模型 ID) |
| VITE_DEEPSEEK_API_KEY | deepseek 时 | DeepSeek API Key |
| VITE_GEMINI_API_KEY | gemini 时 | Gemini API Key |
注意:环境变量修改后必须 Redeploy 才能生效(Vite 在构建时注入)。
部署完成后,在 Supabase Dashboard → Authentication → URL Configuration:
https://<你的项目>.vercel.app/(如 https://pet-adoption-app-omega.vercel.app/)否则登录/注册后重定向会失败。
项目已集成 vite-plugin-pwa,vite.config.ts 中已配置 VitePWA 插件及 manifest。
图标位于 public/pets/:
| 文件 | 用途 |
|------|------|
| pwa-192x192.png | Manifest 小图标 |
| pwa-512x512.png | Manifest 主图标 |
| favicon.ico | 浏览器标签页 |
| apple-touch-icon.png | iOS 主屏幕 |
完整坑点见 reference.md。
| 坑点 | 快速处理 |
|------|----------|
| 提交信息乱码 | 提交信息请使用英文;若已乱码,用 git commit -F <文件> 修正,见 github-batch-commits |
| AI 回复失败 | 配置 VITE_LLM_* 环境变量并 Redeploy |
| 注册成功登录失败 | Supabase 邮箱未验证,查 auth.users.email_confirmed_at |
| 登录重定向失败 | Supabase Redirect URLs 添加 Vercel 域名 |
| 环境变量不生效 | 修改后必须 Redeploy |
部署前:
部署后:
调试:
execute_sql 查 auth.users、profiles[PetConnect Doubao] 日志tools
Guides Supabase usage in petconnect-app including MCP tool calls, migrations, RLS, and API layer conventions. Use when working with Supabase, executing SQL, applying migrations, list_tables, execute_sql, RLS policies, or database schema changes.
tools
项目仓库瘦身与规范。Use when cleaning repo, optimizing .gitignore, removing large files, or organizing project structure. 约定:脚本仅用 PowerShell / npm 跨平台命令,不生成 .sh 文件。
development
Generates professional README files by synthesizing standard-readme, Best-README-Template, Google styleguide, and GitHub best practices. Use when creating or redesigning README.md, documenting projects, or when the user asks for README templates or best practices.
development
专业处理 README 与部署文档。Use when writing README, deployment guides, environment variable docs, or project structure documentation. 约定:README 必须包含环境变量表、获取 API Key 的链接、部署步骤、项目结构。