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.
Files changed (311) hide show
  1. package/.gitmodules +3 -0
  2. package/CHAT.md +3 -0
  3. package/package.json +12 -0
  4. package/references/openspec/.changeset/README.md +6 -0
  5. package/references/openspec/.changeset/config.json +12 -0
  6. package/references/openspec/.coderabbit.yaml +11 -0
  7. package/references/openspec/.devcontainer/README.md +92 -0
  8. package/references/openspec/.devcontainer/devcontainer.json +68 -0
  9. package/references/openspec/.github/CODEOWNERS +2 -0
  10. package/references/openspec/.github/workflows/ci.yml +222 -0
  11. package/references/openspec/.github/workflows/release-prepare.yml +50 -0
  12. package/references/openspec/AGENTS.md +18 -0
  13. package/references/openspec/CHANGELOG.md +205 -0
  14. package/references/openspec/LICENSE +22 -0
  15. package/references/openspec/README.md +374 -0
  16. package/references/openspec/assets/openspec_dashboard.png +0 -0
  17. package/references/openspec/assets/openspec_pixel_dark.svg +89 -0
  18. package/references/openspec/assets/openspec_pixel_light.svg +89 -0
  19. package/references/openspec/bin/openspec.js +3 -0
  20. package/references/openspec/build.js +31 -0
  21. package/references/openspec/openspec/AGENTS.md +454 -0
  22. package/references/openspec/openspec/changes/IMPLEMENTATION_ORDER.md +68 -0
  23. package/references/openspec/openspec/changes/add-antigravity-support/proposal.md +11 -0
  24. package/references/openspec/openspec/changes/add-antigravity-support/specs/cli-init/spec.md +9 -0
  25. package/references/openspec/openspec/changes/add-antigravity-support/specs/cli-update/spec.md +8 -0
  26. package/references/openspec/openspec/changes/add-antigravity-support/tasks.md +12 -0
  27. package/references/openspec/openspec/changes/add-scaffold-command/proposal.md +11 -0
  28. package/references/openspec/openspec/changes/add-scaffold-command/specs/cli-scaffold/spec.md +36 -0
  29. package/references/openspec/openspec/changes/add-scaffold-command/tasks.md +12 -0
  30. package/references/openspec/openspec/changes/archive/2025-01-11-add-update-command/design.md +86 -0
  31. package/references/openspec/openspec/changes/archive/2025-01-11-add-update-command/proposal.md +29 -0
  32. package/references/openspec/openspec/changes/archive/2025-01-11-add-update-command/specs/cli-update/spec.md +59 -0
  33. package/references/openspec/openspec/changes/archive/2025-01-11-add-update-command/tasks.md +20 -0
  34. package/references/openspec/openspec/changes/archive/2025-01-13-add-list-command/proposal.md +20 -0
  35. package/references/openspec/openspec/changes/archive/2025-01-13-add-list-command/specs/cli-list/spec.md +69 -0
  36. package/references/openspec/openspec/changes/archive/2025-01-13-add-list-command/tasks.md +26 -0
  37. package/references/openspec/openspec/changes/archive/2025-08-05-initialize-typescript-project/design.md +64 -0
  38. package/references/openspec/openspec/changes/archive/2025-08-05-initialize-typescript-project/proposal.md +18 -0
  39. package/references/openspec/openspec/changes/archive/2025-08-05-initialize-typescript-project/tasks.md +25 -0
  40. package/references/openspec/openspec/changes/archive/2025-08-06-add-init-command/design.md +104 -0
  41. package/references/openspec/openspec/changes/archive/2025-08-06-add-init-command/proposal.md +30 -0
  42. package/references/openspec/openspec/changes/archive/2025-08-06-add-init-command/specs/cli-init/spec.md +148 -0
  43. package/references/openspec/openspec/changes/archive/2025-08-06-add-init-command/tasks.md +38 -0
  44. package/references/openspec/openspec/changes/archive/2025-08-06-adopt-future-state-storage/proposal.md +24 -0
  45. package/references/openspec/openspec/changes/archive/2025-08-06-adopt-future-state-storage/specs/openspec-conventions/spec.md +120 -0
  46. package/references/openspec/openspec/changes/archive/2025-08-06-adopt-future-state-storage/tasks.md +38 -0
  47. package/references/openspec/openspec/changes/archive/2025-08-11-add-complexity-guidelines/proposal.md +13 -0
  48. package/references/openspec/openspec/changes/archive/2025-08-11-add-complexity-guidelines/specs/openspec-docs/README.md +472 -0
  49. package/references/openspec/openspec/changes/archive/2025-08-11-add-complexity-guidelines/tasks.md +9 -0
  50. package/references/openspec/openspec/changes/archive/2025-08-13-add-archive-command/proposal.md +15 -0
  51. package/references/openspec/openspec/changes/archive/2025-08-13-add-archive-command/specs/cli-archive/spec.md +111 -0
  52. package/references/openspec/openspec/changes/archive/2025-08-13-add-archive-command/tasks.md +44 -0
  53. package/references/openspec/openspec/changes/archive/2025-08-13-add-diff-command/proposal.md +19 -0
  54. package/references/openspec/openspec/changes/archive/2025-08-13-add-diff-command/specs/cli-diff/spec.md +77 -0
  55. package/references/openspec/openspec/changes/archive/2025-08-13-add-diff-command/tasks.md +23 -0
  56. package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/design.md +56 -0
  57. package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/proposal.md +17 -0
  58. package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/specs/cli-change/spec.md +48 -0
  59. package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/specs/cli-list/spec.md +12 -0
  60. package/references/openspec/openspec/changes/archive/2025-08-19-add-change-commands/tasks.md +34 -0
  61. package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/proposal.md +20 -0
  62. package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/specs/cli-change/spec.md +23 -0
  63. package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/specs/cli-show/spec.md +83 -0
  64. package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/specs/cli-spec/spec.md +23 -0
  65. package/references/openspec/openspec/changes/archive/2025-08-19-add-interactive-show-command/tasks.md +142 -0
  66. package/references/openspec/openspec/changes/archive/2025-08-19-add-skip-specs-archive-option/proposal.md +13 -0
  67. package/references/openspec/openspec/changes/archive/2025-08-19-add-skip-specs-archive-option/specs/cli-archive/spec.md +191 -0
  68. package/references/openspec/openspec/changes/archive/2025-08-19-add-skip-specs-archive-option/tasks.md +57 -0
  69. package/references/openspec/openspec/changes/archive/2025-08-19-add-spec-commands/design.md +45 -0
  70. package/references/openspec/openspec/changes/archive/2025-08-19-add-spec-commands/proposal.md +19 -0
  71. package/references/openspec/openspec/changes/archive/2025-08-19-add-spec-commands/specs/cli-spec/spec.md +43 -0
  72. package/references/openspec/openspec/changes/archive/2025-08-19-add-spec-commands/tasks.md +22 -0
  73. package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/design.md +104 -0
  74. package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/proposal.md +22 -0
  75. package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/specs/cli-archive/spec.md +18 -0
  76. package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/specs/cli-diff/spec.md +12 -0
  77. package/references/openspec/openspec/changes/archive/2025-08-19-add-zod-validation/tasks.md +59 -0
  78. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/proposal.md +93 -0
  79. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/specs/cli-archive/spec.md +48 -0
  80. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/specs/cli-diff/spec.md +45 -0
  81. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/specs/openspec-conventions/spec.md +101 -0
  82. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-delta-based-changes/tasks.md +55 -0
  83. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/design.md +19 -0
  84. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/proposal.md +67 -0
  85. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/specs/cli-list/spec.md +57 -0
  86. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/specs/openspec-conventions/spec.md +23 -0
  87. package/references/openspec/openspec/changes/archive/2025-08-19-adopt-verb-noun-cli-structure/tasks.md +27 -0
  88. package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/proposal.md +20 -0
  89. package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/specs/cli-change/spec.md +22 -0
  90. package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/specs/cli-spec/spec.md +23 -0
  91. package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/specs/cli-validate/spec.md +149 -0
  92. package/references/openspec/openspec/changes/archive/2025-08-19-bulk-validation-interactive-selection/tasks.md +81 -0
  93. package/references/openspec/openspec/changes/archive/2025-08-19-fix-update-tool-selection/proposal.md +40 -0
  94. package/references/openspec/openspec/changes/archive/2025-08-19-fix-update-tool-selection/specs/cli-update/spec.md +23 -0
  95. package/references/openspec/openspec/changes/archive/2025-08-19-fix-update-tool-selection/tasks.md +21 -0
  96. package/references/openspec/openspec/changes/archive/2025-08-19-improve-validate-error-messages/proposal.md +25 -0
  97. package/references/openspec/openspec/changes/archive/2025-08-19-improve-validate-error-messages/specs/cli-validate/spec.md +55 -0
  98. package/references/openspec/openspec/changes/archive/2025-08-19-improve-validate-error-messages/tasks.md +21 -0
  99. package/references/openspec/openspec/changes/archive/2025-08-19-structured-spec-format/proposal.md +36 -0
  100. package/references/openspec/openspec/changes/archive/2025-08-19-structured-spec-format/specs/openspec-conventions/spec.md +192 -0
  101. package/references/openspec/openspec/changes/archive/2025-08-19-structured-spec-format/tasks.md +19 -0
  102. package/references/openspec/openspec/changes/archive/2025-09-12-add-view-dashboard-command/proposal.md +38 -0
  103. package/references/openspec/openspec/changes/archive/2025-09-12-add-view-dashboard-command/specs/cli-view/spec.md +109 -0
  104. package/references/openspec/openspec/changes/archive/2025-09-12-add-view-dashboard-command/tasks.md +47 -0
  105. package/references/openspec/openspec/changes/archive/2025-09-29-add-agents-md-config/proposal.md +28 -0
  106. package/references/openspec/openspec/changes/archive/2025-09-29-add-agents-md-config/specs/cli-init/spec.md +71 -0
  107. package/references/openspec/openspec/changes/archive/2025-09-29-add-agents-md-config/specs/cli-update/spec.md +41 -0
  108. package/references/openspec/openspec/changes/archive/2025-09-29-add-agents-md-config/tasks.md +17 -0
  109. package/references/openspec/openspec/changes/archive/2025-09-29-add-multi-agent-init/proposal.md +35 -0
  110. package/references/openspec/openspec/changes/archive/2025-09-29-add-multi-agent-init/specs/cli-init/spec.md +45 -0
  111. package/references/openspec/openspec/changes/archive/2025-09-29-add-multi-agent-init/tasks.md +16 -0
  112. package/references/openspec/openspec/changes/archive/2025-09-29-add-slash-command-support/proposal.md +119 -0
  113. package/references/openspec/openspec/changes/archive/2025-09-29-add-slash-command-support/specs/cli-init/spec.md +21 -0
  114. package/references/openspec/openspec/changes/archive/2025-09-29-add-slash-command-support/specs/cli-update/spec.md +22 -0
  115. package/references/openspec/openspec/changes/archive/2025-09-29-add-slash-command-support/tasks.md +20 -0
  116. package/references/openspec/openspec/changes/archive/2025-09-29-improve-cli-e2e-plan/proposal.md +19 -0
  117. package/references/openspec/openspec/changes/archive/2025-09-29-improve-cli-e2e-plan/tasks.md +9 -0
  118. package/references/openspec/openspec/changes/archive/2025-09-29-improve-deterministic-tests/proposal.md +78 -0
  119. package/references/openspec/openspec/changes/archive/2025-09-29-improve-deterministic-tests/tasks.md +25 -0
  120. package/references/openspec/openspec/changes/archive/2025-09-29-improve-init-onboarding/proposal.md +13 -0
  121. package/references/openspec/openspec/changes/archive/2025-09-29-improve-init-onboarding/specs/cli-init/spec.md +92 -0
  122. package/references/openspec/openspec/changes/archive/2025-09-29-improve-init-onboarding/tasks.md +12 -0
  123. package/references/openspec/openspec/changes/archive/2025-09-29-remove-diff-command/proposal.md +81 -0
  124. package/references/openspec/openspec/changes/archive/2025-09-29-remove-diff-command/tasks.md +37 -0
  125. package/references/openspec/openspec/changes/archive/2025-09-29-sort-active-changes-by-progress/proposal.md +25 -0
  126. package/references/openspec/openspec/changes/archive/2025-09-29-sort-active-changes-by-progress/specs/cli-view/spec.md +9 -0
  127. package/references/openspec/openspec/changes/archive/2025-09-29-sort-active-changes-by-progress/tasks.md +8 -0
  128. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/proposal.md +29 -0
  129. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/specs/cli-init/spec.md +40 -0
  130. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/specs/cli-update/spec.md +22 -0
  131. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/specs/openspec-conventions/spec.md +27 -0
  132. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-file-name/tasks.md +22 -0
  133. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-instructions/design.md +130 -0
  134. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-instructions/proposal.md +117 -0
  135. package/references/openspec/openspec/changes/archive/2025-09-29-update-agent-instructions/tasks.md +69 -0
  136. package/references/openspec/openspec/changes/archive/2025-09-29-update-markdown-parser-crlf/proposal.md +19 -0
  137. package/references/openspec/openspec/changes/archive/2025-09-29-update-markdown-parser-crlf/specs/cli-validate/spec.md +9 -0
  138. package/references/openspec/openspec/changes/archive/2025-09-29-update-markdown-parser-crlf/tasks.md +11 -0
  139. package/references/openspec/openspec/changes/archive/2025-10-14-add-codex-slash-command-support/proposal.md +25 -0
  140. package/references/openspec/openspec/changes/archive/2025-10-14-add-codex-slash-command-support/specs/cli-init/spec.md +56 -0
  141. package/references/openspec/openspec/changes/archive/2025-10-14-add-codex-slash-command-support/specs/cli-update/spec.md +41 -0
  142. package/references/openspec/openspec/changes/archive/2025-10-14-add-codex-slash-command-support/tasks.md +19 -0
  143. package/references/openspec/openspec/changes/archive/2025-10-14-add-github-copilot-prompts/proposal.md +25 -0
  144. package/references/openspec/openspec/changes/archive/2025-10-14-add-github-copilot-prompts/specs/cli-init/spec.md +48 -0
  145. package/references/openspec/openspec/changes/archive/2025-10-14-add-github-copilot-prompts/specs/cli-update/spec.md +48 -0
  146. package/references/openspec/openspec/changes/archive/2025-10-14-add-github-copilot-prompts/tasks.md +30 -0
  147. package/references/openspec/openspec/changes/archive/2025-10-14-add-kilocode-workflows/proposal.md +17 -0
  148. package/references/openspec/openspec/changes/archive/2025-10-14-add-kilocode-workflows/specs/cli-init/spec.md +43 -0
  149. package/references/openspec/openspec/changes/archive/2025-10-14-add-kilocode-workflows/specs/cli-update/spec.md +27 -0
  150. package/references/openspec/openspec/changes/archive/2025-10-14-add-kilocode-workflows/tasks.md +15 -0
  151. package/references/openspec/openspec/changes/archive/2025-10-14-add-non-interactive-init-options/proposal.md +12 -0
  152. package/references/openspec/openspec/changes/archive/2025-10-14-add-non-interactive-init-options/specs/cli-init/spec.md +39 -0
  153. package/references/openspec/openspec/changes/archive/2025-10-14-add-non-interactive-init-options/tasks.md +17 -0
  154. package/references/openspec/openspec/changes/archive/2025-10-14-add-windsurf-workflows/proposal.md +17 -0
  155. package/references/openspec/openspec/changes/archive/2025-10-14-add-windsurf-workflows/specs/cli-init/spec.md +42 -0
  156. package/references/openspec/openspec/changes/archive/2025-10-14-add-windsurf-workflows/specs/cli-update/spec.md +27 -0
  157. package/references/openspec/openspec/changes/archive/2025-10-14-add-windsurf-workflows/tasks.md +17 -0
  158. package/references/openspec/openspec/changes/archive/2025-10-14-enhance-validation-error-messages/proposal.md +12 -0
  159. package/references/openspec/openspec/changes/archive/2025-10-14-enhance-validation-error-messages/specs/cli-validate/spec.md +39 -0
  160. package/references/openspec/openspec/changes/archive/2025-10-14-enhance-validation-error-messages/tasks.md +12 -0
  161. package/references/openspec/openspec/changes/archive/2025-10-14-improve-agent-instruction-usability/proposal.md +12 -0
  162. package/references/openspec/openspec/changes/archive/2025-10-14-improve-agent-instruction-usability/specs/docs-agent-instructions/spec.md +33 -0
  163. package/references/openspec/openspec/changes/archive/2025-10-14-improve-agent-instruction-usability/tasks.md +11 -0
  164. package/references/openspec/openspec/changes/archive/2025-10-14-slim-root-agents-file/proposal.md +13 -0
  165. package/references/openspec/openspec/changes/archive/2025-10-14-slim-root-agents-file/tasks.md +15 -0
  166. package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-enter-selection/proposal.md +14 -0
  167. package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-enter-selection/specs/cli-init/spec.md +10 -0
  168. package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-enter-selection/tasks.md +8 -0
  169. package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-root-agents/proposal.md +15 -0
  170. package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-root-agents/specs/cli-init/spec.md +32 -0
  171. package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-root-agents/specs/cli-update/spec.md +10 -0
  172. package/references/openspec/openspec/changes/archive/2025-10-14-update-cli-init-root-agents/tasks.md +11 -0
  173. package/references/openspec/openspec/changes/archive/2025-10-14-update-release-automation/proposal.md +49 -0
  174. package/references/openspec/openspec/changes/archive/2025-10-14-update-release-automation/tasks.md +12 -0
  175. package/references/openspec/openspec/changes/archive/2025-10-22-add-archive-command-arguments/proposal.md +17 -0
  176. package/references/openspec/openspec/changes/archive/2025-10-22-add-archive-command-arguments/specs/cli-update/spec.md +32 -0
  177. package/references/openspec/openspec/changes/archive/2025-10-22-add-archive-command-arguments/tasks.md +15 -0
  178. package/references/openspec/openspec/changes/archive/2025-10-22-add-cline-support/proposal.md +15 -0
  179. package/references/openspec/openspec/changes/archive/2025-10-22-add-cline-support/specs/cli-init/spec.md +97 -0
  180. package/references/openspec/openspec/changes/archive/2025-10-22-add-cline-support/tasks.md +19 -0
  181. package/references/openspec/openspec/changes/archive/2025-10-22-add-crush-support/proposal.md +13 -0
  182. package/references/openspec/openspec/changes/archive/2025-10-22-add-crush-support/specs/cli-init/spec.md +67 -0
  183. package/references/openspec/openspec/changes/archive/2025-10-22-add-crush-support/tasks.md +7 -0
  184. package/references/openspec/openspec/changes/archive/2025-10-22-add-factory-slash-commands/proposal.md +12 -0
  185. package/references/openspec/openspec/changes/archive/2025-10-22-add-factory-slash-commands/specs/cli-init/spec.md +54 -0
  186. package/references/openspec/openspec/changes/archive/2025-10-22-add-factory-slash-commands/specs/cli-update/spec.md +54 -0
  187. package/references/openspec/openspec/changes/archive/2025-10-22-add-factory-slash-commands/tasks.md +11 -0
  188. package/references/openspec/openspec/changes/fix-cline-workflows-implementation/proposal.md +13 -0
  189. package/references/openspec/openspec/changes/fix-cline-workflows-implementation/specs/cli-init/spec.md +11 -0
  190. package/references/openspec/openspec/changes/fix-cline-workflows-implementation/tasks.md +13 -0
  191. package/references/openspec/openspec/changes/make-validation-scope-aware/proposal.md +12 -0
  192. package/references/openspec/openspec/changes/make-validation-scope-aware/specs/cli-validate/spec.md +25 -0
  193. package/references/openspec/openspec/changes/make-validation-scope-aware/tasks.md +16 -0
  194. package/references/openspec/openspec/project.md +53 -0
  195. package/references/openspec/openspec/specs/cli-archive/spec.md +210 -0
  196. package/references/openspec/openspec/specs/cli-change/spec.md +91 -0
  197. package/references/openspec/openspec/specs/cli-init/spec.md +311 -0
  198. package/references/openspec/openspec/specs/cli-list/spec.md +103 -0
  199. package/references/openspec/openspec/specs/cli-show/spec.md +85 -0
  200. package/references/openspec/openspec/specs/cli-spec/spec.md +87 -0
  201. package/references/openspec/openspec/specs/cli-update/spec.md +190 -0
  202. package/references/openspec/openspec/specs/cli-validate/spec.md +218 -0
  203. package/references/openspec/openspec/specs/cli-view/spec.md +105 -0
  204. package/references/openspec/openspec/specs/docs-agent-instructions/spec.md +38 -0
  205. package/references/openspec/openspec/specs/openspec-conventions/spec.md +474 -0
  206. package/references/openspec/openspec-parallel-merge-plan.md +98 -0
  207. package/references/openspec/package.json +73 -0
  208. package/references/openspec/pnpm-lock.yaml +2324 -0
  209. package/references/openspec/scripts/pack-version-check.mjs +111 -0
  210. package/references/openspec/src/cli/index.ts +253 -0
  211. package/references/openspec/src/commands/change.ts +291 -0
  212. package/references/openspec/src/commands/show.ts +139 -0
  213. package/references/openspec/src/commands/spec.ts +250 -0
  214. package/references/openspec/src/commands/validate.ts +305 -0
  215. package/references/openspec/src/core/archive.ts +606 -0
  216. package/references/openspec/src/core/config.ts +41 -0
  217. package/references/openspec/src/core/configurators/agents.ts +23 -0
  218. package/references/openspec/src/core/configurators/base.ts +6 -0
  219. package/references/openspec/src/core/configurators/claude.ts +23 -0
  220. package/references/openspec/src/core/configurators/cline.ts +23 -0
  221. package/references/openspec/src/core/configurators/codebuddy.ts +24 -0
  222. package/references/openspec/src/core/configurators/costrict.ts +23 -0
  223. package/references/openspec/src/core/configurators/iflow.ts +23 -0
  224. package/references/openspec/src/core/configurators/qoder.ts +53 -0
  225. package/references/openspec/src/core/configurators/qwen.ts +47 -0
  226. package/references/openspec/src/core/configurators/registry.ts +49 -0
  227. package/references/openspec/src/core/configurators/slash/amazon-q.ts +51 -0
  228. package/references/openspec/src/core/configurators/slash/antigravity.ts +28 -0
  229. package/references/openspec/src/core/configurators/slash/auggie.ts +37 -0
  230. package/references/openspec/src/core/configurators/slash/base.ts +95 -0
  231. package/references/openspec/src/core/configurators/slash/claude.ts +42 -0
  232. package/references/openspec/src/core/configurators/slash/cline.ts +27 -0
  233. package/references/openspec/src/core/configurators/slash/codebuddy.ts +43 -0
  234. package/references/openspec/src/core/configurators/slash/codex.ts +126 -0
  235. package/references/openspec/src/core/configurators/slash/costrict.ts +36 -0
  236. package/references/openspec/src/core/configurators/slash/crush.ts +42 -0
  237. package/references/openspec/src/core/configurators/slash/cursor.ts +42 -0
  238. package/references/openspec/src/core/configurators/slash/factory.ts +41 -0
  239. package/references/openspec/src/core/configurators/slash/gemini.ts +27 -0
  240. package/references/openspec/src/core/configurators/slash/github-copilot.ts +39 -0
  241. package/references/openspec/src/core/configurators/slash/iflow.ts +42 -0
  242. package/references/openspec/src/core/configurators/slash/kilocode.ts +21 -0
  243. package/references/openspec/src/core/configurators/slash/opencode.ts +83 -0
  244. package/references/openspec/src/core/configurators/slash/qoder.ts +84 -0
  245. package/references/openspec/src/core/configurators/slash/qwen.ts +55 -0
  246. package/references/openspec/src/core/configurators/slash/registry.ts +81 -0
  247. package/references/openspec/src/core/configurators/slash/roocode.ts +27 -0
  248. package/references/openspec/src/core/configurators/slash/toml-base.ts +66 -0
  249. package/references/openspec/src/core/configurators/slash/windsurf.ts +27 -0
  250. package/references/openspec/src/core/converters/json-converter.ts +61 -0
  251. package/references/openspec/src/core/index.ts +2 -0
  252. package/references/openspec/src/core/init.ts +986 -0
  253. package/references/openspec/src/core/list.ts +104 -0
  254. package/references/openspec/src/core/parsers/change-parser.ts +234 -0
  255. package/references/openspec/src/core/parsers/markdown-parser.ts +237 -0
  256. package/references/openspec/src/core/parsers/requirement-blocks.ts +234 -0
  257. package/references/openspec/src/core/schemas/base.schema.ts +20 -0
  258. package/references/openspec/src/core/schemas/change.schema.ts +42 -0
  259. package/references/openspec/src/core/schemas/index.ts +20 -0
  260. package/references/openspec/src/core/schemas/spec.schema.ts +17 -0
  261. package/references/openspec/src/core/styles/palette.ts +8 -0
  262. package/references/openspec/src/core/templates/agents-root-stub.ts +16 -0
  263. package/references/openspec/src/core/templates/agents-template.ts +457 -0
  264. package/references/openspec/src/core/templates/claude-template.ts +1 -0
  265. package/references/openspec/src/core/templates/cline-template.ts +1 -0
  266. package/references/openspec/src/core/templates/costrict-template.ts +1 -0
  267. package/references/openspec/src/core/templates/index.ts +50 -0
  268. package/references/openspec/src/core/templates/project-template.ts +38 -0
  269. package/references/openspec/src/core/templates/slash-command-templates.ts +60 -0
  270. package/references/openspec/src/core/update.ts +129 -0
  271. package/references/openspec/src/core/validation/constants.ts +48 -0
  272. package/references/openspec/src/core/validation/types.ts +19 -0
  273. package/references/openspec/src/core/validation/validator.ts +448 -0
  274. package/references/openspec/src/core/view.ts +189 -0
  275. package/references/openspec/src/index.ts +2 -0
  276. package/references/openspec/src/utils/file-system.ts +187 -0
  277. package/references/openspec/src/utils/index.ts +2 -0
  278. package/references/openspec/src/utils/interactive.ts +7 -0
  279. package/references/openspec/src/utils/item-discovery.ts +45 -0
  280. package/references/openspec/src/utils/match.ts +26 -0
  281. package/references/openspec/src/utils/task-progress.ts +43 -0
  282. package/references/openspec/test/cli-e2e/basic.test.ts +156 -0
  283. package/references/openspec/test/commands/change.interactive-show.test.ts +45 -0
  284. package/references/openspec/test/commands/change.interactive-validate.test.ts +48 -0
  285. package/references/openspec/test/commands/show.test.ts +123 -0
  286. package/references/openspec/test/commands/spec.interactive-show.test.ts +44 -0
  287. package/references/openspec/test/commands/spec.interactive-validate.test.ts +44 -0
  288. package/references/openspec/test/commands/spec.test.ts +324 -0
  289. package/references/openspec/test/commands/validate.enriched-output.test.ts +49 -0
  290. package/references/openspec/test/commands/validate.test.ts +133 -0
  291. package/references/openspec/test/core/archive.test.ts +680 -0
  292. package/references/openspec/test/core/commands/change-command.list.test.ts +76 -0
  293. package/references/openspec/test/core/commands/change-command.show-validate.test.ts +111 -0
  294. package/references/openspec/test/core/converters/json-converter.test.ts +184 -0
  295. package/references/openspec/test/core/init.test.ts +1710 -0
  296. package/references/openspec/test/core/list.test.ts +165 -0
  297. package/references/openspec/test/core/parsers/change-parser.test.ts +52 -0
  298. package/references/openspec/test/core/parsers/markdown-parser.test.ts +291 -0
  299. package/references/openspec/test/core/update.test.ts +1642 -0
  300. package/references/openspec/test/core/validation.enriched-messages.test.ts +74 -0
  301. package/references/openspec/test/core/validation.test.ts +489 -0
  302. package/references/openspec/test/core/view.test.ts +79 -0
  303. package/references/openspec/test/fixtures/tmp-init/openspec/changes/c1/proposal.md +7 -0
  304. package/references/openspec/test/fixtures/tmp-init/openspec/changes/c1/specs/alpha/spec.md +8 -0
  305. package/references/openspec/test/fixtures/tmp-init/openspec/specs/alpha/spec.md +12 -0
  306. package/references/openspec/test/helpers/run-cli.ts +139 -0
  307. package/references/openspec/test/utils/file-system.test.ts +211 -0
  308. package/references/openspec/test/utils/marker-updates.test.ts +287 -0
  309. package/references/openspec/tsconfig.json +21 -0
  310. package/references/openspec/vitest.config.ts +25 -0
  311. package/references/openspec/vitest.setup.ts +6 -0
