with one click
openspec-archive-change
// 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. Use when the user wants to finalize and archive a change after implementation is complete.
[HINT] Download the complete skill directory including SKILL.md and all related files
| 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.3.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
Verify project board Status=Done before archiving (per project-board-sync.md ยง2 L7)
Invoke scripts/verify_board_state.py BEFORE doing any archive work. The script queries the GH Project board and exits non-zero if the matching item's Status is not Done. Refuse to archive on non-zero exit โ do NOT paraphrase the script's output, cite the exit code (per verification-before-completion.md ยง4.1.2).
Required env / inputs:
--change-id โ the OpenSpec change-id being archived--owner โ GH user/org login owning the project--project-number โ numeric Project V2 ID--expected-status Done โ default for archive workflowspython -m scripts.verify_board_state \
--change-id <name> \
--owner <gh-user-or-org> \
--project-number <N> \
--expected-status Done
Exit-code semantics (stable contract):
0 โ Status=Done, proceed.1 โ Status mismatch. Refuse archive: surface the script's stderr to the user and ask them to (a) wait for L1 PR-merged automation to fire, or (b) verify the L2 workflow ran correctly, or (c) manually advance the status if board got drift.2 โ Item not found. Refuse archive: the change-id doesn't match a project item title.3 โ GraphQL/network error. Surface to user and offer one retry.If scripts/verify_board_state.py is not present (consumer on ai-playbook < v0.10.0): emit a warning and continue (legacy behaviour). New consumers (v0.10.0+) MUST have the script and MUST not bypass.
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.
Assess delta spec sync state (informational only โ no automated sync in this version)
Check for delta specs at openspec/changes/<name>/specs/. If none exist, proceed without notice.
If delta specs exist:
openspec/specs/<capability>/spec.mdFuture enhancement: a dedicated spec-sync skill is planned for v0.8.0 (per specs/v0.8.0-roadmap.md item 10). For now, archive only does the move + retro โ no automated sync is performed.
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>
Chain a retrospective write to retros/<change-id>.md (Gate F deliverable)
Per runbook-bmad-openspec.md ยง3.1 and ยง4 + Gate F in ยง5, every archive MUST chain a retro write. Path: retros/<change-id>.md (relative to the project root). Create the retros/ directory if it does not exist.
If a bmad-retrospective skill is available, invoke it via the Skill tool, passing the change-id and the archive path. It produces the retro per the BMAD retrospective format.
Otherwise, write a stub markdown directly with the following sections (the human fills them in):
# Retrospective: <change-id>
- **Archived**: YYYY-MM-DD
- **Archive path**: openspec/changes/archive/YYYY-MM-DD-<change-id>/
- **Schema**: <schema-name>
## What worked
<one-paragraph: practices, patterns, decisions that paid off>
## What didn't
<one-paragraph: friction, surprises, rework>
## Lessons
<bulleted: durable lessons; candidates for retention to Hindsight if cross-project>
## Carry-forward to next change
<bulleted: action items, follow-up tickets, spec edits>
If retros/<change-id>.md already exists, do NOT overwrite โ append a new dated section instead and warn the user.
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:** No automated sync (deferred to v0.8.0 spec-sync skill); delta-spec assessment shown above for human follow-up.
**Retro:** retros/<change-id>.md (stub written / appended)
All artifacts complete. All tasks complete.
Guardrails