.cursor/skills/project-slimming/SKILL.md
Safely slim down projects by removing redundant files and dependencies while ensuring delivery readiness and functionality. Use when the user asks for project slimming, cleanup, reducing project size, or preparing for delivery after testing.
npx skillsauth add Aafff623/pet-adoption-app project-slimmingInstall 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.
.gitignore 排除,而非物理删除;删除前需确认无引用- [ ] 运行构建命令(如 npm run build)成功
- [ ] 运行开发命令(如 npm run dev)成功
- [ ] 核心功能可正常访问(至少做一次冒烟验证)
- [ ] 如有测试:npm test 通过
任一失败则不得进入删除阶段,先修复问题。
| 目标 | 说明 | .gitignore 条目 |
|------|------|-----------------|
| 构建产物 | 每次 build 可重建 | dist/ dist-ssr/ build/ out/ |
| 依赖目录 | npm install 可重建 | node_modules/ |
| 本地环境 | 含敏感信息,不提交 | .env.local *.local |
| 日志/缓存 | 运行时生成 | *.log .playwright-mcp/ .vite/ .cache/ |
| IDE/系统 | 个人配置 | .cursor/ agent-transcripts/ .idea/ .DS_Store |
操作:在 .gitignore 中补充缺失项,不删除已有文件。
npx depcheck 检查未使用依赖package.json 移除npm run build 验证| 类型 | 操作 | 验证方式 | |------|------|----------| | 图片 | 压缩大图、转 WebP | 页面加载正常、无 404 | | 未使用资源 | 搜索引用后删除 | 构建成功、无 404 | | 重复资源 | 合并后删除冗余 | 功能正常 |
禁止:删除 public/ 下被路由或配置引用的文件。
| 操作 | 前置条件 | |------|----------| | 删除未使用组件/页面 | 已确认无路由、无 import | | 删除死代码 | 已确认无动态调用、无反射引用 | | 合并重复逻辑 | 已做回归验证 |
禁止:删除被 index、动态 import、路由配置引用的文件。
| 操作 | 说明 | |------|------| | 合并过时文档 | 将有效内容并入 README 或 docs 后删除 | | 整理 SQL 迁移 | 合并已应用的迁移,保留可追溯版本 | | 清理部署配置 | 移除无用规则,保留必要配置 |
禁止:删除数据库 schema、种子数据等生产依赖文件。
对任何待删除文件/目录:
.gitignore 中?若在,可只更新 .gitignore,不物理删除| 项目类型 | 可安全排除 | 禁止删除 | |----------|------------|----------| | Vite/React | dist, node_modules, .env.local | .env.local.example, public 被引用资源 | | 含 Supabase | 同上 | schema.sql, supabase/.sql(未确认前) | | 含 Playwright | .playwright-mcp, test-results | playwright.config. |
# 构建
dist/
dist-ssr/
build/
out/
# 依赖
node_modules/
# 本地环境
.env.local
*.local
# 工具/缓存
.playwright-mcp/
.vite/
.cache/
*.log
# IDE/系统
.cursor/
agent-transcripts/
.DS_Store
.idea
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 的链接、部署步骤、项目结构。