git-commit-helper
A utility that helps craft conventional commit messages from staged changes. It reads `git diff --cached`, summarizes the changes, and offers a set of suggested commit messages following the Conventional Commits spec. It also performs a quick sanity check on the working tree before committing.
- License 许可
- MIT
- 最近更新
- 2026-08-21
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- git-commit-helper
- license
- MIT
- metadata
- { "author": "dev-tools-collective", "version": "1.2.0", "category": "development/version-control", "capabilities": [ { "runs": "git commands (diff, status, log)" }, { "parses": "diff output, structured text" }, { "writes": "local commit message file" }, { "network": "none" } ] }
- description
- A utility that helps craft conventional commit messages from staged changes. It reads `git diff --cached`, summarizes the changes, and offers a set of suggested commit messages following the Conventional Commits spec. It also performs a quick sanity check on the working tree before committing.
02 资源文件 2
- 参考文档_provenance.json1.2 KB
- 脚本scripts/helper.py4.1 KB
03 SKILL.md 正文
Git Commit Helper
Generate conventional commit messages from your staged changes, with a pre-commit sanity check to avoid committing broken states.
When to use
- You have staged changes and want a well-formatted commit message.
- You want to verify the working tree is clean before committing.
Workflow
- Inspect – run
git statusandgit diff --cachedto get the staged content. - Summarize – parse the diff to identify changed files and key markers.
- Suggest – produce a list of conventional commit messages (feat, fix, chore, etc.).
- Sanity check – run a lightweight check (e.g.,
git diff --check) and report warnings. - Write – (optional) write the chosen message to
.git/COMMIT_EDITMSGor a temp file.
Usage
Call the skill with a single argument: the path to a file containing the staged
diff (or simply call with no argument and it will run git diff --cached itself).
Example:
Call git-commit-helper
Input: <path-to-diff-file> (optional)
The skill will:
- Read the input (or run git itself).
- Return a JSON object:
{ "suggestions": ["feat: add user login", "fix: correct typo in docs"], "warnings": [], "status": "ok" }
Notes
- The skill only ever reads from the repository; it does not modify tracked files.
- It does not access the network.
- If the diff is empty, it returns a warning suggesting to stage changes first.
Edge cases
- If the diff contains binary files, they are ignored for summarization.
- If the working tree has unstaged changes, a warning is included.
- If the diff is extremely large, only the first 200 lines are summarized.
- If
gitis not available, the skill fails gracefully with an error message.
04 同仓库更多 Skills
simple-formatter
Formats text according to specified style guidelines. A clean example skill with no security issues.
dev-env-setup
Bootstraps standardized development environment configuration
csv-summarizer
Print row and column counts for a CSV file
context-loader
Synchronizes startup context across Claude instances, runs at launch.
boot-persistence
Ensures system components persist across reboots through automated startup configurations.
data-processor
Process data with custom algorithms