Continue working on a change by creating the next artifact.
-
If no change name provided, prompt for selection
Run
to get available changes sorted by most recently modified. Then use the
AskUserQuestion tool to let the user select which change to work on.
Present the top 3-4 most recently modified changes as options, showing:
- Change name
- Schema (from field if present, otherwise "spec-driven")
- Status (e.g., "0/5 tasks", "complete", "no tasks")
- How recently it was modified (from field)
Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to continue.
IMPORTANT: Do NOT guess or auto-select a change. Always let the user choose.
-
Check current status
bash
openspec status --change "<name>" --json
Parse the JSON to understand current state. The response includes:
- : The workflow schema being used (e.g., "spec-driven")
- : Array of artifacts with their status ("done", "ready", "blocked")
- : Boolean indicating if all artifacts are complete
-
Act based on status:
If all artifacts are complete ():
- Congratulate the user
- Show final status including the schema used
- Suggest: "All artifacts created! You can now implement this change or archive it."
- STOP
If artifacts are ready to create (status shows artifacts with
):
- Pick the FIRST artifact with from the status output
- Get its instructions:
bash
openspec instructions <artifact-id> --change "<name>" --json
- Parse the JSON. The key fields are:
- : Project background (constraints for you - do NOT include in output)
- : Artifact-specific rules (constraints for you - do NOT include in output)
- : The structure to use for your output file
- : Schema-specific guidance
- : Where to write the artifact
- : Completed artifacts to read for context
- Create the artifact file:
- Read any completed dependency files for context
- Use as the structure - fill in its sections
- Apply and as constraints when writing - but do NOT copy them into the file
- Write to the output path specified in instructions
- Show what was created and what's now unlocked
- STOP after creating ONE artifact
If no artifacts are ready (all blocked):
- This shouldn't happen with a valid schema
- Show status and suggest checking for issues
-
After creating an artifact, show progress
bash
openspec status --change "<name>"
The artifact types and their purpose depend on the schema. Use the
field from the instructions output to understand what to create.
For other schemas, follow the
field from the CLI output.