-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(cli): remove deprecated noun command groups #1626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
feiniao87968492
wants to merge
3
commits into
Fission-AI:main
Choose a base branch
from
feiniao87968492:fix/remove-legacy-noun-commands
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+255
−1,405
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@fission-ai/openspec": major | ||
| --- | ||
|
|
||
| ### Breaking Changes | ||
|
|
||
| - Removed the deprecated `openspec change ...` and `openspec spec ...` command groups. Use the canonical verb-first commands instead: `openspec show <item> --type change|spec`, `openspec list --changes|--specs`, and `openspec validate <item> --type change|spec`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,92 +1,31 @@ | ||
| # cli-change Specification | ||
|
|
||
| ## Purpose | ||
| Define `openspec change` command behavior for showing, listing, and validating change proposals and deltas. | ||
| Document the removal of the deprecated noun-form `openspec change ...` command group and the canonical verb-first replacements. | ||
|
|
||
| ## Requirements | ||
| ### Requirement: Change Command | ||
| ### Requirement: Deprecated change command group is removed | ||
| The CLI SHALL NOT register a top-level `change` command group. | ||
|
|
||
| The system SHALL provide a `change` command with subcommands for displaying, listing, and validating change proposals. | ||
| #### Scenario: Removed change command is unavailable | ||
| - **WHEN** executing `openspec change ...` | ||
| - **THEN** the command SHALL fail without running a change command action or emitting the former deprecation warning | ||
| - **AND** users SHALL use `openspec show`, `openspec list`, or `openspec validate` instead | ||
|
|
||
| #### Scenario: Show change as JSON | ||
| ### Requirement: Canonical change operations remain available | ||
| The CLI SHALL provide change operations through the canonical verb-first commands. | ||
|
|
||
| - **WHEN** executing `openspec change show update-error --json` | ||
| - **THEN** parse the markdown change file | ||
| - **AND** extract change structure and deltas | ||
| - **AND** output valid JSON to stdout | ||
| #### Scenario: Show a change | ||
| - **WHEN** executing `openspec show <change-id> --type change` | ||
| - **THEN** display the change using the existing top-level show behavior | ||
|
|
||
| #### Scenario: List all changes | ||
| #### Scenario: List changes | ||
| - **WHEN** executing `openspec list` or `openspec list --changes` | ||
| - **THEN** display active changes using the existing list behavior | ||
|
|
||
| - **WHEN** executing `openspec change list` | ||
| - **THEN** scan the openspec/changes directory | ||
| - **AND** return list of all pending changes | ||
| - **AND** support JSON output with `--json` flag | ||
|
|
||
| #### Scenario: Show only requirement changes | ||
|
|
||
| - **WHEN** executing `openspec change show update-error --requirements-only` | ||
| - **THEN** display only the requirement changes (ADDED/MODIFIED/REMOVED/RENAMED) | ||
| - **AND** exclude why and what changes sections | ||
|
|
||
| #### Scenario: Validate change structure | ||
|
|
||
| - **WHEN** executing `openspec change validate update-error` | ||
| - **THEN** parse the change file | ||
| - **AND** validate against Zod schema | ||
| - **AND** ensure deltas are well-formed | ||
|
|
||
| ### Requirement: Legacy Compatibility | ||
|
|
||
| The system SHALL maintain backward compatibility with the existing `list` command while showing deprecation notices. | ||
|
|
||
| #### Scenario: Legacy list command | ||
|
|
||
| - **WHEN** executing `openspec list` | ||
| - **THEN** display current list of changes (existing behavior) | ||
| - **AND** show deprecation notice: "Note: 'openspec list' is deprecated. Use 'openspec change list' instead." | ||
|
|
||
| #### Scenario: Legacy list with --all flag | ||
|
|
||
| - **WHEN** executing `openspec list --all` | ||
| - **THEN** display all changes (existing behavior) | ||
| - **AND** show same deprecation notice | ||
|
|
||
| ### Requirement: Interactive show selection | ||
|
|
||
| The change show command SHALL support interactive selection when no change name is provided. | ||
|
|
||
| #### Scenario: Interactive change selection for show | ||
|
|
||
| - **WHEN** executing `openspec change show` without arguments | ||
| - **THEN** display an interactive list of available changes | ||
| - **AND** allow the user to select a change to show | ||
| - **AND** display the selected change content | ||
| - **AND** maintain all existing show options (--json, --deltas-only) | ||
|
|
||
| #### Scenario: Non-interactive fallback keeps current behavior | ||
|
|
||
| - **GIVEN** stdin is not a TTY or `--no-interactive` is provided or environment variable `OPEN_SPEC_INTERACTIVE=0` | ||
| - **WHEN** executing `openspec change show` without a change name | ||
| - **THEN** do not prompt interactively | ||
| - **AND** print the existing hint including available change IDs | ||
| - **AND** set `process.exitCode = 1` | ||
|
|
||
| ### Requirement: Interactive validation selection | ||
|
|
||
| The change validate command SHALL support interactive selection when no change name is provided. | ||
|
|
||
| #### Scenario: Interactive change selection for validation | ||
|
|
||
| - **WHEN** executing `openspec change validate` without arguments | ||
| - **THEN** display an interactive list of available changes | ||
| - **AND** allow the user to select a change to validate | ||
| - **AND** validate the selected change | ||
|
|
||
| #### Scenario: Non-interactive fallback keeps current behavior | ||
|
|
||
| - **GIVEN** stdin is not a TTY or `--no-interactive` is provided or environment variable `OPEN_SPEC_INTERACTIVE=0` | ||
| - **WHEN** executing `openspec change validate` without a change name | ||
| - **THEN** do not prompt interactively | ||
| - **AND** print the existing hint including available change IDs | ||
| - **AND** set `process.exitCode = 1` | ||
| #### Scenario: Validate a change | ||
| - **WHEN** executing `openspec validate <change-id> --type change` | ||
| - **THEN** validate the change using the existing top-level validate behavior | ||
|
|
||
| ### Requirement: Change data is preserved | ||
| Removing the command group SHALL NOT delete or migrate change directories, proposals, delta specs, tasks, or archived changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,88 +1,44 @@ | ||
| # cli-spec Specification | ||
|
|
||
| ## Purpose | ||
| Define `openspec spec` command behavior for listing, showing, and validating source-of-truth specifications. | ||
| Document the canonical verb-first commands for showing, listing, and validating source-of-truth specifications. | ||
|
|
||
| ## Requirements | ||
| ### Requirement: Interactive spec show | ||
| ### Requirement: Canonical spec show | ||
| The CLI SHALL show specifications through the top-level `show` command. | ||
|
|
||
| The spec show command SHALL support interactive selection when no spec-id is provided. | ||
| #### Scenario: Interactive spec show | ||
| - **WHEN** executing `openspec show` without an item in an interactive terminal | ||
| - **THEN** allow selection of a spec and display its content | ||
|
|
||
| #### Scenario: Interactive spec selection for show | ||
| #### Scenario: Direct spec show | ||
| - **WHEN** executing `openspec show <spec-id> --type spec` | ||
| - **THEN** parse and display the specification | ||
| - **AND** preserve `--json`, `--requirements`, `--no-scenarios`, and `-r/--requirement` | ||
|
|
||
| - **WHEN** executing `openspec spec show` without arguments | ||
| - **THEN** display an interactive list of available specs | ||
| - **AND** allow the user to select a spec to show | ||
| - **AND** display the selected spec content | ||
| - **AND** maintain all existing show options (--json, --requirements, --no-scenarios, -r) | ||
|
|
||
| #### Scenario: Non-interactive fallback keeps current behavior | ||
|
|
||
| - **GIVEN** stdin is not a TTY or `--no-interactive` is provided or environment variable `OPEN_SPEC_INTERACTIVE=0` | ||
| - **WHEN** executing `openspec spec show` without a spec-id | ||
| - **THEN** do not prompt interactively | ||
| - **AND** print the existing error message for missing spec-id | ||
| - **AND** set non-zero exit code | ||
|
|
||
| ### Requirement: Spec Command | ||
|
|
||
| The system SHALL provide a `spec` command with subcommands for displaying, listing, and validating specifications. | ||
|
|
||
| #### Scenario: Show spec as JSON | ||
|
|
||
| - **WHEN** executing `openspec spec show init --json` | ||
| - **THEN** parse the markdown spec file | ||
| - **AND** extract headings and content hierarchically | ||
| - **AND** output valid JSON to stdout | ||
| ### Requirement: Canonical spec list | ||
| The CLI SHALL list specifications through `openspec list --specs`. | ||
|
|
||
| #### Scenario: List all specs | ||
| - **WHEN** executing `openspec list --specs` | ||
| - **THEN** scan `openspec/specs/` | ||
| - **AND** report available capabilities and requirement counts using the existing list behavior | ||
|
|
||
| - **WHEN** executing `openspec spec list` | ||
| - **THEN** scan the openspec/specs directory | ||
| - **AND** return list of all available capabilities | ||
| - **AND** support JSON output with `--json` flag | ||
|
|
||
| #### Scenario: Filter spec content | ||
|
|
||
| - **WHEN** executing `openspec spec show init --requirements` | ||
| - **THEN** display only requirement names and SHALL statements | ||
| - **AND** exclude scenario content | ||
|
|
||
| #### Scenario: Validate spec structure | ||
|
|
||
| - **WHEN** executing `openspec spec validate init` | ||
| - **THEN** parse the spec file | ||
| - **AND** validate against Zod schema | ||
| - **AND** report any structural issues | ||
|
|
||
| ### Requirement: JSON Schema Definition | ||
|
|
||
| The system SHALL define Zod schemas that accurately represent the spec structure for runtime validation. | ||
|
|
||
| #### Scenario: Schema validation | ||
|
|
||
| - **WHEN** parsing a spec into JSON | ||
| - **THEN** validate the structure using Zod schemas | ||
| - **AND** ensure all required fields are present | ||
| - **AND** provide clear error messages for validation failures | ||
|
|
||
| ### Requirement: Interactive spec validation | ||
|
|
||
| The spec validate command SHALL support interactive selection when no spec-id is provided. | ||
|
|
||
| #### Scenario: Interactive spec selection for validation | ||
| ### Requirement: Canonical spec validation | ||
| The CLI SHALL validate specifications through the top-level `validate` command. | ||
|
|
||
| - **WHEN** executing `openspec spec validate` without arguments | ||
| - **THEN** display an interactive list of available specs | ||
| - **AND** allow the user to select a spec to validate | ||
| - **AND** validate the selected spec | ||
| - **AND** maintain all existing validation options (--strict, --json) | ||
| #### Scenario: Validate a spec | ||
| - **WHEN** executing `openspec validate <spec-id> --type spec` | ||
| - **THEN** validate the specification using the existing top-level validate behavior | ||
| - **AND** preserve `--strict` and `--json` | ||
|
|
||
| #### Scenario: Non-interactive fallback keeps current behavior | ||
| ### Requirement: Removed spec command group | ||
| The CLI SHALL NOT register a top-level `spec` command group. | ||
|
|
||
| - **GIVEN** stdin is not a TTY or `--no-interactive` is provided or environment variable `OPEN_SPEC_INTERACTIVE=0` | ||
| - **WHEN** executing `openspec spec validate` without a spec-id | ||
| - **THEN** do not prompt interactively | ||
| - **AND** print the existing error message for missing spec-id | ||
| - **AND** set non-zero exit code | ||
| #### Scenario: Removed spec command is unavailable | ||
| - **WHEN** executing `openspec spec ...` | ||
| - **THEN** the command SHALL fail without running a spec command action or emitting the former deprecation warning | ||
| - **AND** users SHALL use the canonical verb-first commands above | ||
|
|
||
| ### Requirement: Spec data is preserved | ||
| Removing the command group SHALL NOT delete or migrate files under `openspec/specs/`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Document
view --storesupport.viewsupports--store <id>. These lines state the inverse. List onlytemplatesandschemasas current-directory-only commands.Proposed fix
Based on learnings:
openspec viewsupports--store <id>and must remain store-capable.📝 Committable suggestion
🤖 Prompt for AI Agents
Source: Learnings