跳到正文
Skillpedia
部署与云(DevOps)10k · #11999

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/unoplatform/uno/blob/master/.claude/skills/speckit-git-commit/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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:

  1. Determines the event name from the hook context (e.g., if invoked as an after_specify hook, the event is after_specify; if before_plan, the event is before_plan)
  2. Checks .specify/extensions/git/git-config.yml for the auto_commit section
  3. Looks up the specific event key to see if auto-commit is enabled
  4. Falls back to auto_commit.default if no event-specific key exists
  5. Uses the per-command message if configured, otherwise a default message
  6. 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
常见问题

我需要开启它吗?

自动提交由配置文件控制。它可以对所有步骤开启,也可以只对部分步骤开启。

如果没有更改会怎样?

当没有未提交的更改时,这个技能不做任何操作。

我可以修改提交说明吗?

可以。每个步骤都可以在配置中设置自己的提交说明。

详情

作者的原始描述

Auto-commit changes after a Spec Kit command completes

repo: unoplatform/uno

热度

GitHub 星标
10k
排名
#11999
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能