Skip to content

fix(cli): remove deprecated noun command groups - #1626

Open
feiniao87968492 wants to merge 3 commits into
Fission-AI:mainfrom
feiniao87968492:fix/remove-legacy-noun-commands
Open

fix(cli): remove deprecated noun command groups#1626
feiniao87968492 wants to merge 3 commits into
Fission-AI:mainfrom
feiniao87968492:fix/remove-legacy-noun-commands

Conversation

@feiniao87968492

@feiniao87968492 feiniao87968492 commented Aug 11, 2026

Copy link
Copy Markdown

Summary

  • remove the deprecated openspec change ... and openspec spec ... command groups from Commander help and shell completions
  • keep the canonical verb-first openspec show, openspec list, and openspec validate behavior, while removing unreachable noun-command implementations
  • update active guidance and contracts to point to verb-first replacements
  • migrate surviving show/list/validate coverage, including canonical spec listing and spec-show filters
  • add a major Changesets entry for the breaking CLI removal

Breaking change

Scripts using the removed noun-form commands must migrate to:

  • openspec show <item> --type change|spec
  • openspec list --changes|--specs
  • openspec validate <item> --type change|spec

The deprecated noun-form --long and raw JSON contracts are not migrated.

Validation

  • pnpm build
  • pnpm lint
  • CI=true pnpm test — 123 files passed, 1 skipped; 3776 tests passed, 66 skipped

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Breaking Changes

    • Removed the deprecated openspec change ... and openspec spec ... command groups.
    • Use openspec show, openspec list, and openspec validate instead.
    • Use --type change|spec when the item type is ambiguous.
  • Documentation

    • Updated CLI guidance, command references, and examples to reflect the supported verb-first commands.
  • Tests

    • Added coverage confirming removed commands fail cleanly and canonical commands support change and spec workflows.

feiniao87968492 and others added 3 commits August 11, 2026 13:08
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@feiniao87968492
feiniao87968492 requested a review from a team as a code owner August 11, 2026 05:58
@feiniao87968492
feiniao87968492 requested review from clay-good and removed request for a team August 11, 2026 05:58
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The CLI removes the deprecated openspec change and openspec spec command groups. Documentation and specifications now require verb-first show, list, and validate commands. Command guidance, completion definitions, and tests use the canonical syntax.

Changes

Legacy command removal

