fix: honor template overrides for tasks-template (#2278)#2292
fix: honor template overrides for tasks-template (#2278)#2292mnriem merged 19 commits intogithub:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to bring the /tasks command into parity with /plan by adding template override resolution for tasks-template.md (overrides → presets → extensions → core) and updating docs accordingly.
Changes:
- Updated
templates/commands/tasks.mdto reference aTASKS_TEMPLATEplaceholder instead of a hardcoded path. - Added new setup scripts for resolving
tasks-template(bash + PowerShell) and wired PowerShell prerequisite checks to run them. - Updated preset documentation to state that the override stack applies to
tasks-template.mdas well.
Show a summary per file
| File | Description |
|---|---|
| templates/commands/tasks.md | Replaces hardcoded tasks template path with a placeholder reference. |
| scripts/powershell/setup-tasks.ps1 | Adds PowerShell template resolution and writes a resolved template file. |
| scripts/powershell/check-prerequisites.ps1 | Attempts to run setup scripts as part of prerequisite checking. |
| scripts/bash/setup-tasks.sh | Adds bash template resolution/export for tasks-template. |
| docs/reference/presets.md | Documents tasks-template as participating in the same override stack as plan-template. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 5
Suggested fix for #2278 / PR #2292The current PR introduces Since Overview
1.
|
mnriem
left a comment
There was a problem hiding this comment.
See comments authored together with Copilot above
ce75d8d to
05b1ea8
Compare
|
Hi @mnriem, thank you for the detailed feedback. I've rewritten the PR from scratch following your suggested approach: What changed:
The bash script also now fails fast with a non-zero exit and a clear error message if the template cannot be resolved, as suggested by Copilot. Please let me know if anything needs further adjustment. Thank you! |
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 3
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback
|
Thanks for the review @mnriem and Copilot. Fixed:
These were leftover artifacts from the heredoc used to write the files and would have caused a Not changed:
|
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 2
|
Please address Copilot feedback |
|
Thanks again @mnriem and Copilot. Fixed:
|
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
|
Please address Test & Lint errors |
|
Hi @mnriem, addressed the Test & Lint failures. The file inventory tests across 6 integration test files (
The 6 remaining failures in All 1388 previously passing tests continue to pass. |
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
templates/commands/tasks.md:79
- The PR description mentions switching to
{{TASKS_TEMPLATE}}/ exporting via env vars, but this command template currently relies on reading aTASKS_TEMPLATEfield from the JSON emitted by{SCRIPT}. Please either update the PR description (and any related docs) to match this JSON-based flow, or adjust the template to use the mechanism described, so future maintainers aren’t misled about how the template path is provided.
4. **Generate tasks.md**: Read the tasks template from TASKS_TEMPLATE (from the JSON output above) and use it as structure. If TASKS_TEMPLATE is empty, fall back to `.specify/templates/tasks-template.md`. Fill with:
- Files reviewed: 9/9 changed files
- Comments generated: 1
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 10/10 changed files
- Comments generated: 5
|
Looks like there is more to address according to Copilot. Also make sure the Test & Lint passes too |
|
@mnriem kindly review it |
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
tests/test_setup_tasks.py:295
- Writing
.specify/presets/.registryasjson.dumps(["aaa-preset", ...])does not match the.registryschema used byresolve_template/Resolve-Template(it expects a JSON object with apresetsproperty containing per-preset metadata likepriority). With the current format, bash resolution will fall back to an unordered directory scan when the python parser fails, so this test can pass without actually exercising registry ordering. Write a.registryobject with explicit priorities so the test proves the intended behavior.
# Write .registry JSON to declare preset order: aaa-preset first
registry_json = tasks_repo / ".specify" / "presets" / ".registry"
registry_json.write_text(
json.dumps(["aaa-preset", "test-preset"]), encoding="utf-8"
)
- Files reviewed: 10/10 changed files
- Comments generated: 1
|
Please address Copilot feedback |
|
@mnriem review it kindly |
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 10/10 changed files
- Comments generated: 1
|
Please address Copilot feedback |
|
@mnriem have a look on it kindly |
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 10/10 changed files
- Comments generated: 1
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 10/10 changed files
- Comments generated: 0 new
|
Hi @mnriem, all Copilot feedback has been addressed and all checks are passing. This PR is ready for review and merge. |
|
Thank you! |
This PR resolves #2278 by implementing a unified template resolution flow for the tasks command, bringing it into parity with the plan command.
Key Changes:
Removed hardcoded path in templates/commands/tasks.md in favor of {{TASKS_TEMPLATE}}.
Added setup-tasks.ps1 and setup-tasks.sh to handle the resolution priority stack (Overrides > Presets > Core).
Exported the resolved path via environment variables in the prerequisite check.
Updated docs/reference/presets.md to include tasks-template.md in the documented override stack.
Verification:
Confirmed on Windows 64-bit that local overrides in .specify/templates/overrides/tasks-template.md are correctly loaded and utilized by the AI agent.