Description
When archiving a change that creates a new main spec, the openspec archive command ignores the ## Purpose section present in the delta spec and always writes a TBD placeholder in the resulting main spec.
Steps to Reproduce
- Create a change:
openspec new change my-change
- Write a delta spec with both
## Purpose and ## ADDED Requirements:
## Purpose
Ensures every delta spec includes a Purpose section so that archive produces complete main specs without TBD placeholders.
## ADDED Requirements
### Requirement: Example requirement
The system SHALL do something.
#### Scenario: Example
- **WHEN** something happens
- **THEN** result occurs
- Complete all artifacts and run:
openspec archive my-change --yes
Expected Behavior
The resulting main spec at openspec/specs/<name>/spec.md should carry over the ## Purpose content from the delta spec.
Actual Behavior
The main spec is created with:
## Purpose
TBD - created by archiving change my-change. Update Purpose after archive.
The Purpose provided in the delta spec is discarded.
Workaround
Manually editing the main spec after every archive to replace the TBD placeholder with the intended Purpose.
Environment
- OpenSpec CLI v1.5.0
- macOS, Node 22
Description
When archiving a change that creates a new main spec, the
openspec archivecommand ignores the## Purposesection present in the delta spec and always writes a TBD placeholder in the resulting main spec.Steps to Reproduce
openspec new change my-change## Purposeand## ADDED Requirements:openspec archive my-change --yesExpected Behavior
The resulting main spec at
openspec/specs/<name>/spec.mdshould carry over the## Purposecontent from the delta spec.Actual Behavior
The main spec is created with:
## Purpose TBD - created by archiving change my-change. Update Purpose after archive.The Purpose provided in the delta spec is discarded.
Workaround
Manually editing the main spec after every archive to replace the TBD placeholder with the intended Purpose.
Environment