Sync delta specs from a change to main specs.
When to Use
- •User says "sync specs", "update main specs"
- •Before archiving to ensure main specs are current
- •When delta specs have evolved and need to be merged
Input: Optionally specify a change name. If omitted, prompt for selection.
Steps
- •
If no change name, prompt for selection
bashpython .agents/openspec_kit.py list
- •
Find delta specs
Check:
openspec/changes/<name>/specs/If no delta specs:
- •Inform user
- •STOP
- •
Compare each delta spec with main
For each capability spec in delta:
- •Read delta:
openspec/changes/<name>/specs/<capability>/spec.md - •Check main:
openspec/specs/<capability>/spec.md - •Determine diff (adds, modifications, removals)
- •Read delta:
- •
Show sync preview
Display:
code## Sync Preview: <change-name> | Capability | Action | Changes | |------------|--------|---------| | auth | Modify | 3 sections updated | | billing | Add | New spec |
- •
Apply sync
For each capability:
- •Ensure directory exists:
openspec/specs/<capability>/ - •Write/overwrite:
openspec/specs/<capability>/spec.md - •Preserve delta in change (don't delete)
- •Ensure directory exists:
- •
Show completion
List synced capabilities and their locations in main specs.
Guardrails
- •Always show preview before applying
- •Preserve delta specs in change directory
- •Create capability directories as needed
- •Inform user of any conflicts