Skip to content

feat: implement preset wrap strategy#2189

Open
kennedy-whytech wants to merge 5 commits intogithub:mainfrom
kennedy-whytech:kennedy-whytech-feat-preset-wrap-strategy
Open

feat: implement preset wrap strategy#2189
kennedy-whytech wants to merge 5 commits intogithub:mainfrom
kennedy-whytech:kennedy-whytech-feat-preset-wrap-strategy

Conversation

@kennedy-whytech
Copy link
Copy Markdown

@kennedy-whytech kennedy-whytech commented Apr 12, 2026

Description

Implements strategy: wrap for preset commands, which was listed as a roadmap
item in presets/README.md. When a preset command sets strategy: wrap, the
{CORE_TEMPLATE} placeholder in its body is substituted with the body of the
installed 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.specify or /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 into register_commands
    (all other agent types)
  • presets/self-test/ — adds a speckit.wrap-test command for E2E coverage
  • presets/README.md — marks wrap as implemented for command/template types

Test results

184 tests pass (tests/test_presets.py), including a new TestWrapStrategy
class with unit tests for the helper and an end-to-end install test.

Manual test results

Agent: Claude Code | OS/Shell: macOS/zsh

Command tested Notes
specify preset install with strategy: wrap command {CORE_TEMPLATE} correctly substituted in written skill/command file

AI 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

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest
  • Tested with a sample project (if applicable)

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

@kennedy-whytech kennedy-whytech requested a review from mnriem as a code owner April 12, 2026 14:35
@kennedy-whytech kennedy-whytech force-pushed the kennedy-whytech-feat-preset-wrap-strategy branch from 604b585 to 444daef Compare April 12, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant