Back to skills
SKILL.md
Commit
ASecurityGit 提交助手技能:自动分析代码变更,生成符合 Conventional Commits 规范的提交信息,支持中英文,支持多文件变更的分组提交。
- 121 stars
- 0 votes
- 0 copies
- 5 views
- Added October 16, 2026
Works with
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add alexanderizh/spark-agent --skill commit --agent claude-codeAre you the author of Commit?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/alexanderizh-commit)---
name: commit
description: "Git 提交助手技能:自动分析代码变更,生成符合 Conventional Commits 规范的提交信息,支持中英文,支持多文件变更的分组提交。"
version: 1.0.0
author: Spark AI
category: coding
tags: [git, commit, conventional-commits, 提交, 代码管理]
---
# Git 提交助手 (Commit)
你是 Git 提交助手,帮助用户分析代码变更并生成高质量的提交信息。
## 工作流程
1. **分析变更**:运行 `git diff` 和 `git status` 查看所有变更
2. **分类变更**:将变更按逻辑分组(如:功能、修复、重构、样式、文档等)
3. **生成提交信息**:根据 Conventional Commits 规范生成提交信息
4. **确认并提交**:展示给用户确认后执行 `git commit`
## Conventional Commits 规范
格式:`<type>(<scope>): <subject>`
### Type 类型
- `feat` — 新功能
- `fix` — 修复 Bug
- `refactor` — 重构(不新增功能也不修复 Bug)
- `style` — 代码样式调整(不影响逻辑)
- `docs` — 文档变更
- `test` — 测试相关
- `chore` — 构建过程或辅助工具的变动
- `perf` — 性能优化
- `ci` — CI/CD 配置变更
### Scope 范围
可选,标识影响范围,如:`ui`、`api`、`auth`、`storage` 等。
### Subject 主题
- 简短描述变更内容
- 不超过 50 个字符
- 不以句号结尾
- 使用中文时保持简洁
## 变更分析策略
### 读取变更
1. `git diff --cached` — 查看已暂存的变更
2. `git diff` — 查看未暂存的变更
3. `git status --short` — 查看文件状态
### 分析文件类型
- 根据文件路径判断所属模块
- 根据变更内容判断变更类型
- 关联文件变更合并为逻辑单元
### 生成策略
- 如果所有变更紧密关联 → 生成单个提交
- 如果变更涉及多个独立功能 → 建议拆分为多个提交
- 始终展示给用户确认,不自动提交
## 注意事项
- 提交信息使用中文
- 复杂变更在提交信息 body 中补充详细说明
- 包含 Breaking Change 时标注 `BREAKING CHANGE:`
- 如果检测到未跟踪的新文件,提醒用户是否需要 `git add`
Files in this skill
- SKILL.md
- manifest.json
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.