[Bug]: `create-new-feature.sh` rejects the feature descriptions `-n`, `-e` and `-E`, which the Python script accepts

オープン 初心者向け
#5,096 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@WOLIKIMCHENG がすでに取り組んでいます。

2026年10月26日 から。

  • #5124 @WOLIKIMCHENG による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
bash, python
領域
cli

調査の方向性

説明が切り詰められる93行目付近の scripts/bash/create-new-feature.sh を読み、scripts/python/create_new_feature.py の Python の動作と比較してください。まず、issue の再現手順、または tests/test_create_new_feature_python_parity.py のパリティテストを実行してください。bash が -n や -e のような説明を受け付け、Python と同じ出力を生成すれば完了です。空の引数の動作も、関連するパリティの差異として記録します。

索引モデルが issue の本文から書いたものです。

説明

triage-can-wait
Bug Description

scripts/bash/create-new-feature.sh:93 trims the description with FEATURE_DESCRIPTION=$(echo "$FEATURE_DESCRIPTION" | sed -E ...). When the description is exactly an echo option word (-n, -e, -E, or a combination such as -neE), bash's builtin echo treats it as an option and prints nothing. The script then exits 1 with "Feature description cannot be empty or contain only whitespace". The Python twin, scripts/python/create_new_feature.py, accepts the same input and creates 001-n. The two variants therefore disagree.

Steps to Reproduce

From a fresh clone, after uv sync, save the script below and run uv run python -I repro.py from the repository root. It copies both script variants into a temporary project and runs them with --json --dry-run.

import shutil, subprocess, sys, tempfile
from pathlib import Path

repo = Path(tempfile.mkdtemp())
for sub, files in [("bash", ["common.sh", "create-new-feature.sh"]),
                   ("python", ["common.py", "create_new_feature.py"])]:
    d = repo / ".specify" / "scripts" / sub
    d.mkdir(parents=True)
    for f in files:
        shutil.copy(Path("scripts") / sub / f, d / f)

for desc in ["-n", "-e", "-E", "-neE"]:
    for name, cmd in [
        ("bash", ["bash", ".specify/scripts/bash/create-new-feature.sh"]),
        ("python", [sys.executable, ".specify/scripts/python/create_new_feature.py"]),
    ]:
        r = subprocess.run(cmd + ["--json", "--dry-run", desc], cwd=repo,
                           capture_output=True, text=True)
        out = (r.stdout or r.stderr).strip()
        print(f"{desc:5} {name:6} rc={r.returncode} {out[:80]}")
Expected Behavior

Both variants should treat the description as text and produce the same branch name (for example 001-n). The bash script's own comment at scripts/bash/create-new-feature.sh:220-221 says it uses "printf instead of echo, so a name of "-n"/"-e"/"-E" is text, not options". tests/test_create_new_feature_python_parity.py asserts that the variants produce identical output (for example lines 444 and 752).

Actual Behavior
-n    bash   rc=1 Error: Feature description cannot be empty or contain only whitespace
-n    python rc=0 {"BRANCH_NAME":"001-n","SPEC_FILE":"/tmp/tmpimfdrmab/specs/001-n/spec.md","FEATU
-e    bash   rc=1 Error: Feature description cannot be empty or contain only whitespace
-e    python rc=0 {"BRANCH_NAME":"001-e","SPEC_FILE":"/tmp/tmpimfdrmab/specs/001-e/spec.md","FEATU
-E    bash   rc=1 Error: Feature description cannot be empty or contain only whitespace
-E    python rc=0 {"BRANCH_NAME":"001-e","SPEC_FILE":"/tmp/tmpimfdrmab/specs/001-e/spec.md","FEATU
-neE  bash   rc=1 Error: Feature description cannot be empty or contain only whitespace
-neE  python rc=0 {"BRANCH_NAME":"001-nee","SPEC_FILE":"/tmp/tmpimfdrmab/specs/001-nee/spec.md","F
Specify CLI Version

1.2.4.dev0 (main at 27d14e2)

AI Agent

Not applicable

Operating System

Linux 6.18 (Ubuntu container)

Python Version

Python 3.12.3

Error Logs
Error: Feature description cannot be empty or contain only whitespace
Additional Context

Using printf '%s\n' "$FEATURE_DESCRIPTION" on line 93 would match the approach the script already uses elsewhere.

A smaller related parity gap: for a single empty argument (create-new-feature.sh ""), bash prints the Usage line, while the Python script prints "Error: Feature description cannot be empty or contain only whitespace" (scripts/python/create_new_feature.py:150-156). Both exit 1.

Also reproduced on macOS (Darwin 25.6, arm64) with Python 3.14.4 and uv run python -I repro.py against 27d14e2; the output matches the above.

AI Disclosure

Found and reproduced with Claude Code (model: Claude Opus 4.8), run autonomously under human supervision. The human reporter re-ran every reproduction above before filing.

主要言語
Python
スター
144k
フォーク
12.9k
平均マージ
1日 6時間
マージ済み PR(30日)
194

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/spec-kit のほかの issue

github/spec-kit の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。