feat: implement preset wrap strategy#2189
Open
kennedy-whytech wants to merge 5 commits intogithub:mainfrom
Open
feat: implement preset wrap strategy#2189kennedy-whytech wants to merge 5 commits intogithub:mainfrom
kennedy-whytech wants to merge 5 commits intogithub:mainfrom
Conversation
…E_TEMPLATE} with core command body
…EMPLATE} for all agent types
604b585 to
444daef
Compare
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
Implements
strategy: wrapfor preset commands, which was listed as a roadmapitem in
presets/README.md. When a preset command setsstrategy: wrap, the{CORE_TEMPLATE}placeholder in its body is substituted with the body of theinstalled core speckit command template at install time.
This lets preset authors add pre/post logic around core commands without
copy-pasting the entire command body — useful for extending frequently-updated
templates like
/speckit.specifyor/speckit.tasks. Personally, I find it neccessary.Changes
src/specify_cli/presets.py— adds_substitute_core_template()helper;wires substitution into
_register_skills(skills-backed agents like Claude)src/specify_cli/agents.py— wires substitution intoregister_commands(all other agent types)
presets/self-test/— adds aspeckit.wrap-testcommand for E2E coveragepresets/README.md— markswrapas implemented for command/template typesTest results
184 tests pass (
tests/test_presets.py), including a newTestWrapStrategyclass with unit tests for the helper and an end-to-end install test.
Manual test results
Agent: Claude Code | OS/Shell: macOS/zsh
specify preset installwithstrategy: wrapcommand{CORE_TEMPLATE}correctly substituted in written skill/command fileAI assistance disclosure
This PR was implemented with AI assistance (Claude Code) for code generation,
test writing, and commit messages. All changes were reviewed and verified
manually.
Testing
uv run specify --helpuv sync && uv run pytestAI Disclosure