Skip to content

Support project-scoped profile/workflow config via --scope project #914

@kitimark

Description

@kitimark

Problem

OpenSpec profile/workflow configuration is currently global-only, which causes cross-project coupling.

Today:

  • openspec config advertises only global scope
  • openspec update reads global config and regenerates project skills/commands from it

This means enabling/disabling workflows (e.g. sync) for one repo can unintentionally affect other repos on the same machine.

Relevant source:

  • src/commands/config.ts:
    • --scope <scope> says only global is supported
    • non-global scope is rejected with:
      Error: Project-local config is not yet implemented
  • src/core/global-config.ts: config path is global ($XDG_CONFIG_HOME / ~/.config)
  • src/core/update.ts: update resolves workflows from global config

Proposed Fix

Add project-scoped config support for profile/workflows with explicit precedence.

Scope model

  • --scope global (existing)
  • --scope project (new, repository-scoped)

Precedence (highest -> lowest)

  1. CLI flags
  2. Project config (--scope project)
  3. Global config (--scope global)
  4. Built-in defaults (core, both)

CLI behavior

  • openspec config list --scope project
  • openspec config get <key> --scope project
  • openspec config set <key> <value> --scope project
  • openspec config profile --scope project
  • openspec update should use effective config from precedence above

Acceptance Criteria

  • --scope project is supported for config read/write commands
  • Project-scoped profile, delivery, and workflows can be persisted in-repo
  • openspec update uses project config when present
  • Global behavior remains unchanged when project config is absent
  • Docs clearly explain scope semantics and precedence
  • Existing users are not broken (project scope is opt-in)

Why this helps

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