openspecui 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitmodules +3 -0
- package/CHAT.md +3 -0
- package/package.json +12 -0
- package/references/openspec/.changeset/README.md +6 -0
- package/references/openspec/.changeset/config.json +12 -0
- package/references/openspec/.coderabbit.yaml +11 -0
- package/references/openspec/.devcontainer/README.md +92 -0
- package/references/openspec/.devcontainer/devcontainer.json +68 -0
- package/references/openspec/.github/CODEOWNERS +2 -0
- package/references/openspec/.github/workflows/ci.yml +222 -0
- package/references/openspec/.github/workflows/release-prepare.yml +50 -0
- package/references/openspec/AGENTS.md +18 -0
- package/references/openspec/CHANGELOG.md +205 -0
- package/references/openspec/LICENSE +22 -0
- package/references/openspec/README.md +374 -0
- package/references/openspec/assets/openspec_dashboard.png +0 -0
- package/references/openspec/assets/openspec_pixel_dark.svg +89 -0
- package/references/openspec/assets/openspec_pixel_light.svg +89 -0
- package/references/openspec/bin/openspec.js +3 -0
- package/references/openspec/build.js +31 -0
- package/references/openspec/openspec/AGENTS.md +454 -0
- package/references/openspec/openspec/changes/IMPLEMENTATION_ORDER.md +68 -0
- package/references/openspec/openspec/changes/add-antigravity-support/proposal.md +11 -0
- package/references/openspec/openspec/changes/add-antigravity-support/specs/cli-init/spec.md +9 -0
- package/references/openspec/openspec/changes/add-antigravity-support/specs/cli-update/spec.md +8 -0
- package/references/openspec/openspec/changes/add-antigravity-support/tasks.md +12 -0
- package/references/openspec/openspec/changes/add-scaffold-command/proposal.md +11 -0
- package/references/openspec/openspec/changes/add-scaffold-command/specs/cli-scaffold/spec.md +36 -0
- package/references/openspec/openspec/changes/add-scaffold-command/tasks.md +12 -0
- package/references/openspec/openspec/changes/archive/2025-01-11-add-update-command/design.md +86 -0
- package/references/openspec/openspec/changes/archive/2025-01-11-add-update-command/proposal.md +29 -0
- package/references/openspec/openspec/changes/archive/2025-01-11-add-update-command/specs/cli-update/spec.md +59 -0
- package/references/openspec/openspec/changes/archive/2025-01-11-add-update-command/tasks.md +20 -0
- package/references/openspec/openspec/changes/archive/2025-01-13-add-list-command/proposal.md +20 -0
- package/references/openspec/openspec/changes/archive/2025-01-13-add-list-command/specs/cli-list/spec.md +69 -0
- package/references/openspec/openspec/changes/archive/2025-01-13-add-list-command/tasks.md +26 -0
- package/references/openspec/openspec/changes/archive/2025-08-05-initialize-typescript-project/design.md +64 -0
- package/references/openspec/openspec/changes/archive/2025-08-05-initialize-typescript-project/proposal.md +18 -0
- package/references/openspec/openspec/changes/archive/2025-08-05-initialize-typescript-project/tasks.md +25 -0
- package/references/openspec/openspec/changes/archive/2025-08-06-add-init-command/design.md +104 -0
- package/references/openspec/openspec/changes/archive/2025-08-06-add-init-command/proposal.md +30 -0
- package/references/openspec/openspec/changes/archive/2025-08-06-add-init-command/specs/cli-init/spec.md +148 -0
- package/references/openspec/openspec/changes/archive/2025-08-06-add-init-command/tasks.md +38 -0
- package/references/openspec/openspec/changes/archive/2025-08-06-adopt-future-state-storage/proposal.md +24 -0
- package/references/openspec/openspec/changes/archive/2025-08-06-adopt-future-state-storage/specs/openspec-conventions/spec.md +120 -0
- package/references/openspec/openspec/changes/archive/2025-08-06-adopt-future-state-storage/tasks.md +38 -0
- package/references/openspec/openspec/changes/archive/2025-08-11-add-complexity-guidelines/proposal.md +13 -0
- package/references/openspec/openspec/changes/archive/2025-08-11-add-complexity-guidelines/specs/openspec-docs/README.md +472 -0
- package/references/openspec/openspec/changes/archive/2025-08-11-add-complexity-guidelines/tasks.md +9 -0
- package/references/openspec/openspec/changes/archive/2025-08-13-add-archive-command/proposal.md +15 -0
- package/references/openspec/openspec/changes/archive/2025-08-13-add-archive-command/specs/cli-archive/spec.md +111 -0
- package/references/openspec/openspec/changes/archive/2025-08-13-add-archive-command/tasks.md +44 -0
- package/references/openspec/openspec/changes/archive/2025-08-13-add-diff-command/proposal.md +19 -0
- package/references/openspec/openspec/changes/archive/2025-08-13-add-diff-command/specs/cli-diff/spec.md +77 -0
- package/references/openspec/openspec/changes/archive/2025-08-13-add-diff-command/tasks.md +23 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/design.md +56 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/proposal.md +17 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/specs/cli-change/spec.md +48 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/specs/cli-list/spec.md +12 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/tasks.md +34 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/proposal.md +20 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/specs/cli-change/spec.md +23 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/specs/cli-show/spec.md +83 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/specs/cli-spec/spec.md +23 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/tasks.md +142 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-skip-specs-archive-option/proposal.md +13 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-skip-specs-archive-option/specs/cli-archive/spec.md +191 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-skip-specs-archive-option/tasks.md +57 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-spec-commands/design.md +45 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-spec-commands/proposal.md +19 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-spec-commands/specs/cli-spec/spec.md +43 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-spec-commands/tasks.md +22 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/design.md +104 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/proposal.md +22 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/specs/cli-archive/spec.md +18 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/specs/cli-diff/spec.md +12 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/tasks.md +59 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/proposal.md +93 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/specs/cli-archive/spec.md +48 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/specs/cli-diff/spec.md +45 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/specs/openspec-conventions/spec.md +101 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/tasks.md +55 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/design.md +19 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/proposal.md +67 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/specs/cli-list/spec.md +57 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/specs/openspec-conventions/spec.md +23 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/tasks.md +27 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/proposal.md +20 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/specs/cli-change/spec.md +22 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/specs/cli-spec/spec.md +23 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/specs/cli-validate/spec.md +149 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/tasks.md +81 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-fix-update-tool-selection/proposal.md +40 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-fix-update-tool-selection/specs/cli-update/spec.md +23 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-fix-update-tool-selection/tasks.md +21 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-improve-validate-error-messages/proposal.md +25 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-improve-validate-error-messages/specs/cli-validate/spec.md +55 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-improve-validate-error-messages/tasks.md +21 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-structured-spec-format/proposal.md +36 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-structured-spec-format/specs/openspec-conventions/spec.md +192 -0
- package/references/openspec/openspec/changes/archive/2025-08-19-structured-spec-format/tasks.md +19 -0
- package/references/openspec/openspec/changes/archive/2025-09-12-add-view-dashboard-command/proposal.md +38 -0
- package/references/openspec/openspec/changes/archive/2025-09-12-add-view-dashboard-command/specs/cli-view/spec.md +109 -0
- package/references/openspec/openspec/changes/archive/2025-09-12-add-view-dashboard-command/tasks.md +47 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-add-agents-md-config/proposal.md +28 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-add-agents-md-config/specs/cli-init/spec.md +71 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-add-agents-md-config/specs/cli-update/spec.md +41 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-add-agents-md-config/tasks.md +17 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-add-multi-agent-init/proposal.md +35 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-add-multi-agent-init/specs/cli-init/spec.md +45 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-add-multi-agent-init/tasks.md +16 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-add-slash-command-support/proposal.md +119 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-add-slash-command-support/specs/cli-init/spec.md +21 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-add-slash-command-support/specs/cli-update/spec.md +22 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-add-slash-command-support/tasks.md +20 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-improve-cli-e2e-plan/proposal.md +19 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-improve-cli-e2e-plan/tasks.md +9 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-improve-deterministic-tests/proposal.md +78 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-improve-deterministic-tests/tasks.md +25 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-improve-init-onboarding/proposal.md +13 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-improve-init-onboarding/specs/cli-init/spec.md +92 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-improve-init-onboarding/tasks.md +12 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-remove-diff-command/proposal.md +81 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-remove-diff-command/tasks.md +37 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-sort-active-changes-by-progress/proposal.md +25 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-sort-active-changes-by-progress/specs/cli-view/spec.md +9 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-sort-active-changes-by-progress/tasks.md +8 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/proposal.md +29 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/specs/cli-init/spec.md +40 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/specs/cli-update/spec.md +22 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/specs/openspec-conventions/spec.md +27 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/tasks.md +22 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-instructions/design.md +130 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-instructions/proposal.md +117 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-instructions/tasks.md +69 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-update-markdown-parser-crlf/proposal.md +19 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-update-markdown-parser-crlf/specs/cli-validate/spec.md +9 -0
- package/references/openspec/openspec/changes/archive/2025-09-29-update-markdown-parser-crlf/tasks.md +11 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-codex-slash-command-support/proposal.md +25 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-codex-slash-command-support/specs/cli-init/spec.md +56 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-codex-slash-command-support/specs/cli-update/spec.md +41 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-codex-slash-command-support/tasks.md +19 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-github-copilot-prompts/proposal.md +25 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-github-copilot-prompts/specs/cli-init/spec.md +48 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-github-copilot-prompts/specs/cli-update/spec.md +48 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-github-copilot-prompts/tasks.md +30 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-kilocode-workflows/proposal.md +17 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-kilocode-workflows/specs/cli-init/spec.md +43 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-kilocode-workflows/specs/cli-update/spec.md +27 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-kilocode-workflows/tasks.md +15 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-non-interactive-init-options/proposal.md +12 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-non-interactive-init-options/specs/cli-init/spec.md +39 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-non-interactive-init-options/tasks.md +17 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-windsurf-workflows/proposal.md +17 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-windsurf-workflows/specs/cli-init/spec.md +42 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-windsurf-workflows/specs/cli-update/spec.md +27 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-add-windsurf-workflows/tasks.md +17 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-enhance-validation-error-messages/proposal.md +12 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-enhance-validation-error-messages/specs/cli-validate/spec.md +39 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-enhance-validation-error-messages/tasks.md +12 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-improve-agent-instruction-usability/proposal.md +12 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-improve-agent-instruction-usability/specs/docs-agent-instructions/spec.md +33 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-improve-agent-instruction-usability/tasks.md +11 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-slim-root-agents-file/proposal.md +13 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-slim-root-agents-file/tasks.md +15 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-enter-selection/proposal.md +14 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-enter-selection/specs/cli-init/spec.md +10 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-enter-selection/tasks.md +8 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-root-agents/proposal.md +15 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-root-agents/specs/cli-init/spec.md +32 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-root-agents/specs/cli-update/spec.md +10 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-root-agents/tasks.md +11 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-update-release-automation/proposal.md +49 -0
- package/references/openspec/openspec/changes/archive/2025-10-14-update-release-automation/tasks.md +12 -0
- package/references/openspec/openspec/changes/archive/2025-10-22-add-archive-command-arguments/proposal.md +17 -0
- package/references/openspec/openspec/changes/archive/2025-10-22-add-archive-command-arguments/specs/cli-update/spec.md +32 -0
- package/references/openspec/openspec/changes/archive/2025-10-22-add-archive-command-arguments/tasks.md +15 -0
- package/references/openspec/openspec/changes/archive/2025-10-22-add-cline-support/proposal.md +15 -0
- package/references/openspec/openspec/changes/archive/2025-10-22-add-cline-support/specs/cli-init/spec.md +97 -0
- package/references/openspec/openspec/changes/archive/2025-10-22-add-cline-support/tasks.md +19 -0
- package/references/openspec/openspec/changes/archive/2025-10-22-add-crush-support/proposal.md +13 -0
- package/references/openspec/openspec/changes/archive/2025-10-22-add-crush-support/specs/cli-init/spec.md +67 -0
- package/references/openspec/openspec/changes/archive/2025-10-22-add-crush-support/tasks.md +7 -0
- package/references/openspec/openspec/changes/archive/2025-10-22-add-factory-slash-commands/proposal.md +12 -0
- package/references/openspec/openspec/changes/archive/2025-10-22-add-factory-slash-commands/specs/cli-init/spec.md +54 -0
- package/references/openspec/openspec/changes/archive/2025-10-22-add-factory-slash-commands/specs/cli-update/spec.md +54 -0
- package/references/openspec/openspec/changes/archive/2025-10-22-add-factory-slash-commands/tasks.md +11 -0
- package/references/openspec/openspec/changes/fix-cline-workflows-implementation/proposal.md +13 -0
- package/references/openspec/openspec/changes/fix-cline-workflows-implementation/specs/cli-init/spec.md +11 -0
- package/references/openspec/openspec/changes/fix-cline-workflows-implementation/tasks.md +13 -0
- package/references/openspec/openspec/changes/make-validation-scope-aware/proposal.md +12 -0
- package/references/openspec/openspec/changes/make-validation-scope-aware/specs/cli-validate/spec.md +25 -0
- package/references/openspec/openspec/changes/make-validation-scope-aware/tasks.md +16 -0
- package/references/openspec/openspec/project.md +53 -0
- package/references/openspec/openspec/specs/cli-archive/spec.md +210 -0
- package/references/openspec/openspec/specs/cli-change/spec.md +91 -0
- package/references/openspec/openspec/specs/cli-init/spec.md +311 -0
- package/references/openspec/openspec/specs/cli-list/spec.md +103 -0
- package/references/openspec/openspec/specs/cli-show/spec.md +85 -0
- package/references/openspec/openspec/specs/cli-spec/spec.md +87 -0
- package/references/openspec/openspec/specs/cli-update/spec.md +190 -0
- package/references/openspec/openspec/specs/cli-validate/spec.md +218 -0
- package/references/openspec/openspec/specs/cli-view/spec.md +105 -0
- package/references/openspec/openspec/specs/docs-agent-instructions/spec.md +38 -0
- package/references/openspec/openspec/specs/openspec-conventions/spec.md +474 -0
- package/references/openspec/openspec-parallel-merge-plan.md +98 -0
- package/references/openspec/package.json +73 -0
- package/references/openspec/pnpm-lock.yaml +2324 -0
- package/references/openspec/scripts/pack-version-check.mjs +111 -0
- package/references/openspec/src/cli/index.ts +253 -0
- package/references/openspec/src/commands/change.ts +291 -0
- package/references/openspec/src/commands/show.ts +139 -0
- package/references/openspec/src/commands/spec.ts +250 -0
- package/references/openspec/src/commands/validate.ts +305 -0
- package/references/openspec/src/core/archive.ts +606 -0
- package/references/openspec/src/core/config.ts +41 -0
- package/references/openspec/src/core/configurators/agents.ts +23 -0
- package/references/openspec/src/core/configurators/base.ts +6 -0
- package/references/openspec/src/core/configurators/claude.ts +23 -0
- package/references/openspec/src/core/configurators/cline.ts +23 -0
- package/references/openspec/src/core/configurators/codebuddy.ts +24 -0
- package/references/openspec/src/core/configurators/costrict.ts +23 -0
- package/references/openspec/src/core/configurators/iflow.ts +23 -0
- package/references/openspec/src/core/configurators/qoder.ts +53 -0
- package/references/openspec/src/core/configurators/qwen.ts +47 -0
- package/references/openspec/src/core/configurators/registry.ts +49 -0
- package/references/openspec/src/core/configurators/slash/amazon-q.ts +51 -0
- package/references/openspec/src/core/configurators/slash/antigravity.ts +28 -0
- package/references/openspec/src/core/configurators/slash/auggie.ts +37 -0
- package/references/openspec/src/core/configurators/slash/base.ts +95 -0
- package/references/openspec/src/core/configurators/slash/claude.ts +42 -0
- package/references/openspec/src/core/configurators/slash/cline.ts +27 -0
- package/references/openspec/src/core/configurators/slash/codebuddy.ts +43 -0
- package/references/openspec/src/core/configurators/slash/codex.ts +126 -0
- package/references/openspec/src/core/configurators/slash/costrict.ts +36 -0
- package/references/openspec/src/core/configurators/slash/crush.ts +42 -0
- package/references/openspec/src/core/configurators/slash/cursor.ts +42 -0
- package/references/openspec/src/core/configurators/slash/factory.ts +41 -0
- package/references/openspec/src/core/configurators/slash/gemini.ts +27 -0
- package/references/openspec/src/core/configurators/slash/github-copilot.ts +39 -0
- package/references/openspec/src/core/configurators/slash/iflow.ts +42 -0
- package/references/openspec/src/core/configurators/slash/kilocode.ts +21 -0
- package/references/openspec/src/core/configurators/slash/opencode.ts +83 -0
- package/references/openspec/src/core/configurators/slash/qoder.ts +84 -0
- package/references/openspec/src/core/configurators/slash/qwen.ts +55 -0
- package/references/openspec/src/core/configurators/slash/registry.ts +81 -0
- package/references/openspec/src/core/configurators/slash/roocode.ts +27 -0
- package/references/openspec/src/core/configurators/slash/toml-base.ts +66 -0
- package/references/openspec/src/core/configurators/slash/windsurf.ts +27 -0
- package/references/openspec/src/core/converters/json-converter.ts +61 -0
- package/references/openspec/src/core/index.ts +2 -0
- package/references/openspec/src/core/init.ts +986 -0
- package/references/openspec/src/core/list.ts +104 -0
- package/references/openspec/src/core/parsers/change-parser.ts +234 -0
- package/references/openspec/src/core/parsers/markdown-parser.ts +237 -0
- package/references/openspec/src/core/parsers/requirement-blocks.ts +234 -0
- package/references/openspec/src/core/schemas/base.schema.ts +20 -0
- package/references/openspec/src/core/schemas/change.schema.ts +42 -0
- package/references/openspec/src/core/schemas/index.ts +20 -0
- package/references/openspec/src/core/schemas/spec.schema.ts +17 -0
- package/references/openspec/src/core/styles/palette.ts +8 -0
- package/references/openspec/src/core/templates/agents-root-stub.ts +16 -0
- package/references/openspec/src/core/templates/agents-template.ts +457 -0
- package/references/openspec/src/core/templates/claude-template.ts +1 -0
- package/references/openspec/src/core/templates/cline-template.ts +1 -0
- package/references/openspec/src/core/templates/costrict-template.ts +1 -0
- package/references/openspec/src/core/templates/index.ts +50 -0
- package/references/openspec/src/core/templates/project-template.ts +38 -0
- package/references/openspec/src/core/templates/slash-command-templates.ts +60 -0
- package/references/openspec/src/core/update.ts +129 -0
- package/references/openspec/src/core/validation/constants.ts +48 -0
- package/references/openspec/src/core/validation/types.ts +19 -0
- package/references/openspec/src/core/validation/validator.ts +448 -0
- package/references/openspec/src/core/view.ts +189 -0
- package/references/openspec/src/index.ts +2 -0
- package/references/openspec/src/utils/file-system.ts +187 -0
- package/references/openspec/src/utils/index.ts +2 -0
- package/references/openspec/src/utils/interactive.ts +7 -0
- package/references/openspec/src/utils/item-discovery.ts +45 -0
- package/references/openspec/src/utils/match.ts +26 -0
- package/references/openspec/src/utils/task-progress.ts +43 -0
- package/references/openspec/test/cli-e2e/basic.test.ts +156 -0
- package/references/openspec/test/commands/change.interactive-show.test.ts +45 -0
- package/references/openspec/test/commands/change.interactive-validate.test.ts +48 -0
- package/references/openspec/test/commands/show.test.ts +123 -0
- package/references/openspec/test/commands/spec.interactive-show.test.ts +44 -0
- package/references/openspec/test/commands/spec.interactive-validate.test.ts +44 -0
- package/references/openspec/test/commands/spec.test.ts +324 -0
- package/references/openspec/test/commands/validate.enriched-output.test.ts +49 -0
- package/references/openspec/test/commands/validate.test.ts +133 -0
- package/references/openspec/test/core/archive.test.ts +680 -0
- package/references/openspec/test/core/commands/change-command.list.test.ts +76 -0
- package/references/openspec/test/core/commands/change-command.show-validate.test.ts +111 -0
- package/references/openspec/test/core/converters/json-converter.test.ts +184 -0
- package/references/openspec/test/core/init.test.ts +1710 -0
- package/references/openspec/test/core/list.test.ts +165 -0
- package/references/openspec/test/core/parsers/change-parser.test.ts +52 -0
- package/references/openspec/test/core/parsers/markdown-parser.test.ts +291 -0
- package/references/openspec/test/core/update.test.ts +1642 -0
- package/references/openspec/test/core/validation.enriched-messages.test.ts +74 -0
- package/references/openspec/test/core/validation.test.ts +489 -0
- package/references/openspec/test/core/view.test.ts +79 -0
- package/references/openspec/test/fixtures/tmp-init/openspec/changes/c1/proposal.md +7 -0
- package/references/openspec/test/fixtures/tmp-init/openspec/changes/c1/specs/alpha/spec.md +8 -0
- package/references/openspec/test/fixtures/tmp-init/openspec/specs/alpha/spec.md +12 -0
- package/references/openspec/test/helpers/run-cli.ts +139 -0
- package/references/openspec/test/utils/file-system.test.ts +211 -0
- package/references/openspec/test/utils/marker-updates.test.ts +287 -0
- package/references/openspec/tsconfig.json +21 -0
- package/references/openspec/vitest.config.ts +25 -0
- package/references/openspec/vitest.setup.ts +6 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# CLI Diff Command Specification
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
The `openspec diff` command provides developers with a visual comparison between proposed spec changes and the current deployed specs.
|
|
6
|
+
|
|
7
|
+
## Command Syntax
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
openspec diff [change-name]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Behavior
|
|
14
|
+
|
|
15
|
+
### Without Arguments
|
|
16
|
+
|
|
17
|
+
WHEN running `openspec diff` without arguments
|
|
18
|
+
THEN list all available changes in the `changes/` directory (excluding archive)
|
|
19
|
+
AND prompt user to select a change
|
|
20
|
+
|
|
21
|
+
### With Change Name
|
|
22
|
+
|
|
23
|
+
WHEN running `openspec diff <change-name>`
|
|
24
|
+
THEN compare all spec files in `changes/<change-name>/specs/` with corresponding files in `specs/`
|
|
25
|
+
|
|
26
|
+
### Diff Output
|
|
27
|
+
|
|
28
|
+
FOR each spec file in the change:
|
|
29
|
+
- IF file exists in both locations THEN show unified diff
|
|
30
|
+
- IF file only exists in change THEN show as new file (all lines with +)
|
|
31
|
+
- IF file only exists in current specs THEN show as deleted (all lines with -)
|
|
32
|
+
|
|
33
|
+
### Display Format
|
|
34
|
+
|
|
35
|
+
The diff SHALL use standard unified diff format:
|
|
36
|
+
- Lines prefixed with `-` for removed content
|
|
37
|
+
- Lines prefixed with `+` for added content
|
|
38
|
+
- Lines without prefix for unchanged context
|
|
39
|
+
- File headers showing the paths being compared
|
|
40
|
+
|
|
41
|
+
### Color Support
|
|
42
|
+
|
|
43
|
+
WHEN terminal supports colors:
|
|
44
|
+
- Removed lines displayed in red
|
|
45
|
+
- Added lines displayed in green
|
|
46
|
+
- File headers displayed in bold
|
|
47
|
+
- Context lines in default color
|
|
48
|
+
|
|
49
|
+
### Error Handling
|
|
50
|
+
|
|
51
|
+
WHEN specified change doesn't exist THEN display error "Change '<name>' not found"
|
|
52
|
+
WHEN no specs directory in change THEN display "No spec changes found for '<name>'"
|
|
53
|
+
WHEN changes directory doesn't exist THEN display "No OpenSpec changes directory found"
|
|
54
|
+
|
|
55
|
+
## Examples
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# View diff for specific change
|
|
59
|
+
$ openspec diff add-auth-feature
|
|
60
|
+
|
|
61
|
+
--- specs/user-auth/spec.md
|
|
62
|
+
+++ changes/add-auth-feature/specs/user-auth/spec.md
|
|
63
|
+
@@ -10,6 +10,8 @@
|
|
64
|
+
Users SHALL authenticate with email and password.
|
|
65
|
+
|
|
66
|
+
+Users MAY authenticate with OAuth providers.
|
|
67
|
+
+
|
|
68
|
+
WHEN credentials are valid THEN issue JWT token.
|
|
69
|
+
|
|
70
|
+
# List all changes and select
|
|
71
|
+
$ openspec diff
|
|
72
|
+
Available changes:
|
|
73
|
+
1. add-auth-feature
|
|
74
|
+
2. update-payment-flow
|
|
75
|
+
3. add-status-command
|
|
76
|
+
Select a change (1-3):
|
|
77
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Implementation Tasks
|
|
2
|
+
|
|
3
|
+
## 1. Core Implementation
|
|
4
|
+
- [x] 1.1 Create `src/core/diff.ts` with diff logic
|
|
5
|
+
- [x] 1.2 Implement change directory scanning
|
|
6
|
+
- [x] 1.3 Implement file comparison using unified diff format
|
|
7
|
+
- [x] 1.4 Add color support for terminal output
|
|
8
|
+
|
|
9
|
+
## 2. CLI Integration
|
|
10
|
+
- [x] 2.1 Add diff command to `src/cli/index.ts`
|
|
11
|
+
- [x] 2.2 Implement interactive change selection when no argument provided
|
|
12
|
+
- [x] 2.3 Add error handling for missing changes
|
|
13
|
+
|
|
14
|
+
## 3. Enhancements
|
|
15
|
+
- [x] 3.1 Replace with jest-diff for professional diff output
|
|
16
|
+
- [x] 3.2 Improve file headers with status and statistics
|
|
17
|
+
- [x] 3.3 Add summary view with file counts and line changes
|
|
18
|
+
|
|
19
|
+
## 4. Testing
|
|
20
|
+
- [ ] 4.1 Test diff generation for modified files
|
|
21
|
+
- [ ] 4.2 Test handling of new files
|
|
22
|
+
- [ ] 4.3 Test handling of deleted files
|
|
23
|
+
- [ ] 4.4 Test interactive mode
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Design: Change Commands
|
|
2
|
+
|
|
3
|
+
## Architecture Decisions
|
|
4
|
+
|
|
5
|
+
### Command Structure
|
|
6
|
+
Similar to spec commands, we use subcommands (`change show`, `change list`, `change validate`) for:
|
|
7
|
+
- Consistency with spec command pattern
|
|
8
|
+
- Clear separation of concerns
|
|
9
|
+
- Future extensibility for change management features
|
|
10
|
+
|
|
11
|
+
### JSON Schema for Changes
|
|
12
|
+
```typescript
|
|
13
|
+
{
|
|
14
|
+
version: string, // Schema version
|
|
15
|
+
format: "change", // Identifies as change document
|
|
16
|
+
sourcePath: string, // Original markdown file path
|
|
17
|
+
id: string, // Change identifier
|
|
18
|
+
title: string, // Change title
|
|
19
|
+
why: string, // Motivation section
|
|
20
|
+
whatChanges: Array<{
|
|
21
|
+
type: "ADDED" | "MODIFIED" | "REMOVED" | "RENAMED",
|
|
22
|
+
deltas: Array<{
|
|
23
|
+
specId: string,
|
|
24
|
+
description: string,
|
|
25
|
+
requirements?: Array<Requirement> // Only for ADDED/MODIFIED
|
|
26
|
+
}>
|
|
27
|
+
}>
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Rationale:**
|
|
32
|
+
- Group deltas by operation type for clearer organization
|
|
33
|
+
- Optional requirements field (only relevant for ADDED/MODIFIED)
|
|
34
|
+
- Reuse RequirementSchema from spec commands for consistency
|
|
35
|
+
|
|
36
|
+
### Delta Operations
|
|
37
|
+
**Four operation types:**
|
|
38
|
+
1. **ADDED**: New requirements added to specs
|
|
39
|
+
2. **MODIFIED**: Changes to existing requirements
|
|
40
|
+
3. **REMOVED**: Requirements being deleted
|
|
41
|
+
4. **RENAMED**: Spec identifier changes
|
|
42
|
+
|
|
43
|
+
**Design choice:** Explicit operation types rather than diff-based approach for:
|
|
44
|
+
- Human readability in markdown
|
|
45
|
+
- Clear intent communication
|
|
46
|
+
- Easier validation and tooling
|
|
47
|
+
|
|
48
|
+
### Dependency on Spec Commands
|
|
49
|
+
- **Shared schemas**: RequirementSchema and ScenarioSchema reused
|
|
50
|
+
- **Implementation order**: spec commands must be implemented first
|
|
51
|
+
- **Common parser utilities**: Share markdown parsing logic
|
|
52
|
+
|
|
53
|
+
### Legacy Compatibility
|
|
54
|
+
- Keep existing `list` command functional with deprecation warning
|
|
55
|
+
- Migration path: `list` → `change list` with same functionality
|
|
56
|
+
- Gradual transition to avoid breaking existing workflows
|
package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/proposal.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Change: Add Change Commands with JSON Output
|
|
2
|
+
|
|
3
|
+
## Why
|
|
4
|
+
|
|
5
|
+
OpenSpec change proposals currently can only be viewed as markdown files, creating the same programmatic access limitations as specs. Additionally, the current `openspec list` command only lists changes, which is inconsistent with the new resource-based command structure.
|
|
6
|
+
|
|
7
|
+
## What Changes
|
|
8
|
+
|
|
9
|
+
- **cli-change:** Add new command for managing change proposals with show, list, and validate subcommands
|
|
10
|
+
- **cli-list:** Add deprecation notice for legacy list command to guide users to the new change list command
|
|
11
|
+
|
|
12
|
+
## Impact
|
|
13
|
+
|
|
14
|
+
- **Affected specs**: cli-list (modify to add deprecation notice)
|
|
15
|
+
- **Affected code**:
|
|
16
|
+
- src/cli/index.ts (register new command)
|
|
17
|
+
- src/core/list.ts (add deprecation notice)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
## ADDED Requirements
|
|
2
|
+
|
|
3
|
+
### Requirement: Change Command
|
|
4
|
+
|
|
5
|
+
The system SHALL provide a `change` command with subcommands for displaying, listing, and validating change proposals.
|
|
6
|
+
|
|
7
|
+
#### Scenario: Show change as JSON
|
|
8
|
+
|
|
9
|
+
- **WHEN** executing `openspec change show update-error --json`
|
|
10
|
+
- **THEN** parse the markdown change file
|
|
11
|
+
- **AND** extract change structure and deltas
|
|
12
|
+
- **AND** output valid JSON to stdout
|
|
13
|
+
|
|
14
|
+
#### Scenario: List all changes
|
|
15
|
+
|
|
16
|
+
- **WHEN** executing `openspec change list`
|
|
17
|
+
- **THEN** scan the openspec/changes directory
|
|
18
|
+
- **AND** return list of all pending changes
|
|
19
|
+
- **AND** support JSON output with `--json` flag
|
|
20
|
+
|
|
21
|
+
#### Scenario: Show only requirement changes
|
|
22
|
+
|
|
23
|
+
- **WHEN** executing `openspec change show update-error --requirements-only`
|
|
24
|
+
- **THEN** display only the requirement changes (ADDED/MODIFIED/REMOVED/RENAMED)
|
|
25
|
+
- **AND** exclude why and what changes sections
|
|
26
|
+
|
|
27
|
+
#### Scenario: Validate change structure
|
|
28
|
+
|
|
29
|
+
- **WHEN** executing `openspec change validate update-error`
|
|
30
|
+
- **THEN** parse the change file
|
|
31
|
+
- **AND** validate against Zod schema
|
|
32
|
+
- **AND** ensure deltas are well-formed
|
|
33
|
+
|
|
34
|
+
### Requirement: Legacy Compatibility
|
|
35
|
+
|
|
36
|
+
The system SHALL maintain backward compatibility with the existing `list` command while showing deprecation notices.
|
|
37
|
+
|
|
38
|
+
#### Scenario: Legacy list command
|
|
39
|
+
|
|
40
|
+
- **WHEN** executing `openspec list`
|
|
41
|
+
- **THEN** display current list of changes (existing behavior)
|
|
42
|
+
- **AND** show deprecation notice: "Note: 'openspec list' is deprecated. Use 'openspec change list' instead."
|
|
43
|
+
|
|
44
|
+
#### Scenario: Legacy list with --all flag
|
|
45
|
+
|
|
46
|
+
- **WHEN** executing `openspec list --all`
|
|
47
|
+
- **THEN** display all changes (existing behavior)
|
|
48
|
+
- **AND** show same deprecation notice
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## MODIFIED Requirements
|
|
2
|
+
|
|
3
|
+
### Requirement: Command Execution
|
|
4
|
+
|
|
5
|
+
The current `list` command behavior SHALL be preserved but marked as deprecated.
|
|
6
|
+
|
|
7
|
+
#### Scenario: Deprecation notice
|
|
8
|
+
|
|
9
|
+
- **WHEN** using the legacy `list` command
|
|
10
|
+
- **THEN** continue to work as before
|
|
11
|
+
- **AND** display deprecation notice
|
|
12
|
+
- **AND** suggest using `openspec change list` instead
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Implementation Tasks (Phase 2: Builds on add-zod-validation)
|
|
2
|
+
|
|
3
|
+
## 1. Command Implementation
|
|
4
|
+
- [x] 1.1 Create src/commands/change.ts
|
|
5
|
+
- [x] 1.2 Import ChangeSchema and DeltaSchema from src/core/schemas/change.schema.ts
|
|
6
|
+
- [x] 1.3 Import markdown parser from src/core/parsers/markdown-parser.ts
|
|
7
|
+
- [x] 1.4 Import ChangeValidator from src/core/validation/validator.ts
|
|
8
|
+
- [x] 1.5 Import JSON converter from src/core/converters/json-converter.ts
|
|
9
|
+
- [x] 1.6 Implement show subcommand with JSON output using existing converter
|
|
10
|
+
- [x] 1.7 Implement list subcommand
|
|
11
|
+
- [x] 1.8 Implement validate subcommand using existing ChangeValidator
|
|
12
|
+
- [x] 1.9 Add --requirements-only filtering option
|
|
13
|
+
- [x] 1.10 Add --strict mode support (leveraging existing validation infrastructure)
|
|
14
|
+
- [x] 1.11 Add --json flag for validation reports
|
|
15
|
+
|
|
16
|
+
## 2. Change-Specific Parser Extensions
|
|
17
|
+
- [x] 2.1 Create src/core/parsers/change-parser.ts (extends base markdown parser)
|
|
18
|
+
- [x] 2.2 Parse proposal structure (Why, What Changes sections)
|
|
19
|
+
- [x] 2.3 Extract ADDED/MODIFIED/REMOVED/RENAMED sections
|
|
20
|
+
- [x] 2.4 Parse delta operations within each section
|
|
21
|
+
- [x] 2.5 Add tests for change parser
|
|
22
|
+
|
|
23
|
+
## 3. Legacy Compatibility
|
|
24
|
+
- [x] 3.1 Update src/core/list.ts to add deprecation notice
|
|
25
|
+
- [x] 3.2 Ensure existing list command continues to work
|
|
26
|
+
- [x] 3.3 Add console warning for deprecated command usage
|
|
27
|
+
|
|
28
|
+
## 4. Integration
|
|
29
|
+
- [x] 4.1 Register change command in src/cli/index.ts
|
|
30
|
+
- [ ] 4.2 Add integration tests for all subcommands
|
|
31
|
+
- [x] 4.3 Test JSON output for changes
|
|
32
|
+
- [x] 4.4 Test legacy compatibility
|
|
33
|
+
- [x] 4.5 Test validation with strict mode
|
|
34
|
+
- [x] 4.6 Update CLI help documentation (add 'change' command to main help, document subcommands: show, list, validate)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
## Why
|
|
2
|
+
|
|
3
|
+
Users frequently need to view changes and specs but must know in advance whether they're looking at a change or spec. The current subcommand structure (`change show`, `spec show`) creates friction when:
|
|
4
|
+
- Users want to quickly view an item without remembering its type
|
|
5
|
+
- Exploring the codebase requires switching between different show commands
|
|
6
|
+
- Show commands without arguments return errors instead of helpful guidance
|
|
7
|
+
|
|
8
|
+
## What Changes
|
|
9
|
+
|
|
10
|
+
- Add new top-level `show` command for displaying changes or specs with intelligent selection
|
|
11
|
+
- Support direct item display: `openspec show <item>` with automatic type detection
|
|
12
|
+
- Interactive selection when no arguments provided
|
|
13
|
+
- Enhance existing `change show` and `spec show` to support interactive selection (backwards compatibility)
|
|
14
|
+
- Maintain all existing format options (--json, --deltas-only, --requirements, etc.)
|
|
15
|
+
|
|
16
|
+
## Impact
|
|
17
|
+
|
|
18
|
+
- New specs to create: cli-show
|
|
19
|
+
- Specs to enhance: cli-change, cli-spec (for backwards compatibility)
|
|
20
|
+
- Affected code: src/cli/index.ts, src/commands/show.ts (new), src/commands/spec.ts, src/commands/change.ts
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# CLI Change Command Spec
|
|
2
|
+
|
|
3
|
+
## ADDED Requirements
|
|
4
|
+
|
|
5
|
+
### Requirement: Interactive show selection
|
|
6
|
+
|
|
7
|
+
The change show command SHALL support interactive selection when no change name is provided.
|
|
8
|
+
|
|
9
|
+
#### Scenario: Interactive change selection for show
|
|
10
|
+
|
|
11
|
+
- **WHEN** executing `openspec change show` without arguments
|
|
12
|
+
- **THEN** display an interactive list of available changes
|
|
13
|
+
- **AND** allow the user to select a change to show
|
|
14
|
+
- **AND** display the selected change content
|
|
15
|
+
- **AND** maintain all existing show options (--json, --deltas-only)
|
|
16
|
+
|
|
17
|
+
#### Scenario: Non-interactive fallback keeps current behavior
|
|
18
|
+
|
|
19
|
+
- **GIVEN** stdin is not a TTY or `--no-interactive` is provided or environment variable `OPEN_SPEC_INTERACTIVE=0`
|
|
20
|
+
- **WHEN** executing `openspec change show` without a change name
|
|
21
|
+
- **THEN** do not prompt interactively
|
|
22
|
+
- **AND** print the existing hint including available change IDs
|
|
23
|
+
- **AND** set `process.exitCode = 1`
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# CLI Show Command Spec
|
|
2
|
+
|
|
3
|
+
## ADDED Requirements
|
|
4
|
+
|
|
5
|
+
### Requirement: Top-level show command
|
|
6
|
+
|
|
7
|
+
The CLI SHALL provide a top-level `show` command for displaying changes and specs with intelligent selection.
|
|
8
|
+
|
|
9
|
+
#### Scenario: Interactive show selection
|
|
10
|
+
|
|
11
|
+
- **WHEN** executing `openspec show` without arguments
|
|
12
|
+
- **THEN** prompt user to select type (change or spec)
|
|
13
|
+
- **AND** display list of available items for selected type
|
|
14
|
+
- **AND** show the selected item's content
|
|
15
|
+
|
|
16
|
+
#### Scenario: Non-interactive environments do not prompt
|
|
17
|
+
|
|
18
|
+
- **GIVEN** stdin is not a TTY or `--no-interactive` is provided or environment variable `OPEN_SPEC_INTERACTIVE=0`
|
|
19
|
+
- **WHEN** executing `openspec show` without arguments
|
|
20
|
+
- **THEN** do not prompt
|
|
21
|
+
- **AND** print a helpful hint with examples for `openspec show <item>` or `openspec change/spec show`
|
|
22
|
+
- **AND** exit with code 1
|
|
23
|
+
|
|
24
|
+
#### Scenario: Direct item display
|
|
25
|
+
|
|
26
|
+
- **WHEN** executing `openspec show <item-name>`
|
|
27
|
+
- **THEN** automatically detect if item is a change or spec
|
|
28
|
+
- **AND** display the item's content
|
|
29
|
+
- **AND** use appropriate formatting based on item type
|
|
30
|
+
|
|
31
|
+
#### Scenario: Type detection and ambiguity handling
|
|
32
|
+
|
|
33
|
+
- **WHEN** executing `openspec show <item-name>`
|
|
34
|
+
- **THEN** if `<item-name>` uniquely matches a change or a spec, show that item
|
|
35
|
+
- **AND** if it matches both, print an ambiguity error and suggest `--type change|spec` or using `openspec change show`/`openspec spec show`
|
|
36
|
+
- **AND** if it matches neither, print not-found with nearest-match suggestions
|
|
37
|
+
|
|
38
|
+
#### Scenario: Explicit type override
|
|
39
|
+
|
|
40
|
+
- **WHEN** executing `openspec show --type change <item>`
|
|
41
|
+
- **THEN** treat `<item>` as a change ID and show it (skipping auto-detection)
|
|
42
|
+
|
|
43
|
+
- **WHEN** executing `openspec show --type spec <item>`
|
|
44
|
+
- **THEN** treat `<item>` as a spec ID and show it (skipping auto-detection)
|
|
45
|
+
|
|
46
|
+
### Requirement: Output format options
|
|
47
|
+
|
|
48
|
+
The show command SHALL support various output formats consistent with existing commands.
|
|
49
|
+
|
|
50
|
+
#### Scenario: JSON output
|
|
51
|
+
|
|
52
|
+
- **WHEN** executing `openspec show <item> --json`
|
|
53
|
+
- **THEN** output the item in JSON format
|
|
54
|
+
- **AND** include parsed metadata and structure
|
|
55
|
+
- **AND** maintain format consistency with existing change/spec show commands
|
|
56
|
+
|
|
57
|
+
#### Scenario: Flag scoping and delegation
|
|
58
|
+
|
|
59
|
+
- **WHEN** showing a change or a spec via the top-level command
|
|
60
|
+
- **THEN** accept common flags such as `--json`
|
|
61
|
+
- **AND** pass through type-specific flags to the corresponding implementation
|
|
62
|
+
- Change-only flags: `--deltas-only` (alias `--requirements-only` deprecated)
|
|
63
|
+
- Spec-only flags: `--requirements`, `--no-scenarios`, `-r/--requirement`
|
|
64
|
+
- **AND** ignore irrelevant flags for the detected type with a warning
|
|
65
|
+
|
|
66
|
+
### Requirement: Interactivity controls
|
|
67
|
+
|
|
68
|
+
- The CLI SHALL respect `--no-interactive` to disable prompts.
|
|
69
|
+
- The CLI SHALL respect `OPEN_SPEC_INTERACTIVE=0` to disable prompts globally.
|
|
70
|
+
- Interactive prompts SHALL only be shown when stdin is a TTY and interactivity is not disabled.
|
|
71
|
+
|
|
72
|
+
#### Scenario: Change-specific options
|
|
73
|
+
|
|
74
|
+
- **WHEN** showing a change with `openspec show <change-name> --deltas-only`
|
|
75
|
+
- **THEN** display only the deltas in JSON format
|
|
76
|
+
- **AND** maintain compatibility with existing change show options
|
|
77
|
+
|
|
78
|
+
#### Scenario: Spec-specific options
|
|
79
|
+
|
|
80
|
+
- **WHEN** showing a spec with `openspec show <spec-id> --requirements`
|
|
81
|
+
- **THEN** display only requirements in JSON format
|
|
82
|
+
- **AND** support other spec options (--no-scenarios, -r)
|
|
83
|
+
- **AND** maintain compatibility with existing spec show options
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# CLI Spec Command Spec
|
|
2
|
+
|
|
3
|
+
## ADDED Requirements
|
|
4
|
+
|
|
5
|
+
### Requirement: Interactive spec show
|
|
6
|
+
|
|
7
|
+
The spec show command SHALL support interactive selection when no spec-id is provided.
|
|
8
|
+
|
|
9
|
+
#### Scenario: Interactive spec selection for show
|
|
10
|
+
|
|
11
|
+
- **WHEN** executing `openspec spec show` without arguments
|
|
12
|
+
- **THEN** display an interactive list of available specs
|
|
13
|
+
- **AND** allow the user to select a spec to show
|
|
14
|
+
- **AND** display the selected spec content
|
|
15
|
+
- **AND** maintain all existing show options (--json, --requirements, --no-scenarios, -r)
|
|
16
|
+
|
|
17
|
+
#### Scenario: Non-interactive fallback keeps current behavior
|
|
18
|
+
|
|
19
|
+
- **GIVEN** stdin is not a TTY or `--no-interactive` is provided or environment variable `OPEN_SPEC_INTERACTIVE=0`
|
|
20
|
+
- **WHEN** executing `openspec spec show` without a spec-id
|
|
21
|
+
- **THEN** do not prompt interactively
|
|
22
|
+
- **AND** print the existing error message for missing spec-id
|
|
23
|
+
- **AND** set non-zero exit code
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Implementation Tasks — Add Interactive Show Command
|
|
2
|
+
|
|
3
|
+
## Goals
|
|
4
|
+
- Add a top-level `show` command with intelligent selection and type detection.
|
|
5
|
+
- Add interactive selection to `change show` and `spec show` when no ID is provided.
|
|
6
|
+
- Preserve raw-first output behavior and existing JSON formats/filters.
|
|
7
|
+
- Respect `--no-interactive` and `OPEN_SPEC_INTERACTIVE=0` consistently.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1) CLI wiring
|
|
12
|
+
- [x] In `src/cli/index.ts` add a top-level command: `program.command('show [item-name]')`
|
|
13
|
+
- Options:
|
|
14
|
+
- `--json`
|
|
15
|
+
- `--type <type>` where `<type>` is `change|spec`
|
|
16
|
+
- `--no-interactive`
|
|
17
|
+
- Allow passing-through type-specific flags using `.allowUnknownOption(true)` so the top-level can forward flags to the underlying type handler.
|
|
18
|
+
- Action: instantiate `new ShowCommand().execute(itemName, options)`.
|
|
19
|
+
- [x] Update `change show` subcommand to accept `--no-interactive` and pass it to `ChangeCommand.show(...)`.
|
|
20
|
+
- [x] Change `spec show` subcommand to accept optional ID (`show [spec-id]`), add `--no-interactive`, and pass to spec show implementation.
|
|
21
|
+
|
|
22
|
+
Acceptance:
|
|
23
|
+
- `openspec show` exists and prints a helpful hint in non-interactive contexts when no args.
|
|
24
|
+
- Unknown flags for other types do not crash parsing; they are warned/ignored appropriately.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 2) New module: `src/commands/show.ts`
|
|
29
|
+
- [x] Create `ShowCommand` with:
|
|
30
|
+
- `execute(itemName?: string, options?: { json?: boolean; type?: string; noInteractive?: boolean; [k: string]: any })`
|
|
31
|
+
- Interactive path when `!itemName` and interactive is enabled:
|
|
32
|
+
- Prompt: "What would you like to show?" → `change` or `spec`.
|
|
33
|
+
- Load available IDs for the chosen type and prompt selection.
|
|
34
|
+
- Delegate to type-specific show implementation.
|
|
35
|
+
- Non-interactive path when `!itemName`:
|
|
36
|
+
- Print hint with examples:
|
|
37
|
+
- `openspec show <item>`
|
|
38
|
+
- `openspec change show`
|
|
39
|
+
- `openspec spec show`
|
|
40
|
+
- Exit with code 1.
|
|
41
|
+
- Direct item path when `itemName` is provided:
|
|
42
|
+
- Type override via `--type` takes precedence.
|
|
43
|
+
- Otherwise detect using `getActiveChangeIds()` and `getSpecIds()`.
|
|
44
|
+
- If ambiguous and no override: print error + suggestion to pass `--type` or use subcommands; exit code 1.
|
|
45
|
+
- If unknown: print not-found with nearest-match suggestions; exit code 1.
|
|
46
|
+
- On success: delegate to type-specific show.
|
|
47
|
+
- [x] Flag scoping and pass-through:
|
|
48
|
+
- Common: `--json` → forwarded to both types.
|
|
49
|
+
- Change-only: `--deltas-only`, `--requirements-only` (deprecated alias).
|
|
50
|
+
- Spec-only: `--requirements`, `--no-scenarios`, `-r/--requirement`.
|
|
51
|
+
- Warn and ignore irrelevant flags for the resolved type.
|
|
52
|
+
|
|
53
|
+
Acceptance:
|
|
54
|
+
- `openspec show <change-id> --json --deltas-only` matches `openspec change show <id> --json --deltas-only` output.
|
|
55
|
+
- `openspec show <spec-id> --json --requirements` matches `openspec spec show <id> --json --requirements` output.
|
|
56
|
+
- Ambiguity and not-found behaviors match the `cli-show` spec.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 3) Refactor spec show into reusable API
|
|
61
|
+
- [x] In `src/commands/spec.ts`, extract show logic into an exported `SpecCommand` with `show(specId?: string, options?: { json?: boolean; requirements?: boolean; scenarios?: boolean; requirement?: string; noInteractive?: boolean })`.
|
|
62
|
+
- Reuse current helpers (`parseSpecFromFile`, `filterSpec`, raw-first printing).
|
|
63
|
+
- Keep `registerSpecCommand` but delegate to `new SpecCommand().show(...)`.
|
|
64
|
+
- [x] Update CLI spec show subcommand to optional arg and interactive behavior (see section 4).
|
|
65
|
+
|
|
66
|
+
Acceptance:
|
|
67
|
+
- Existing `spec show` tests continue to pass.
|
|
68
|
+
- New `SpecCommand.show` can be called from `ShowCommand`.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 4) Backwards-compatible interactive in subcommands
|
|
73
|
+
- [x] `src/commands/change.ts` → extend `show(changeName?: string, options?: { json?: boolean; requirementsOnly?: boolean; deltasOnly?: boolean; noInteractive?: boolean })`:
|
|
74
|
+
- When `!changeName` and interactive enabled: prompt from `getActiveChangeIds()` and show the selected change.
|
|
75
|
+
- Non-interactive fallback: keep current behavior (print available IDs + `openspec change list` hint, set `process.exitCode = 1`).
|
|
76
|
+
- [x] `src/commands/spec.ts` → `SpecCommand.show` as above:
|
|
77
|
+
- When `!specId` and interactive enabled: prompt from `getSpecIds()` and show the selected spec.
|
|
78
|
+
- Non-interactive fallback: print the same error as existing behavior for missing `<spec-id>` and set non-zero exit code.
|
|
79
|
+
|
|
80
|
+
Acceptance:
|
|
81
|
+
- `openspec change show` in non-interactive prints list hint and exits non-zero.
|
|
82
|
+
- `openspec spec show` in non-interactive prints missing-arg error and exits non-zero.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 5) Shared utilities
|
|
87
|
+
- [x] Extract `nearestMatches` and `levenshtein` from `src/commands/validate.ts` into `src/utils/match.ts` (exported helpers).
|
|
88
|
+
- [x] Update `ValidateCommand` and new `ShowCommand` to import from `utils/match`.
|
|
89
|
+
|
|
90
|
+
Acceptance:
|
|
91
|
+
- Build succeeds with shared helpers and no duplication.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 6) Hints, warnings, and messages
|
|
96
|
+
- [x] Top-level `show` hint (non-interactive no-arg):
|
|
97
|
+
- Lines include: `openspec show <item>`, `openspec change show`, `openspec spec show`, and "Or run in an interactive terminal.".
|
|
98
|
+
- [x] Ambiguity message suggests `--type change|spec` and the subcommands.
|
|
99
|
+
- [x] Not-found suggests nearest matches (up to 5).
|
|
100
|
+
- [x] Irrelevant flag warnings for the resolved type (printed to stderr, no crash).
|
|
101
|
+
|
|
102
|
+
Acceptance:
|
|
103
|
+
- Messages match the `cli-show` spec wording intent and style used elsewhere.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 7) Tests
|
|
108
|
+
Add tests mirroring existing patterns (non-TTY simulation via `OPEN_SPEC_INTERACTIVE=0`).
|
|
109
|
+
|
|
110
|
+
- [x] `test/commands/show.test.ts`
|
|
111
|
+
- Non-interactive, no arg → prints hint and exits non-zero.
|
|
112
|
+
- Direct item detection for change and for spec.
|
|
113
|
+
- Ambiguity case when both exist → error and suggestion for `--type`.
|
|
114
|
+
- Not-found case → nearest-match suggestions.
|
|
115
|
+
- Pass-through flags: change `--json --deltas-only`, spec `--json --requirements`.
|
|
116
|
+
- [x] `test/commands/change.interactive-show.test.ts` (non-interactive fallback)
|
|
117
|
+
- Ensure `openspec change show` without args prints available IDs + list hint and non-zero exit.
|
|
118
|
+
- [x] `test/commands/spec.interactive-show.test.ts` (non-interactive fallback)
|
|
119
|
+
- Ensure `openspec spec show` without args prints missing-arg error and non-zero exit.
|
|
120
|
+
|
|
121
|
+
Acceptance:
|
|
122
|
+
- All new tests pass after build; no regressions in existing tests.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 8) Documentation (optional but recommended)
|
|
127
|
+
- [x] Update `openspec/README.md` usage examples to include the new `show` command with type detection and flags.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 9) Non-functional checks
|
|
132
|
+
- [x] Run `pnpm build` and all tests (`pnpm test`).
|
|
133
|
+
- [x] Ensure no linter/type errors and messages are consistent with existing style.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Notes on consistency
|
|
138
|
+
- Follow raw-first behavior for text output: passthrough file content with no formatting, mirroring current `change show` and `spec show`.
|
|
139
|
+
- Reuse `isInteractive` and `item-discovery` helpers for consistent prompting behavior.
|
|
140
|
+
- Keep JSON output shapes identical to current `ChangeCommand.show` and `spec show` outputs.
|
|
141
|
+
|
|
142
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## Why
|
|
2
|
+
The archive command currently forces users to either accept spec updates or cancel the entire archive operation. Users need flexibility to archive changes without updating specs, either through explicit flags or by declining the confirmation prompt. This is especially important for changes that don't modify specs (like tooling, documentation, or infrastructure updates).
|
|
3
|
+
|
|
4
|
+
## What Changes
|
|
5
|
+
- Add new `--skip-specs` flag to the archive command that bypasses all spec update operations
|
|
6
|
+
- Fix confirmation behavior: when users decline spec updates interactively, proceed with archiving instead of cancelling the entire operation
|
|
7
|
+
- When `--skip-specs` flag is used, skip both the spec discovery and update confirmation steps entirely
|
|
8
|
+
- Display clear message when specs are skipped (either via flag or user choice)
|
|
9
|
+
- Flag can be combined with existing `--yes` flag for fully automated archiving without spec updates
|
|
10
|
+
|
|
11
|
+
## Impact
|
|
12
|
+
- Affected specs: cli-archive
|
|
13
|
+
- Affected code: src/core/archive.ts, src/cli/index.ts
|