Repository navigation
fix: substitute [DATE] in create-new-feature and setup-plan scripts - #5608
IlayWolfson wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The preservation test selects 002-existing instead of the seeded 001-existing, so its final assertion cannot detect changes to an existing spec’s literal [DATE].
1 open issue
What changed in this PR
This PR addresses part of #4335 by filling [DATE] when Spec Kit creates feature specifications and implementation plans, rather than leaving the date for the agent to infer.
Changes:
- Substitute today’s local date across Bash, PowerShell, and Python scripts while preserving other placeholders and existing files.
- Remove the blank line after the tasks template’s opening front-matter delimiter.
- Add cross-language regression coverage and update an existing plan-template assertion.
AI-generated review for the requester by GitHub Copilot (model unknown, autonomous). Validation used source inspection; tests were not run.
| File | Description |
|---|---|
| tests/test_template_date_and_frontmatter.py | Adds date-substitution, preservation, error-path, and front-matter tests. |
| tests/test_setup_plan_no_overwrite.py | Updates expected plan content to include the generated date. |
| templates/tasks-template.md | Removes the blank line inside front matter. |
| scripts/python/setup_plan.py | Substitutes [DATE] in new plans. |
| scripts/python/create_new_feature.py | Substitutes [DATE] in new specifications. |
| scripts/powershell/setup-plan.ps1 | Adds literal, culture-independent date substitution for plans. |
| scripts/powershell/create-new-feature.ps1 | Adds literal, culture-independent date substitution for specifications. |
| scripts/bash/setup-plan.sh | Substitutes dates while preserving trailing newlines. |
| scripts/bash/create-new-feature.sh | Substitutes the exact date token in new specifications. |
Review effort: Balanced (adaptive)
0f7cbba to
678783d
Compare
|
Force-pushed
AI disclosure: the rescope, squash and the Copilot test fixes were done with Claude (Opus 5.5) under my direction; I reviewed and ran the checks. |
Replaces literal [DATE] with today's local YYYY-MM-DD date when create-new-feature and setup-plan write spec.md and plan.md, across bash, PowerShell 5.1, and Python. Plain string replace, so other placeholders are untouched; --dry-run, --json and no-overwrite of an existing spec.md/plan.md behave as before. Part of github#4335. Assisted-by: Antigravity (model: claude-opus-5-5-high, autonomous) Assisted-by: Antigravity (model: gemini-4-neon-high, autonomous)
678783d to
ff38bd9
Compare


Part of #4335 (fixes the [DATE] substitution; the tasks-template front matter fix will come in a separate PR)
Description
The bug: the agent never got the date.
create-new-featureandsetup-plancopied the templates as-is, sospec.mdandplan.mdkept a literal[DATE]and the agent had to guess it, sometimes wrong.What this PR changes:
[DATE]with today's date (YYYY-MM-DD)create-new-featureandsetup-planplan.mdto the raw templatetests/test_setup_plan_no_overwrite.pytests/test_template_date_substitution.pyKept as-is: other placeholders (
[DATE_CREATED],$ARGUMENTS, ...),--dry-run,--json, and not overwriting an existingspec.mdorplan.md. Field labels in the templates are unchanged.Testing
Set up this checkout's
.venvand editable install using the local development guide. Run commands from the checkout root..venv/bin/specify --help(Windows PowerShell:.\.venv\Scripts\specify.exe --help)specify.exeon my machine, so I ran the same entry point throughpython -c "from specify_cli import main; ..."..venv/bin/python -m pytest tests -q(Windows PowerShell:.\.venv\Scripts\python.exe -m pytest tests -q); use affected test paths for focused checks andLC_ALL=en_US.UTF-8on macOSmain, all 36 pass with this fix (Python, Windows PowerShell 5.1, Git Bash). The 12 that pass onmainguard behavior that must not change.@requires_bashcase that fails on Windows Git Bash because of/tmppaths (not related to this change)ruff check src tests: passedspecify init --script ps, then ran both scripts in PowerShell 5.1:spec.mdandplan.mdgot today's date.AI Disclosure
AI disclosure: I used Antigravity agents in separate checkouts that could not see each other's work: Claude Opus (high, autonomous) wrote the fix, a second agent wrote the regression tests, and Gemini (high, autonomous) wrote an independent blind test suite that I used only locally. After review, Claude (Opus 5.5) fixed the test Copilot flagged, removed the front-matter change and squashed the PR into one commit, under my direction. I reviewed the diffs, ran the tests and the sample project myself, and edited this description.