Layer / File(s) Summary
Contracts and command guidance
.changeset/..., docs/..., openspec/specs/...
Specifications and documentation define removal of noun-form command groups and the canonical verb-first replacements.
Command registration removal
src/cli/index.ts, src/commands/change.ts, src/commands/spec.ts, src/core/completions/*, src/core/root-selection.ts
CLI registration, deprecated command implementations, and completion definitions no longer expose change or spec groups.
Canonical command guidance
src/commands/show.ts, src/commands/validate.ts, src/core/validation/constants.ts
Ambiguity errors and validation guidance now use explicit commands with --type change or --type spec.
CLI and command regression coverage
test/cli-e2e/*, test/commands/*, test/core/commands/*, test/core/completions/*
Tests cover removed groups, canonical show/list/validate behavior, completion output, and updated validation guidance.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related PRs

Suggested reviewers: tabishb

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the removal of deprecated noun command groups, which is the primary change in the pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
test/commands/legacy-groups-removed.test.ts (1)

68-73: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert unknown-command behavior.

A nonzero exit code can also occur when a registered command group fails in its list subcommand. Assert that the combined output reports an unknown command. This makes the test prove that the deleted group is not still registered.

Proposed test update
       expect(result.exitCode).not.toBe(0);
-      expect(`${result.stdout}\n${result.stderr}`).not.toContain('deprecated');
+      const output = `${result.stdout}\n${result.stderr}`;
+      expect(output).toMatch(/unknown command/i);
+      expect(output).not.toContain('deprecated');
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/commands/legacy-groups-removed.test.ts` around lines 68 - 73, Update the
test loop in legacy-groups-removed.test.ts to assert that the combined stdout
and stderr explicitly reports an unknown command, in addition to the existing
nonzero exit-code check and deprecated-output assertion. This ensures each
removed group is unregistered rather than merely failing its list subcommand.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/stores-beta/user-guide.md`:
- Around line 430-431: Update the command-scope statement in the user guide to
keep view listed as supporting --store <id>; identify only templates and schemas
as current-directory-only commands, while preserving the surrounding deprecated
noun-form documentation.

In `@test/commands/list-specs.test.ts`:
- Line 83: Update the root-path assertion around output.root to compare
canonical paths: canonicalize output.root.path with
FileSystemUtils.canonicalizeExistingPath() and projectDir with
fs.realpathSync.native() before applying the expectation, preserving the
existing object-shape assertion.

---

Nitpick comments:
In `@test/commands/legacy-groups-removed.test.ts`:
- Around line 68-73: Update the test loop in legacy-groups-removed.test.ts to
assert that the combined stdout and stderr explicitly reports an unknown
command, in addition to the existing nonzero exit-code check and
deprecated-output assertion. This ensures each removed group is unregistered
rather than merely failing its list subcommand.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e1a1f866-81ca-4b11-b1de-7c3f94c9c881

📥 Commits

Reviewing files that changed from the base of the PR and between e50bd09 and b8bbc40.

📒 Files selected for processing (31)
  • .changeset/remove-legacy-noun-command-groups.md
  • docs/agent-contract.md
  • docs/stores-beta/user-guide.md
  • openspec/specs/cli-change/spec.md
  • openspec/specs/cli-show/spec.md
  • openspec/specs/cli-spec/spec.md
  • openspec/specs/cli-validate/spec.md
  • openspec/specs/openspec-conventions/spec.md
  • src/cli/index.ts
  • src/commands/change.ts
  • src/commands/show.ts
  • src/commands/spec.ts
  • src/commands/validate.ts
  • src/core/completions/command-registry.ts
  • src/core/completions/types.ts
  • src/core/root-selection.ts
  • src/core/validation/constants.ts
  • test/cli-e2e/validate-scenario-loss.test.ts
  • test/cli-e2e/validate-task-numbering.test.ts
  • test/commands/change.interactive-show.test.ts
  • test/commands/change.interactive-validate.test.ts
  • test/commands/legacy-groups-removed.test.ts
  • test/commands/list-specs.test.ts
  • test/commands/show.test.ts
  • test/commands/spec.interactive-show.test.ts
  • test/commands/spec.interactive-validate.test.ts
  • test/commands/spec.test.ts
  • test/commands/validate.enriched-output.test.ts
  • test/core/commands/change-command.list.test.ts
  • test/core/commands/change-command.show.test.ts
  • test/core/completions/command-registry.test.ts
💤 Files with no reviewable changes (7)
  • test/commands/spec.test.ts
  • test/commands/change.interactive-validate.test.ts
  • test/commands/spec.interactive-show.test.ts
  • test/core/commands/change-command.list.test.ts
  • test/commands/spec.interactive-validate.test.ts
  • src/core/completions/command-registry.ts
  • test/commands/change.interactive-show.test.ts

Comment on lines +430 to +431
- **Some commands stay where they are.** `view`, `templates`, and `schemas`
act on the current directory only — no `--store`. The deprecated noun-form

Copy link
Copy Markdown
Contributor

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 --store support.

view supports --store <id>. These lines state the inverse. List only templates and schemas as current-directory-only commands.

Proposed fix
- **Some commands stay where they are.** `view`, `templates`, and `schemas`
+ **Some commands stay where they are.** `templates` and `schemas`
  act on the current directory only — no `--store`.

Based on learnings: openspec view supports --store <id> and must remain store-capable.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **Some commands stay where they are.** `view`, `templates`, and `schemas`
act on the current directory only — no `--store`. The deprecated noun-form
- **Some commands stay where they are.** `templates` and `schemas`
act on the current directory only — no `--store`. The deprecated noun-form
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/stores-beta/user-guide.md` around lines 430 - 431, Update the
command-scope statement in the user guide to keep view listed as supporting
--store <id>; identify only templates and schemas as current-directory-only
commands, while preserving the surrounding deprecated noun-form documentation.

Source: Learnings

{ id: 'auth', requirementCount: 2 },
{ id: 'payment', requirementCount: 1 },
]);
expect(output.root).toMatchObject({ path: projectDir });

Copy link
Copy Markdown
Contributor

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

Canonicalize the root path before comparing it.

output.root.path and projectDir identify an existing filesystem path. Compare canonical paths so this assertion remains valid through aliases and platform path normalization.

As per coding guidelines, “When asserting existing filesystem paths as identities, canonicalize both actual and expected paths first using FileSystemUtils.canonicalizeExistingPath() in project code and fs.realpathSync.native() in test-only expectations.”

Proposed test update
-import { promises as fs } from 'node:fs';
+import { promises as fs, realpathSync } from 'node:fs';
...
-    expect(output.root).toMatchObject({ path: projectDir });
+    expect(realpathSync.native(output.root.path)).toBe(
+      realpathSync.native(projectDir)
+    );
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
expect(output.root).toMatchObject({ path: projectDir });
expect(realpathSync.native(output.root.path)).toBe(
realpathSync.native(projectDir)
);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/commands/list-specs.test.ts` at line 83, Update the root-path assertion
around output.root to compare canonical paths: canonicalize output.root.path
with FileSystemUtils.canonicalizeExistingPath() and projectDir with
fs.realpathSync.native() before applying the expectation, preserving the
existing object-shape assertion.

Source: Coding guidelines

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant