Archive a completed change in the experimental workflow.
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
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
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.
Assess delta spec sync state
Use artifactPaths.specs.existingOutputPaths from status JSON to check for delta 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, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change ''. Delta spec analysis: "). Proceed to archive regardless of choice.
Perform the archive
Create an archive directory under planningHome.changesDir if it doesn't exist:
mkdir -p "<planningHome.changesDir>/archive"
Generate target name using current date: YYYY-MM-DD-<change-name>
Check if target already exists:
- If yes: Fail with error, suggest renaming existing archive or using different date
- If no: Move
changeRoot to the archive directory
mv "<changeRoot>" "<planningHome.changesDir>/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)
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" 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
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
- Show clear summary of what happened
- If sync is requested, use openspec-sync-specs approach (agent-driven)
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
Source: liangxiegame/QFramework — distributed by TomeVault.
1---2name: openspec-archive-change-223description: Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete. Use when this capability is needed.4---56Archive a completed change in the experimental workflow.78**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.910**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.1112**Steps**13141. **If no change name provided, prompt for selection**1516 Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.1718 Show only active changes (not already archived).19 Include the schema used for each change if available.2021 **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.22232. **Check artifact completion status**2425 Run `openspec status --change "<name>" --json` to check artifact completion.2627 Parse the JSON to understand:28 - `schemaName`: The workflow being used29 - `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context30 - `artifacts`: List of artifacts with their status (`done` or other)3132 **If any artifacts are not `done`:**33 - Display warning listing incomplete artifacts34 - Use **AskUserQuestion tool** to confirm user wants to proceed35 - Proceed if user confirms36373. **Check task completion status**3839 Read the tasks file (typically `tasks.md`) to check for incomplete tasks.4041 Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).4243 **If incomplete tasks found:**44 - Display warning showing count of incomplete tasks45 - Use **AskUserQuestion tool** to confirm user wants to proceed46 - Proceed if user confirms4748 **If no tasks file exists:** Proceed without task-related warning.49504. **Assess delta spec sync state**5152 Use `artifactPaths.specs.existingOutputPaths` from status JSON to check for delta specs. If none exist, proceed without sync prompt.5354 **If delta specs exist:**55 - Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`56 - Determine what changes would be applied (adds, modifications, removals, renames)57 - Show a combined summary before prompting5859 **Prompt options:**60 - If changes needed: "Sync now (recommended)", "Archive without syncing"61 - If already synced: "Archive now", "Sync anyway", "Cancel"6263 If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.64655. **Perform the archive**6667 Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:68 ```bash69 mkdir -p "<planningHome.changesDir>/archive"70 ```7172 Generate target name using current date: `YYYY-MM-DD-<change-name>`7374 **Check if target already exists:**75 - If yes: Fail with error, suggest renaming existing archive or using different date76 - If no: Move `changeRoot` to the archive directory7778 ```bash79 mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"80 ```81826. **Display summary**8384 Show archive completion summary including:85 - Change name86 - Schema that was used87 - Archive location88 - Whether specs were synced (if applicable)89 - Note about any warnings (incomplete artifacts/tasks)9091**Output On Success**9293```94## Archive Complete9596**Change:** <change-name>97**Schema:** <schema-name>98**Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/99**Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")100101All artifacts complete. All tasks complete.102```103104**Guardrails**105- Always prompt for change selection if not provided106- Use artifact graph (openspec status --json) for completion checking107- Don't block archive on warnings - just inform and confirm108- Preserve .openspec.yaml when moving to archive (it moves with the directory)109- Show clear summary of what happened110- If sync is requested, use openspec-sync-specs approach (agent-driven)111- If delta specs exist, always run the sync assessment and show the combined summary before prompting112113---114> Source: [liangxiegame/QFramework](https://github.com/liangxiegame/QFramework) — distributed by [TomeVault](https://tomevault.io).115<!-- tomevault:4.0:skill_md:2026-07-05 -->