| name | openspec-archive-change |
| description | Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete. |
| license | MIT |
| compatibility | Requires openspec CLI. |
| metadata | {"author":"openspec","version":"1.0","generatedBy":"1.2.0"} |
Archive a completed change in the experimental workflow.
Input: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you 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 used
artifacts: List of artifacts with their status (done or other)
If any artifacts are not done:
- 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 tasks.md) to check for incomplete tasks.
Count tasks marked with - [ ] (incomplete) vs - [x] (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.
-
Archive via CLI (merges delta specs and moves to archive)
The openspec archive CLI command handles both spec syncing and archiving in one step.
If the change has no delta specs (empty or missing specs/ directory), skip the sync:
openspec archive "<name>" --skip-specs -y
If delta specs exist, let the CLI merge them into openspec/specs/:
openspec archive "<name>" -y
The CLI will:
- Parse ADDED/MODIFIED/REMOVED sections from each delta spec
- Merge changes into the corresponding main spec at
openspec/specs/<domain>/spec.md
- Move the change folder to
openspec/changes/archive/YYYY-MM-DD-<name>/
If the CLI fails, report the error and stop. Do not attempt a manual move.
-
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)
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 "Sync skipped")
All artifacts complete. All tasks complete.
Guardrails
- Always prompt for change selection if not provided
- Use artifact graph (openspec status --json) for completion checking
- Don't block archive on warnings - just inform and confirm
- Always use the
openspec archive CLI command (never manual mv)
- The CLI handles spec merging, date-prefixed naming, and directory structure
- Show clear summary of what happened