fix(scripts): warn when spec template is missing in create-new-feature.ps1 (parity with bash)#3230
Merged
mnriem merged 2 commits intoJun 29, 2026
Conversation
…e.ps1 (parity with bash) create-new-feature.sh prints 'Warning: Spec template not found; created empty spec file' to stderr when no spec template resolves, then touches an empty spec. The PowerShell twin created the empty file silently with no warning, so on Windows a missing/broken template tree gave no signal. Emit the same warning on stderr (keeps stdout/JSON pure), matching the bash wording and stream. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Regression test for the bash/PowerShell parity fix: with no resolvable spec template, the PowerShell script must emit 'Spec template not found' on stderr (matching bash) while keeping stdout parseable JSON and still creating the empty spec file. Gated on pwsh; decodes stdout/stderr as UTF-8. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Aligns the PowerShell create-new-feature.ps1 behavior with the bash twin by emitting a warning to stderr when no spec template can be resolved and the script falls back to creating an empty spec file. This improves UX on Windows while keeping stdout clean for JSON-mode consumers.
Changes:
- Add a stderr warning in
create-new-feature.ps1before creating an empty spec file when the spec template is missing. - Add a regression test ensuring the warning appears on stderr while stdout remains parseable JSON and the empty spec file is still created.
Show a summary per file
| File | Description |
|---|---|
| tests/test_timestamp_branches.py | Adds a PowerShell parity test asserting the missing-template warning is emitted on stderr and JSON stdout remains clean. |
| scripts/powershell/create-new-feature.ps1 | Writes the bash-matching warning to stderr when no spec template is found before creating an empty spec file. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Low
Collaborator
|
Thank you! |
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
When no spec template can be resolved, the bash
create-new-feature.shwarns before falling back to an empty spec:The PowerShell twin
create-new-feature.ps1created the empty file silently (no warning), so on Windows a missing or broken template tree gave the user no signal:Fix
Emit the same warning on stderr before creating the empty spec file, matching the bash wording and stream (keeps stdout/JSON output pure). One source file.
Testing
uvx ruff checkclean;tests/test_ps1_encoding.pygreen (edited.ps1stays ASCII / PowerShell 5.1-safe).TestSequentialBranchPowerShell::test_missing_spec_template_warns_matching_bash: with no resolvable template, assertsSpec template not foundon stderr, stdout still parseable JSON, and the empty spec file created. Fails before this change (PowerShell was silent), passes after.AI Disclosure
Found and fixed with Claude Code (Claude Opus 4.8) under my direction. AI located the missing-template warning divergence across the bash/PowerShell twins and drafted the fix plus a regression test; I verified the bash wording/stream and confirmed the warning lands on stderr with stdout staying pure JSON under Windows PowerShell 5.1, and reviewed the diff before submitting.