Skip to content

Commit 7fd87f9

Browse files
committed
fix: address third round of PR review comments
- Remove scripts frontmatter from command files (CommandRegistrar rewrites ../../scripts/ to .specify/scripts/ which points at core scripts, not extension scripts) - Update speckit.git.commit command to derive event name from hook context rather than using a static example - Clarify that hook argument passthrough works via AI agent context (the agent carries conversation state including user's original feature description)
1 parent 174e909 commit 7fd87f9

3 files changed

Lines changed: 12 additions & 18 deletions

File tree

extensions/git/commands/speckit.git.commit.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
---
22
description: "Auto-commit changes after a Spec Kit command completes"
3-
scripts:
4-
sh: ../../scripts/bash/auto-commit.sh
5-
ps: ../../scripts/powershell/auto-commit.ps1
63
---
74

85
# Auto-Commit Changes
@@ -11,20 +8,23 @@ Automatically stage and commit all changes after a Spec Kit command completes.
118

129
## Behavior
1310

14-
This command is invoked as a post-hook after core commands. It:
11+
This command is invoked as a hook after (or before) core commands. It:
1512

16-
1. Checks `.specify/extensions/git/git-config.yml` for the `auto_commit` section
17-
2. Looks up the specific event key (e.g., `after_specify`) to see if auto-commit is enabled
18-
3. Falls back to `auto_commit.default` if no event-specific key exists
19-
4. Uses the per-command `message` if configured, otherwise a default message
20-
5. If enabled and there are uncommitted changes, runs `git add .` + `git commit`
13+
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`)
14+
2. Checks `.specify/extensions/git/git-config.yml` for the `auto_commit` section
15+
3. Looks up the specific event key to see if auto-commit is enabled
16+
4. Falls back to `auto_commit.default` if no event-specific key exists
17+
5. Uses the per-command `message` if configured, otherwise a default message
18+
6. If enabled and there are uncommitted changes, runs `git add .` + `git commit`
2119

2220
## Execution
2321

24-
The hook system passes the event name to the script:
22+
Determine the event name from the hook that triggered this command, then run the script:
2523

26-
- **Bash**: `.specify/extensions/git/scripts/bash/auto-commit.sh after_specify`
27-
- **PowerShell**: `.specify/extensions/git/scripts/powershell/auto-commit.ps1 after_specify`
24+
- **Bash**: `.specify/extensions/git/scripts/bash/auto-commit.sh <event_name>`
25+
- **PowerShell**: `.specify/extensions/git/scripts/powershell/auto-commit.ps1 <event_name>`
26+
27+
Replace `<event_name>` with the actual hook event (e.g., `after_specify`, `before_plan`, `after_implement`).
2828

2929
## Configuration
3030

extensions/git/commands/speckit.git.feature.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
---
22
description: "Create a feature branch with sequential or timestamp numbering"
3-
scripts:
4-
sh: ../../scripts/bash/create-new-feature.sh
5-
ps: ../../scripts/powershell/create-new-feature.ps1
63
---
74

85
# Create Feature Branch

extensions/git/commands/speckit.git.initialize.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
---
22
description: "Initialize a Git repository with an initial commit"
3-
scripts:
4-
sh: ../../scripts/bash/initialize-repo.sh
5-
ps: ../../scripts/powershell/initialize-repo.ps1
63
---
74

85
# Initialize Git Repository

0 commit comments

Comments
 (0)