Skip to content
Back to skills

Commit

ASecurity

Git 提交助手技能:自动分析代码变更,生成符合 Conventional Commits 规范的提交信息,支持中英文,支持多文件变更的分组提交。

  • 121 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added October 16, 2026
ai-agentsgogitapici/cd

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 16, 2026

npx -y skills add alexanderizh/spark-agent --skill commit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Commit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Commit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/alexanderizh-commit/badge)](https://www.skillsdirectory.com/skills/alexanderizh-commit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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.md2.1 KB
  • manifest.json102 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.