Skip to content

[Feature Request] Support schema selection in propose/new skills and commands #770

Closed

Description

@pacaplan

Summary

The opsx:propose command (and related openspec-propose skill) always creates a new change using the default schema from config.yaml, with no way for the user to select a different schema. The CLI supports this today via:

openspec new change <name> --schema <schema>

But there is no equivalent UX in the skills or commands.

Current Behavior

  • opsx:propose / openspec-propose skill: Always calls openspec new change "<name>" without --schema. No schema selection logic exists — the user cannot specify a different schema even if the project has multiple schemas available in openspec/schemas/.
  • opsx:new / openspec-new-change skill: Partially supported — will pass --schema if the user explicitly names one, or list schemas if the user asks, but does not proactively offer schema selection.
  • CLI: Full support via --schema flag.

Expected Behavior

When a project has multiple schemas available, the propose (and new) skills/commands should either:

  1. Proactively ask which schema to use when multiple schemas are available, or
  2. Accept a schema argument (e.g., /opsx-propose --schema hotfix) so users can specify it inline

The openspec schemas --json command is already available for agents to discover available schemas, so the building blocks are in place.

Why This Matters

Projects with multiple schemas (e.g., one for features, one for hotfixes, one for experiments) are forced to use the CLI instead of skills when they want to use a non-default schema. This breaks the agent-first workflow that OpenSpec is designed for.

Activity

  1. 21st-connector commented on Feb 27, 2026

    @21st-connector
    Contributor

    Task completed.

    The enrichment comment has been posted on issue #770. Here's a summary of what I found and included:

    Key finding: The propose skill (src/core/templates/workflows/propose.ts) hardcodes openspec new change "<name>" with no schema flag and no schema selection step at all. Meanwhile, the new-change skill (src/core/templates/workflows/new-change.ts) already has a "Determine the workflow schema" step that handles --schema reactively — but doesn't proactively offer selection.

    The comment covers:


    View full conversation

    Powered by 1Code

  2. 21st-connector commented on Feb 27, 2026

    @21st-connector
    Contributor

    Issue Triage & Codebase Analysis

    Thanks for the detailed write-up. Here's a breakdown of the relevant code and some notes to help get started on this.

    Affected Files

    opsx:propose / openspec-propose skill — src/core/templates/workflows/propose.ts

    • getOpsxProposeSkillTemplate() (line 9) and getOpsxProposeCommandTemplate() (line 118)
    • Both hardcode openspec new change "<name>" at lines 39 and 150 respectively, with no --schema flag and no schema selection step.
    • This is the core of the issue: there is no Step 2 to determine the workflow schema, unlike the new-change skill.

    opsx:new / openspec-new-change skill — src/core/templates/workflows/new-change.ts

    • getNewChangeSkillTemplate() (line 9) and getOpsxNewCommandTemplate() (line 82)
    • These already have a "Determine the workflow schema" step (lines 28–36 in the skill, lines 103–111 in the command) that:
      • Uses the default schema unless the user explicitly requests a different one
      • Responds to "show workflows" / "what workflows" by running openspec schemas --json
      • Passes --schema <name> when a non-default schema is requested
    • However, as the issue notes, this is reactive only — it doesn't proactively offer selection when multiple schemas are detected.

    Existing Building Blocks

    These utilities are already available and can be leveraged:

    Utility Location Purpose
    openspec schemas --json src/commands/workflow/schemas.ts:22-46 Lists all schemas with name, description, artifacts, and source
    listSchemasWithInfo() src/core/artifact-graph/resolver.ts:224-268 Programmatic schema discovery (returns SchemaInfo[])
    listSchemas() src/core/artifact-graph/resolver.ts:161-206 Returns schema name list from all 3 tiers (project → user → package)
    validateSchemaExists() src/commands/workflow/shared.ts:152-161 Validates schema name, throws with available schemas on failure
    resolveSchemaForChange() src/utils/change-metadata.ts:162-196 4-tier resolution: explicit flag → .openspec.yaml → config.yaml → 'spec-driven' default
    DEFAULT_SCHEMA src/commands/workflow/shared.ts:44 Constant: 'spec-driven'

    The CLI already fully supports --schema via src/commands/workflow/new-change.ts:38-40 and src/cli/index.ts:493-508.

    Suggested Implementation Approach

    For propose (the main gap):

    Add a schema determination step between the current Step 1 (get user input) and Step 2 (create the change directory) in both getOpsxProposeSkillTemplate() and getOpsxProposeCommandTemplate(). The new-change skill's existing Step 2 (lines 28–36 of new-change.ts) can serve as a direct template for this.

    Minimal change:

    1. Insert a new step in the propose instructions that mirrors the "Determine the workflow schema" block from new-change.ts
    2. Update the openspec new change "<name>" invocation at line 39/150 to conditionally include --schema <name>

    For proactive schema selection (enhancement):

    To address the "proactively ask" behavior when multiple schemas exist:

    1. Add a step that runs openspec schemas --json early in the flow
    2. If more than one schema is returned, use the AskUserQuestion tool to present the choices
    3. This would apply to both propose and new-change skills

    Related Issues & PRs

    Test Considerations

    This appears to not be a duplicate of any existing issue. The closest is #666, but that's about schema format constraints rather than schema selection UX in skills.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions