Skip to content

fix(scripts): persist .specify/feature.json during feature creation#2273

Open
grafvonb wants to merge 2 commits intogithub:mainfrom
grafvonb:codex/fix-feature-json-persistence
Open

fix(scripts): persist .specify/feature.json during feature creation#2273
grafvonb wants to merge 2 commits intogithub:mainfrom
grafvonb:codex/fix-feature-json-persistence

Conversation

@grafvonb
Copy link
Copy Markdown
Contributor

Description

The current /speckit.specify workflow expects .specify/feature.json to exist, but the shipped create-new-feature scripts do not persist it.

That creates a mismatch between documented behavior and actual script behavior:

  • the command flow and downstream tooling expect feature_directory metadata
  • feature creation creates the branch and spec directory
  • but no .specify/feature.json file is written

As a result, later steps may rely on metadata that the standard feature-creation flow never produces.

This PR fixes that by persisting .specify/feature.json during 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

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest
  • Tested with a sample project (if applicable)

Additional verification:

  • pytest tests/test_timestamp_branches.py

Results in this environment:

  • 44 passed, 6 skipped

The skipped tests are PowerShell runtime tests because pwsh is not available in this environment.

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

Used Codex to inspect the existing /speckit.specify flow, implement the minimal script changes, and add/update regression tests.

Copilot AI review requested due to automatic review settings April 19, 2026 15:50
@grafvonb grafvonb requested a review from mnriem as a code owner April 19, 2026 15:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (with feature_directory) when creating a new feature via Bash script.
  • Persist .specify/feature.json (with feature_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.

@grafvonb grafvonb force-pushed the codex/fix-feature-json-persistence branch from af936c7 to 682a15b Compare April 19, 2026 16:01
Copilot AI review requested due to automatic review settings April 19, 2026 16:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@grafvonb grafvonb force-pushed the codex/fix-feature-json-persistence branch from 682a15b to fdc81ac Compare April 19, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants