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,38 @@
1
+ # Change: Add View Dashboard Command
2
+
3
+ ## Why
4
+
5
+ Users need a quick, at-a-glance overview of their OpenSpec project status without running multiple commands. Currently, users must run `openspec list --changes` and `openspec list --specs` separately to understand the project state. A unified dashboard view would improve developer experience and provide immediate insight into project progress.
6
+
7
+ ## What Changes
8
+
9
+ ### Added `openspec view` Command
10
+
11
+ The new command provides an interactive dashboard displaying:
12
+ - Summary metrics (total specs, requirements, changes, task progress)
13
+ - Active changes with visual progress bars
14
+ - Completed changes
15
+ - Specifications with requirement counts
16
+
17
+ ### Specifications Affected
18
+
19
+ - **cli-view** (NEW): Complete specification for the view dashboard command
20
+
21
+ ## Implementation Details
22
+
23
+ ### File Structure
24
+ - Created `/src/core/view.ts` implementing the `ViewCommand` class
25
+ - Registered command in `/src/cli/index.ts`
26
+ - Reuses existing utilities from `task-progress.ts` and `MarkdownParser`
27
+
28
+ ### Visual Design
29
+ - Uses Unicode box drawing characters for borders
30
+ - Color coding: cyan for specs, yellow for active, green for completed
31
+ - Progress bars using filled (█) and empty (░) blocks
32
+ - Clean alignment with proper padding
33
+
34
+ ### Technical Approach
35
+ - Async data fetching from changes and specs directories
36
+ - Parallel processing of specs and changes
37
+ - Error handling for missing or invalid data
38
+ - Maintains consistency with existing list command output
@@ -0,0 +1,109 @@
1
+ # CLI View Command - Changes
2
+
3
+ ## ADDED Requirements
4
+
5
+ ### Requirement: Dashboard Display
6
+
7
+ The system SHALL provide a `view` command that displays a dashboard overview of specs and changes.
8
+
9
+ #### Scenario: Basic dashboard display
10
+
11
+ - **WHEN** user runs `openspec view`
12
+ - **THEN** system displays a formatted dashboard with sections for summary, active changes, completed changes, and specifications
13
+
14
+ #### Scenario: No OpenSpec directory
15
+
16
+ - **WHEN** user runs `openspec view` in a directory without OpenSpec
17
+ - **THEN** system displays error message "✗ No openspec directory found"
18
+
19
+ ### Requirement: Summary Section
20
+
21
+ The dashboard SHALL display a summary section with key project metrics.
22
+
23
+ #### Scenario: Complete summary display
24
+
25
+ - **WHEN** dashboard is rendered with specs and changes
26
+ - **THEN** system shows total number of specifications and requirements
27
+ - **AND** shows number of active changes in progress
28
+ - **AND** shows number of completed changes
29
+ - **AND** shows overall task progress percentage
30
+
31
+ #### Scenario: Empty project summary
32
+
33
+ - **WHEN** no specs or changes exist
34
+ - **THEN** summary shows zero counts for all metrics
35
+
36
+ ### Requirement: Active Changes Display
37
+
38
+ The dashboard SHALL show active changes with visual progress indicators.
39
+
40
+ #### Scenario: Active changes with progress bars
41
+
42
+ - **WHEN** there are in-progress changes with tasks
43
+ - **THEN** system displays each change with change name left-aligned
44
+ - **AND** visual progress bar using Unicode characters
45
+ - **AND** percentage completion on the right
46
+
47
+ #### Scenario: No active changes
48
+
49
+ - **WHEN** all changes are completed or no changes exist
50
+ - **THEN** active changes section is omitted from display
51
+
52
+ ### Requirement: Completed Changes Display
53
+
54
+ The dashboard SHALL list completed changes in a separate section.
55
+
56
+ #### Scenario: Completed changes listing
57
+
58
+ - **WHEN** there are completed changes (all tasks done)
59
+ - **THEN** system shows them with checkmark indicators in a dedicated section
60
+
61
+ #### Scenario: Mixed completion states
62
+
63
+ - **WHEN** some changes are complete and others active
64
+ - **THEN** system separates them into appropriate sections
65
+
66
+ ### Requirement: Specifications Display
67
+
68
+ The dashboard SHALL display specifications sorted by requirement count.
69
+
70
+ #### Scenario: Specs listing with counts
71
+
72
+ - **WHEN** specifications exist in the project
73
+ - **THEN** system shows specs sorted by requirement count (descending) with count labels
74
+
75
+ #### Scenario: Specs with parsing errors
76
+
77
+ - **WHEN** a spec file cannot be parsed
78
+ - **THEN** system includes it with 0 requirement count
79
+
80
+ ### Requirement: Visual Formatting
81
+
82
+ The dashboard SHALL use consistent visual formatting with colors and symbols.
83
+
84
+ #### Scenario: Color coding
85
+
86
+ - **WHEN** dashboard elements are displayed
87
+ - **THEN** system uses cyan for specification items
88
+ - **AND** yellow for active changes
89
+ - **AND** green for completed items
90
+ - **AND** dim gray for supplementary text
91
+
92
+ #### Scenario: Progress bar rendering
93
+
94
+ - **WHEN** displaying progress bars
95
+ - **THEN** system uses filled blocks (█) for completed portions and light blocks (░) for remaining
96
+
97
+ ### Requirement: Error Handling
98
+
99
+ The view command SHALL handle errors gracefully.
100
+
101
+ #### Scenario: File system errors
102
+
103
+ - **WHEN** file system operations fail
104
+ - **THEN** system continues with available data and omits inaccessible items
105
+
106
+ #### Scenario: Invalid data structures
107
+
108
+ - **WHEN** specs or changes have invalid format
109
+ - **THEN** system skips invalid items and continues rendering
@@ -0,0 +1,47 @@
1
+ # Implementation Tasks
2
+
3
+ ## Design Phase
4
+ - [x] Research existing list command implementation
5
+ - [x] Design dashboard layout and information architecture
6
+ - [x] Choose appropriate command verb (`view`)
7
+ - [x] Define visual elements (progress bars, colors, layout)
8
+
9
+ ## Core Implementation
10
+ - [x] Create ViewCommand class in `/src/core/view.ts`
11
+ - [x] Implement getChangesData method for fetching change information
12
+ - [x] Implement getSpecsData method for fetching spec information
13
+ - [x] Implement displaySummary method for summary metrics
14
+ - [x] Add progress bar visualization with Unicode characters
15
+ - [x] Implement color coding using chalk
16
+
17
+ ## Integration
18
+ - [x] Import ViewCommand in CLI index
19
+ - [x] Register `openspec view` command with commander
20
+ - [x] Add proper error handling and ora spinner integration
21
+ - [x] Ensure command appears in help documentation
22
+
23
+ ## Data Processing
24
+ - [x] Reuse TaskProgress utilities for change progress
25
+ - [x] Integrate MarkdownParser for spec requirement counting
26
+ - [x] Handle async operations for file system access
27
+ - [x] Sort specifications by requirement count
28
+
29
+ ## Testing and Validation
30
+ - [x] Build project successfully with new command
31
+ - [x] Test command with sample data
32
+ - [x] Verify correct requirement counts match list --specs
33
+ - [x] Test progress bar display for various completion states
34
+ - [x] Run existing test suite to ensure no regressions
35
+ - [x] Verify TypeScript compilation with no errors
36
+
37
+ ## Documentation
38
+ - [x] Add command description in CLI help
39
+ - [x] Create change proposal documentation
40
+ - [x] Update README with view command example (if needed)
41
+ - [x] Add view command to user documentation (if exists)
42
+
43
+ ## Polish
44
+ - [x] Ensure consistent formatting and alignment
45
+ - [x] Add helpful footer text referencing list commands
46
+ - [x] Optimize for terminal width considerations
47
+ - [x] Review and refine color choices for accessibility
@@ -0,0 +1,28 @@
1
+ # Add AGENTS.md Standard Support To Init/Update
2
+
3
+ ## Summary
4
+ - Teach `openspec init` to manage a root-level `AGENTS.md` file using the same marker system as `CLAUDE.md`.
5
+ - Allow `openspec update` to refresh or scaffold that root `AGENTS.md` so AGENTS-compatible tools always receive current instructions.
6
+ - Keep the existing `openspec/AGENTS.md` template as the canonical source while ensuring assistants that read `AGENTS.md` opt-in instructions get the latest guidance automatically.
7
+
8
+ ## Motivation
9
+ The README now points teams to AGENTS.md-compatible assistants, but the CLI only manages `CLAUDE.md`. Projects must hand-roll a root `AGENTS.md` file to benefit from the standard, and updates will drift unless maintainers remember to copy content manually. Extending `init` and `update` closes that gap so OpenSpec actually delivers on the promise of first-class AGENTS support.
10
+
11
+ ## Proposal
12
+ 1. Extend the `openspec init` selection flow with an "AGENTS.md standard" option that creates or refreshes a root `AGENTS.md` file wrapped in OpenSpec markers, mirroring the existing CLAUDE integration.
13
+ 2. When generating the file, pull the managed content from the same template used in `openspec/AGENTS.md`, ensuring both locations stay in sync.
14
+ 3. Update `openspec update` so it always refreshes the root `AGENTS.md` (creating it if missing) alongside `openspec/AGENTS.md` and any other configured assistants.
15
+ 4. Document the new behavior in CLI specs and verify marker handling (no duplicates, preserve user content outside the block) with tests for both commands.
16
+
17
+ ## Out of Scope
18
+ - Adding additional AGENTS-specific prompts or workflows beyond the shared instructions block.
19
+ - Non-interactive flags or bulk configuration for multiple standards in one run.
20
+ - Broader restructuring of how templates are stored or loaded.
21
+
22
+ ## Risks & Mitigations
23
+ - **Risk:** Accidentally overwriting user-edited content surrounding the managed block.
24
+ - **Mitigation:** Reuse the existing marker-update helper shared with `CLAUDE.md`, and add tests that cover files containing custom text before and after the block.
25
+ - **Risk:** Divergence between `openspec/AGENTS.md` and the root file.
26
+ - **Mitigation:** Source the root file content from the canonical template rather than duplicating strings inline.
27
+ - **Risk:** Confusion about when the file is created.
28
+ - **Mitigation:** Log creation vs update, and ensure help text references the AGENTS option during `init`.
@@ -0,0 +1,71 @@
1
+ ## MODIFIED Requirements
2
+ ### Requirement: AI Tool Configuration
3
+ The command SHALL configure AI coding assistants with OpenSpec instructions based on user selection.
4
+
5
+ #### Scenario: Prompting for AI tool selection
6
+
7
+ - **WHEN** run
8
+ - **THEN** prompt user to select AI tools to configure:
9
+ - Claude Code (✅ OpenSpec custom slash commands available)
10
+ - Cursor (✅ OpenSpec custom slash commands available)
11
+ - AGENTS.md (works with Codex, Amp, Copilot, …)
12
+
13
+ ### Requirement: AI Tool Configuration Details
14
+ The command SHALL properly configure selected AI tools with OpenSpec-specific instructions using a marker system.
15
+
16
+ #### Scenario: Configuring Claude Code
17
+
18
+ - **WHEN** Claude Code is selected
19
+ - **THEN** create or update `CLAUDE.md` in the project root directory (not inside openspec/)
20
+
21
+ #### Scenario: Configuring AGENTS standard
22
+
23
+ - **WHEN** the AGENTS.md standard is selected
24
+ - **THEN** create or update `AGENTS.md` in the project root directory (not inside openspec/)
25
+
26
+ #### Scenario: Creating new CLAUDE.md
27
+
28
+ - **WHEN** CLAUDE.md does not exist
29
+ - **THEN** create new file with OpenSpec content wrapped in markers:
30
+ ```markdown
31
+ <!-- OPENSPEC:START -->
32
+ # OpenSpec Project
33
+
34
+ This document provides instructions for AI coding assistants on how to use OpenSpec conventions for spec-driven development. Follow these rules precisely when working on OpenSpec-enabled projects.
35
+
36
+ This project uses OpenSpec for spec-driven development. Specifications are the source of truth.
37
+
38
+ See @openspec/AGENTS.md for detailed conventions and guidelines.
39
+ <!-- OPENSPEC:END -->
40
+ ```
41
+
42
+ #### Scenario: Creating new AGENTS.md
43
+
44
+ - **WHEN** AGENTS.md does not exist in the project root
45
+ - **THEN** create new file with OpenSpec content wrapped in markers using the same template as CLAUDE.md
46
+
47
+ #### Scenario: Updating existing CLAUDE.md
48
+
49
+ - **WHEN** CLAUDE.md already exists
50
+ - **THEN** preserve all existing content
51
+ - **AND** insert OpenSpec content at the beginning of the file using markers
52
+ - **AND** ensure markers don't duplicate if they already exist
53
+
54
+ #### Scenario: Updating existing AGENTS.md
55
+
56
+ - **WHEN** AGENTS.md already exists in the project root
57
+ - **THEN** preserve all existing content
58
+ - **AND** ensure the OpenSpec-managed block at the beginning of the file is refreshed without duplicating markers
59
+
60
+ #### Scenario: Managing content with markers
61
+
62
+ - **WHEN** using the marker system
63
+ - **THEN** use `<!-- OPENSPEC:START -->` to mark the beginning of managed content
64
+ - **AND** use `<!-- OPENSPEC:END -->` to mark the end of managed content
65
+ - **AND** allow OpenSpec to update its content without affecting user customizations
66
+ - **AND** preserve all content outside the markers intact
67
+
68
+ WHY use markers:
69
+ - Users may have existing CLAUDE.md or AGENTS.md instructions they want to keep
70
+ - OpenSpec can update its instructions in future versions
71
+ - Clear boundary between OpenSpec-managed and user-managed content
@@ -0,0 +1,41 @@
1
+ ## MODIFIED Requirements
2
+ ### Requirement: Update Behavior
3
+ The update command SHALL update OpenSpec instruction files to the latest templates in a team-friendly manner.
4
+
5
+ #### Scenario: Running update command
6
+
7
+ - **WHEN** a user runs `openspec update`
8
+ - **THEN** the command SHALL:
9
+ - Check if the `openspec` directory exists
10
+ - Replace `openspec/AGENTS.md` with the latest template (complete replacement)
11
+ - Create or refresh a root-level `AGENTS.md` file using the managed marker block (create if missing)
12
+ - Update **only existing** AI tool configuration files (e.g., CLAUDE.md)
13
+ - Check each registered AI tool configurator
14
+ - For each configurator, check if its file exists
15
+ - Update only files that already exist using their markers
16
+ - Preserve user content outside markers
17
+ - Display success message listing updated files
18
+
19
+ ### Requirement: Tool-Agnostic Updates
20
+ The update command SHALL handle file updates in a predictable and safe manner while respecting team tool choices.
21
+
22
+ #### Scenario: Updating files
23
+
24
+ - **WHEN** updating files
25
+ - **THEN** completely replace `openspec/AGENTS.md` with the latest template
26
+ - **AND** create or update the root-level `AGENTS.md` using the OpenSpec markers
27
+ - **AND** update only the OpenSpec-managed blocks in **existing** AI tool files using markers
28
+ - **AND** use the default directory name `openspec`
29
+ - **AND** be idempotent (repeated runs have no additional effect)
30
+ - **AND** respect team members' AI tool choices by not creating additional tool files beyond the root `AGENTS.md`
31
+
32
+ ### Requirement: Core Files Always Updated
33
+ The update command SHALL always update the core OpenSpec files and display an ASCII-safe success message.
34
+
35
+ #### Scenario: Successful update
36
+
37
+ - **WHEN** the update completes successfully
38
+ - **THEN** replace `openspec/AGENTS.md` with the latest template
39
+ - **AND** ensure the root-level `AGENTS.md` matches the latest template via the marker block
40
+ - **AND** update existing AI tool configuration files within markers
41
+ - **AND** display the message: "Updated OpenSpec instructions"
@@ -0,0 +1,17 @@
1
+ # Implementation Tasks
2
+
3
+ ## 1. Extend Init Workflow
4
+ - [x] 1.1 Add an "AGENTS.md standard" option to the `openspec init` tool-selection prompt, respecting the existing UI conventions.
5
+ - [x] 1.2 Generate or refresh a root-level `AGENTS.md` file using the OpenSpec markers when that option is selected, sourcing content from the canonical template.
6
+
7
+ ## 2. Enhance Update Command
8
+ - [x] 2.1 Ensure `openspec update` writes the root `AGENTS.md` from the latest template (creating it if missing) alongside `openspec/AGENTS.md`.
9
+ - [x] 2.2 Update success messaging and logging to reflect creation vs refresh of the AGENTS standard file.
10
+
11
+ ## 3. Shared Template Handling
12
+ - [x] 3.1 Refactor template utilities if necessary so both commands reuse the same content without duplication.
13
+ - [x] 3.2 Add automated tests covering init/update flows for projects with and without an existing `AGENTS.md`, ensuring markers behave correctly.
14
+
15
+ ## 4. Documentation
16
+ - [x] 4.1 Update CLI specs and user-facing docs to describe AGENTS standard support.
17
+ - [x] 4.2 Run `openspec validate add-agents-md-config --strict` and document any notable behavior changes.
@@ -0,0 +1,35 @@
1
+ # Allow Additional AI Tool Initialization After Setup
2
+
3
+ ## Summary
4
+ - Let `openspec init` configure new AI coding tools for projects that already contain an OpenSpec structure.
5
+ - Keep the initialization flow safe by skipping structure creation and only generating files for tools the user explicitly selects.
6
+ - Provide clear feedback so users know which tool files were added versus already present.
7
+
8
+ ## Motivation
9
+ Today `openspec init` exits with an error once an `openspec/` directory exists. That protects the directory layout, but it blocks
10
+ teams that start with one assistant (for example, Claude Code) and later want to add another such as Cursor. They have to create
11
+ those files by hand or rerun `init` in a clean clone, which undermines the "easy onboarding" promise. Letting the command extend
12
+ an existing installation keeps the workflow consistent and avoids manual file management.
13
+
14
+ ## Proposal
15
+ 1. Detect an existing OpenSpec structure at the start of `openspec init` and branch into an "extend" mode instead of exiting.
16
+ - Announce that the base structure already exists and that the command will only manage AI tool configuration files.
17
+ - Keep the existing guard for directories or files we must not overwrite.
18
+ 2. Present the usual AI tool selection prompt even in extend mode, showing which tools are already configured.
19
+ - Skip disabled options that remain "coming soon".
20
+ - Mark already configured tools as such so users know whether selecting them will refresh or add files.
21
+ 3. When the user selects additional tools, generate the same initialization files that a fresh run would create (e.g., Cursor
22
+ workspace files) while leaving untouched tools intact apart from marker-managed sections.
23
+ - Do nothing when the user selects no new tools and keep the previous error messaging to avoid silently succeeding.
24
+ 4. Summarize the outcome (created, refreshed, skipped) before exiting with code 0 when work was performed.
25
+ - Include friendly guidance that future updates to shared content still come from `openspec update`.
26
+
27
+ ## Out of Scope
28
+ - Changing how `openspec update` discovers or updates AI tool files.
29
+ - Supporting brand-new AI tools beyond those already wired into the CLI.
30
+ - Adding non-interactive flags for selecting multiple tools in one run (follow-up if needed).
31
+
32
+ ## Risks & Mitigations
33
+ - **User confusion about extend mode** → Explicitly log what will happen before prompting and summarise results afterward.
34
+ - **Accidental overwrites** → Continue using marker-based updates and skip files unless the user chooses that tool.
35
+ - **Inconsistent state if init fails mid-run** → Reuse existing rollback/transaction logic so partial writes clean up.
@@ -0,0 +1,45 @@
1
+ ## MODIFIED Requirements
2
+ ### Requirement: Safety Checks
3
+ The command SHALL perform safety checks to prevent overwriting existing structures and ensure proper permissions.
4
+
5
+ #### Scenario: Detecting existing initialization
6
+ - **WHEN** the `openspec/` directory already exists
7
+ - **THEN** inform the user that OpenSpec is already initialized, skip recreating the base structure, and enter an extend mode
8
+ - **AND** continue to the AI tool selection step so additional tools can be configured
9
+ - **AND** display the existing-initialization error message only when the user declines to add any AI tools
10
+
11
+ ### Requirement: Interactive Mode
12
+ The command SHALL provide an interactive menu for AI tool selection with clear navigation instructions.
13
+
14
+ #### Scenario: Displaying interactive menu
15
+ - **WHEN** run in fresh or extend mode
16
+ - **THEN** present a looping select menu that lets users toggle tools with Enter and finish via a "Done" option
17
+ - **AND** label already configured tools with "(already configured)" while keeping disabled options marked "coming soon"
18
+ - **AND** change the prompt copy in extend mode to "Which AI tools would you like to add or refresh?"
19
+ - **AND** display inline instructions clarifying that Enter toggles a tool and selecting "Done" confirms the list
20
+
21
+ ## ADDED Requirements
22
+ ### Requirement: Additional AI Tool Initialization
23
+ `openspec init` SHALL allow users to add configuration files for new AI coding assistants after the initial setup.
24
+
25
+ #### Scenario: Configuring an extra tool after initial setup
26
+ - **GIVEN** an `openspec/` directory already exists and at least one AI tool file is present
27
+ - **WHEN** the user runs `openspec init` and selects a different supported AI tool
28
+ - **THEN** generate that tool's configuration files with OpenSpec markers the same way as during first-time initialization
29
+ - **AND** leave existing tool configuration files unchanged except for managed sections that need refreshing
30
+ - **AND** exit with code 0 and display a success summary highlighting the newly added tool files
31
+
32
+ ### Requirement: Success Output Enhancements
33
+ `openspec init` SHALL summarize tool actions when initialization or extend mode completes.
34
+
35
+ #### Scenario: Showing tool summary
36
+ - **WHEN** the command completes successfully
37
+ - **THEN** display a categorized summary of tools that were created, refreshed, or skipped (including already-configured skips)
38
+ - **AND** personalize the "Next steps" header using the names of the selected tools, defaulting to a generic label when none remain
39
+
40
+ ### Requirement: Exit Code Adjustments
41
+ `openspec init` SHALL treat extend mode with no selected tools as a guarded error.
42
+
43
+ #### Scenario: Preventing empty extend runs
44
+ - **WHEN** OpenSpec is already initialized and the user selects no additional tools
45
+ - **THEN** exit with code 1 after showing the existing-initialization guidance message
@@ -0,0 +1,16 @@
1
+ # Implementation Tasks
2
+
3
+ ## 1. Extend Init Guard
4
+ - [x] 1.1 Detect existing OpenSpec structures at the start of `openspec init` and enter an extend mode instead of failing.
5
+ - [x] 1.2 Log that core scaffolding will be skipped while still protecting against missing write permissions.
6
+
7
+ ## 2. Update AI Tool Selection
8
+ - [x] 2.1 Present AI tool choices even in extend mode, indicating which tools are already configured.
9
+ - [x] 2.2 Ensure disabled "coming soon" tools remain non-selectable.
10
+
11
+ ## 3. Generate Additional Tool Files
12
+ - [x] 3.1 Create configuration files for newly selected tools while leaving untouched tools unaffected apart from marker-managed sections.
13
+ - [x] 3.2 Summarize created, refreshed, and skipped tools before exiting with the appropriate code.
14
+
15
+ ## 4. Verification
16
+ - [x] 4.1 Add tests covering rerunning `openspec init` to add another tool and the scenario where the user declines to add anything.
@@ -0,0 +1,119 @@
1
+ # Add Slash Command Support for Coding Agents
2
+
3
+ ## Summary
4
+ - Enable OpenSpec to generate and update custom slash commands for supported coding agents (Claude Code and Cursor).
5
+ - Provide three slash commands aligned with OpenSpec's workflow: proposal (start a change proposal), apply (implement), and archive.
6
+ - Share slash command templating between agents to make future extensions simple.
7
+
8
+ ## Motivation
9
+ Developers use different coding agents and editors. Having consistent slash commands across tools for the OpenSpec workflow reduces friction and ensures a standard way to trigger the workflow. Supporting both Claude Code and Cursor now lays a foundation for future agents that introduce slash command features.
10
+
11
+ ## Proposal
12
+ 1. During `openspec init`, when a user selects a supported tool, generate slash command configuration for three OpenSpec workflow stages:
13
+ - Claude (namespaced): `/openspec/proposal`, `/openspec/apply`, `/openspec/archive`.
14
+ - Cursor (flat, prefixed): `/openspec-proposal`, `/openspec-apply`, `/openspec-archive`.
15
+ - Semantics:
16
+ - Create – scaffold a change (ID, `proposal.md`, `tasks.md`, delta specs); validate strictly.
17
+ - Apply – implement an approved change; complete tasks; validate strictly.
18
+ - Archive – archive after deployment; update specs if needed.
19
+ - Each command file MUST embed concise, step-by-step instructions sourced from `openspec/README.md` (see Template Content section).
20
+ 2. Store slash command files per tool:
21
+ - Claude Code: `.claude/commands/openspec/{proposal,apply,archive}.md`
22
+ - Cursor: `.cursor/commands/{openspec-proposal,openspec-apply,openspec-archive}.md`
23
+ - Ensure nested directories are created.
24
+ 3. Command file format and metadata:
25
+ - Use Markdown with optional YAML frontmatter for tool metadata (name/title, description, category/tags) when supported by the tool.
26
+ - Place OpenSpec markers around the body only, never inside frontmatter.
27
+ - Keep the visible slash name, file name, and any frontmatter `name`/`id` consistently aligned (e.g., `proposal`, `openspec-proposal`).
28
+ - Namespacing: categorize these under “OpenSpec” and prefer unique IDs (e.g., `openspec-proposal`) to avoid collisions.
29
+ 4. Centralize templates: define command bodies once and reuse across tools; apply minimal per-tool wrappers (frontmatter, categories, filenames).
30
+ 5. During `openspec update`, refresh only existing slash command files (per-file basis) within markers; do not create missing files or new tools.
31
+
32
+ ## Design Ideas
33
+ - Introduce `SlashCommandConfigurator` to manage multiple files per tool.
34
+ - Expose targets rather than a single `configFileName` (e.g., `getTargets(): Array<{ path: string; kind: 'slash'; id: string }>`).
35
+ - Provide `generateAll(projectPath, openspecDir)` for init and `updateExisting(projectPath, openspecDir)` for update.
36
+ - Per-tool adapters add only frontmatter and pathing; bodies come from shared templates.
37
+ - Templates live in `TemplateManager` with helpers that extract concise, authoritative snippets from `openspec/README.md`.
38
+ - Update flow logs per-file results so users see exactly which slash files were refreshed.
39
+
40
+ ### Marker Placement
41
+ - Markers MUST wrap only the Markdown body contents:
42
+ - Frontmatter (if present) goes first.
43
+ - Then `<!-- OPENSPEC:START -->` … body … `<!-- OPENSPEC:END -->`.
44
+ - Avoid inserting markers into the YAML block to prevent parse errors.
45
+
46
+ ### Idempotency and Creation Rules
47
+ - `init`: create all three files for the chosen tool(s) once; subsequent `init` runs are no-ops for existing files.
48
+ - `update`: refresh only files that exist; skip missing ones without creating new files.
49
+ - Directory creation for `.claude/commands/openspec/` and `.cursor/commands/` is the configurator’s responsibility.
50
+
51
+ ### Command Naming & UX
52
+ - Claude Code: use namespacing in the slash itself for readability and grouping: `/openspec/proposal`, `/openspec/apply`, `/openspec/archive`.
53
+ - Cursor: use flat names with an `openspec-` prefix: `/openspec-proposal`, `/openspec-apply`, `/openspec-archive`. Group via `category: OpenSpec` when supported.
54
+ - Consistency: align file names, visible slash names, and any frontmatter `id` (e.g., `id: openspec-apply`).
55
+ - Migration: do not rename existing commands during `update`; apply new naming only on `init` (or via an explicit migrate step).
56
+
57
+ ## Open Questions
58
+ - Validate exact metadata/frontmatter supported by each tool version; if unsupported, omit frontmatter and ship Markdown body only.
59
+ - Confirm the final Cursor command file location for the targeted versions; fall back to Markdown-only if Cursor does not parse frontmatter.
60
+ - Evaluate additional commands beyond the initial three (e.g., `/show-change`, `/validate-all`) based on user demand.
61
+
62
+ ## Alternatives
63
+ - Hard-code slash command text per tool (rejected: duplicates content; increases maintenance).
64
+ - Delay Cursor support until its config stabilizes (partial accept): gate Cursor behind a feature flag until verified in real environments.
65
+
66
+ ## Risks
67
+ - Tool configuration formats may change, requiring updates to wrappers/frontmatter.
68
+ - Incorrect paths or categories can hide commands; add path existence checks and clear logging.
69
+ - Marker misuse (inside frontmatter) can break parsing; enforce placement rules in tests.
70
+
71
+ ## Future Work
72
+ - Support additional editors/agents that expose slash command APIs.
73
+ - Allow users to customize command names and categories during `openspec init`.
74
+ - Provide a dedicated command to regenerate slash commands without running full `update`.
75
+
76
+ ## File Format Examples
77
+ The following examples illustrate expected structure. If a tool does not support frontmatter, omit the YAML block and keep only the markers + body.
78
+
79
+ ### Claude Code: `.claude/commands/openspec/proposal.md`
80
+ ```markdown
81
+ ---
82
+ name: OpenSpec: Proposal
83
+ description: Scaffold a new OpenSpec change and validate strictly.
84
+ category: OpenSpec
85
+ tags: [openspec, change]
86
+ ---
87
+ <!-- OPENSPEC:START -->
88
+ ...command body from shared template...
89
+ <!-- OPENSPEC:END -->
90
+ ```
91
+
92
+ Slash invocation: `/openspec/proposal` (namespaced)
93
+
94
+ ### Cursor: `.cursor/commands/openspec-proposal.md`
95
+ ```markdown
96
+ ---
97
+ name: /openspec-proposal
98
+ id: openspec-proposal
99
+ category: OpenSpec
100
+ description: Scaffold a new OpenSpec change and validate strictly.
101
+ ---
102
+ <!-- OPENSPEC:START -->
103
+ ...command body from shared template...
104
+ <!-- OPENSPEC:END -->
105
+ ```
106
+
107
+ Slash invocation: `/openspec-proposal` (flat, prefixed)
108
+
109
+ ## Template Content
110
+ Templates should be brief, actionable, and sourced from `openspec/README.md` to avoid duplication. Each command body includes:
111
+ - Guardrails: ask 1–2 clarifying questions if needed; follow minimal-complexity rules; use `pnpm` for Node projects.
112
+ - Step list tailored to the workflow stage (proposal, apply, archive), including strict validation commands.
113
+ - Pointers to `openspec show`, `openspec list`, and troubleshooting tips when validation fails.
114
+
115
+ ## Testing Strategy
116
+ - Golden snapshots for generated files per tool (frontmatter + markers + body).
117
+ - Partial presence tests: if 1–2 files exist, `update` only refreshes those and does not create missing ones.
118
+ - Marker placement tests: ensure markers never appear inside frontmatter; cover missing/duplicated marker recovery behavior.
119
+ - Logging tests: `update` reports per-file updates for slash commands.
@@ -0,0 +1,21 @@
1
+ ## ADDED Requirements
2
+ ### Requirement: Slash Command Configuration
3
+ The init command SHALL generate slash command files for supported editors using shared templates.
4
+
5
+ #### Scenario: Generating slash commands for Claude Code
6
+ - **WHEN** the user selects Claude Code during initialization
7
+ - **THEN** create `.claude/commands/openspec/proposal.md`, `.claude/commands/openspec/apply.md`, and `.claude/commands/openspec/archive.md`
8
+ - **AND** populate each file from shared templates so command text matches other tools
9
+ - **AND** each template includes instructions for the relevant OpenSpec workflow stage
10
+
11
+ #### Scenario: Generating slash commands for Cursor
12
+ - **WHEN** the user selects Cursor during initialization
13
+ - **THEN** create `.cursor/commands/openspec-proposal.md`, `.cursor/commands/openspec-apply.md`, and `.cursor/commands/openspec-archive.md`
14
+ - **AND** populate each file from shared templates so command text matches other tools
15
+ - **AND** each template includes instructions for the relevant OpenSpec workflow stage
16
+
17
+ #### Scenario: Generating slash commands for OpenCode
18
+ - **WHEN** the user selects OpenCode during initialization
19
+ - **THEN** create `.opencode/commands/openspec-proposal.md`, `.opencode/commands/openspec-apply.md`, and `.opencode/commands/openspec-archive.md`
20
+ - **AND** populate each file from shared templates so command text matches other tools
21
+ - **AND** each template includes instructions for the relevant OpenSpec workflow stage
@@ -0,0 +1,22 @@
1
+ ## ADDED Requirements
2
+ ### Requirement: Slash Command Updates
3
+ The update command SHALL refresh existing slash command files for configured tools without creating new ones.
4
+
5
+ #### Scenario: Updating slash commands for Claude Code
6
+ - **WHEN** `.claude/commands/openspec/` contains `proposal.md`, `apply.md`, and `archive.md`
7
+ - **THEN** refresh each file using shared templates
8
+ - **AND** ensure templates include instructions for the relevant workflow stage
9
+
10
+ #### Scenario: Updating slash commands for Cursor
11
+ - **WHEN** `.cursor/commands/` contains `openspec-proposal.md`, `openspec-apply.md`, and `openspec-archive.md`
12
+ - **THEN** refresh each file using shared templates
13
+ - **AND** ensure templates include instructions for the relevant workflow stage
14
+
15
+ #### Scenario: Updating slash commands for OpenCode
16
+ - **WHEN** `.opencode/commands/` contains `openspec-proposal.md`, `openspec-apply.md`, and `openspec-archive.md`
17
+ - **THEN** refresh each file using shared templates
18
+ - **AND** ensure templates include instructions for the relevant workflow stage
19
+
20
+ #### Scenario: Missing slash command file
21
+ - **WHEN** a tool lacks a slash command file
22
+ - **THEN** do not create a new file during update
@@ -0,0 +1,20 @@
1
+ # Implementation Tasks
2
+
3
+ ## 1. Templates and Configurators
4
+ - [x] 1.1 Create shared templates for the Proposal, Apply, and Archive commands with instructions for each workflow stage from `openspec/README.md`.
5
+ - [x] 1.2 Implement a `SlashCommandConfigurator` base and tool-specific configurators for Claude Code and Cursor.
6
+
7
+ ## 2. Claude Code Integration
8
+ - [x] 2.1 Generate `.claude/commands/openspec/{proposal,apply,archive}.md` during `openspec init` using shared templates.
9
+ - [x] 2.2 Update existing `.claude/commands/openspec/*` files during `openspec update`.
10
+
11
+ ## 3. Cursor Integration
12
+ - [x] 3.1 Generate `.cursor/commands/{openspec-proposal,openspec-apply,openspec-archive}.md` during `openspec init` using shared templates.
13
+ - [x] 3.2 Update existing `.cursor/commands/*` files during `openspec update`.
14
+
15
+ ## 4. Verification
16
+ - [x] 4.1 Add tests verifying slash command files are created and updated correctly.
17
+
18
+ ## 5. OpenCode Integration
19
+ - [x] 5.1 Generate `.opencode/commands/{openspec-proposal,openspec-apply,openspec-archive}.md` during `openspec init` using shared templates.
20
+ - [x] 5.2 Update existing `.opencode/commands/*` files during `openspec update`.