@@ -0,0 +1,149 @@
1
+ # CLI Validate Command Spec
2
+
3
+ ## ADDED Requirements
4
+
5
+ ### Requirement: Top-level validate command
6
+
7
+ The CLI SHALL provide a top-level `validate` command for validating changes and specs with flexible selection options.
8
+
9
+ #### Scenario: Interactive validation selection
10
+
11
+ - **WHEN** executing `openspec validate` without arguments
12
+ - **THEN** prompt user to select what to validate (all, changes, specs, or specific item)
13
+ - **AND** perform validation based on selection
14
+ - **AND** display results with appropriate formatting
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 validate` without arguments
20
+ - **THEN** do not prompt interactively
21
+ - **AND** print a helpful hint listing available commands/flags and exit with code 1
22
+
23
+ #### Scenario: Direct item validation
24
+
25
+ - **WHEN** executing `openspec validate <item-name>`
26
+ - **THEN** automatically detect if item is a change or spec
27
+ - **AND** validate the specified item
28
+ - **AND** display validation results
29
+
30
+ ### Requirement: Bulk and filtered validation
31
+
32
+ The validate command SHALL support flags for bulk validation (--all) and filtered validation by type (--changes, --specs).
33
+
34
+ #### Scenario: Validate everything
35
+
36
+ - **WHEN** executing `openspec validate --all`
37
+ - **THEN** validate all changes in openspec/changes/ (excluding archive)
38
+ - **AND** validate all specs in openspec/specs/
39
+ - **AND** display a summary showing passed/failed items
40
+ - **AND** exit with code 1 if any validation fails
41
+
42
+ #### Scenario: Scope of bulk validation
43
+
44
+ - **WHEN** validating with `--all` or `--changes`
45
+ - **THEN** include all change proposals under `openspec/changes/`
46
+ - **AND** exclude the `openspec/changes/archive/` directory
47
+
48
+ - **WHEN** validating with `--specs`
49
+ - **THEN** include all specs that have a `spec.md` under `openspec/specs/<id>/spec.md`
50
+
51
+ #### Scenario: Validate all changes
52
+
53
+ - **WHEN** executing `openspec validate --changes`
54
+ - **THEN** validate all changes in openspec/changes/ (excluding archive)
55
+ - **AND** display results for each change
56
+ - **AND** show summary statistics
57
+
58
+ #### Scenario: Validate all specs
59
+
60
+ - **WHEN** executing `openspec validate --specs`
61
+ - **THEN** validate all specs in openspec/specs/
62
+ - **AND** display results for each spec
63
+ - **AND** show summary statistics
64
+
65
+ ### Requirement: Validation options and progress indication
66
+
67
+ The validate command SHALL support standard validation options (--strict, --json) and display progress during bulk operations.
68
+
69
+ #### Scenario: Strict validation
70
+
71
+ - **WHEN** executing `openspec validate --all --strict`
72
+ - **THEN** apply strict validation to all items
73
+ - **AND** treat warnings as errors
74
+ - **AND** fail if any item has warnings or errors
75
+
76
+ #### Scenario: JSON output
77
+
78
+ - **WHEN** executing `openspec validate --all --json`
79
+ - **THEN** output validation results as JSON
80
+ - **AND** include detailed issues for each item
81
+ - **AND** include summary statistics
82
+
83
+ #### Scenario: JSON output schema for bulk validation
84
+
85
+ - **WHEN** executing `openspec validate --all --json` (or `--changes` / `--specs`)
86
+ - **THEN** output a JSON object with the following shape:
87
+ - `items`: Array of objects with fields `{ id: string, type: "change"|"spec", valid: boolean, issues: Issue[], durationMs: number }`
88
+ - `summary`: Object `{ totals: { items: number, passed: number, failed: number }, byType: { change?: { items: number, passed: number, failed: number }, spec?: { items: number, passed: number, failed: number } } }`
89
+ - `version`: String identifier for the schema (e.g., `"1.0"`)
90
+ - **AND** exit with code 1 if any `items[].valid === false`
91
+
92
+ Where `Issue` follows the existing per-item validation report shape `{ level: "ERROR"|"WARNING"|"INFO", path: string, message: string }`.
93
+
94
+ #### Scenario: Show validation progress
95
+
96
+ - **WHEN** validating multiple items (--all, --changes, or --specs)
97
+ - **THEN** show progress indicator or status updates
98
+ - **AND** indicate which item is currently being validated
99
+ - **AND** display running count of passed/failed items
100
+
101
+ #### Scenario: Concurrency limits for performance
102
+
103
+ - **WHEN** validating multiple items
104
+ - **THEN** run validations with a bounded concurrency (e.g., 4–8 in parallel)
105
+ - **AND** ensure progress indicators remain responsive
106
+
107
+ ### Requirement: Item type detection and ambiguity handling
108
+
109
+ The validate command SHALL handle ambiguous names and explicit type overrides to ensure clear, deterministic behavior.
110
+
111
+ #### Scenario: Direct item validation with automatic type detection
112
+
113
+ - **WHEN** executing `openspec validate <item-name>`
114
+ - **THEN** if `<item-name>` uniquely matches a change or a spec, validate that item
115
+
116
+ #### Scenario: Ambiguity between change and spec names
117
+
118
+ - **GIVEN** `<item-name>` exists both as a change and as a spec
119
+ - **WHEN** executing `openspec validate <item-name>`
120
+ - **THEN** print an ambiguity error explaining both matches
121
+ - **AND** suggest passing `--type change` or `--type spec`, or using `openspec change validate` / `openspec spec validate`
122
+ - **AND** exit with code 1 without performing validation
123
+
124
+ #### Scenario: Unknown item name
125
+
126
+ - **WHEN** the `<item-name>` matches neither a change nor a spec
127
+ - **THEN** print a not-found error
128
+ - **AND** show nearest-match suggestions when available
129
+ - **AND** exit with code 1
130
+
131
+ #### Scenario: Explicit type override
132
+
133
+ - **WHEN** executing `openspec validate --type change <item>`
134
+ - **THEN** treat `<item>` as a change ID and validate it (skipping auto-detection)
135
+
136
+ - **WHEN** executing `openspec validate --type spec <item>`
137
+ - **THEN** treat `<item>` as a spec ID and validate it (skipping auto-detection)
138
+
139
+ ### Requirement: Interactivity controls
140
+
141
+ - The CLI SHALL respect `--no-interactive` to disable prompts.
142
+ - The CLI SHALL respect `OPEN_SPEC_INTERACTIVE=0` to disable prompts globally.
143
+ - Interactive prompts SHALL only be shown when stdin is a TTY and interactivity is not disabled.
144
+
145
+ #### Scenario: Disabling prompts via flags or environment
146
+
147
+ - **WHEN** `openspec validate` is executed with `--no-interactive` or with environment `OPEN_SPEC_INTERACTIVE=0`
148
+ - **THEN** the CLI SHALL not display interactive prompts
149
+ - **AND** SHALL print non-interactive hints or chosen outputs as appropriate
@@ -0,0 +1,81 @@
1
+ # Implementation Tasks
2
+
3
+ ## 1. Change Command: Interactive Validation Selection
4
+ - [x] 1.1 Add `--no-interactive` flag to `change validate` in `src/cli/index.ts`
5
+ - [x] 1.2 Implement interactivity gate respecting TTY and `OPEN_SPEC_INTERACTIVE=0` in `src/commands/change.ts`
6
+ - [x] 1.3 When no `[change-name]` is provided and interactivity is allowed, prompt with a list of active changes (exclude `archive/`) and validate the selected one
7
+ - [x] 1.4 Preserve current non-interactive fallback: print available change IDs and hint, set `process.exitCode = 1`
8
+ - [x] 1.5 Tests: add coverage for interactive and non-interactive flows
9
+ - Added `test/commands/change.interactive-validate.test.ts`
10
+
11
+ ## 2. Spec Command: Interactive Validation Selection
12
+ - [x] 2.1 Make `spec validate` accept optional `[spec-id]` in `src/commands/spec.ts` registration
13
+ - [x] 2.2 Add `--no-interactive` flag to `spec validate`
14
+ - [x] 2.3 Implement interactivity gate respecting TTY and `OPEN_SPEC_INTERACTIVE=0`
15
+ - [x] 2.4 When no `[spec-id]` provided and interactivity allowed, prompt to select from `openspec/specs/*/spec.md` and validate the selected spec
16
+ - [x] 2.5 Preserve current non-interactive fallback when no spec-id and no interactivity: print existing error and exit code non-zero
17
+ - [x] 2.6 Tests: add coverage for interactive and non-interactive flows
18
+ - Added `test/commands/spec.interactive-validate.test.ts`
19
+
20
+ ## 3. New Top-level `validate` Command
21
+ - [x] 3.1 Add `validate` command in `src/cli/index.ts`
22
+ - Options: `--all`, `--changes`, `--specs`, `--type <change|spec>`, `--strict`, `--json`, `--no-interactive`
23
+ - Usage: `openspec validate [item-name]`
24
+ - [x] 3.2 Create `src/commands/validate.ts` implementing:
25
+ - [x] 3.2.1 Interactive selector when no args (choices: All, Changes, Specs, Specific item)
26
+ - [x] 3.2.2 Non-interactive fallback with helpful hint and exit code 1
27
+ - [x] 3.2.3 Direct item validation with automatic type detection
28
+ - [x] 3.2.4 Ambiguity error when name exists as both change and spec; suggest `--type` or subcommands
29
+ - [x] 3.2.5 Unknown item handling with nearest-match suggestions
30
+ - [x] 3.2.6 Bulk validation for `--all`, `--changes`, `--specs` (exclude `openspec/changes/archive/`)
31
+ - [x] 3.2.7 Respect `--strict` and `--json` options; JSON shape per spec
32
+ - [x] 3.2.8 Exit with code 1 if any validation fails
33
+ - [x] 3.2.9 Bounded concurrency (default 4–8) for bulk validation
34
+ - [x] 3.2.10 Progress indication during bulk runs (current item, running counts)
35
+
36
+ ## 4. Utilities and Shared Helpers
37
+ - [x] 4.1 Add `src/utils/interactive.ts` with `isInteractive(stdin: NodeJS.ReadStream, noInteractiveFlag?: boolean): boolean`
38
+ - Considers: `process.stdin.isTTY`, `--no-interactive`, `OPEN_SPEC_INTERACTIVE=0`
39
+ - [x] 4.2 Add `src/utils/item-discovery.ts` with:
40
+ - `getActiveChangeIds(root = process.cwd()): Promise<string[]>` (exclude `archive/`)
41
+ - `getSpecIds(root = process.cwd()): Promise<string[]>` (folders with `spec.md`)
42
+ - [ ] 4.3 Optional: `src/utils/concurrency.ts` helper for bounded parallelism
43
+ - [x] 4.4 Reuse `src/core/validation/validator.ts` for item validation
44
+
45
+ ## 5. JSON Output (Bulk Validation)
46
+ - [x] 5.1 Implement JSON schema:
47
+ - `items: Array<{ id: string, type: "change"|"spec", valid: boolean, issues: Issue[], durationMs: number }>`
48
+ - `summary: { totals: { items: number, passed: number, failed: number }, byType: { change?: { items: number, passed: number, failed: number }, spec?: { items: number, passed: number, failed: number } } }`
49
+ - `version: "1.0"`
50
+ - [x] 5.2 Ensure process exit code is 1 if any `items[].valid === false`
51
+ - [x] 5.3 Tests for JSON shape (keys, types, counts) and exit code behavior
52
+ - Added `test/commands/validate.test.ts`
53
+
54
+ ## 6. Progress and UX
55
+ - [x] 6.1 Use `ora` or minimal console progress to show current item and running counts
56
+ - [x] 6.2 Keep output stable in `--json` mode (no extra logs to stdout; use stderr for progress if needed)
57
+ - [x] 6.3 Ensure responsiveness with concurrency limits
58
+
59
+ ## 7. Tests
60
+ - [x] 7.1 Add top-level validate tests: `test/commands/validate.test.ts`
61
+ - Includes non-interactive hint, --all JSON, --specs with concurrency, ambiguity error
62
+ - [ ] 7.2 Add unit tests for `isInteractive` and item discovery helpers
63
+ - [x] 7.3 Extend existing change/spec command tests to cover interactive `validate`
64
+ - Added `test/commands/change.interactive-validate.test.ts`, `test/commands/spec.interactive-validate.test.ts`
65
+
66
+ ## 8. CLI Help and Docs
67
+ - [x] 8.1 Update command descriptions/options in `src/cli/index.ts`
68
+ - [x] 8.2 Verify help output includes `validate` command and flags
69
+ - [x] 8.3 Ensure existing specs under `openspec/changes/bulk-validation-interactive-selection/specs/*` remain satisfied
70
+
71
+ ## 9. Non-functional
72
+ - [x] 9.1 Code style and types: explicit types for exported APIs; avoid `any`
73
+ - [x] 9.2 No linter errors; stable formatting; avoid unrelated refactors
74
+ - [x] 9.3 Maintain existing behavior for unaffected commands
75
+
76
+ ## 10. Acceptance Criteria Mapping
77
+ - [x] AC-1: `openspec change validate` interactive selection when no arg (TTY only; respects `--no-interactive`/env) — matches cli-change spec
78
+ - [x] AC-2: `openspec spec validate` interactive selection when no arg (TTY only; respects `--no-interactive`/env) — matches cli-spec spec
79
+ - [x] AC-3: New `openspec validate` supports interactive selection, bulk/filtered validation, JSON schema, progress, concurrency, exit codes — matches cli-validate spec
80
+
81
+
@@ -0,0 +1,40 @@
1
+ # Fix Update Command Tool Selection
2
+
3
+ ## Problem
4
+
5
+ The `openspec update` command currently forces the creation/update of CLAUDE.md regardless of which AI tool was selected during initialization. This violates the tool-agnostic design principle and creates confusion for users who selected different AI assistants.
6
+
7
+ Additionally, different team members may use different AI tools, so we cannot rely on a shared configuration file.
8
+
9
+ ## Solution
10
+
11
+ Modify the update command to:
12
+ 1. Only update AI tool configuration files that already exist
13
+ 2. Never create new AI tool configuration files
14
+ 3. Always update the core OpenSpec files (README.md, etc.)
15
+
16
+ ## Implementation
17
+
18
+ - Remove hardcoded CLAUDE.md update from update command
19
+ - Implement file existence check before updating any AI tool config
20
+ - Update each existing AI tool config file with its appropriate markers
21
+ - No configuration file needed (avoids team conflicts)
22
+
23
+ ## Success Criteria
24
+
25
+ - Update command only modifies existing AI tool configuration files
26
+ - No new AI tool files created during update
27
+ - Team members can use different AI tools without conflicts
28
+ - Existing projects continue to work (backward compatibility)
29
+
30
+ ## Why
31
+
32
+ Users need predictable, tool-agnostic behavior from `openspec update`. Creating or forcing updates for AI tool files that a project does not use causes confusion and merge conflicts. Restricting updates to existing files and always updating core OpenSpec files keeps the workflow consistent for mixed-tool teams.
33
+
34
+ ## What Changes
35
+
36
+ - **cli-update:** Modify update behavior to update only existing AI tool configuration files and never create new ones; always update core OpenSpec files and display an ASCII-safe success message.
37
+
38
+ ## ADDED Requirements
39
+
40
+ Removed from proposal to follow conventions. See `specs/cli-update/spec.md` for the delta requirements content.
@@ -0,0 +1,23 @@
1
+ ## ADDED Requirements
2
+
3
+ ### Requirement: Tool-Agnostic Updates
4
+
5
+ The update command SHALL update only existing AI tool configuration files and SHALL NOT create new ones.
6
+
7
+ #### Scenario: Updating existing tool files
8
+
9
+ - **WHEN** a user runs `openspec update`
10
+ - **THEN** update each AI tool configuration file that exists (e.g., CLAUDE.md, COPILOT.md)
11
+ - **AND** do not create missing tool configuration files
12
+ - **AND** preserve user content outside OpenSpec markers
13
+
14
+ ### Requirement: Core Files Always Updated
15
+
16
+ The update command SHALL always update the core OpenSpec files and display an ASCII-safe success message.
17
+
18
+ #### Scenario: Successful update
19
+
20
+ - **WHEN** the update completes successfully
21
+ - **THEN** replace `openspec/README.md` with the latest template
22
+ - **AND** update existing AI tool configuration files within markers
23
+ - **AND** display the message: "Updated OpenSpec instructions"
@@ -0,0 +1,21 @@
1
+ # Implementation Tasks
2
+
3
+ ## 1. Update Update Command
4
+ - [x] Remove hardcoded CLAUDE.md update from `src/core/update.ts`
5
+ - [x] Add logic to check for existing AI tool configuration files
6
+ - [x] Update only existing files using their appropriate configurators
7
+ - [x] Iterate through all registered configurators to check for existing files
8
+
9
+ ## 2. Update Configurator Registry
10
+ - [x] Add method to get all configurators for update command
11
+ - [x] Ensure each configurator can check if its file exists
12
+
13
+ ## 3. Add Tests
14
+ - [x] Test update command with only CLAUDE.md present
15
+ - [x] Test update command with no AI tool files present
16
+ - [x] Test update command with multiple AI tool files present
17
+ - [x] Test that update never creates new AI tool files
18
+
19
+ ## 4. Update Documentation
20
+ - [x] Update README to clarify team-friendly behavior
21
+ - [x] Document that update only modifies existing files
@@ -0,0 +1,25 @@
1
+ # improve-validate-error-messages
2
+
3
+ ## Why
4
+
5
+ Developers struggle to resolve validation failures because current errors lack actionable guidance. Common issues include: missing deltas, missing required sections, and misformatted scenarios that are silently ignored. Without clear remediation steps, users cannot quickly correct structure or formatting, leading to frustration and rework. Improving error messages with concrete fixes, file/section hints, and suggested commands will significantly reduce time-to-green and make OpenSpec more approachable.
6
+
7
+ ## What Changes
8
+
9
+ - Validation errors SHALL include specific remediation steps (what to change and where).
10
+ - "No deltas found" error SHALL guide users to create `specs/` with proper delta headers and suggest debug commands.
11
+ - Missing required sections (Spec: Purpose/Requirements; Change: Why/What Changes) SHALL include expected header names and a minimal skeleton example.
12
+ - Likely misformatted scenarios (bulleted WHEN/THEN/AND) SHALL emit a targeted warning explaining the `#### Scenario:` format and show a conversion template.
13
+ - All reported issues SHALL include the source file path and structured location (e.g., `deltas[0].requirements[0]`).
14
+ - Non-JSON output SHOULD end with a short "Next steps" footer when invalid.
15
+
16
+ ## Impact
17
+
18
+ - Affected CLI: validate
19
+ - Affected code:
20
+ - `src/commands/validate.ts`
21
+ - `src/core/validation/validator.ts`
22
+ - `src/core/validation/constants.ts`
23
+ - `src/core/parsers/*` (wrapping thrown errors with richer context)
24
+
25
+
@@ -0,0 +1,55 @@
1
+ # Validate Command
2
+
3
+ ## ADDED Requirements
4
+
5
+ ### Requirement: Validation SHALL provide actionable remediation steps
6
+ Validation output SHALL include specific guidance to fix each error, including expected structure, example headers, and suggested commands to verify fixes.
7
+
8
+ #### Scenario: No deltas found in change
9
+ - **WHEN** validating a change with zero parsed deltas
10
+ - **THEN** show error "No deltas found" with guidance:
11
+ - Ensure `openspec/changes/{id}/specs/` exists with `.md` files
12
+ - Use delta headers: `## ADDED Requirements`, `## MODIFIED Requirements`, `## REMOVED Requirements`, `## RENAMED Requirements`
13
+ - Each requirement must include at least one `#### Scenario:` block
14
+ - Try: `openspec change show {id} --json --deltas-only` to inspect what was parsed
15
+
16
+ #### Scenario: Missing required sections
17
+ - **WHEN** a required section is missing
18
+ - **THEN** the validator SHALL include expected header names and a minimal skeleton:
19
+ - For Spec: `## Purpose`, `## Requirements`
20
+ - For Change: `## Why`, `## What Changes`
21
+ - Show an example snippet of the missing section
22
+
23
+ ### Requirement: Validator SHALL detect likely misformatted scenarios and warn with a fix
24
+ The validator SHALL recognize bulleted lines that look like scenarios (e.g., lines beginning with WHEN/THEN/AND) and emit a targeted warning with a conversion example to `#### Scenario:`.
25
+
26
+ #### Scenario: Bulleted WHEN/THEN under a Requirement
27
+ - **WHEN** bullets that start with WHEN/THEN/AND are found under a requirement without any `#### Scenario:` headers
28
+ - **THEN** emit warning: "Scenarios must use '#### Scenario:' headers", and show a conversion template:
29
+ ```
30
+ #### Scenario: Short name
31
+ - **WHEN** ...
32
+ - **THEN** ...
33
+ - **AND** ...
34
+ ```
35
+
36
+ ### Requirement: All issues SHALL include file paths and structured locations
37
+ Error, warning, and info messages SHALL include:
38
+ - Source file path (`openspec/changes/{id}/proposal.md`, `.../specs/{cap}/spec.md`)
39
+ - Structured path (e.g., `deltas[0].requirements[0].scenarios`)
40
+
41
+ #### Scenario: Zod validation error
42
+ - **WHEN** a schema validation fails
43
+ - **THEN** the message SHALL include `file`, `path`, and a remediation hint if applicable
44
+
45
+ ### Requirement: Invalid results SHALL include a Next steps footer in human-readable output
46
+ The CLI SHALL append a Next steps footer when the item is invalid and not using `--json`, including:
47
+ - Summary line with counts
48
+ - Top-3 guidance bullets (contextual to the most frequent or blocking errors)
49
+ - A suggestion to re-run with `--json` and/or the debug command
50
+
51
+ #### Scenario: Change invalid summary
52
+ - **WHEN** a change validation fails
53
+ - **THEN** print "Next steps" with 2-3 targeted bullets and suggest `openspec change show <id> --json --deltas-only`
54
+
55
+
@@ -0,0 +1,21 @@
1
+ ## 1. Enhance validation messages
2
+ - [x] 1.1 Add remediation guidance for "No deltas found"
3
+ - [x] 1.2 Include file path and structured path in all issues
4
+ - [x] 1.3 Improve messages for missing required sections (Spec, Change)
5
+ - [x] 1.4 Detect likely misformatted scenarios and warn with conversion example
6
+ - [x] 1.5 Add "Next steps" footer for non-JSON invalid output
7
+
8
+ ## 2. Update constants and helpers
9
+ - [x] 2.1 Centralize guidance snippets in `VALIDATION_MESSAGES`
10
+ - [x] 2.2 Provide minimal skeleton examples for missing sections
11
+
12
+ ## 3. Parser integration
13
+ - [x] 3.1 Capture parser-thrown errors and wrap with richer context
14
+ - [x] 3.2 Add file/section references to surfaced parser errors
15
+
16
+ ## 4. Tests
17
+ - [x] 4.1 Unit tests for validator message composition
18
+ - [x] 4.2 CLI integration tests for human-readable output (with footer)
19
+ - [x] 4.3 JSON mode tests (structure unchanged, content enriched)
20
+
21
+
@@ -0,0 +1,36 @@
1
+ ## Why
2
+
3
+ OpenSpec specifications lack a consistent structure that makes sections visually identifiable and programmatically parseable across different specs. This makes it harder to maintain consistency and build tooling.
4
+
5
+ ## What Changes
6
+
7
+ **Specification Format Section**
8
+ - From: No formal structure requirements for specifications
9
+ - To: Structured format with `### Requirement:` and `#### Scenario:` headers
10
+ - Reason: Visual consistency and parseability across all specs
11
+ - Impact: Non-breaking - existing specs can migrate gradually
12
+
13
+ **Keyword Formatting**
14
+ - From: Inconsistent use of WHEN/THEN/AND keywords
15
+ - To: Bold keywords (**WHEN**, **THEN**, **AND**) in scenario bullets
16
+ - Reason: Improved readability and consistent visual hierarchy
17
+ - Impact: Non-breaking - formatting enhancement only
18
+
19
+ **Format Flexibility**
20
+ - From: Implicit understanding that different content needs different formats
21
+ - To: Explicit allowance for alternative formats (OpenAPI, JSON Schema, etc.)
22
+ - Reason: Address concern that not all specs fit requirement/scenario pattern
23
+ - Impact: Non-breaking - clarifies existing practice
24
+
25
+ **Migration Guidelines**
26
+ - From: No migration guidance
27
+ - To: Documented gradual migration approach
28
+ - Reason: Allows incremental adoption without disrupting existing specs
29
+ - Impact: Non-breaking - opt-in migration as specs are modified
30
+
31
+ ## Impact
32
+
33
+ - Affected specs: openspec-conventions (enhancement to existing capability)
34
+ - Affected code: None initially - this is a documentation standard enhancement
35
+ - Migration: Gradual - existing specs migrate as they're modified
36
+ - Tooling: Enables future parsing tools but doesn't require them
@@ -0,0 +1,192 @@
1
+ # OpenSpec Conventions Specification
2
+
3
+ ## ADDED Requirements
4
+
5
+ ### Requirement: Structured Format Adoption
6
+
7
+ Behavioral specifications SHALL adopt the structured format with `### Requirement:` and `#### Scenario:` headers as the default.
8
+
9
+ #### Scenario: Use structured headings for behavior
10
+
11
+ - **WHEN** documenting behavioral requirements
12
+ - **THEN** use `### Requirement:` for requirements
13
+ - **AND** use `#### Scenario:` for scenarios with bold WHEN/THEN/AND keywords
14
+
15
+ ## Purpose
16
+
17
+ OpenSpec conventions SHALL define how system capabilities are documented, how changes are proposed and tracked, and how specifications evolve over time. This meta-specification serves as the source of truth for OpenSpec's own conventions.
18
+
19
+ ## Core Principles
20
+
21
+ The system SHALL follow these principles:
22
+ - Specs reflect what IS currently built and deployed
23
+ - Changes contain proposals for what SHOULD be changed
24
+ - AI drives the documentation process
25
+ - Specs are living documentation kept in sync with deployed code
26
+
27
+ ## Directory Structure
28
+
29
+ WHEN an OpenSpec project is initialized
30
+ THEN it SHALL have this structure:
31
+ ```
32
+ openspec/
33
+ ├── project.md # Project-specific context
34
+ ├── README.md # AI assistant instructions
35
+ ├── specs/ # Current deployed capabilities
36
+ │ └── [capability]/ # Single, focused capability
37
+ │ ├── spec.md # WHAT and WHY
38
+ │ └── design.md # HOW (optional, for established patterns)
39
+ └── changes/ # Proposed changes
40
+ ├── [change-name]/ # Descriptive change identifier
41
+ │ ├── proposal.md # Why, what, and impact
42
+ │ ├── tasks.md # Implementation checklist
43
+ │ ├── design.md # Technical decisions (optional)
44
+ │ └── specs/ # Complete future state
45
+ │ └── [capability]/
46
+ │ └── spec.md # Clean markdown (no diff syntax)
47
+ └── archive/ # Completed changes
48
+ └── YYYY-MM-DD-[name]/
49
+ ```
50
+
51
+ ## Specification Format
52
+
53
+ ### Requirement: Structured Format for Behavioral Specs
54
+
55
+ Behavioral specifications SHALL use a structured format with consistent section headers and keywords to ensure visual consistency and parseability.
56
+
57
+ #### Scenario: Writing requirement sections
58
+
59
+ - **WHEN** documenting a requirement in a behavioral specification
60
+ - **THEN** use a level-3 heading with format `### Requirement: [Name]`
61
+ - **AND** immediately follow with a SHALL statement describing core behavior
62
+ - **AND** keep requirement names descriptive and under 50 characters
63
+
64
+ #### Scenario: Documenting scenarios
65
+
66
+ - **WHEN** documenting specific behaviors or use cases
67
+ - **THEN** use level-4 headings with format `#### Scenario: [Description]`
68
+ - **AND** use bullet points with bold keywords for steps:
69
+ - **GIVEN** for initial state (optional)
70
+ - **WHEN** for conditions or triggers
71
+ - **THEN** for expected outcomes
72
+ - **AND** for additional outcomes or conditions
73
+
74
+ #### Scenario: Adding implementation details
75
+
76
+ - **WHEN** a step requires additional detail
77
+ - **THEN** use sub-bullets under the main step
78
+ - **AND** maintain consistent indentation
79
+ - Sub-bullets provide examples or specifics
80
+ - Keep sub-bullets concise
81
+
82
+ ### Requirement: Format Flexibility
83
+
84
+ The structured format SHALL be the default for behavioral specifications, but alternative formats MAY be used when more appropriate for the content type.
85
+
86
+ #### Scenario: Documenting API specifications
87
+
88
+ - **WHEN** documenting REST API endpoints or GraphQL schemas
89
+ - **THEN** OpenAPI, GraphQL SDL, or similar formats MAY be used
90
+ - **AND** the spec SHALL clearly indicate the format being used
91
+ - **AND** behavioral aspects SHALL still follow the structured format
92
+
93
+ #### Scenario: Documenting data schemas
94
+
95
+ - **WHEN** documenting data structures, database schemas, or configurations
96
+ - **THEN** JSON Schema, SQL DDL, or similar formats MAY be used
97
+ - **AND** include the structured format for behavioral rules and constraints
98
+
99
+ #### Scenario: Using simplified format
100
+
101
+ - **WHEN** documenting simple capabilities without complex scenarios
102
+ - **THEN** a simplified WHEN/THEN format without full structure MAY be used
103
+ - **AND** this should be consistent within the capability
104
+
105
+ ## Change Storage Convention
106
+
107
+ ### Future State Storage
108
+
109
+ WHEN creating a change proposal
110
+ THEN store the complete future state of affected specs
111
+ AND use clean markdown without diff syntax
112
+
113
+ The `changes/[name]/specs/` directory SHALL contain:
114
+ - Complete spec files as they will exist after the change
115
+ - Clean markdown without `+` or `-` prefixes
116
+ - All formatting and structure of the final intended state
117
+
118
+ ### Proposal Format
119
+
120
+ WHEN documenting what changes
121
+ THEN the proposal SHALL explicitly describe each change:
122
+
123
+ ```markdown
124
+ **[Section or Behavior Name]**
125
+ - From: [current state/requirement]
126
+ - To: [future state/requirement]
127
+ - Reason: [why this change is needed]
128
+ - Impact: [breaking/non-breaking, who's affected]
129
+ ```
130
+
131
+ This explicit format compensates for not having inline diffs and ensures reviewers understand exactly what will change.
132
+
133
+ ## Change Lifecycle
134
+
135
+ The change process SHALL follow these states:
136
+
137
+ 1. **Propose**: AI creates change with future state specs and explicit proposal
138
+ 2. **Review**: Humans review proposal and future state
139
+ 3. **Approve**: Change is approved for implementation
140
+ 4. **Implement**: Follow tasks.md checklist (can span multiple PRs)
141
+ 5. **Deploy**: Changes are deployed to production
142
+ 6. **Update**: Specs in `specs/` are updated to match deployed reality
143
+ 7. **Archive**: Change is moved to `archive/YYYY-MM-DD-[name]/`
144
+
145
+ ## Viewing Changes
146
+
147
+ WHEN reviewing proposed changes
148
+ THEN reviewers can compare using:
149
+ - GitHub PR diff view when changes are committed
150
+ - Command line: `diff -u specs/[capability]/spec.md changes/[name]/specs/[capability]/spec.md`
151
+ - Any visual diff tool comparing current vs future state
152
+
153
+ The system relies on tools to generate diffs rather than storing them.
154
+
155
+ ## Capability Naming
156
+
157
+ Capabilities SHALL use:
158
+ - Verb-noun patterns (e.g., `user-auth`, `payment-capture`)
159
+ - Hyphenated lowercase names
160
+ - Singular focus (one responsibility per capability)
161
+ - No nesting (flat structure under `specs/`)
162
+
163
+ ## When Changes Require Proposals
164
+
165
+ A proposal SHALL be created for:
166
+ - New features or capabilities
167
+ - Breaking changes to existing behavior
168
+ - Architecture or pattern changes
169
+ - Performance optimizations that change behavior
170
+ - Security updates affecting access patterns
171
+
172
+ A proposal is NOT required for:
173
+ - Bug fixes restoring intended behavior
174
+ - Typos or formatting fixes
175
+ - Non-breaking dependency updates
176
+ - Adding tests for existing behavior
177
+ - Documentation clarifications
178
+
179
+ ## Why This Approach
180
+
181
+ Clean future state storage provides:
182
+ - **Readability**: No diff syntax pollution
183
+ - **AI-compatibility**: Standard markdown that AI tools understand
184
+ - **Simplicity**: No special parsing or processing needed
185
+ - **Tool-agnostic**: Any diff tool can show changes
186
+ - **Clear intent**: Explicit proposals document reasoning
187
+
188
+ The structured format adds:
189
+ - **Visual Consistency**: Requirement and Scenario prefixes make sections instantly recognizable
190
+ - **Parseability**: Consistent structure enables tooling and automation
191
+ - **Flexibility**: Alternative formats supported where appropriate
192
+ - **Gradual Adoption**: Existing specs can migrate incrementally
@@ -0,0 +1,19 @@
1
+ ## 1. Update OpenSpec Conventions Spec
2
+
3
+ - [x] 1.1 Add "Specification Format" section to openspec-conventions
4
+ - [x] 1.2 Document structured format with Requirement/Scenario headers
5
+ - [x] 1.3 Define bold keyword usage (WHEN/THEN/AND) for scenarios
6
+ - [x] 1.4 Include examples demonstrating the format within the spec itself
7
+
8
+ ## 2. Update Documentation
9
+
10
+ - [x] 2.1 Update the "Why This Approach" section with structured format benefits
11
+ - [x] 2.2 Ensure spec follows its own format as a demonstration
12
+
13
+ ## 3. Update Existing Specs
14
+
15
+ - [x] 3.1 Update cli-init spec to use structured format in Behavior section
16
+ - [x] 3.2 Update cli-list spec to use structured format in Behavior section
17
+ - [x] 3.3 Update cli-update spec to use structured format in Behavior section
18
+ - [x] 3.4 Update cli-diff spec to use structured format in Behavior section
19
+ - [x] 3.5 Update cli-archive spec to use structured format in Behavior section