Summary
Feature-directory resolution is inconsistent across the bundled scripts. check-prerequisites.sh (used by /speckit.implement) enforces the feature-branch name unconditionally, while setup-plan.sh and setup-tasks.sh skip that check when .specify/feature.json pins a valid feature directory. As a result, a valid feature.json lets plan and tasks run on any branch, but /speckit.implement still fails on a branch not named NNN-....
Environment
Detail
scripts/bash/common.sh get_feature_paths resolves the feature directory from, in priority order:
SPECIFY_FEATURE_DIRECTORY env var
.specify/feature.json feature_directory
- branch-name prefix lookup
setup-plan.sh and setup-tasks.sh wrap the branch validation with feature_json_matches_feature_dir, e.g. "skip the git branch pattern check when feature.json resolves to the active feature dir". But check-prerequisites.sh calls check_feature_branch "$CURRENT_BRANCH" "$HAS_GIT" unconditionally, with no such guard. CURRENT_BRANCH comes from the git branch (unless SPECIFY_FEATURE is set), so feature.json alone does not let /speckit.implement proceed.
Steps to reproduce
- In a git repo, on a branch not named like
NNN-... (e.g. feature/foo), create specs/001-x/{spec,plan,tasks}.md and .specify/feature.json = {"feature_directory":"specs/001-x"}.
- Run the plan or tasks prerequisite (
setup-plan.sh / setup-tasks.sh): passes (feature.json honored).
- Run
check-prerequisites.sh --json --require-tasks: fails with ERROR: Not on a feature branch.
Expected
Consistent resolution. If .specify/feature.json (or SPECIFY_FEATURE_DIRECTORY) pins a valid feature directory, every prerequisite script should accept it.
Actual
check-prerequisites.sh ignores feature.json for the branch gate, so /speckit.implement fails where /speckit.plan and /speckit.tasks succeed.
Suggested fix
Wrap the check_feature_branch call in check-prerequisites.sh with the same feature_json_matches_feature_dir guard used by setup-plan.sh / setup-tasks.sh, so the branch-name check is skipped when feature.json resolves to the active feature directory.
Summary
Feature-directory resolution is inconsistent across the bundled scripts.
check-prerequisites.sh(used by/speckit.implement) enforces the feature-branch name unconditionally, whilesetup-plan.shandsetup-tasks.shskip that check when.specify/feature.jsonpins a valid feature directory. As a result, a validfeature.jsonletsplanandtasksrun on any branch, but/speckit.implementstill fails on a branch not namedNNN-....Environment
0.8.18Detail
scripts/bash/common.shget_feature_pathsresolves the feature directory from, in priority order:SPECIFY_FEATURE_DIRECTORYenv var.specify/feature.jsonfeature_directorysetup-plan.shandsetup-tasks.shwrap the branch validation withfeature_json_matches_feature_dir, e.g. "skip the git branch pattern check when feature.json resolves to the active feature dir". Butcheck-prerequisites.shcallscheck_feature_branch "$CURRENT_BRANCH" "$HAS_GIT"unconditionally, with no such guard.CURRENT_BRANCHcomes from the git branch (unlessSPECIFY_FEATUREis set), sofeature.jsonalone does not let/speckit.implementproceed.Steps to reproduce
NNN-...(e.g.feature/foo), createspecs/001-x/{spec,plan,tasks}.mdand.specify/feature.json={"feature_directory":"specs/001-x"}.setup-plan.sh/setup-tasks.sh): passes (feature.json honored).check-prerequisites.sh --json --require-tasks: fails withERROR: Not on a feature branch.Expected
Consistent resolution. If
.specify/feature.json(orSPECIFY_FEATURE_DIRECTORY) pins a valid feature directory, every prerequisite script should accept it.Actual
check-prerequisites.shignoresfeature.jsonfor the branch gate, so/speckit.implementfails where/speckit.planand/speckit.taskssucceed.Suggested fix
Wrap the
check_feature_branchcall incheck-prerequisites.shwith the samefeature_json_matches_feature_dirguard used bysetup-plan.sh/setup-tasks.sh, so the branch-name check is skipped whenfeature.jsonresolves to the active feature directory.