Archive an OpenSpec change
Move a change from active to archived, confirming completeness and offering to sync its delta specs into the long-lived main specs first.
Steps
Select the change. If not given, run
openspec list --json, show only active (non-archived) changes with their schema, and let the user choose. Never guess.Check artifact completion:
openspec status --change "<name>" --json— readschemaNameand each artifact's status. If any are notdone, show a warning listing them and confirm the user wants to proceed anyway.Check task completion. Read the tasks file (typically
tasks.md), count- [ ]vs- [x]. If incomplete tasks exist, warn with the count and confirm before proceeding. No tasks file means no warning needed.Assess delta spec sync state. Check
openspec/changes/<name>/specs/. If delta specs exist, compare each against its main spec atopenspec/specs/<capability>/spec.md, determine what would change, and show a combined summary before offering: "Sync now (recommended)" vs "Archive without syncing" (or, if already synced, "Archive now" / "Sync anyway" / "Cancel"). If the user chooses sync, delegate via the Task tool (subagent_type: general-purpose) with the prompt "Invoke/openspec-sync-specsfor change ''" plus the analyzed delta summary — then archive regardless of the sync choice made.Perform the archive:
mkdir -p openspec/changes/archive mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>Use the current date. If the target directory already exists, fail with an error and suggest renaming the existing archive or using a different date.
.openspec.yamlmoves with the directory automatically.Display a summary: change name, schema, archive location, whether specs were synced, and any warnings from steps 2-3.
Output
## Archive Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** synced to main specs / no delta specs / sync skipped
Guardrails
- Always prompt for change selection if not given — never auto-select.
- Warnings inform and require confirmation; they never silently block.
- Preserve
.openspec.yamlwhen moving to archive. - If delta specs exist, always run the sync assessment and show the combined summary before prompting, regardless of the user's eventual choice.
Completion
Complete when the change directory has moved to
openspec/changes/archive/YYYY-MM-DD-<name>/, any chosen spec sync has run,
and the summary — including every warning surfaced along the way — has been
shown to the user.