fix(scripts): persist .specify/feature.json during feature creation#2273
Open
grafvonb wants to merge 2 commits intogithub:mainfrom
Open
fix(scripts): persist .specify/feature.json during feature creation#2273grafvonb wants to merge 2 commits intogithub:mainfrom
grafvonb wants to merge 2 commits intogithub:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns the shipped feature-creation scripts with the existing speckit.specify workflow expectation by ensuring .specify/feature.json is created during feature creation (both Bash and PowerShell), and adds regression coverage to prevent the mismatch from recurring.
Changes:
- Persist
.specify/feature.json(withfeature_directory) when creating a new feature via Bash script. - Persist
.specify/feature.json(withfeature_directory) when creating a new feature via PowerShell script. - Add Bash + PowerShell regression tests asserting the metadata file is written correctly.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_timestamp_branches.py | Adds regression tests verifying .specify/feature.json is created and contains the expected feature_directory. |
| scripts/bash/create-new-feature.sh | Writes .specify/feature.json during non-dry-run feature creation (jq when available, fallback JSON escaping otherwise). |
| scripts/powershell/create-new-feature.ps1 | Writes .specify/feature.json during non-dry-run feature creation and ensures the parent directory exists. |
| scripts/bash/common.sh | Removes trailing whitespace at EOF (no functional change). |
| scripts/powershell/common.ps1 | Removes trailing whitespace at EOF (no functional change). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
af936c7 to
682a15b
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
682a15b to
fdc81ac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The current
/speckit.specifyworkflow expects.specify/feature.jsonto exist, but the shippedcreate-new-featurescripts do not persist it.That creates a mismatch between documented behavior and actual script behavior:
feature_directorymetadata.specify/feature.jsonfile is writtenAs a result, later steps may rely on metadata that the standard feature-creation flow never produces.
This PR fixes that by persisting
.specify/feature.jsonduring feature creation in both the Bash and PowerShell scripts. It keeps the change intentionally small and aligns the shipped scripts with the workflow’s existing expectations.Testing
uv run specify --helpuv sync && uv run pytestAdditional verification:
pytest tests/test_timestamp_branches.pyResults in this environment:
44 passed, 6 skippedThe skipped tests are PowerShell runtime tests because
pwshis not available in this environment.AI Disclosure
Used Codex to inspect the existing
/speckit.specifyflow, implement the minimal script changes, and add/update regression tests.