spec-kit
spec-kit copied to clipboard
Add `init` workflow step to bootstrap projects like `specify init`
Workflows had no way to scaffold a project; users had to run specify init manually before any workflow could drive the spec-driven process. This adds an init step type so a workflow can bootstrap (or merge into) a project itself.
Changes
- New
InitStep(type: init) insrc/specify_cli/workflows/steps/init/— runs the bundledspecify initcommand in-process againstcontext.project_root, capturingexit_code/stdout/stderrand returningFAILEDon non-zero exit.- Config fields (all optional):
project,here,integration,integration_options,script,force,ignore_agent_tools,preset; string fields resolve{{ }}expressions. - Integration falls back to the workflow-level default, then to
DEFAULT_INIT_INTEGRATION(copilot); defaults to--ignore-agent-toolssince workflows run unattended. - When only engine-owned directories (
.specify/) exist,--forceis implicitly added so init proceeds unattended. validate()rejectsscriptvalues other thansh/ps.
- Config fields (all optional):
- Registration — added to
STEP_REGISTRYand the engine's valid-step-types fallback. - Docs —
workflows/ARCHITECTURE.mdandworkflows/README.mdupdated (step table, module tree, new "Init Steps" section). - Tests — coverage for bootstrap, default-integration fallback, project-name subdirectory, invalid-integration failure, engine-owned dir handling, integration_options passthrough, and validation.
Example
- id: bootstrap
type: init
here: true
integration: copilot # optional; defaults to workflow integration
integration_options: "--skills" # optional
script: sh