[Bug]: PowerShell common.ps1 uses wrong base path for specs directory
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- powershell
- Lĩnh vực
- tooling
Hướng nghiên cứu
Bắt đầu trong .specify/scripts/powershell/common.ps1, tập trung vào Get-CurrentBranch và Get-FeatureDir. Chạy .specify/scripts/powershell/setup-plan.ps1 -Json trên một feature branch và kiểm tra các đường dẫn được tạo. Được coi là hoàn tất khi các tệp được đặt trong .specify/specs/ mà không có thư mục feature/ bổ sung, đồng thời các workflow hiện có vẫn tiếp tục hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Description
The PowerShell common functions in .specify/scripts/powershell/common.ps1 use incorrect paths, causing spec files to be created in specs/ at the repository root instead of .specify/specs/ as documented and expected by the framework.
Steps to Reproduce
- Clone a spec-kit project
- Check out a feature branch (e.g.,
feature/US123-my-feature) - Run
.specify/scripts/powershell/setup-plan.ps1 -Json - Observe files are created in
specs/feature/US123-my-feature/instead of.specify/specs/US123-my-feature/
Expected Behavior
All spec files should be created under the .specify/specs/ directory as documented throughout the framework and in .specify/specs/README.md.
Actual Behavior
- Files are created in
specs/at the repository root (wrong location) - When using feature branches like
feature/something, an extra nestedfeature/directory is created:specs/feature/something/ - This violates the documented
.specify/prefix convention - Requires manual cleanup after every planning operation
Specify CLI Version
0.2.1
AI Agent
GitHub Copilot
Operating System
Windows 10.0.26200 AMD64
Python Version
3.12.4
Error Logs
Additional Context
Component
Scripts (.specify/scripts/)
AI Agent (if applicable)
Affects all agents that use /speckit.plan, /speckit.tasks, and related commands
Additional Context
-
This affects all PowerShell-based workflows
-
The bash version (
common.sh) likely has similar issues if it exists -
Working fix tested in production: https://ghe.coxautoinc.com/deCipher/TestingbyRallyCards/commit/abc54be
-
Root Cause
File: .specify/scripts/powershell/common.ps1
Line 38 (in Get-CurrentBranch function):
$specsDir = Join-Path $repoRoot "specs"
Should be:
$specsDir = Join-Path $repoRoot ".specify/specs"
Line 98 (in Get-FeatureDir function):
Join-Path $repoRoot "specs/$Branch"
Should be:
$dirName = $Branch -replace '^feature/', '' # Strip branch prefix
Join-Path $repoRoot ".specify/specs/$dirName"
Proposed Fix
function Get-FeatureDir {
param([string]$RepoRoot, [string]$Branch)
# Strip feature/ prefix if present for specs directory naming
$dirName = $Branch -replace '^feature/', ''
Join-Path $RepoRoot ".specify/specs/$dirName"
}
Also update line 38 in Get-CurrentBranch:
$specsDir = Join-Path $repoRoot ".specify/specs"
- Ngôn ngữ chính
- Python
- Star
- 138k
- Fork
- 12.4k
- Merge trung bình
- 3 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 136
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/spec-kit
-
enhancement needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
enhancement needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
enhancement needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
[Feature]: 给 slug 添加默认值 Đang mởenhancement needs-triage triage-can-wait
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
extension-submission triage-can-wait
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Tất cả issue của github/spec-kit
Issue tương tự
-
documentation help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
simonw/sqlite-utils#872 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100