Conversation
extensions/git extension (opt-out, auto-enabled)
There was a problem hiding this comment.
Pull request overview
This PR migrates git/branching workflow logic into a bundled extensions/git/ extension and wires it into specify init as an auto-enabled (opt-out) migration step, aiming to decouple branching behavior from core and reduce platform-specific breakages.
Changes:
- Add a new
extensions/git/extension (manifest, commands, config template, and cross-platform scripts) for feature-branch creation/validation/remote detection. - Auto-install the bundled git extension during
specify initand bundle it into the wheel viapyproject.tomlforce-include. - Update the
/speckit.specifycommand template to consult extension enablement/config and prefer extension scripts with fallback behavior.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/commands/specify.md | Updates specify command flow to check git extension enablement/config and prefer extension scripts. |
| src/specify_cli/init.py | Adds bundled-extension discovery + auto-install during specify init. |
| pyproject.toml | Bundles extensions/git into the wheel’s core_pack. |
| extensions/git/extension.yml | New extension manifest defining commands, hooks, and defaults. |
| extensions/git/config-template.yml | New user-facing config template for git extension settings. |
| extensions/git/README.md | Documentation for git extension usage, config, and behavior. |
| extensions/git/commands/speckit.git.feature.md | Command template for creating a feature branch via extension scripts. |
| extensions/git/commands/speckit.git.validate.md | Command template for validating branch naming conventions. |
| extensions/git/commands/speckit.git.remote.md | Command template for detecting git remote URL safely. |
| extensions/git/scripts/bash/create-new-feature.sh | Bash feature-creation script adapted for extension install locations. |
| extensions/git/scripts/bash/git-common.sh | Bash git-only helper functions extracted for reuse. |
| extensions/git/scripts/powershell/create-new-feature.ps1 | PowerShell feature-creation script adapted for extension install locations. |
| extensions/git/scripts/powershell/git-common.ps1 | PowerShell git-only helper functions extracted for reuse. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread |
All 9 review comments addressed in
All 818 tests pass, CodeQL clean. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
with tempfile.TemporaryDirectory() as tmpdir:
with tempfile.TemporaryDirectory() as tmpdir:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread |
All 7 review comments addressed in
All 818 tests pass, CodeQL clean. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread |
Both comments addressed in
All 818 tests pass. |
There was a problem hiding this comment.
Pull request overview
This PR introduces a bundled, opt-in extensions/git extension that encapsulates Spec Kit’s Git workflow (init/branch/validate/remote/auto-commit) and expands hook support so all core commands can participate in before/after extension hooks.
Changes:
- Add bundled
extensions/git/(manifest, commands, config templates, bash + PowerShell scripts) plus comprehensive extension-level tests. - Update extension manifest validation to allow hooks-only extensions (must provide at least one command or hook).
- Add hook-checking guidance to additional core command templates and enable local install of bundled extensions via
specify extension add <id>.
Show a summary per file
| File | Description |
|---|---|
| tests/test_extensions.py | Adds manifest validation tests for hooks-only and invalid hooks/commands types. |
| tests/extensions/git/test_git_extension.py | New test suite covering git extension manifest + scripts + bundled locator. |
| tests/extensions/git/init.py | Initializes git extension test package. |
| tests/extensions/init.py | Initializes extensions test package. |
| templates/commands/taskstoissues.md | Adds pre/post hook-check sections for tasks-to-issues command template. |
| templates/commands/constitution.md | Adds pre/post hook-check sections for constitution command template. |
| templates/commands/clarify.md | Adds pre/post hook-check sections for clarify command template. |
| templates/commands/checklist.md | Adds pre/post hook-check sections for checklist command template. |
| templates/commands/analyze.md | Adds hook-check guidance for analyze command template. |
| src/specify_cli/extensions.py | Allows manifests with hooks-only; adds stricter type checks for commands/hooks. |
| src/specify_cli/init.py | Adds _locate_bundled_extension() + installs bundled extensions before catalog fallback. |
| pyproject.toml | Force-includes extensions/git into wheel core_pack. |
| extensions/git/scripts/powershell/initialize-repo.ps1 | New PS repo init script for git extension. |
| extensions/git/scripts/powershell/git-common.ps1 | New PS git helper functions (has git, feature-branch validation). |
| extensions/git/scripts/powershell/create-new-feature.ps1 | New PS feature-branch creation script for git extension. |
| extensions/git/scripts/powershell/auto-commit.ps1 | New PS auto-commit script for git extension. |
| extensions/git/scripts/bash/initialize-repo.sh | New bash repo init script for git extension. |
| extensions/git/scripts/bash/git-common.sh | New bash git helper functions (has git, feature-branch validation). |
| extensions/git/scripts/bash/create-new-feature.sh | New bash feature-branch creation script for git extension. |
| extensions/git/scripts/bash/auto-commit.sh | New bash auto-commit script for git extension. |
| extensions/git/README.md | Documents git extension commands, hooks, config, and install/disable workflow. |
| extensions/git/git-config.yml | Default git extension configuration (auto-commit disabled by default). |
| extensions/git/extension.yml | Git extension manifest (commands + hooks + config template). |
| extensions/git/config-template.yml | Config template copied into project on install. |
| extensions/git/commands/speckit.git.validate.md | Command doc for branch validation behavior. |
| extensions/git/commands/speckit.git.remote.md | Command doc for remote URL detection behavior. |
| extensions/git/commands/speckit.git.initialize.md | Command doc for repo initialization behavior. |
| extensions/git/commands/speckit.git.feature.md | Command doc for feature-branch creation behavior. |
| extensions/git/commands/speckit.git.commit.md | Command doc for hook-driven auto-commit behavior. |
| extensions/EXTENSION-USER-GUIDE.md | Updates documented list of hook events (removes before/after_commit). |
| extensions/EXTENSION-DEVELOPMENT-GUIDE.md | Updates extension authoring guidance for hooks-only + expanded hook events. |
| extensions/EXTENSION-API-REFERENCE.md | Updates hook event reference list to include newly supported events. |
| extensions/catalog.json | Adds git extension to catalog for discoverability and updates updated_at. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 33/33 changed files
- Comments generated: 3
Ensures git init succeeds even on empty repos where nothing has been staged yet.
There was a problem hiding this comment.
Pull request overview
Adds a bundled, opt-in git extension that encapsulates Spec Kit’s git init/branching/commit workflows as extension commands + hooks, while also extending hook support across additional core commands and relaxing manifest validation to allow hooks-only extensions.
Changes:
- Introduces
extensions/git/(manifest, config template, command templates, and Bash/PowerShell scripts) plus comprehensive tests for install + script behaviors. - Updates extension manifest validation to allow “hooks-only” extensions and tightens type validation for
provides.commandsandhooks. - Adds pre/post hook discovery steps to additional core command templates and updates extension documentation/catalog metadata.
Show a summary per file
| File | Description |
|---|---|
| tests/test_extensions.py | Updates/extends manifest validation tests for hooks-only support and type checks. |
| tests/extensions/git/test_git_extension.py | New integration-style tests for bundled git extension install + scripts. |
| tests/extensions/git/init.py | Adds test package marker for git extension tests. |
| tests/extensions/init.py | Adds test package marker for extensions tests. |
| templates/commands/analyze.md | Adds before/after hook discovery instructions to analyze command template. |
| templates/commands/checklist.md | Adds before/after hook discovery instructions to checklist command template. |
| templates/commands/clarify.md | Adds before/after hook discovery instructions to clarify command template. |
| templates/commands/constitution.md | Adds before/after hook discovery instructions to constitution command template. |
| templates/commands/taskstoissues.md | Adds before/after hook discovery instructions to taskstoissues command template. |
| src/specify_cli/extensions.py | Allows hooks-only manifests; validates commands/hooks types; makes commands property resilient when absent. |
| src/specify_cli/init.py | Adds bundled-extension locator and prefers installing bundled extensions before catalog download. |
| pyproject.toml | Packages bundled extensions/git into the wheel under core_pack/extensions/git. |
| extensions/git/extension.yml | Defines the git extension’s commands, hooks, config template, and metadata. |
| extensions/git/config-template.yml | Adds template configuration file for git extension install. |
| extensions/git/git-config.yml | Adds default user-facing git extension configuration (copied on install). |
| extensions/git/README.md | Documents the git extension commands, hooks, and configuration. |
| extensions/git/commands/speckit.git.feature.md | Adds extension command template for feature branch creation via scripts. |
| extensions/git/commands/speckit.git.validate.md | Adds extension command template for validating feature branch naming. |
| extensions/git/commands/speckit.git.remote.md | Adds extension command template for remote URL detection. |
| extensions/git/commands/speckit.git.initialize.md | Adds extension command template for git repo initialization. |
| extensions/git/commands/speckit.git.commit.md | Adds extension command template for config-driven auto-commit. |
| extensions/git/scripts/bash/create-new-feature.sh | Adds Bash implementation for branch creation + spec dir creation. |
| extensions/git/scripts/bash/initialize-repo.sh | Adds Bash implementation for git init + initial commit. |
| extensions/git/scripts/bash/auto-commit.sh | Adds Bash implementation for config-driven auto-commit. |
| extensions/git/scripts/bash/git-common.sh | Adds Bash helpers for git presence + branch validation. |
| extensions/git/scripts/powershell/create-new-feature.ps1 | Adds PowerShell implementation for branch creation + spec dir creation. |
| extensions/git/scripts/powershell/initialize-repo.ps1 | Adds PowerShell implementation for git init + initial commit. |
| extensions/git/scripts/powershell/auto-commit.ps1 | Adds PowerShell implementation for config-driven auto-commit. |
| extensions/git/scripts/powershell/git-common.ps1 | Adds PowerShell helpers for git presence + branch validation. |
| extensions/EXTENSION-USER-GUIDE.md | Updates documented hook events list (removes planned commit hooks; adds new core hook events). |
| extensions/EXTENSION-DEVELOPMENT-GUIDE.md | Updates “provides” guidance and hook event documentation to match new behavior. |
| extensions/EXTENSION-API-REFERENCE.md | Updates hook event reference list to include newly supported events. |
| extensions/catalog.json | Adds bundled git extension entry and updates catalog timestamp. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 33/33 changed files
- Comments generated: 7
When 'specify extension add "Git Branching Workflow"' is used with a display name instead of the ID, the catalog resolver now runs first to map the name to an ID, then checks bundled extensions again with the resolved ID before falling back to network download. Also noted: EXECUTE_COMMAND_INVOCATION and condition handling match the existing pattern in specify/plan/tasks/implement templates (pre-existing, not introduced by this PR).
There was a problem hiding this comment.
Pull request overview
Introduces an opt-in, bundled git extension that moves Git initialization/branching/validation/remote-detection/auto-commit into extensions/git/, and expands hook support so all core commands can trigger before/after extension hooks via the .specify/extensions.yml configuration.
Changes:
- Add bundled
extensions/git/extension (commands, scripts, default config) plus extensive test coverage for manifest/install and scripts. - Update extension manifest validation to allow hooks-only extensions (commands optional, but at least one command or hook required).
- Add hook-check instructions to additional core command templates and update extension documentation/catalog for new hook events.
Show a summary per file
| File | Description |
|---|---|
tests/test_extensions.py |
Updates/extends manifest validation tests for hooks-only extensions and stricter type checks. |
tests/extensions/git/test_git_extension.py |
New end-to-end tests for the bundled git extension (install + bash/pwsh scripts). |
tests/extensions/git/__init__.py |
Adds package marker for git extension tests. |
tests/extensions/__init__.py |
Adds package marker for extensions tests. |
templates/commands/taskstoissues.md |
Adds pre/post hook-check instructions for before_taskstoissues / after_taskstoissues. |
templates/commands/constitution.md |
Adds pre/post hook-check instructions for constitution hooks. |
templates/commands/clarify.md |
Adds pre/post hook-check instructions for clarify hooks. |
templates/commands/checklist.md |
Adds pre/post hook-check instructions for checklist hooks. |
templates/commands/analyze.md |
Adds hook-check instructions for analyze hooks. |
src/specify_cli/extensions.py |
Allows hooks-only extensions and adds type validation for provides.commands and hooks. |
src/specify_cli/__init__.py |
Adds bundled extension locator and installs bundled extensions locally before catalog download. |
pyproject.toml |
Ensures extensions/git is packaged into the wheel under core_pack/extensions/git. |
extensions/git/scripts/powershell/initialize-repo.ps1 |
New PowerShell repo-init script for the git extension. |
extensions/git/scripts/powershell/git-common.ps1 |
New PowerShell shared git helpers (repo detection + branch validation). |
extensions/git/scripts/powershell/create-new-feature.ps1 |
New PowerShell feature-branch creation script for the extension layout. |
extensions/git/scripts/powershell/auto-commit.ps1 |
New PowerShell auto-commit script driven by git-config.yml. |
extensions/git/scripts/bash/initialize-repo.sh |
New Bash repo-init script for the git extension. |
extensions/git/scripts/bash/git-common.sh |
New Bash shared git helpers (repo detection + branch validation). |
extensions/git/scripts/bash/create-new-feature.sh |
New Bash feature-branch creation script for the extension layout. |
extensions/git/scripts/bash/auto-commit.sh |
New Bash auto-commit script driven by git-config.yml. |
extensions/git/README.md |
Adds extension README describing commands, hooks, config, install/disable behavior. |
extensions/git/git-config.yml |
Default extension configuration template shipped with the extension. |
extensions/git/extension.yml |
New git extension manifest (commands, hooks, config metadata). |
extensions/git/config-template.yml |
Config template file referenced by the manifest. |
extensions/git/commands/speckit.git.validate.md |
New command template doc for branch validation command. |
extensions/git/commands/speckit.git.remote.md |
New command template doc for remote detection command. |
extensions/git/commands/speckit.git.initialize.md |
New command template doc for repo initialization command. |
extensions/git/commands/speckit.git.feature.md |
New command template doc for feature-branch creation command. |
extensions/git/commands/speckit.git.commit.md |
New command template doc for auto-commit hook command. |
extensions/EXTENSION-USER-GUIDE.md |
Updates list of supported hook events to include all core commands. |
extensions/EXTENSION-DEVELOPMENT-GUIDE.md |
Updates manifest guidance (commands optional; hooks expanded; hooks can reference any command). |
extensions/EXTENSION-API-REFERENCE.md |
Updates hook event reference (removes planned commit hooks; adds new standard events). |
extensions/catalog.json |
Adds bundled git extension entry for discoverability and updates catalog timestamp. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 33/33 changed files
- Comments generated: 3
- Strip both before_ and after_ prefixes when deriving command name (fixes misleading 'Auto-commit after before_plan' messages) - Include phase (before/after) in default commit messages - Clarify README config example is an override, not default behavior
There was a problem hiding this comment.
Pull request overview
Introduces a bundled, opt-in git extension that encapsulates Spec Kit’s Git branching/init/auto-commit behavior, expands hook support to all core commands, and adds local-first installation of bundled extensions (no network required).
Changes:
- Added
extensions/git/(manifest, commands, config templates, bash + PowerShell scripts) plus a comprehensive test suite for the bundled extension. - Updated extension manifest validation to allow hooks-only extensions (must provide at least one command or hook).
- Added hook support to remaining core command templates and added a bundled-extension install path (
specify extension add gitresolves locally first).
Show a summary per file
| File | Description |
|---|---|
| tests/test_extensions.py | Updates manifest validation tests for hooks-only extensions and stronger type checks. |
| tests/extensions/git/test_git_extension.py | Adds end-to-end tests for git extension install + scripts (bash + pwsh) + bundled locator. |
| tests/extensions/git/init.py | Declares test package for git extension tests. |
| tests/extensions/init.py | Declares test package for extension tests. |
| templates/commands/taskstoissues.md | Adds before/after hook checks around tasks-to-issues conversion. |
| templates/commands/constitution.md | Adds before/after hook checks around constitution command. |
| templates/commands/clarify.md | Adds before/after hook checks around clarify command. |
| templates/commands/checklist.md | Adds before/after hook checks around checklist command. |
| templates/commands/analyze.md | Adds before hook checks and an after hook check step for analyze. |
| src/specify_cli/extensions.py | Allows hooks-only manifests; validates provides.commands and hooks types; makes commands property resilient. |
| src/specify_cli/init.py | Adds _locate_bundled_extension() and updates extension add to prefer bundled installs before catalog download. |
| pyproject.toml | Force-includes extensions/git into the wheel under core_pack/. |
| extensions/git/scripts/powershell/initialize-repo.ps1 | Adds PowerShell repo initialization script reading init_commit_message. |
| extensions/git/scripts/powershell/git-common.ps1 | Adds PowerShell git helpers (repo detection + branch validation). |
| extensions/git/scripts/powershell/create-new-feature.ps1 | Adds PowerShell feature-branch creation script with sequential/timestamp modes and graceful no-git behavior. |
| extensions/git/scripts/powershell/auto-commit.ps1 | Adds PowerShell auto-commit hook script driven by auto_commit config. |
| extensions/git/scripts/bash/initialize-repo.sh | Adds bash repo initialization script reading init_commit_message. |
| extensions/git/scripts/bash/git-common.sh | Adds bash git helpers (repo detection + branch validation). |
| extensions/git/scripts/bash/create-new-feature.sh | Adds bash feature-branch creation script with sequential/timestamp modes and graceful no-git behavior. |
| extensions/git/scripts/bash/auto-commit.sh | Adds bash auto-commit hook script driven by auto_commit config. |
| extensions/git/README.md | Documents git extension commands, hooks, configuration, and install/disable workflow. |
| extensions/git/git-config.yml | Provides default git extension config (branch numbering + per-event auto-commit toggles/messages). |
| extensions/git/extension.yml | Declares git extension manifest (commands, hooks, config defaults, metadata). |
| extensions/git/config-template.yml | Template config file for install-time config provisioning. |
| extensions/git/commands/speckit.git.validate.md | Adds validate command documentation/behavior contract. |
| extensions/git/commands/speckit.git.remote.md | Adds remote-detection command documentation/behavior contract. |
| extensions/git/commands/speckit.git.initialize.md | Adds initialize command documentation/behavior contract. |
| extensions/git/commands/speckit.git.feature.md | Adds feature-branch command documentation/behavior contract. |
| extensions/git/commands/speckit.git.commit.md | Adds commit hook command documentation/behavior contract. |
| extensions/EXTENSION-USER-GUIDE.md | Updates documented hook event list to include newly supported core commands. |
| extensions/EXTENSION-DEVELOPMENT-GUIDE.md | Updates docs to reflect hooks-only extensions + expanded hook events. |
| extensions/EXTENSION-API-REFERENCE.md | Updates hook event reference list (removes planned commit hooks; adds newly supported events). |
| extensions/catalog.json | Adds the bundled git extension entry for discoverability via catalog search. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (5)
templates/commands/constitution.md:148
- This post-hook section also hardcodes
/{command}as the invocation. For skill-mode agents, the executable invocation can differ; the existing HookExecutor can render the correct invocation and includesEXECUTE_COMMAND_INVOCATIONin its formatted output. Update this section to output/reference the rendered invocation instead of assuming slash commands.
**Optional Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
```
- **Mandatory hook** (`optional: false`):
```
## Extension Hooks
**Automatic Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
templates/commands/clarify.md:248
- Post-execution hook output here assumes hooks are executed as
/{command}. That won’t be correct for skill-mode agents; the codebase already supports agent-specific invocations via HookExecutor (EXECUTE_COMMAND_INVOCATION). Adjust this section to use the rendered invocation so hooks remain runnable across agents.
**Optional Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
```
- **Mandatory hook** (`optional: false`):
```
## Extension Hooks
**Automatic Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
templates/commands/checklist.md:362
- This post-hook block hardcodes
/{command}as the execution syntax. In skill-mode setups the correct invocation may not be a slash command; the repo already has HookExecutor logic that emitsEXECUTE_COMMAND_INVOCATION. Update this block to output/reference the rendered invocation rather than assuming/{command}.
**Optional Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
```
- **Mandatory hook** (`optional: false`):
```
## Extension Hooks
**Automatic Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
templates/commands/taskstoissues.md:97
- The post-execution hook instructions here assume
/{command}is the correct invocation. For skill-mode agents this can be incorrect; HookExecutor already renders agent-specific invocations and providesEXECUTE_COMMAND_INVOCATION. Update this block to use the rendered invocation to keep hooks executable.
**Optional Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
```
- **Mandatory hook** (`optional: false`):
```
## Extension Hooks
**Automatic Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
templates/commands/analyze.md:229
- This after-hook rendering block also hardcodes
/{command}. Since HookExecutor supports agent-specific invocations (and emitsEXECUTE_COMMAND_INVOCATION), this template should use that rendered invocation rather than assuming slash commands, otherwise hooks may be non-executable in skills mode.
**Optional Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
```
- **Mandatory hook** (`optional: false`):
```
## Extension Hooks
**Automatic Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
- Files reviewed: 33/33 changed files
- Comments generated: 0 new
There was a problem hiding this comment.
Pull request overview
Introduces a bundled, opt-in extensions/git/ Git workflow extension and expands the core command templates/docs to support before/after extension hooks across all core commands, including new hook points for analyze, checklist, clarify, constitution, and taskstoissues.
Changes:
- Add bundled
gitextension (manifest, scripts, config templates, command prompts) plus comprehensive tests. - Allow hooks-only extensions by updating
ExtensionManifestvalidation and adding regression tests. - Add bundled-extension resolution to
specify extension addand expand hook-check sections across additional core command templates and docs.
Show a summary per file
| File | Description |
|---|---|
| tests/test_extensions.py | Updates manifest validation tests for hooks-only extensions and type checks. |
| tests/extensions/init.py | Marks extensions tests as a package. |
| tests/extensions/git/init.py | Marks git extension tests as a package. |
| tests/extensions/git/test_git_extension.py | Adds end-to-end tests for bundled git extension, install flow, and scripts (bash/pwsh). |
| templates/commands/analyze.md | Adds pre/post hook checks for before_analyze / after_analyze. |
| templates/commands/checklist.md | Adds pre/post hook checks for before_checklist / after_checklist. |
| templates/commands/clarify.md | Adds pre/post hook checks for before_clarify / after_clarify. |
| templates/commands/constitution.md | Adds pre/post hook checks for before_constitution / after_constitution. |
| templates/commands/taskstoissues.md | Adds pre/post hook checks for before_taskstoissues / after_taskstoissues. |
| src/specify_cli/extensions.py | Relaxes manifest validation to permit hooks-only extensions; adds type validation for commands/hooks. |
| src/specify_cli/init.py | Adds _locate_bundled_extension() and updates extension add to prefer local bundled extensions before catalog download. |
| pyproject.toml | Force-includes extensions/git into the wheel’s core_pack bundle. |
| extensions/catalog.json | Adds the bundled git extension to the catalog for discoverability. |
| extensions/EXTENSION-API-REFERENCE.md | Updates documented hook events and removes unimplemented planned commit hooks. |
| extensions/EXTENSION-DEVELOPMENT-GUIDE.md | Updates guidance to allow hooks-only extensions and expands hook points. |
| extensions/EXTENSION-USER-GUIDE.md | Updates list of available hook events. |
| extensions/git/README.md | Documents git extension commands, hooks, configuration, and behavior. |
| extensions/git/extension.yml | Defines the git extension manifest, commands, and hook registrations across core events. |
| extensions/git/config-template.yml | Provides install-time template for git-config.yml. |
| extensions/git/git-config.yml | Provides a default example configuration (disabled auto-commit by default). |
| extensions/git/commands/speckit.git.feature.md | Adds the extension command prompt for feature branch creation. |
| extensions/git/commands/speckit.git.validate.md | Adds the extension command prompt for branch validation. |
| extensions/git/commands/speckit.git.remote.md | Adds the extension command prompt for remote detection. |
| extensions/git/commands/speckit.git.initialize.md | Adds the extension command prompt for repo initialization. |
| extensions/git/commands/speckit.git.commit.md | Adds the extension command prompt for auto-commit behavior. |
| extensions/git/scripts/bash/create-new-feature.sh | Adds bash script for feature branch + specs dir creation. |
| extensions/git/scripts/bash/initialize-repo.sh | Adds bash script for git init + initial commit. |
| extensions/git/scripts/bash/auto-commit.sh | Adds bash script for config-driven auto-commit. |
| extensions/git/scripts/bash/git-common.sh | Adds bash git helper functions (repo detection + branch validation). |
| extensions/git/scripts/powershell/create-new-feature.ps1 | Adds PowerShell script for feature branch + specs dir creation. |
| extensions/git/scripts/powershell/initialize-repo.ps1 | Adds PowerShell script for git init + initial commit. |
| extensions/git/scripts/powershell/auto-commit.ps1 | Adds PowerShell script for config-driven auto-commit. |
| extensions/git/scripts/powershell/git-common.ps1 | Adds PowerShell git helper functions (repo detection + branch validation). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 33/33 changed files
- Comments generated: 1
BSD grep (macOS) doesn't support \b as a word boundary. Replace with grep -qw which is POSIX-portable.
There was a problem hiding this comment.
Pull request overview
Adds an opt-in, bundled extensions/git extension that encapsulates Spec Kit’s Git branching/initialization/auto-commit behaviors and wires extension hook checks into the remaining core command templates, while updating validation/docs/tests to support hooks-only extensions.
Changes:
- Introduces bundled
extensions/git/with commands, hooks, config template, and cross-platform scripts (+ extensive tests). - Expands core command templates (
analyze,checklist,clarify,constitution,taskstoissues) to include before/after hook-check instructions. - Updates extension manifest validation to allow hooks-only extensions and adds bundled-extension resolution during
specify extension add.
Show a summary per file
| File | Description |
|---|---|
| tests/test_extensions.py | Updates/extends manifest validation tests (hooks-only + type checks). |
| tests/extensions/git/test_git_extension.py | Adds integration-style tests for bundled git extension manifest, install, and scripts. |
| tests/extensions/git/init.py | Declares git extension tests package. |
| tests/extensions/init.py | Declares extensions tests package. |
| templates/commands/taskstoissues.md | Adds pre/post hook-check instructions for tasks→issues command. |
| templates/commands/constitution.md | Adds pre/post hook-check instructions for constitution command. |
| templates/commands/clarify.md | Adds pre/post hook-check instructions for clarify command. |
| templates/commands/checklist.md | Adds pre/post hook-check instructions for checklist command. |
| templates/commands/analyze.md | Adds pre/post hook-check instructions for analyze command. |
| src/specify_cli/extensions.py | Allows hooks-only manifests; adds type validation for commands/hooks containers. |
| src/specify_cli/init.py | Adds _locate_bundled_extension() and prefers bundled install in extension add. |
| pyproject.toml | Force-includes extensions/git into the wheel under core_pack/. |
| extensions/git/scripts/powershell/initialize-repo.ps1 | Implements repo init + initial commit (PS). |
| extensions/git/scripts/powershell/git-common.ps1 | Adds PS git helpers for repo/branch validation. |
| extensions/git/scripts/powershell/create-new-feature.ps1 | Implements PS feature branch + spec dir creation. |
| extensions/git/scripts/powershell/auto-commit.ps1 | Implements PS auto-commit driven by config + event name. |
| extensions/git/scripts/bash/initialize-repo.sh | Implements repo init + initial commit (bash). |
| extensions/git/scripts/bash/git-common.sh | Adds bash git helpers for repo/branch validation. |
| extensions/git/scripts/bash/create-new-feature.sh | Implements bash feature branch + spec dir creation. |
| extensions/git/scripts/bash/auto-commit.sh | Implements bash auto-commit driven by config + event name. |
| extensions/git/README.md | Documents git extension commands, hooks, config, and usage. |
| extensions/git/git-config.yml | Provides default config (copied on install). |
| extensions/git/extension.yml | Declares git extension commands, hooks, and config template. |
| extensions/git/config-template.yml | Template for git-config.yml on install. |
| extensions/git/commands/speckit.git.validate.md | Command template: validate feature branch naming. |
| extensions/git/commands/speckit.git.remote.md | Command template: detect git remote URL. |
| extensions/git/commands/speckit.git.initialize.md | Command template: initialize repository. |
| extensions/git/commands/speckit.git.feature.md | Command template: create feature branch + spec dir. |
| extensions/git/commands/speckit.git.commit.md | Command template: auto-commit hook behavior. |
| extensions/EXTENSION-USER-GUIDE.md | Updates documented hook events list (removes planned commit hooks). |
| extensions/EXTENSION-DEVELOPMENT-GUIDE.md | Documents commands as optional; expands hook points and clarifies hook commands. |
| extensions/EXTENSION-API-REFERENCE.md | Updates hook event examples/list to include newly supported events. |
| extensions/catalog.json | Adds bundled git extension entry and updates catalog timestamp. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 33/33 changed files
- Comments generated: 3
- Validate each hook value is a dict with a 'command' field during manifest _validate() (prevents crash at install time) - Validate --number is a non-negative integer in bash create-new-feature (clear error instead of cryptic shell arithmetic failure) - Route PowerShell no-git warning to stderr in JSON mode so stdout stays valid JSON
There was a problem hiding this comment.
Pull request overview
This PR introduces an opt-in, bundled git extension (extensions/git/) that encapsulates Spec Kit’s git initialization, feature branch creation, branch validation, remote detection, and auto-commit behavior, and wires hook support into additional core command templates so extensions can run before/after all core workflows.
Changes:
- Add a bundled
gitextension (manifest, commands, scripts, default config, docs) plus comprehensive cross-platform tests. - Extend manifest validation to allow hooks-only extensions, and add bundled-extension discovery/installation via
specify extension add. - Update additional core command templates (
constitution,clarify,checklist,analyze,taskstoissues) to include pre/post hook handling instructions; refresh extension docs and catalog.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/extensions.py |
Allows hooks-only extension manifests; adds hook validation and makes commands property resilient to missing commands. |
src/specify_cli/__init__.py |
Adds _locate_bundled_extension() and updates extension add flow to prefer bundled extensions before catalog downloads. |
pyproject.toml |
Force-includes extensions/git into the wheel under core_pack/extensions/. |
extensions/git/extension.yml |
Declares the git extension’s commands, hooks, tools, and defaults. |
extensions/git/README.md |
Documents extension behavior, hooks, config, and installation/disable flow. |
extensions/git/config-template.yml / extensions/git/git-config.yml |
Provides default configuration for numbering/init commit message/auto-commit toggles. |
extensions/git/commands/*.md |
Adds the five git extension command definitions. |
extensions/git/scripts/bash/*.sh |
Adds bash implementations for init/branching/auto-commit/git helpers. |
extensions/git/scripts/powershell/*.ps1 |
Adds PowerShell implementations for init/branching/auto-commit/git helpers. |
templates/commands/analyze.md |
Adds pre-execution hook instructions and post-execution hook check section for analyze. |
templates/commands/checklist.md |
Adds pre/post hook instructions for checklist. |
templates/commands/clarify.md |
Adds pre/post hook instructions for clarify. |
templates/commands/constitution.md |
Adds pre/post hook instructions for constitution. |
templates/commands/taskstoissues.md |
Adds pre/post hook instructions for taskstoissues. |
extensions/EXTENSION-USER-GUIDE.md |
Updates documented hook events list to include all newly supported core commands. |
extensions/EXTENSION-DEVELOPMENT-GUIDE.md |
Updates guidance: commands are optional as long as hooks exist; documents additional hook points. |
extensions/EXTENSION-API-REFERENCE.md |
Updates hook event reference list to remove planned commit hooks and add new core events. |
extensions/catalog.json |
Adds bundled git extension entry for discovery and updates catalog timestamp. |
tests/test_extensions.py |
Updates/extends manifest validation tests for hooks-only extensions and type checks. |
tests/extensions/git/test_git_extension.py |
Adds end-to-end tests for manifest, install, bundled locator, and scripts (bash + pwsh where available). |
tests/extensions/__init__.py / tests/extensions/git/__init__.py |
Initializes test packages for git extension tests. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 33/33 changed files
- Comments generated: 0 new
Stage 1: Git Extension (opt-in, bundled)
Extracts Git branching operations into a self-contained
extensions/git/extension. This is stage 1 — the extension is opt-in viaspecify extension add git(resolves locally from the bundled copy, no network required). Core git init and branching code remains unchanged.Refs: #841, #1382, #1066, #1791, #1191
Extension structure (
extensions/git/)5 commands:
speckit.git.initializespeckit.git.featurespeckit.git.validatespeckit.git.remotespeckit.git.commit18 hooks across all 9 core commands:
before_constitutionspeckit.git.initializebefore_specifyspeckit.git.featurebefore_clarify/plan/tasks/implement/checklist/analyze/taskstoissuesspeckit.git.commitafter_constitution/specify/clarify/plan/tasks/implement/checklist/analyze/taskstoissuesspeckit.git.commitScripts (bash + powershell):
create-new-feature.{sh,ps1}— branch creation with sequential/timestamp numberinginitialize-repo.{sh,ps1}— git init with configurable commit messageauto-commit.{sh,ps1}— per-command auto-commit with config-driven enable/disable and custom messagesgit-common.{sh,ps1}— extractedhas_git()andcheck_feature_branch()helpersAll scripts capture git output and suppress it on success; full output is included in error messages on failure.
Configuration (
git-config.yml):branch_numbering: sequential or timestampinit_commit_message: custom initial commit messageauto_commit: per-command enable/disable with custom commit messages (all disabled by default)Hook system improvements
before_*/after_*hook support toanalyze,checklist,clarify,constitution, andtaskstoissues(previously onlyspecify,plan,tasks,implementhad hooks)before_commit/after_commit: These were documented as "planned" but never implemented and had no backing core command. Removed from API reference, user guide, and dev guideBundled extension install
pyproject.tomlforce-includesextensions/gitinto the wheel_locate_bundled_extension()resolves bundled extensions fromcore_pack/(wheel) orextensions/(source checkout)specify extension add gitresolves locally before falling back to catalog — no network neededcatalog.jsonfor discoverability viaspecify extension searchWhat stays in core (unchanged)
is_git_repo(),init_git_repo(),--branch-numberingflag,--no-gitflag,get_current_branch(),SPECIFY_FEATUREenv var,find_feature_dir_by_prefix(),specify.mdtemplate — all unchanged. The core{SCRIPT}flow continues to work as before.Disable/re-enable
Tests
37 new tests in
tests/extensions/git/test_git_extension.py:ExtensionManagerinitialize-repo.sh/.ps1— init, skip-if-exists, custom commit messagecreate-new-feature.sh/.ps1— sequential, timestamp, spec dir creation, increments, no-git degradation, dry-runauto-commit.sh/.ps1— disabled by default, per-command enable, custom messages, default fallback, no-changes skip, no-config skip, no-git skipgit-common.sh— has_git, check_feature_branch (sequential, timestamp, reject main, reject malformed)Stage 2 (future)
specify init(controlled by--no-git→ don't install git extension)git init/is_git_repo/init_git_repo—before_constitutionhook handles itspecify.md—before_specifyhook handles it viaspeckit.git.feature; changespecify.mdscript ref fromcreate-new-featuretocheck-prerequisitesonlycreate-new-featurescripts)