Sign in
Explore
Prompts · PromptEveryday codingReviewed

speckit.git.commit

Stages and commits all changes after a Spec Kit command finishes.

Kind
Prompt
Works with
Claude Code, Codex, GitHub Copilot, Cursor, Windsurf / Devin, Cline
Source
github/spec-kit @ c00dc0551583
Path
extensions/git/commands/speckit.git.commit.md
License
MIT
Jobs
Git workflow
InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
# 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.
…