Skip to content

Proposal: decide where workflow phases (apply/archive/sync) are configured — schema.yaml, config.yaml, or both #1456

Description

@clay-good

Summary

OpenSpec has two places project guidance can live, and workflow phases (apply, archive, sync) are currently mapped into them inconsistently. We should decide the intended mapping deliberately and make the CLI surface follow it.

This is a design decision to schedule, not a bug. It came out of review on #1062 (which is fine to ship as-is) and it subsumes #1383.

The intended split

The distinction is about reuse, not about which fields exist where:

Location Scope Meaning
schema.yaml Global Reusable across projects — how this kind of workflow works
config.yaml Project-specific How this project works

Both are legitimate homes for phase guidance, and the likely end state is both — a global default in the schema, overridden or extended per project in config. What we don't have is a decided, documented mapping, or a merge/precedence rule between the two.

Where it's inconsistent today

apply is a phase block in schema.yaml:

# schemas/spec-driven/schema.yaml
apply:
  requires: [tasks]
  tracks: tasks.md
  instruction: |
    Read context files, work through pending tasks, mark complete as you go.

archive guidance, after #1062, is a config namespace:

# openspec/config.yaml
operations:
  archive:
    guidance:
      - Summarize the archive outcome before finishing

sync has no configurable guidance in either place. So the same concept — "how should the agent conduct this phase" — has three different answers depending on which phase you ask about. #1383 asks for the schema.yaml half of this and is still open.

Already decided — not reopening

@TabishB settled the artifact-vs-operation distinction on #1062, and this issue takes it as given:

Artifact rule     = what an output should look like
Operation guidance = optional advice for how to do some work
Skill             = the built-in steps for doing the work
CLI check         = something that must pass

Artifact rules "travel with the artifact" — archive receives the specs rules because archive happens to produce a spec, not because they are archive rules. operations.<phase>.guidance living in config.yaml was also his explicit call, implemented as specified in #1062. Neither is an open question here. What remains open is only whether phases also get a home in schema.yaml, and how the two would combine.

The CLI surface follows from it

openspec instructions [artifact] takes a positional documented as an artifact ID, but apply and (after #1062) archive are accepted there as reserved words. Artifact IDs come from user-editable openspec/schemas/<name>/schema.yaml, so the namespaces genuinely overlap: a project-local schema that defines an artifact named archive can no longer reach it — verified on the #1062 branch, main returns the artifact and the branch silently returns archive inputs instead, with no error.

Once the phase model is settled, the fix is small and non-breaking:

  • rename the positional to <target> in help/docs — it's a positional, so Commander matches by position and nothing users type changes
  • add --operation <apply|archive|sync> as the unambiguous form, keeping the bare shorthand working
  • resolve phases from a namespace separate from artifact IDs so the collision can't happen

Open questions

  1. Do phases live in schema.yaml, config.yaml, or both?
  2. If both, what's the precedence/merge rule — does project config override the schema instruction, or append to it?
  3. Does sync become a first-class phase alongside apply and archive?
  4. Does the phase block carry structure (requires, tracks) like apply: does, or only free-text guidance?

Note

@0xTab's read is that a configurator for this will expose the gaps in the mapping better than reasoning about it in the abstract, so this may be worth sequencing behind that work rather than designing up front.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogReal issue or feature queued for later implementationcliCLI commands, output, flagsdesign-reviewNeeds product/design decisionenhancementNew feature or requestschemaSchema system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions