Files
Manfred Riem 4038d370bf chore: align CI Python matrix with devguide lifecycle + fix bash 3.2 portability (#3244)
* chore: align CI Python matrix with devguide release lifecycle

Run the pytest matrix only on the bugfix (maintenance) releases — 3.13
and 3.14 — instead of 3.11/3.12/3.13, and point the ruff lint job at the
latest interpreter (3.14). The supported floor stays at requires-python
>= 3.11 (oldest non-EOL security release): older security versions are
supported by claim and fixed reactively rather than gated on a wide
per-commit matrix. Also add macos-latest to the OS matrix so macOS
regressions are caught.

Assisted-by: GitHub Copilot (model: Claude Opus 4.8, autonomous)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: make bash scripts portable to bash 3.2 (macOS system /bin/bash)

Adding macos-latest to the CI matrix surfaced two pre-existing bash 3.2
incompatibilities (macOS ships bash 3.2 as /bin/bash):

1. update-agent-context.sh embedded Python heredocs inside $(...) command
   substitution. bash 3.2 mis-parses an apostrophe in a heredoc body
   nested in $(...), failing with "unexpected EOF while looking for
   matching `''". Removed the apostrophes from the affected $()-nested
   heredoc body and documented the constraint to prevent regressions.

2. create-new-feature-branch.sh and create-new-feature.sh used the
   bash 4+ ${word^^} uppercase parameter expansion, which errors as a
   "bad substitution" on bash 3.2 and caused short uppercase acronyms
   (e.g. "GO") to be dropped from derived branch names. Replaced with a
   portable `tr '[:lower:]' '[:upper:]'` pipeline.

Verified the full test suite passes under bash 3.2.57 and shellcheck
(--severity=error) is clean.

Assisted-by: GitHub Copilot (model: Claude Opus 4.8, autonomous)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: address review feedback on bash 3.2 portability changes

- create-new-feature.sh: replace the non-portable `\b...\b` grep
  word-boundary (BSD grep treats `\b` as a backspace, so the acronym
  branch could silently fail) with `grep -qw`, matching its twin
  create-new-feature-branch.sh, and pipe the description via
  `printf '%s'` instead of `echo`.
- create-new-feature-branch.sh: switch the acronym check to
  `printf '%s'` as well so both twins are identical and avoid `echo`
  on user-provided text.
- update-agent-context.sh: reword the apostrophe-free self-seeding
  comment to be clearer and less easy to misread.

Verified under bash 3.2.57 (full bash-script suite green) and
shellcheck --severity=error.

Assisted-by: GitHub Copilot (model: Claude Opus 4.8, autonomous)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-30 06:43:48 -05:00
..

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

Command Description
speckit.git.initialize Initialize a Git repository with a configurable commit message
speckit.git.feature Create a feature branch with sequential or timestamp numbering
speckit.git.validate Validate current branch follows feature branch naming conventions
speckit.git.remote Detect Git remote URL for GitHub integration
speckit.git.commit Auto-commit changes (configurable per-command enable/disable and messages)

Hooks

Event Command Optional Description
before_constitution speckit.git.initialize No Init git repo before constitution
before_specify speckit.git.feature No Create feature branch before specification
before_clarify speckit.git.commit Yes Commit outstanding changes before clarification
before_plan speckit.git.commit Yes Commit outstanding changes before planning
before_tasks speckit.git.commit Yes Commit outstanding changes before task generation
before_implement speckit.git.commit Yes Commit outstanding changes before implementation
before_checklist speckit.git.commit Yes Commit outstanding changes before checklist
before_analyze speckit.git.commit Yes Commit outstanding changes before analysis
before_taskstoissues speckit.git.commit Yes Commit outstanding changes before issue sync
after_constitution speckit.git.commit Yes Auto-commit after constitution update
after_specify speckit.git.commit Yes Auto-commit after specification
after_clarify speckit.git.commit Yes Auto-commit after clarification
after_plan speckit.git.commit Yes Auto-commit after planning
after_tasks speckit.git.commit Yes Auto-commit after task generation
after_implement speckit.git.commit Yes Auto-commit after implementation
after_checklist speckit.git.commit Yes Auto-commit after checklist
after_analyze speckit.git.commit Yes Auto-commit after analysis
after_taskstoissues speckit.git.commit Yes Auto-commit after issue sync

Configuration

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

# 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

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

Disabling

# 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-branch.sh — Bash implementation (branch creation only)
  • scripts/bash/git-common.sh — Shared Git utilities (Bash)
  • scripts/powershell/create-new-feature-branch.ps1 — PowerShell implementation (branch creation only)
  • scripts/powershell/git-common.ps1 — Shared Git utilities (PowerShell)