Skip to content

openspec schema init --default sets a config key nothing reads #1708

Closed

Description

@TabishB

The problem

openspec schema init <name> --default says it made your new schema the project default, but new changes keep using spec-driven.

The flag writes defaultSchema: <name> to openspec/config.yaml. Nothing in the CLI reads that key. The key the config loader actually reads is schema.

Reproduce

openspec schema init my-workflow --default
# ...
# Set as project default schema.

cat openspec/config.yaml
# defaultSchema: my-workflow

openspec new change test-change
# Creating change 'test-change' with schema 'spec-driven'...
# Schema: spec-driven

The new change is created with spec-driven, not my-workflow. No warning is printed.

Expected

After --default, new changes use the schema you just created:

openspec new change test-change
# Schema: my-workflow

That's what happens when openspec/config.yaml contains schema: my-workflow instead (verified by editing the file by hand).

Cause

So the flag has been a no-op since it was added in #525.

Fix

In schema init, write schema: <name> instead of defaultSchema: <name> (both branches: updating an existing config.yaml and creating a new one). Two lines.

openspec schema init --help ("Set as project default schema") and the success message are both correct once the key is fixed.

The CLI reference already describes the current behaviour honestly (docs-lab/reference/cli.md, the --default row under openspec schema init). Update that row once this lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions