Skip to main content
skill CX Codex

speckit-git-commit — Claude Code skill: what it does, how to install

The speckit-git-commit skill stages and commits project changes around Spec Kit commands. Use it when Git history should be updated from the project’s Spec Kit settings.

MIT ★ 110 updated 2026-10-19

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add alfredoperez/speckit-companion --skill speckit-git-commit -a claude-code
Open on GitHub

What speckit-git-commit does

The skill reads the hook event that triggered it, such as after_specify or before_plan, then checks .specify/extensions/git/git-config.yml. It evaluates the global auto_commit.default value and any event-specific override. When the setting allows a commit and the repository has changes, it runs git add . followed by git commit.

With commit_style: fixed, the configured per-command message is used, or the skill builds a generic Spec Kit message. With conventional, it reviews git diff and git status, writes a one-line Conventional Commit message to a temporary file, and passes that file to the Bash or PowerShell script. A .specify/ project structure is required for this setup. Git and a configured repository are also necessary for a commit; otherwise the action is skipped or reported with a warning.

What it helps with

  • commit Spec Kit changes after a hook event
  • toggle auto-commit for individual Spec Kit commands
  • set per-command messages in git-config.yml
  • generate a Conventional Commit from the current diff

Example prompts for the agent

  • After after_specify, check the project settings and commit the changes when auto-commit is enabled.
  • For before_plan, run the configured Git commit step from .specify/extensions/git/git-config.yml.
  • Create a Conventional Commit message from git diff, save it to a temporary file, and pass that file to the script.

How to install speckit-git-commit

1Skills CLI (Vercel)

npx skills add alfredoperez/speckit-companion --skill speckit-git-commit -a claude-code

2Manually: put the files in place

~/.claude/skills/speckit-git-commit/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/speckit-git-commit/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about speckit-git-commit

How do I install speckit-git-commit in Claude Code?

Run npx skills add alfredoperez/speckit-companion --skill speckit-git-commit -a claude-code, then check ~/.claude/skills/speckit-git-commit/SKILL.md.

What does speckit-git-commit do?

It handles Spec Kit hook events, reads the project’s auto-commit configuration, and stages and commits changes when the relevant setting is enabled.

What happens when Git is unavailable or there are no changes?

The skill skips the action and emits a warning when Git cannot be used or the directory is not a repository. It also skips the commit when the working tree has nothing to commit.

Source text

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

Similar skills

All skills for Git and GitHub →

From the same set83

The whole set →
install-local The install-local command for Claude Code builds and installs local speckit-companion VS Code and spec-kit extensions, bumping the patch version to trigger an editor reload banner. CX Codex +1 ★ 110repo stars speckit.companion.living-drift speckit.companion.living-drift finds capability files that changed after their living spec was last committed. Use it to spot project changes that have not made it back into the spec. CX Codex +1 ★ 110repo stars speckit.companion.resume speckit.companion.resume is a command for Claude Code that resumes spec-driven development after a pause. It carries recorded decisions forward and starts the next pipeline step. CX Codex +1 ★ 110repo stars speckit.git.commit speckit.git.commit is a Claude Code command that stages and commits changes after Spec Kit commands, according to project configuration. CX Codex +1 ★ 110repo stars bench-capture bench-capture — a command for Claude Code and Codex that captures benchmark scores after a size runs through three cells, appends them to history, regenerates the report, and resets the cells for the next round. CX Codex +1 ★ 110repo stars speckit.companion.living-validate speckit.companion.living-validate is a command for Claude Code that checks living specs and feature deltas without editing files. It flags missing scenarios, unlinked headings, and syntax issues. CX Codex +1 ★ 110repo stars publish The publish command guides a VS Code extension release, from QA checks and changelog updates to versioning and pushing a tagged commit. A separate file is available for Codex. CX Codex +1 ★ 110repo stars release-loop release-loop is a command for Claude Code and Codex that moves a batch of changes through fixes, QA, and release. It prepares a report and waits for approval before publishing. CX Codex +1 ★ 110repo stars

Project sponsors

Companies that keep this analytics open