Archive a completed change in the experimental workflow.
-
If no change name provided, prompt for selection
Run
to get available changes. Use the
AskUserQuestion tool to let the user select.
Show only active changes (not already archived).
Include the schema used for each change if available.
IMPORTANT: Do NOT guess or auto-select a change. Always let the user choose.
-
Check artifact completion status
Run
openspec status --change "<name>" --json
to check artifact completion.
Parse the JSON to understand:
- : The workflow being used
- : List of artifacts with their status ( or other)
If any artifacts are not :
- Display warning listing incomplete artifacts
- Use AskUserQuestion tool to confirm user wants to proceed
- Proceed if user confirms
-
Check task completion status
Read the tasks file (typically
) to check for incomplete tasks.
Count tasks marked with
(incomplete) vs
(complete).
If incomplete tasks found:
- Display warning showing count of incomplete tasks
- Use AskUserQuestion tool to confirm user wants to proceed
- Proceed if user confirms
If no tasks file exists: Proceed without task-related warning.
-
Assess delta spec sync state
Check for delta specs at
openspec/changes/<name>/specs/
. If none exist, proceed without sync prompt.
If delta specs exist:
- Compare each delta spec with its corresponding main spec at
openspec/specs/<capability>/spec.md
- Determine what changes would be applied (adds, modifications, removals, renames)
- Show a combined summary before prompting
Prompt options:
- If changes needed: "Sync now (recommended)", "Archive without syncing"
- If already synced: "Archive now", "Sync anyway", "Cancel"
If user chooses sync, execute /opsx:sync logic (use the openspec-sync-specs skill). Proceed to archive regardless of
choice.
-
Perform the archive
Create the archive directory if it doesn't exist:
bash
mkdir -p openspec/changes/archive
Generate target name using current date:
Check if target already exists:
- If yes: Fail with error, suggest renaming existing archive or using different date
- If no: Move the change directory to archive
bash
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
-
Display summary
Show archive completion summary including:
- Change name
- Schema that was used
- Archive location
- Whether specs were synced (if applicable)
- Note about any warnings (incomplete artifacts/tasks)