Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.
Archive a completed change in the experimental workflow.
Input: Optionally specify a change name. If omitted, MUST prompt for available changes.
Steps
If no change name provided, prompt for selection
Run openspec list --json 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:
schemaName: The workflow being usedartifacts: List of artifacts with their status (done or other)If any artifacts are not done:
Check task completion status
Read the tasks file (typically tasks.md) to check for incomplete tasks.
Count tasks marked with - [ ] (incomplete) vs - [x] (complete).
If incomplete tasks found:
If no tasks file exists: Proceed without task-related warning.
Check if delta specs need syncing
Check if specs/ directory exists in the change with spec files.
If delta specs exist, perform a quick sync check:
a. For each delta spec at openspec/changes/<name>/specs/<capability>/spec.md:
### Requirement: <name>)b. Check corresponding main spec at openspec/specs/<capability>/spec.md:
c. Report findings:
If sync needed:
⚠️ Delta specs may not be synced:
- specs/auth/spec.md → Main spec missing requirement "Token Refresh"
- specs/api/spec.md → Main spec doesn't exist yet
Would you like to sync now before archiving?
If already synced (all requirements found):
If no delta specs exist: Proceed without sync-related checks.
Perform the archive
Create the archive directory if it doesn't exist:
mkdir -p openspec/changes/archive
Generate target name using current date: YYYY-MM-DD-<change-name>
Check if target already exists:
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
Display summary
Show archive completion summary including:
Output On Success
## Archive Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** ✓ Synced to main specs (or "No delta specs" or "⚠️ Not synced")
All artifacts complete. All tasks complete.
Guardrails