Bug Description
The /specify command (via create-new-feature.ps1) generates a branch name and creates the feature directory structure, but does not create the actual git branch.
Expected Behavior
When running /specify add user authentication, the script should:
- ✅ Generate branch name (e.g.,
001-user-authentication)
- ✅ Create
specs/001-user-authentication/ directory
- ✅ Create
specs/001-user-authentication/spec.md
- ✅ Save to
.specify/feature.json
- ❌ MISSING: Create and checkout git branch with
git checkout -b 001-user-authentication
Actual Behavior
Only steps 1-4 happen. The git branch is never created. Users remain on their current branch (e.g., master or main).
Environment
- Spec Kit version:
0.11.0
- OS: Windows 11
- Script:
.specify/scripts/powershell/create-new-feature.ps1
Root Cause
In create-new-feature.ps1 (line 212), after Save-FeatureJson is called, there is no git checkout -b invocation. The Get-CurrentBranch function in common.ps1 only reads from environment variables or .specify/feature.json — it's a virtual branch, not a real git branch.
Suggested Fix
Add after Save-FeatureJson call (around line 212):
# Create git branch for the new feature
try {
$existingBranches = & git branch --list $branchName 2>$null
if ($existingBranches) {
Write-Warning "[specify] Git branch '$branchName' already exists. Checking it out..."
& git checkout $branchName 2>$null | Out-Null
} else {
& git checkout -b $branchName 2>$null | Out-Null
Write-Output "[specify] Created and checked out git branch: $branchName"
}
} catch {
Write-Warning "[specify] Failed to create git branch: $_"
}
This handles:
- New branch creation
- Existing branch checkout (idempotent)
- Error handling if git is unavailable
Impact
Users following Spec-Driven Development workflows expect each feature to be isolated in its own git branch. Without automatic branch creation, users must manually run git checkout -b <branch-name> after every /specify command, which is error-prone and breaks the expected workflow.
Bug Description
The
/specifycommand (viacreate-new-feature.ps1) generates a branch name and creates the feature directory structure, but does not create the actual git branch.Expected Behavior
When running
/specify add user authentication, the script should:001-user-authentication)specs/001-user-authentication/directoryspecs/001-user-authentication/spec.md.specify/feature.jsongit checkout -b 001-user-authenticationActual Behavior
Only steps 1-4 happen. The git branch is never created. Users remain on their current branch (e.g.,
masterormain).Environment
0.11.0.specify/scripts/powershell/create-new-feature.ps1Root Cause
In
create-new-feature.ps1(line 212), afterSave-FeatureJsonis called, there is nogit checkout -binvocation. TheGet-CurrentBranchfunction incommon.ps1only reads from environment variables or.specify/feature.json— it's a virtual branch, not a real git branch.Suggested Fix
Add after
Save-FeatureJsoncall (around line 212):This handles:
Impact
Users following Spec-Driven Development workflows expect each feature to be isolated in its own git branch. Without automatic branch creation, users must manually run
git checkout -b <branch-name>after every/specifycommand, which is error-prone and breaks the expected workflow.