Bug Description
get_feature_paths() in common.sh calls _persist_feature_json when SPECIFY_FEATURE_DIRECTORY is set, even when invoked purely for path resolution — e.g. check-prerequisites.sh --paths-only, which is documented as "only output path variables (no validation)". This writes the tracked file .specify/feature.json and can overwrite a previously pinned feature directory when a caller passes a temporary override. A skip-write-when-unchanged guard exists, so it only writes when the value differs — but an override value still triggers an unexpected write.
Steps to Reproduce
- Pin a feature directory in .specify/feature.json.
- Run check-prerequisites.sh --paths-only with SPECIFY_FEATURE_DIRECTORY set to a different value.
- Run git status.
Expected Behavior
Read-only / --paths-only path resolution does not modify tracked files.
Actual Behavior
.specify/feature.json is rewritten — the working tree is dirtied and the pinned value is overwritten.
Specify CLI Version
0.11.0
AI Agent
GitHub Copilot
Operating System
macOS Tahoe 26.5.1
Python Version
3.11.15 (uv-managed standalone CPython, cpython-3.11-macos-aarch64-none — uv installs specify under its own Python, not the system CLT 3.9.6 or Homebrew 3.13/3.14)
Error Logs
Additional Context
Files: .specify/scripts/bash/common.sh (get_feature_paths, _persist_feature_json), .specify/scripts/bash/check-prerequisites.sh. Suggested fix: an opt-out (e.g. SPECIFY_NO_PERSIST_FEATURE_JSON=1) honored in --paths-only mode. Sibling issues: agent-context scoped layout; empty CURRENT_BRANCH.
Bug Description
get_feature_paths() in common.sh calls _persist_feature_json when SPECIFY_FEATURE_DIRECTORY is set, even when invoked purely for path resolution — e.g. check-prerequisites.sh --paths-only, which is documented as "only output path variables (no validation)". This writes the tracked file .specify/feature.json and can overwrite a previously pinned feature directory when a caller passes a temporary override. A skip-write-when-unchanged guard exists, so it only writes when the value differs — but an override value still triggers an unexpected write.
Steps to Reproduce
Expected Behavior
Read-only / --paths-only path resolution does not modify tracked files.
Actual Behavior
.specify/feature.json is rewritten — the working tree is dirtied and the pinned value is overwritten.
Specify CLI Version
0.11.0
AI Agent
GitHub Copilot
Operating System
macOS Tahoe 26.5.1
Python Version
3.11.15 (uv-managed standalone CPython, cpython-3.11-macos-aarch64-none — uv installs
specifyunder its own Python, not the system CLT 3.9.6 or Homebrew 3.13/3.14)Error Logs
Additional Context
Files: .specify/scripts/bash/common.sh (get_feature_paths, _persist_feature_json), .specify/scripts/bash/check-prerequisites.sh. Suggested fix: an opt-out (e.g. SPECIFY_NO_PERSIST_FEATURE_JSON=1) honored in --paths-only mode. Sibling issues: agent-context scoped layout; empty CURRENT_BRANCH.