[Bug]: PowerShell common.ps1 uses wrong base path for specs directory
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 88/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- powershell
- 领域
- tooling
调研方向
从 .specify/scripts/powershell/common.ps1 开始,重点关注 Get-CurrentBranch 和 Get-FeatureDir。在功能分支上运行 .specify/scripts/powershell/setup-plan.ps1 -Json,并检查生成的路径。完成的标准是文件放置在 .specify/specs/ 下,不包含额外的 feature/ 目录,同时现有工作流继续正常运行。
由索引模型根据 Issue 内容生成。
描述
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"
- 主要语言
- Python
- 星标
- 138k
- 派生
- 12.4k
- 平均合并
- 3 天 6 小时
- 30 天内合并 PR
- 136
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/spec-kit 的其他 Issue
-
enhancement needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
-
enhancement needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
-
enhancement needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
-
enhancement needs-triage triage-can-wait
难度 2/5 1-3 小时 新手友好度 65/100
-
extension-submission triage-can-wait
难度 2/5 1-3 小时 新手友好度 75/100
相似的 Issue
-
documentation help wanted
难度 2/5 1-3 小时 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 90/100
simonw/sqlite-utils#872 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 78/100