Skip to main content

Overview

The /sdd-archive command finalizes a completed change by merging delta specs into the main specs (source of truth) and moving the change folder to the archive. This closes the SDD cycle.
Only run this command after successful verification. The change should be code-complete and tested.

Usage

string
Optional. The change to archive. If omitted, archives the most recent verified change.

What It Does

1. Validates Readiness

Checks prerequisites:
  • ✓ Verification report exists?
  • ✓ Verification status is PASS or PASS WITH WARNINGS?
  • ✓ No CRITICAL issues?
  • ✓ All MUST/SHALL requirements met?

2. Merges Delta Specs

Syncs change specs into main specs:
Copies new spec files to main specs directory:

3. Moves to Archive

Relocates the change folder with timestamp:
Archive preserves:
  • Proposal
  • Exploration
  • Specs (delta)
  • Design
  • Tasks
  • Verification report

4. Generates Archive Report

Creates a summary:
  • Change name and date
  • Specs merged
  • Files affected
  • Audit trail reference

Example Output

Successful Archive

Output:
openspec/changes/add-dark-mode/ ↓ openspec/changes/archive/2024-03-04-add-dark-mode/

Archive with Warnings

User types: yes
User types: yes

Archive Structure

The archive preserves complete change history:

Delta Spec Merging

The archiver intelligently merges specs:

ADDED Requirements

Change spec:
Main spec after merge:

MODIFIED Requirements

Change spec:
Main spec after merge:

REMOVED Requirements

Change spec:
Main spec after merge:

When to Use

After Verification

Run after /sdd-verify passes successfully

Change Complete

All code written, tested, and reviewed

Before Deployment

Close the change before deploying to production

Cycle Completion

Final step in the SDD workflow
Don’t archive if:
  • Verification has CRITICAL issues
  • Tests are failing
  • MUST/SHALL requirements not met
  • Code review pending

Archive Checklist

Before archiving, confirm:
  • /sdd-verify run successfully
  • Status is PASS or PASS WITH WARNINGS
  • No CRITICAL issues
  • All tests passing
  • All tasks marked done
  • Code reviewed (if team process)
  • No TODOs (or documented as follow-up)
  • Ready to deploy
  • Delta specs reflect actual changes
  • No placeholder content
  • Scenarios match implementation
  • README updated if needed
  • API docs updated if needed
  • Migration guide written if needed

Rollback After Archive

If you need to revert an archived change:
1

Find archive

2

Read rollback plan

3

Revert code changes

Use git to revert commits or manually undo changes
4

Revert spec changes

Manually undo spec merges (ADDED → delete, MODIFIED → restore previous)

Spec Sync Behavior

How specs are synced:

Archive Reports

The archive report includes: