speckit-git-commit
它能做什么
这个技能在 Spec Kit 步骤完成时,自动将你的项目更改保存到 Git。适合使用 Git 且希望减少手动提交的开发者。
适用场景
- ✓某个 Spec Kit 步骤完成,你希望立即把它的更改保存到 Git 的时候。
- ✓你想在配置中为特定步骤开启或关闭自动提交的时候。
- ✓你希望每个规划阶段都有各自清晰的提交说明的时候。
技能链接
https://github.com/unoplatform/uno/blob/master/.claude/skills/speckit-git-commit/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“这个规划步骤完成后,请把所有更改保存到 Git,并附上清晰的提交说明。”
每周 5 个新技能,1 分钟读完。
工作原理
这个技能检查项目配置文件,看该步骤是否开启了自动提交。如果已开启且有更改,它会暂存这些更改并进行提交。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Auto-Commit Changes
Automatically stage and commit all changes after a Spec Kit command completes.
Behavior
This command is invoked as a hook after (or before) core commands. It:
- Determines the event name from the hook context (e.g., if invoked as an
after_specifyhook, the event isafter_specify; ifbefore_plan, the event isbefore_plan) - Checks
.specify/extensions/git/git-config.ymlfor theauto_commitsection - Looks up the specific event key to see if auto-commit is enabled
- Falls back to
auto_commit.defaultif no event-specific key exists - Uses the per-command
messageif configured, otherwise a default message - If enabled and there are uncommitted changes, runs
git add .+git commit
Execution
Determine the event name from the hook that triggered this command, then run the script:
- Bash:
.specify/extensions/git/scripts/bash/auto-commit.sh <event_name> - PowerShell:
.specify/extensions/git/scripts/powershell/auto-commit.ps1 <event_name>
Replace <event_name> with the actual hook event (e.g., after_specify, before_plan, after_implement).
Configuration
In .specify/extensions/git/git-config.yml:
auto_commit:
default: false # Global toggle — set true to enable for all commands
after_specify:
enabled: true # Override per-command
message: "[Spec Kit] Add specification"
after_plan:
enabled: false
message: "[Spec Kit] Add implementation plan"
Graceful Degradation
- If Git is not available or the current directory is not a repository: skips with a warning
- If no config file exists: skips (disabled by default)
- If no changes to commit: skips with a message
常见问题
我需要开启它吗?
自动提交由配置文件控制。它可以对所有步骤开启,也可以只对部分步骤开启。
如果没有更改会怎样?
当没有未提交的更改时,这个技能不做任何操作。
我可以修改提交说明吗?
可以。每个步骤都可以在配置中设置自己的提交说明。
详情
热度
- GitHub 星标
- 10k
- 排名
- #11999
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …