spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

Add `init` workflow step to bootstrap projects like `specify init`

Open Copilot opened this issue 5 months ago • 0 comments

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) in src/specify_cli/workflows/steps/init/ — runs the bundled specify init command in-process against context.project_root, capturing exit_code/stdout/stderr and returning FAILED on 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-tools since workflows run unattended.
    • When only engine-owned directories (.specify/) exist, --force is implicitly added so init proceeds unattended.
    • validate() rejects script values other than sh/ps.
  • Registration — added to STEP_REGISTRY and the engine's valid-step-types fallback.
  • Docs — workflows/ARCHITECTURE.md and workflows/README.md updated (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

Copilot avatar Jun 03 '26 21:06 Copilot