Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug]: Test-FeatureJsonMatchesFeatureDir was missing in common.ps1 — this was a missing function that caused setup-tasks.ps1 to fail.

未关闭 适合新手
#2,721 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
powershell
领域
cli, tooling

调研方向

从 .specify/scripts/powershell/common.ps1 以及 .specify/scripts/powershell/setup-tasks.ps1 中的调用开始。在 PowerShell 中使用 setup-tasks.ps1 -Json 重现失败,然后验证 Test-FeatureJsonMatchesFeatureDir 可用,并且功能目录验证在没有报告的命令错误或解析器错误的情况下完成。

由索引模型根据 Issue 内容生成。

描述

stale
Bug Description

On start of /speckit.tasks in PowerShell environment, it attempts to call function
Test-FeatureJsonMatchesFeatureDir
An error is thrown and there is no such commandlet.

CoPilot eventually worked around the problem.

.\.specify\scripts\powershell\setup-tasks.ps1 -Json
C:\Code\private\app\.specify\scripts\powershell\setup-tasks.ps1 : The term 
'Test-FeatureJsonMatchesFeatureDir' is not recognized as the name of a cmdlet, function, script file, or 
operable program. Check the spelling of the name, or if a path was included, verify that the path is 
correct and try again.
At line:1 char:1
+ .\.specify\scripts\powershell\setup-tasks.ps1 -Json
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Test-FeatureJsonMatchesFeatureDir:String) [setup-tasks.ps1] 
   , CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,setup-tasks.ps1
Steps to Reproduce

1: Run /speckit.tasks
2: Errors noted for missing function Test-FeatureJsonMatchesFeatureDir

The function checks if feature.json pins an existing feature directory, and if it does, branch naming validation gets skipped.

Since the function is missing from common.ps1, this validation logic can't run.

Expected Behavior

No error should have been reported.

Actual Behavior
.\.specify\scripts\powershell\setup-tasks.ps1 -Json
C:\Code\private\app\.specify\scripts\powershell\setup-tasks.ps1 : The term 
'Test-FeatureJsonMatchesFeatureDir' is not recognized as the name of a cmdlet, function, script file, or 
operable program. Check the spelling of the name, or if a path was included, verify that the path is 
correct and try again.
At line:1 char:1
+ .\.specify\scripts\powershell\setup-tasks.ps1 -Json
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Test-FeatureJsonMatchesFeatureDir:String) [setup-tasks.ps1] 
   , CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,setup-tasks.ps1

Since the function is missing from common.ps1, this validation logic can't run.

CoPilot eventually determined what the function should have returned and worked around the problem.

Specify CLI Version

0.8.13

AI Agent

GitHub Copilot

Operating System

Windows 11 (10.0.26220)

Python Version

Python 3.12.6

Error Logs
.\.specify\scripts\powershell\setup-tasks.ps1 -Json
C:\Code\private\app\.specify\scripts\powershell\setup-tasks.ps1 : At 
C:\Code\private\app\.specify\scripts\powershell\common.ps1:141 char:122
+ ... -Path $RepoRoot $pinnedRelative) -ErrorAction SilentlyContinue)?.Path
+                                                                    ~~~~~~
Unexpected token '?.Path' in expression or statement.
At C:\Code\private\app\.specify\scripts\powershell\common.ps1:142 char:102
+ ... h -LiteralPath $ActiveFeatureDir -ErrorAction SilentlyContinue)?.Path
+                                                                    ~~~~~~
Unexpected token '?.Path' in expression or statement.
At line:1 char:1
+ .\.specify\scripts\powershell\setup-tasks.ps1 -Json
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ParserError: (:) [setup-tasks.ps1], ParseException
    + FullyQualifiedErrorId : UnexpectedToken,setup-tasks.ps1
Additional Context

This speckit was in-place upgraded from a previous version ~ 1 month old

主要语言
Python
星标
138k
派生
12.4k
平均合并
3 天 4 小时
30 天内合并 PR
154

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/spec-kit 的其他 Issue

查看 github/spec-kit 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。