/comet-archive runs a single script that syncs your delta specs into the canonical main specs, annotates the Design Doc and plan with their final status, moves the change directory to a dated archive folder, and marks the workflow complete. One command, fully automated — no manual document syncing required.
Trigger
Run/comet-archive directly, or let /comet auto-dispatch after Phase 4 completes.
Owner
OpenSpec — the archive phase is handled entirely bycomet-archive.sh, which operates on OpenSpec’s change and spec directory structure.
Prerequisites
Both conditions must be true before the archive phase can begin. The entry check enforces these as hard prerequisites:verify_result: passin.comet.yamlbranch_status: handledin.comet.yaml
What comet-archive.sh Does
Validates entry state
The script checks that
phase: archive, verify_result: pass, and archived: false are all set in .comet.yaml. If validation fails, it reports the specific field mismatch and exits with a non-zero code.Syncs delta specs to main specs
Each delta spec at
openspec/changes/<name>/specs/<capability>/spec.md is copied to (overwrites) the canonical main spec at openspec/specs/<capability>/spec.md. Before overwriting, the script prints a unified diff preview so you can confirm exactly what will change. This is the moment delta specs graduate to become the project’s canonical specifications.Annotates design doc frontmatter
The Design Doc at
docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md receives archived-with and status annotations in its frontmatter, recording that this design was completed and archived as part of this change.Annotates plan frontmatter
Similarly, the implementation plan at
docs/superpowers/plans/YYYY-MM-DD-<feature>.md receives archived-with frontmatter annotations, closing the link between the plan and the archived change.Moves the change to the archive directory
The active change directory at
openspec/changes/<name>/ is moved to openspec/changes/archive/YYYY-MM-DD-<name>/. The date prefix makes the archive chronologically browsable.Dry Run
Before executing the archive, you can preview exactly what the script will do — diffs, paths to be moved, frontmatter changes — without writing anything:After Archive
The change is complete. The activeopenspec/changes/<name>/ directory no longer exists — it has moved to openspec/changes/archive/YYYY-MM-DD-<name>/. To start new work, run /comet or /comet-open.
After the archive script runs successfully, do not run the phase guard (
comet-guard.sh archive) against the old change name — the active directory no longer exists. Archive completeness is determined by the script’s exit code and the presence of the dated archive directory.