| 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. |
| allowed-tools | Bash(openspec:*) |
| license | MIT |
| compatibility | Requires openspec CLI. |
| metadata | {"author":"openspec","version":"1.0","generatedBy":"1.6.0"} |
Archive a completed change in the experimental workflow.
Local Workflow Customizations
The steps labeled Local Customization are repository-specific additions layered on top of the upstream OpenSpec skill. Keep them grouped when merging future upstream updates so the local workflow policy stays easy to review and reapply.
Store selection: If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run openspec store list --json to discover registered store ids, then pass --store <id> on the commands that read or write specs and changes (new change, status, instructions, list, show, validate, archive, doctor, context). Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local openspec/ root.
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
-
Select the change
Run openspec list --json to get available changes.
- If a change name was provided, use it.
- If no change name was provided and exactly one active change exists, use it automatically.
- If multiple active changes exist, use the AskUserQuestion tool to let the user select.
- If no active changes exist, stop and tell the user there is nothing to archive.
Show only active changes (not already archived) when prompting. Include the schema used for each change if available.
-
Check artifact completion status
Run openspec status --change "<name>" --json to check artifact completion.
Parse the JSON to understand:
schemaName: The workflow being used
planningHome, changeRoot, artifactPaths, and actionContext: path and scope context
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.
-
Local Customization: create a pre-archive commit when required
Inspect git status before syncing or moving the change.
- If the selected change has no relevant uncommitted work, continue.
- If the selected change has uncommitted implementation work, planning artifacts that missed the apply checkpoint, delta specs, or other directly related archive inputs, stage only relevant files and create a pre-archive commit before continuing.
Output On Success
## Archive Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
**Specs:** ✓ Synced to main specs (or "No delta specs")
All artifacts complete. All tasks complete.
Guardrails
- Auto-select the change when there is exactly one active change; otherwise prompt
- Use artifact graph (openspec status --json) for completion checking
- Don't block archive on warnings - just inform and confirm
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
- Show clear summary of what happened
- Always sync delta specs during archive; do not offer a skip path
- Do not use a subagent for archive-time spec sync
- Ask for confirmation before archiving when tasks remain incomplete
- Before archive, run applicable local build and test validation; ask for confirmation if an applicable check fails
- Create a pre-archive commit when the selected change has relevant uncommitted work, and a post-archive commit after sync and archive complete
- Do not treat commit/sync/archive workflow actions as implementation tasks