Add init workflow step to bootstrap projects like specify init#2838
Draft
Copilot wants to merge 5 commits into
Draft
Add init workflow step to bootstrap projects like specify init#2838Copilot wants to merge 5 commits into
init workflow step to bootstrap projects like specify init#2838Copilot wants to merge 5 commits into
Conversation
Copilot
AI
changed the title
[WIP] Add InitStep for bootstrapping project workflow
Add Jun 3, 2026
init workflow step to bootstrap projects like specify init
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new workflow step type (type: init) so workflows can bootstrap (or merge into) a Spec Kit project by invoking the bundled specify init logic in-process, enabling end-to-end “scaffold → run steps” workflows without requiring a manual pre-step.
Changes:
- Introduces
InitStep(src/specify_cli/workflows/steps/init/) that buildsspecify initargv from step config, runs it viaCliRunner, and capturesexit_code/stdout/stderr. - Registers the new step type in the workflow step registry and engine’s valid-step-type fallback, and updates architecture/README docs.
- Adds tests covering argv building, workflow-default integration fallback, directory creation via
project, invalid integration failure, and validation.
Show a summary per file
| File | Description |
|---|---|
| workflows/README.md | Documents the new init step type and provides a YAML example. |
| workflows/ARCHITECTURE.md | Updates step-type counts/table and module tree to include init. |
| tests/test_workflows.py | Adds test coverage for the new InitStep. |
| src/specify_cli/workflows/steps/init/init.py | Implements InitStep execution, expression resolution, and validation. |
| src/specify_cli/workflows/engine.py | Adds init to the engine’s valid step-type fallback set. |
| src/specify_cli/workflows/init.py | Registers InitStep in the built-in STEP_REGISTRY. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 3
Comment on lines
+101
to
+105
| base = context.project_root or os.getcwd() | ||
| try: | ||
| not_empty = any(os.scandir(base)) | ||
| except OSError: | ||
| not_empty = False |
Comment on lines
+202
to
+205
| try: | ||
| result = runner.invoke(app, argv, catch_exceptions=True) | ||
| finally: | ||
| os.chdir(prev_cwd) |
Comment on lines
+223
to
+228
| script = config.get("script") | ||
| if ( | ||
| isinstance(script, str) | ||
| and "{{" not in script | ||
| and script not in VALID_SCRIPT_TYPES | ||
| ): |
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.
Workflows had no way to scaffold a project; users had to run
specify initmanually before any workflow could drive the spec-driven process. This adds aninitstep type so a workflow can bootstrap (or merge into) a project itself.Changes
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.project,here,integration,script,force,no_git,ignore_agent_tools,preset,branch_numbering; string fields resolve{{ }}expressions.--ignore-agent-toolssince workflows run unattended.validate()rejectsscriptvalues other thansh/ps.STEP_REGISTRYand the engine's valid-step-types fallback.workflows/ARCHITECTURE.mdandworkflows/README.mdupdated (step table, module tree, new "Init Steps" section).Example