[Bug] create-new-feature.sh uses ${word^^} (bash 4+) and silently drops acronyms on macOS (bash 3.2)
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 84/100
Piste de recherche
Commencez à .specify/scripts/bash/create-new-feature.sh, autour de la ligne 231, et examinez le chemin du nom de branche pour les acronymes. Exécutez les commandes --json --dry-run fournies avec /bin/bash 3.2 de macOS et comparez-les avec Bash 5.x. C’est terminé lorsque les acronymes courts en majuscules restent dans BRANCH_NAME et que stderr ne contient aucun avertissement de substitution incorrecte.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
create-new-feature.sh (line 231) uses ${word^^}, a bash 4+ uppercase expansion. macOS ships bash 3.2.57 (Apple's last GPLv2 build) and the script fails silently on that line: stderr is full of bad substitution warnings, the script keeps running, and the generated branch name silently drops acronyms that were short (≤2 chars) and uppercase in the original description.
Because the script still emits valid JSON and the resulting branch name is plausible, end users on macOS get a quietly truncated branch without realizing it.
Environment
- macOS (any current version; bash 3.2.57 has been the system bash on every macOS since 2007)
- Any git repo initialised with
specify init - No
bashfrom Homebrew installed (or installed but not first inPATHfor the running shell)
$ /bin/bash --version
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin24)
$ bash .specify/scripts/bash/create-new-feature.sh --json --dry-run \
"Transparencia Art. 50 AI Act: aviso de interaccion con IA"
{"BRANCH_NAME":"001-transparencia-art-act", ...} # ← missing "AI"
$ bash .specify/scripts/bash/create-new-feature.sh --json --dry-run "AI Act transparency"
{"BRANCH_NAME":"001-act-transparency", ...} # ← missing "AI" (top-3 cutoff also affected)
bad substitution # (only visible in stderr; the JSON looks fine)
The same inputs against bash 5.x preserve the acronym:
$ bash .specify/scripts/bash/create-new-feature.sh --json --dry-run "AI Act transparency"
{"BRANCH_NAME":"001-ai-act-transparency", ...} # ← "ai" preserved
Root cause
create-new-feature.sh, line 231:
elif echo "$description" | grep -q "\b${word^^}\b"; then
# Keep short words if they appear as uppercase in original (likely acronyms)
meaningful_words+=("$word")
fi
${word^^} is case-conversion syntax introduced in bash 4.0 (2009). It is not available in bash 3.2. On bash 3.2 the line errors out, grep runs with the literal placeholder string, the grep returns non-zero, the elif is false, and the short word is silently dropped from meaningful_words[]. The same ${var^^} / ${var,,} pattern likely exists in other vendored scripts; I have not audited them all.
The shebang #!/usr/bin/env bash does not protect against this — env picks whatever bash resolves to in the current PATH, and on a stock macOS that is the system's bash 3.2.
Suggested fix
Two options, in order of preference:
- POSIX-portable — replace
${word^^}with a portable uppercase conversion, e.g.echo "$word" | tr '[:lower:]' '[:upper:]', so the script works on bash 3.2 too. This is a one-line change per occurrence and removes the silent failure mode entirely. - Bash 4+ required — if the project decides to require bash 4+ intentionally, make the failure loud: at the top of every vendored script, add a runtime check that fails fast with a clear message and a hint to install bash from Homebrew (
brew install bash). Currently the failure is silent and the user has no way to know their branch name is wrong.
I'd recommend option 1 (POSIX-portable) — the function is a small, isolated transformation and the project already has a clean_branch_name that uses tr '[:upper:]' '[:lower:]' to do the inverse. Symmetry argues for replacing the bash-only expansion with tr as well.
Workaround on macOS today
Install bash 5.x via Homebrew and ensure it is first in PATH for the shell that runs Spec-Kit:
brew install bash
# ~/.zshrc or ~/.bashrc, idempotent:
case "$PATH" in
/opt/homebrew/bin:*) ;;
/opt/homebrew/bin) ;;
*) export PATH="/opt/homebrew/bin${PATH:+:$PATH}" ;;
esac
Note that on login shells, /etc/zprofile runs path_helper which re-derives PATH from /etc/paths + /etc/paths.d/* and puts /opt/homebrew/bin at the end — so the prefix must be re-asserted in a file that runs after /etc/zprofile (e.g. ~/.zshrc).
Impact
This affects every macOS developer or agent using Spec-Kit with a description containing acronyms (e.g. "AI Act", "RGPD", "GDPR", "API", "OAuth", "HIPAA", "PCI"). The "feature name" used downstream in specs/NNN-short-name/spec.md is the same truncated string, so the spec file itself also loses the acronym, and any tooling that relies on the branch/spec name to understand the feature (e.g. CI labels, dashboards, search) gets the wrong subject.
Discovered while piloting Spec-Kit on ada-legal-ai (PR #11 in the HOILAB org). Same root cause likely affects any other team running Spec-Kit on macOS.
- Langage dominant
- Python
- Étoiles
- 139k
- Forks
- 12.5k
- Merge moyen
- 2 j 5 h
- PR mergées (30 j)
- 164
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de github/spec-kit
-
triage-nice-to-have
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
feature-assess feature-go triage-can-wait
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
github/spec-kit#4804 · 6 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
needs-triage triage-nice-to-have
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
github/spec-kit#4527 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: specify init writes speckit.manifest.json without the speckit-converge skill it just installedPeut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouvertebug-assess severity-medium
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
github/spec-kit#4273 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: /speckit-implement counts checkbox markers inside fenced code blocks — example checkboxes can falsely block implementationPeut-être pris @ntdatt812 l’a pris il y a 24 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de github/spec-kit
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 Une demi-journée Accessibilité débutants 70/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Qiskit/qiskit-ibm-runtime#3431 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
[Lesson] A compatibility-gate rejection is a verdict, not something to overwrite with --accept-riskOuvertelesson-submission needs-ac pending-review
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
Ikalus1988/MisakaNet#2870 ·
Les mainteneurs répondent en général sous 1 jour
-
feature:LinkChecker
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
digitalfabrik/integreat-cms#4594 ·
Les mainteneurs répondent en général sous 5 jours