speckit-git-commit — скилл для Claude Code: что делает и установка
Скилл speckit-git-commit автоматически добавляет и коммитит изменения после команд Spec Kit. Он пригодится, когда историю Git нужно обновлять через настройки проекта.
MIT ★ 110 обновлён 2026-10-19
npx skills add alfredoperez/speckit-companion --skill speckit-git-commit -a claude-codeЧто делает speckit-git-commit
После завершения или перед запуском команды Spec Kit скилл получает имя события хука, например after_specify или before_plan. Затем он читает .specify/extensions/git/git-config.yml, проверяет общий и локальный флаги auto_commit и при наличии изменений выполняет git add . и git commit.
Сообщение берётся из настройки fixed либо создаётся в формате Conventional Commit при commit_style: conventional. Во втором режиме скилл анализирует git diff и git status, записывает сообщение во временный файл и передаёт его скрипту auto-commit.sh или auto-commit.ps1. Без каталога .specify/ структура скилла не совпадёт с проектом. Git, репозиторий и файл конфигурации нужны для автоматического коммита; при их отсутствии скилл пропускает действие или выводит предупреждение.
Какие задачи решает
- автоматически коммитить изменения после команды Spec Kit
- включать автокоммит для отдельных событий хуков
- задавать сообщения коммитов через
git-config.yml - создавать Conventional Commit по изменённому коду
Примеры запросов агенту
- После
after_specifyпроверь настройки и закоммить изменения по правиламgit-config.yml. - Для события
before_planвыполни автокоммит, если он включён в.specify/extensions/git/git-config.yml. - Сформируй сообщение Conventional Commit по
git diffи передай его скрипту без вставки текста в shell-команду.
Как установить speckit-git-commit
1Через Skills CLI (Vercel)
npx skills add alfredoperez/speckit-companion --skill speckit-git-commit -a claude-code2Вручную: положить файлы
~/.claude/skills/speckit-git-commit/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/speckit-git-commit/
1Через Skills CLI (Vercel)
npx skills add alfredoperez/speckit-companion --skill speckit-git-commit -a codex2Вручную: положить файлы
.agents/skills/speckit-git-commit/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add alfredoperez/speckit-companion --skill speckit-git-commit -a cursor2Вручную: положить файлы
.cursor/skills/speckit-git-commit/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install alfredoperez/speckit-companion .claude/skills/speckit-git-commit2Вручную: положить файлы
.github/skills/speckit-git-commit/SKILL.md1Через Skills CLI (Vercel)
npx skills add alfredoperez/speckit-companion --skill speckit-git-commit -a gemini-cli2Командой платформы
gemini skills install https://github.com/alfredoperez/speckit-companion --path .claude/skills/speckit-git-commitВручную: положить файлы
.devin/skills/speckit-git-commit/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о speckit-git-commit
Как установить speckit-git-commit в Claude Code?
Выполните npx skills add alfredoperez/speckit-companion --skill speckit-git-commit -a claude-code, затем проверьте файл ~/.claude/skills/speckit-git-commit/SKILL.md.
Что делает speckit-git-commit?
Скилл отслеживает события хуков Spec Kit, читает настройки автокоммита и при включённой опции добавляет изменения через git add ., а затем создаёт коммит.
Что произойдёт, если Git недоступен или изменений нет?
Скилл пропустит действие и выведет предупреждение, если Git недоступен или каталог не является репозиторием. При отсутствии изменений коммит также не создаётся.
Исходный текст
SKILL.md · MIT
---
name: speckit-git-commit
description: Auto-commit changes after a Spec Kit command completes
compatibility: Requires spec-kit project structure with .specify/ directory
metadata:
author: spec-kit-core
source: extension:git
user-invocable: true
disable-model-invocation: false
---
# Git Commit Skill
# 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. Determines the commit message based on `commit_style` (see below)
6. If enabled and there are uncommitted changes, runs `git add .` + `git commit`
## Commit Message Styles
Controlled by the `commit_style` key in `.specify/extensions/git/git-config.yml`:
- **`fixed`** (default): use the per-command `message` if configured, otherwise a generic `[Spec Kit] Auto-commit <phase> <command>` message.
- **`conventional`**: inspect the actual changes (`git diff` / `git status`) since the last commit and generate a single-line [Conventional Commit](https://www.conventionalcommits.org/) message (`type(scope): subject`, e.g. `feat: add OAuth specification` or `docs: update implementation plan`) that accurately summarizes the change. Write this message to a temporary file and pass the file's path to the script (see Execution below). The configured `message` values are ignored in this mode.
## 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> [--message-file <path>]`
- **PowerShell**: `.specify/extensions/git/scripts/powershell/auto-commit.ps1 <event_name> [-MessageFile <path>]`
Replace `<event_name>` with the actual hook event (e.g., `after_specify`, `before_plan`, `after_implement`). Only pass a generated message when `commit_style: conventional` is configured — first check `.specify/extensions/git/git-config.yml` for the value of `commit_style`:
- If `conventional`: inspect the diff and generate a Conventional Commit message. **Do not interpolate the generated message directly into a shell command string** — its content is derived from repository changes and may contain characters (quotes, `$(...)`, backticks) that a shell would execute or that would break command quoting. Instead, write the message to a temporary file using your file-editing tool (not a shell `echo`/`printf`), then pass that file's path via `--message-file <path>` (Bash) or `-MessageFile <path>` (PowerShell).
- If `fixed` or absent: run the script with just `<event_name>`; it uses the configured/static message.
## Configuration
In `.specify/extensions/git/git-config.yml`:
```yaml
# "fixed" (default) uses the messages below; "conventional" asks the agent
# to generate a Conventional Commit message from the diff instead.
commit_style: fixed
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
- If `commit_style: conventional` is set and no generated message was supplied: fails with a clear error instead of silently falling back to the fixed message format
© spec-kit-core · MIT · alfredoperez/speckit-companion