Skip to content

Feature Request: Support on_archive (post-archive hooks) in schema for custom artifact moves/copies #704

@da1z

Description

@da1z

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.md files that should end up in docs/
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions