feat(templates): add py: lines to command templates' scripts frontmatter#3403
Merged
Conversation
Every templates/commands/*.md with a scripts: block now declares a py: variant so --script py renders a Python invocation via the existing interpreter-prefixing in process_template. Fixes github#3283 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Spec Kit’s command templates to include a py: entry in their scripts: frontmatter blocks, and adds tests to ensure IntegrationBase.process_template(..., script_type="py") renders a Python-invocation string (supporting the --script py pathway described in #3283/#3277).
Changes:
- Add
py:script lines to all 8templates/commands/*.mdfiles that declare ascripts:block. - Add
tests/test_command_template_py_scripts.pyto validatepy:presence and basic--script pyrendering behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_command_template_py_scripts.py | New tests to discover scripted templates, assert py: lines exist, and validate process_template(..., "py") output shape |
| templates/commands/analyze.md | Add py: script entry for check prerequisites |
| templates/commands/checklist.md | Add py: script entry for check prerequisites |
| templates/commands/clarify.md | Add py: script entry for check prerequisites |
| templates/commands/converge.md | Add py: script entry for check prerequisites |
| templates/commands/implement.md | Add py: script entry for check prerequisites |
| templates/commands/plan.md | Add py: script entry for plan setup |
| templates/commands/tasks.md | Add py: script entry for tasks setup |
| templates/commands/taskstoissues.md | Add py: script entry for check prerequisites |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
install_shared_infra mapped every non-sh script type to powershell, so --script py rendered invocations pointing at files that were never installed. Map py to the python variant dir and skip __pycache__ artifacts during the copy. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop the plan/tasks py: lines that referenced scripts shipping in the core port (github#3280); they move to that PR. Tests now assert every py: line points at a script the repo ships, so a dangling reference can never merge green. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
marcelsafin
added a commit
to marcelsafin/spec-kit
that referenced
this pull request
Jul 8, 2026
Ships with the scripts they reference; the remaining templates got their py: lines in github#3403. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Fixes #3283 (part of #3277)
Adds a
py:line to thescripts:frontmatter block in the 6 command templates whose referenced Python script already ships in the repo (check_prerequisites.py).plan.mdandtasks.mdget their lines in #3386 together withsetup_plan.py/setup_tasks.py; a test asserts everypy:line points at an existing script, so a dangling reference cannot merge green.process_templatealready handles thepyscript type (interpreter resolution, quoting, path rewrite to.specify/scripts/python/), so this is the last wiring needed for--script pyrendering.Extension commands reference scripts inline in prose rather than through
scripts:frontmatter, so no extension files change.Testing
uv run specify --helpuv sync && uv run pytest(3834 passed)New
tests/test_command_template_py_scripts.py(25 tests) discovers every scripted template and verifies: apy:line exists,--script pyrendering produces an interpreter-prefixed Python invocation, andshrendering is unchanged.AI Disclosure
Written with GitHub Copilot CLI; I reviewed the diff and test results.