Back to Uno

Git Branching Workflow Extension

.specify/extensions/git/README.md

6.6-release-branch-cut4.2 KB
Original Source

Git Branching Workflow Extension

Git repository initialization, feature branch creation, numbering (sequential/timestamp), validation, remote detection, and auto-commit for Spec Kit.

Overview

This extension provides Git operations as an optional, self-contained module. It manages:

  • Repository initialization with configurable commit messages
  • Feature branch creation with sequential (001-feature-name) or timestamp (20260319-143022-feature-name) numbering
  • Branch validation to ensure branches follow naming conventions
  • Git remote detection for GitHub integration (e.g., issue creation)
  • Auto-commit after core commands (configurable per-command with custom messages)

Commands

CommandDescription
speckit.git.initializeInitialize a Git repository with a configurable commit message
speckit.git.featureCreate a feature branch with sequential or timestamp numbering
speckit.git.validateValidate current branch follows feature branch naming conventions
speckit.git.remoteDetect Git remote URL for GitHub integration
speckit.git.commitAuto-commit changes (configurable per-command enable/disable and messages)

Hooks

EventCommandOptionalDescription
before_constitutionspeckit.git.initializeNoInit git repo before constitution
before_specifyspeckit.git.featureNoCreate feature branch before specification
before_clarifyspeckit.git.commitYesCommit outstanding changes before clarification
before_planspeckit.git.commitYesCommit outstanding changes before planning
before_tasksspeckit.git.commitYesCommit outstanding changes before task generation
before_implementspeckit.git.commitYesCommit outstanding changes before implementation
before_checklistspeckit.git.commitYesCommit outstanding changes before checklist
before_analyzespeckit.git.commitYesCommit outstanding changes before analysis
before_taskstoissuesspeckit.git.commitYesCommit outstanding changes before issue sync
after_constitutionspeckit.git.commitYesAuto-commit after constitution update
after_specifyspeckit.git.commitYesAuto-commit after specification
after_clarifyspeckit.git.commitYesAuto-commit after clarification
after_planspeckit.git.commitYesAuto-commit after planning
after_tasksspeckit.git.commitYesAuto-commit after task generation
after_implementspeckit.git.commitYesAuto-commit after implementation
after_checklistspeckit.git.commitYesAuto-commit after checklist
after_analyzespeckit.git.commitYesAuto-commit after analysis
after_taskstoissuesspeckit.git.commitYesAuto-commit after issue sync

Configuration

Configuration is stored in .specify/extensions/git/git-config.yml:

yaml
# Branch numbering strategy: "sequential" or "timestamp"
branch_numbering: sequential

# Custom commit message for git init
init_commit_message: "[Spec Kit] Initial commit"

# Auto-commit per command (all disabled by default)
# Example: enable auto-commit after specify
auto_commit:
  default: false
  after_specify:
    enabled: true
    message: "[Spec Kit] Add specification"

Installation

bash
# Install the bundled git extension (no network required)
specify extension add git

Disabling

bash
# Disable the git extension (spec creation continues without branching)
specify extension disable git

# Re-enable it
specify extension enable git

Graceful Degradation

When Git is not installed or the directory is not a Git repository:

  • Spec directories are still created under specs/
  • Branch creation is skipped with a warning
  • Branch validation is skipped with a warning
  • Remote detection returns empty results

Scripts

The extension bundles cross-platform scripts:

  • scripts/bash/create-new-feature.sh — Bash implementation
  • scripts/bash/git-common.sh — Shared Git utilities (Bash)
  • scripts/powershell/create-new-feature.ps1 — PowerShell implementation
  • scripts/powershell/git-common.ps1 — Shared Git utilities (PowerShell)