Agent skill
smart-commit
Splits uncommitted changes into multiple logical commits by functionality. Use when asked to organize commits, split changes, or create atomic commits.
Install this agent skill to your Project
npx add-skill https://github.com/meglinge/megskills/tree/main/skills/smart-commit
SKILL.md
Smart Commit
将未提交的更改按功能/逻辑分成多个独立的 commit。
工作流程
-
分析更改
- 运行
git status查看所有未提交的文件 - 运行
git diff和git diff --cached查看具体更改内容
- 运行
-
分类更改
- 阅读每个文件的更改内容
- 按功能/逻辑将更改分组:
- 新功能
- Bug 修复
- 重构
- 文档更新
- 配置变更
- 测试相关
- 样式/格式化
-
逐组提交
- 对每组相关更改:
bash
git add <相关文件...> git commit -m "<type>: <简洁描述>" - 如果单个文件包含多个功能的更改,使用
git add -p分块暂存
- 对每组相关更改:
Commit 消息格式
使用 Conventional Commits 格式:
feat: 添加用户登录功能fix: 修复分页计算错误refactor: 重构数据库连接逻辑docs: 更新 API 文档test: 添加用户模块单元测试chore: 更新依赖版本style: 格式化代码
注意事项
- 每个 commit 应该是独立的、可编译的
- 相关的更改放在同一个 commit
- 不相关的更改分开提交
- commit 消息要清晰描述更改内容
- 提交前确认分组是否合理
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
deep-analysis
Uses multiple parallel finder agents and multiple oracle consultations simultaneously for broad analysis. Use when asked to search from multiple angles, investigate across many files, or need parallel multi-perspective analysis.
iterative-analysis
Performs sequential multi-round oracle analysis where each round builds on previous findings. Use when user specifies analysis count (e.g., "analyze 5 times"), asks to think repeatedly, or needs progressive refinement.
scaffold-exercises
Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
obsidian-vault
Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
Didn't find tool you were looking for?