> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comet.rpamis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# comet archive

> Complete OpenSpec archive, validate main specs, annotate linked artifacts, and close the Classic lifecycle.

`comet archive` is the stable deterministic archive command. A mutating archive requires a verified change and recorded final confirmation; `--dry-run` can preview the operation before confirmation.

```bash theme={null}
comet archive <change-name>
comet archive <change-name> --dry-run
```

## What it does

1. Validates the change name and locates active or partially archived state.
2. Requires `phase: archive` and `verify_result: pass` for both modes.
3. Checks the dated archive destination.
4. For `--dry-run`, reports the preview without requiring final confirmation or writing a pending action.
5. For a real archive, requires `archive_confirmation: confirmed` and writes a recoverable pending checkpoint.
6. Calls `openspec archive <change> --yes` to merge delta semantics and move the change.
7. Validates that main specs contain no delta-only headings.
8. Idempotently annotates the Design Doc and Plan, preserving a clean Markdown EOF.
9. Marks the change archived, completes Run state, and clears pending state.

Final user approval is recorded by `comet state transition <name> archive-confirm`. Reopening archive clears the old confirmation. Do not edit `archive_confirmation` or `archived` directly.

The command does not commit or push. Before running it, the Archive Skill confirms an immediate push or push plus PR. After success, the Skill writes `branch_status: handled`, runs the archive guard, and creates and pushes one complete commit containing the change move, main-spec merge, artifact annotations, and final state. Archived `docs/superpowers/` pointers remain rooted at the project, so the Dashboard can still display Design Docs, Plans, and verification reports.

<Note>
  The packaged <code>comet-archive.mjs</code> launcher remains for compatibility. Prefer{' '}
  <code>comet archive</code> in user and agent instructions.
</Note>
