[Bug]: check-prerequisites.sh --paths-only still runs branch validation, contradicting --help
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 86/100
調査の方向性
scripts/bash/check-prerequisites.sh と issue で説明されている --paths-only フローから始め、その順序を scripts/powershell/check-prerequisites.ps1 および common.sh の branch チェックと比較します。非 feature branch で --paths-only と --json を使って再現します。path 変数が出力され、branch の検証なしでコマンドが成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Bug Description
scripts/bash/check-prerequisites.sh --paths-only is documented as "no validation" / "no prerequisite validation", but the script runs check_feature_branch before the --paths-only early exit. The result: when the current branch does not match the feature-branch naming convention, --paths-only exits non-zero with a branch-format error, even though the caller asked for paths only and explicitly opted out of validation.
Source: https://github.com/github/spec-kit/blob/main/scripts/bash/check-prerequisites.sh#L81-L113
# Get feature paths and validate branch
_paths_output=$(get_feature_paths) || { ... ; exit 1; }
eval "$_paths_output"
unset _paths_output
check_feature_branch "$CURRENT_BRANCH" "$HAS_GIT" || exit 1 # ← runs even with --paths-only
# If paths-only mode, output paths and exit (support JSON + paths-only combined)
if \$PATHS_ONLY; then
...
exit 0
fi
The header documentation (line 14) says: `--paths-only Only output path variables (no validation)` and `--help` (line 54) says `(no prerequisite validation)`. Branch validation is the most user-visible form of validation, so this contradicts the documented behavior.
Steps to Reproduce
- Initialize a Spec Kit project: `specify init test-paths-only --integration claude`
- Switch to a non-feature branch: `git checkout -b chore/some-cleanup`
- Run paths-only: `./.specify/scripts/bash/check-prerequisites.sh --paths-only`
Expected Behavior
`--paths-only` succeeds and emits `REPO_ROOT`, `BRANCH`, `FEATURE_DIR`, etc., regardless of branch name (the caller asked for paths, not validation).
Actual Behavior
Exit 1 with branch-validation error (the message produced by `check_feature_branch` in `common.sh`), no path variables emitted.
Specify CLI Version
0.7.4.dev0
AI Agent
Claude Code
Suggested Fix
Move `check_feature_branch` after the `if $PATHS_ONLY; then ... exit 0; fi` block so `--paths-only` truly skips validation. Same source ordering already exists in `scripts/powershell/check-prerequisites.ps1` — please verify both are aligned.
Context
Surfaced while bulk-installing Spec Kit across 20 internal projects. `/speckit-tasks` and similar commands invoke `check-prerequisites.sh --paths-only --json` from non-feature chore branches and unexpectedly fail with branch-format errors despite the documented opt-out.
- 主要言語
- Python
- スター
- 138k
- フォーク
- 12.4k
- 平均マージ
- 3日 6時間
- マージ済み PR(30日)
- 136
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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
github/spec-kit の issue をすべて見る
似ている 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