feat(cli): add specify extension init scaffolding command#1929
Open
mvanhorn wants to merge 1 commit intogithub:mainfrom
Open
feat(cli): add specify extension init scaffolding command#1929mvanhorn wants to merge 1 commit intogithub:mainfrom
specify extension init scaffolding command#1929mvanhorn wants to merge 1 commit intogithub:mainfrom
Conversation
Add a new `specify extension init <name>` subcommand that scaffolds a ready-to-develop extension directory from the built-in template. Substitutes extension metadata (ID, name, author, description, repository URL, date) into all template files. The extension ecosystem has 23+ community extensions, all manually created by copying extensions/template/. This command completes the extension authoring lifecycle - every other stage (search, add, remove, enable, disable, update, catalog management) already has CLI support. Features: - Extension ID validation (lowercase, hyphen-separated) - Interactive prompts when CLI args are omitted - --output flag for custom output directory - --no-git flag to skip git initialization - Replaces EXAMPLE-README.md as the new README.md - Prints next-steps guidance panel Includes 23 pytest test cases covering validation, placeholder substitution, CLI integration, and edge cases.
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
Add a
specify extension init <name>subcommand that scaffolds a new extension directory from the built-in template (extensions/template/), substituting user-provided metadata into all placeholder values.The extension ecosystem has 23+ community extensions published to the catalog, each manually created by copying
extensions/template/and hand-editing 7 files. Every other stage of the extension lifecycle has CLI support (search, add, remove, enable, disable, update, set-priority, catalog management) - except creation. This closes that gap.What it does:
extensions/template/tospec-kit-<name>/in the current or specified directory^[a-z][a-z0-9]*(-[a-z0-9]+)*$)EXAMPLE-README.mdas the newREADME.md--no-gitto skip)specify initUsage:
This command does NOT require a spec-kit project - you can scaffold an extension anywhere, then test it with
specify extension add --dev /path/to/extension.The template source is resolved from the installed package first (works in wheel/air-gapped), falling back to the source tree layout.
Testing
pytest- all 810 existing tests passtests/test_extension_init.py:specify extension init my-test --no-gitproduces a working extension directory with all placeholders replacedAI Disclosure
This contribution was developed with AI assistance (Claude Code). The implementation follows existing patterns from the
specify initcommand andextension addsubcommand.