.cursor/skills/github-batch-commits/SKILL.md
Analyzes staged and modified files, groups them by feature, and guides batch commits. Use when the user says "提交到Github", "提交到 GitHub", "push to GitHub", or has many staged files from multiple features and wants to commit by feature.
npx skillsauth add Aafff623/pet-adoption-app github-batch-commitsInstall 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.
触发词:用户说「提交到Github」「提交到 GitHub」「push to GitHub」等时,执行本流程。
git commit / git push 前,必须先获得用户明确许可(例如“确认提交”“可以 push”)。git status
区分:
Changes to be committedChanges not staged for commitUntracked files使用以下启发式规则对文件分组(优先级从高到低):
| 规则 | 说明 | 示例 |
|------|------|------|
| 目录归属 | 同目录下文件通常属于同一功能 | lib/api/messages.ts + lib/api/gemini.ts → api |
| 功能前缀 | 文件名或路径含功能关键词 | add_agent_type_*.sql → agent 功能 |
| 依赖关系 | 互相 import 或引用 | ChatDetail.tsx ↔ lib/api/messages.ts → 聊天功能 |
| 类型聚合 | 同类型变更 | *.sql → schema;*.tsx → UI |
分组输出格式:
## 功能 A:xxx
- path/to/file1.ts
- path/to/file2.tsx
## 功能 B:yyy
- path/to/file3.sql
- path/to/file4.ts
对每个分组:
Commit messages must be in English only.
提交信息必须使用英文,禁止使用中文,以避免 Windows/PowerShell 下的编码乱码。
Commit message rules:
- Language : English only (no Chinese)
- Format : <type>(<scope>): <short description>
- Types : feat | fix | refactor | chore | docs | style | test
- Description: present tense, lowercase (except proper nouns)
Good: "feat(auth): add Google sign-in"
Bad : "feat(auth): 添加谷歌登录"
对每个分组依次执行:
# 1. 若文件已全部暂存,先 unstage 全部
git reset HEAD
# 2. 仅暂存当前分组文件
git add <file1> <file2> ...
# 3. 提交(使用 Conventional Commits 风格,英文描述)
git commit -m "feat(scope): short description in English"
注意:提交信息须使用英文,不得使用中文,以避免乱码。若确需非 ASCII 字符,可使用 git commit -F <UTF-8 文件>,详见 reference.md。
提交信息格式(Conventional Commits):
| 类型 | 用途 | 示例(英文) |
|------|------|-------------|
| feat(scope) | 新功能 | feat(auth): add Google sign-in |
| fix(scope) | 修复 | fix(api): handle null response |
| refactor(scope) | 重构 | refactor(utils): simplify date helpers |
| chore(scope) | 配置、依赖、脚本 | chore(config): update env example |
| docs(scope) | 文档 | docs(readme): update deploy steps |
每完成一批提交后,再次运行 git status 确认剩余文件,继续分组提交。
| 路径模式 | 建议 scope/功能名 |
|----------|-------------------|
| lib/api/*.ts | api |
| pages/*.tsx | 页面名(如 chat、messages) |
| supabase/*.sql | schema / migration |
| lib/utils/*.ts | utils |
| types.ts | 随主功能(若仅类型变更可单独 chore(types)) |
| .env*.example | config |
若 pages/ChatDetail.tsx 与 lib/api/messages.ts 同时修改,且语义相关(如聊天功能),应归入同一分组。
chore 或 fix 提交提交前:
git status 获取完整变更提交后:
git status 无遗漏git log -3 查看最近提交是否清晰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 的链接、部署步骤、项目结构。