-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Background
Currently, archiving a change in OpenSpec merges delta specs into openspec/specs/ and moves the full change folder to openspec/changes/archive/, preserving all artifacts. However, there is no configurable way to automatically move or copy additional artifacts (such as documentation, generated reports, or other outputs) to other locations (e.g., a project-wide docs/ folder) when a change is archived.
Problem
Custom workflows often generate output files that belong outside the archived change, such as:
doc.mdfiles that should end up indocs/- Other generated artifacts needed elsewhere in the project
Currently, this must be performed manually before archiving, making the process error-prone and less automatable.
Proposal
Add an on_archive hook to schema.yaml
Support an optional on_archive block in the schema file that declares rules for copying or moving specific artifacts/files when a change is archived.
Example schema.yaml (proposed):
name: my-workflow
version: 1
...
on_archive:
copy:
- from: doc.md
to: docs/
move:
- from: coverage.txt
to: builds/coverage/Benefits
- Unlocks advanced automation for doc+artifact handoffs
- Eliminates manual, error-prone steps
- Enables custom workflows with output location guarantees
- Makes archiving more powerful and composable