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,53 @@
1
+ # OpenSpec Project Overview
2
+
3
+ A minimal CLI tool that helps developers set up OpenSpec file structures and keep AI instructions updated. The AI tools themselves handle all the change management complexity by working directly with markdown files.
4
+
5
+ ## Technology Stack
6
+ - Language: TypeScript
7
+ - Runtime: Node.js (≥20.19.0, ESM modules)
8
+ - Package Manager: pnpm
9
+ - CLI Framework: Commander.js
10
+ - User Interaction: @inquirer/prompts
11
+ - Distribution: npm package
12
+
13
+ ## Project Structure
14
+ ```
15
+ src/
16
+ ├── cli/ # CLI command implementations
17
+ ├── core/ # Core OpenSpec logic (templates, structure)
18
+ └── utils/ # Shared utilities (file operations, rollback)
19
+
20
+ dist/ # Compiled output (gitignored)
21
+ ```
22
+
23
+ ## Conventions
24
+ - TypeScript strict mode enabled
25
+ - Async/await for all asynchronous operations
26
+ - Minimal dependencies principle
27
+ - Clear separation of CLI, core logic, and utilities
28
+ - AI-friendly code with descriptive names
29
+
30
+ ## Error Handling
31
+ - Let errors bubble up to CLI level for consistent user messaging
32
+ - Use native Error types with descriptive messages
33
+ - Exit with appropriate codes: 0 (success), 1 (general error), 2 (misuse)
34
+ - No try-catch in utility functions, handle at command level
35
+
36
+ ## Logging
37
+ - Use console methods directly (no logging library)
38
+ - console.log() for normal output
39
+ - console.error() for errors (outputs to stderr)
40
+ - No verbose/debug modes initially (keep it simple)
41
+
42
+ ## Testing Strategy
43
+ - Manual testing via `pnpm link` during development
44
+ - Smoke tests for critical paths only (init, help commands)
45
+ - No unit tests initially - add when complexity grows
46
+ - Test commands: `pnpm test:smoke` (when added)
47
+
48
+ ## Development Workflow
49
+ - Use pnpm for all package management
50
+ - Run `pnpm run build` to compile TypeScript
51
+ - Run `pnpm run dev` for development mode
52
+ - Test locally with `pnpm link`
53
+ - Follow OpenSpec's own change-driven development process
@@ -0,0 +1,210 @@
1
+ # CLI Archive Command Specification
2
+
3
+ ## Purpose
4
+ The archive command moves completed changes from the active changes directory to the archive folder with date-based naming, following OpenSpec conventions.
5
+
6
+ ## Command Syntax
7
+ ```bash
8
+ openspec archive [change-name] [--yes|-y]
9
+ ```
10
+
11
+ Options:
12
+ - `--yes`, `-y`: Skip confirmation prompts (for automation)
13
+ ## Requirements
14
+ ### Requirement: Change Selection
15
+
16
+ The command SHALL support both interactive and direct change selection methods.
17
+
18
+ #### Scenario: Interactive selection
19
+
20
+ - **WHEN** no change-name is provided
21
+ - **THEN** display interactive list of available changes (excluding archive/)
22
+ - **AND** allow user to select one
23
+
24
+ #### Scenario: Direct selection
25
+
26
+ - **WHEN** change-name is provided
27
+ - **THEN** use that change directly
28
+ - **AND** validate it exists
29
+
30
+ ### Requirement: Task Completion Check
31
+
32
+ The command SHALL verify task completion status before archiving to prevent premature archival.
33
+
34
+ #### Scenario: Incomplete tasks found
35
+
36
+ - **WHEN** incomplete tasks are found (marked with `- [ ]`)
37
+ - **THEN** display all incomplete tasks to the user
38
+ - **AND** prompt for confirmation to continue
39
+ - **AND** default to "No" for safety
40
+
41
+ #### Scenario: All tasks complete
42
+
43
+ - **WHEN** all tasks are complete OR no tasks.md exists
44
+ - **THEN** proceed with archiving without prompting
45
+
46
+ ### Requirement: Archive Process
47
+
48
+ The archive operation SHALL follow a structured process to safely move changes to the archive.
49
+
50
+ #### Scenario: Performing archive
51
+
52
+ - **WHEN** archiving a change
53
+ - **THEN** execute these steps:
54
+ 1. Create archive/ directory if it doesn't exist
55
+ 2. Generate target name as `YYYY-MM-DD-[change-name]` using current date
56
+ 3. Check if target directory already exists
57
+ 4. Update main specs from the change's future state specs (see Spec Update Process below)
58
+ 5. Move the entire change directory to the archive location
59
+
60
+ #### Scenario: Archive already exists
61
+
62
+ - **WHEN** target archive already exists
63
+ - **THEN** fail with error message
64
+ - **AND** do not overwrite existing archive
65
+
66
+ #### Scenario: Successful archive
67
+
68
+ - **WHEN** move succeeds
69
+ - **THEN** display success message with archived name and list of updated specs
70
+
71
+ ### Requirement: Spec Update Process
72
+
73
+ Before moving the change to archive, the command SHALL apply delta changes to main specs to reflect the deployed reality.
74
+
75
+ #### Scenario: Applying delta changes
76
+
77
+ - **WHEN** archiving a change with delta-based specs
78
+ - **THEN** parse and apply delta changes as defined in openspec-conventions
79
+ - **AND** validate all operations before applying
80
+
81
+ #### Scenario: Validating delta changes
82
+
83
+ - **WHEN** processing delta changes
84
+ - **THEN** perform validations as specified in openspec-conventions
85
+ - **AND** if validation fails, show specific errors and abort
86
+
87
+ #### Scenario: Conflict detection
88
+
89
+ - **WHEN** applying deltas would create duplicate requirement headers
90
+ - **THEN** abort with error message showing the conflict
91
+ - **AND** suggest manual resolution
92
+
93
+ ### Requirement: Confirmation Behavior
94
+
95
+ The spec update confirmation SHALL provide clear visibility into changes before they are applied.
96
+
97
+ #### Scenario: Displaying confirmation
98
+
99
+ - **WHEN** prompting for confirmation
100
+ - **THEN** display a clear summary showing:
101
+ - Which specs will be created (new capabilities)
102
+ - Which specs will be updated (existing capabilities)
103
+ - The source path for each spec
104
+ - **AND** format the confirmation prompt as:
105
+ ```
106
+ The following specs will be updated:
107
+
108
+ NEW specs to be created:
109
+ - cli-archive (from changes/add-archive-command/specs/cli-archive/spec.md)
110
+
111
+ EXISTING specs to be updated:
112
+ - cli-init (from changes/update-init-command/specs/cli-init/spec.md)
113
+
114
+ Update 2 specs and archive 'add-archive-command'? [y/N]:
115
+ ```
116
+ #### Scenario: Handling confirmation response
117
+
118
+ - **WHEN** waiting for user confirmation
119
+ - **THEN** default to "No" for safety (require explicit "y" or "yes")
120
+ - **AND** skip confirmation when `--yes` or `-y` flag is provided
121
+
122
+ #### Scenario: User declines confirmation
123
+
124
+ - **WHEN** user declines the confirmation
125
+ - **THEN** abort the entire archive operation
126
+ - **AND** display message: "Archive cancelled. No changes were made."
127
+ - **AND** exit with non-zero status code
128
+
129
+ ### Requirement: Error Conditions
130
+
131
+ The command SHALL handle various error conditions gracefully.
132
+
133
+ #### Scenario: Handling errors
134
+
135
+ - **WHEN** errors occur
136
+ - **THEN** handle the following conditions:
137
+ - Missing openspec/changes/ directory
138
+ - Change not found
139
+ - Archive target already exists
140
+ - File system permissions issues
141
+
142
+ ### Requirement: Skip Specs Option
143
+
144
+ The archive command SHALL support a `--skip-specs` flag that skips all spec update operations and proceeds directly to archiving.
145
+
146
+ #### Scenario: Skipping spec updates with flag
147
+
148
+ - **WHEN** executing `openspec archive <change> --skip-specs`
149
+ - **THEN** skip spec discovery and update confirmation
150
+ - **AND** proceed directly to moving the change to archive
151
+ - **AND** display a message indicating specs were skipped
152
+
153
+ ### Requirement: Non-blocking confirmation
154
+
155
+ The archive operation SHALL proceed when the user declines spec updates instead of cancelling the entire operation.
156
+
157
+ #### Scenario: User declines spec update confirmation
158
+
159
+ - **WHEN** the user declines spec update confirmation
160
+ - **THEN** skip spec updates
161
+ - **AND** continue with the archive operation
162
+ - **AND** display a success message indicating specs were not updated
163
+
164
+ ### Requirement: Display Output
165
+
166
+ The command SHALL provide clear feedback about delta operations.
167
+
168
+ #### Scenario: Showing delta application
169
+
170
+ - **WHEN** applying delta changes
171
+ - **THEN** display for each spec:
172
+ - Number of requirements added
173
+ - Number of requirements modified
174
+ - Number of requirements removed
175
+ - Number of requirements renamed
176
+ - **AND** use standard output symbols (+ ~ - →) as defined in openspec-conventions:
177
+ ```
178
+ Applying changes to specs/user-auth/spec.md:
179
+ + 2 added
180
+ ~ 3 modified
181
+ - 1 removed
182
+ → 1 renamed
183
+ ```
184
+
185
+ ### Requirement: Archive Validation
186
+
187
+ The archive command SHALL validate changes before applying them to ensure data integrity.
188
+
189
+ #### Scenario: Pre-archive validation
190
+
191
+ - **WHEN** executing `openspec archive change-name`
192
+ - **THEN** validate the change structure first
193
+ - **AND** only proceed if validation passes
194
+ - **AND** show validation errors if it fails
195
+
196
+ #### Scenario: Force archive without validation
197
+
198
+ - **WHEN** executing `openspec archive change-name --no-validate`
199
+ - **THEN** skip validation (unsafe mode)
200
+ - **AND** show warning about skipping validation
201
+
202
+ ## Why These Decisions
203
+
204
+ **Interactive selection**: Reduces typing and helps users see available changes
205
+ **Task checking**: Prevents accidental archiving of incomplete work
206
+ **Date prefixing**: Maintains chronological order and prevents naming conflicts
207
+ **No overwrite**: Preserves historical archives and prevents data loss
208
+ **Spec updates before archiving**: Specs in the main directory represent current reality; when a change is deployed and archived, its future state specs become the new reality and must replace the main specs
209
+ **Confirmation for spec updates**: Provides visibility into what will change, prevents accidental overwrites, and ensures users understand the impact before specs are modified
210
+ **--yes flag for automation**: Allows CI/CD pipelines to archive without interactive prompts while maintaining safety by default for manual use
@@ -0,0 +1,91 @@
1
+ # cli-change Specification
2
+
3
+ ## Purpose
4
+ TBD - created by archiving change add-change-commands. Update Purpose after archive.
5
+ ## Requirements
6
+ ### Requirement: Change Command
7
+
8
+ The system SHALL provide a `change` command with subcommands for displaying, listing, and validating change proposals.
9
+
10
+ #### Scenario: Show change as JSON
11
+
12
+ - **WHEN** executing `openspec change show update-error --json`
13
+ - **THEN** parse the markdown change file
14
+ - **AND** extract change structure and deltas
15
+ - **AND** output valid JSON to stdout
16
+
17
+ #### Scenario: List all changes
18
+
19
+ - **WHEN** executing `openspec change list`
20
+ - **THEN** scan the openspec/changes directory
21
+ - **AND** return list of all pending changes
22
+ - **AND** support JSON output with `--json` flag
23
+
24
+ #### Scenario: Show only requirement changes
25
+
26
+ - **WHEN** executing `openspec change show update-error --requirements-only`
27
+ - **THEN** display only the requirement changes (ADDED/MODIFIED/REMOVED/RENAMED)
28
+ - **AND** exclude why and what changes sections
29
+
30
+ #### Scenario: Validate change structure
31
+
32
+ - **WHEN** executing `openspec change validate update-error`
33
+ - **THEN** parse the change file
34
+ - **AND** validate against Zod schema
35
+ - **AND** ensure deltas are well-formed
36
+
37
+ ### Requirement: Legacy Compatibility
38
+
39
+ The system SHALL maintain backward compatibility with the existing `list` command while showing deprecation notices.
40
+
41
+ #### Scenario: Legacy list command
42
+
43
+ - **WHEN** executing `openspec list`
44
+ - **THEN** display current list of changes (existing behavior)
45
+ - **AND** show deprecation notice: "Note: 'openspec list' is deprecated. Use 'openspec change list' instead."
46
+
47
+ #### Scenario: Legacy list with --all flag
48
+
49
+ - **WHEN** executing `openspec list --all`
50
+ - **THEN** display all changes (existing behavior)
51
+ - **AND** show same deprecation notice
52
+
53
+ ### Requirement: Interactive show selection
54
+
55
+ The change show command SHALL support interactive selection when no change name is provided.
56
+
57
+ #### Scenario: Interactive change selection for show
58
+
59
+ - **WHEN** executing `openspec change show` without arguments
60
+ - **THEN** display an interactive list of available changes
61
+ - **AND** allow the user to select a change to show
62
+ - **AND** display the selected change content
63
+ - **AND** maintain all existing show options (--json, --deltas-only)
64
+
65
+ #### Scenario: Non-interactive fallback keeps current behavior
66
+
67
+ - **GIVEN** stdin is not a TTY or `--no-interactive` is provided or environment variable `OPEN_SPEC_INTERACTIVE=0`
68
+ - **WHEN** executing `openspec change show` without a change name
69
+ - **THEN** do not prompt interactively
70
+ - **AND** print the existing hint including available change IDs
71
+ - **AND** set `process.exitCode = 1`
72
+
73
+ ### Requirement: Interactive validation selection
74
+
75
+ The change validate command SHALL support interactive selection when no change name is provided.
76
+
77
+ #### Scenario: Interactive change selection for validation
78
+
79
+ - **WHEN** executing `openspec change validate` without arguments
80
+ - **THEN** display an interactive list of available changes
81
+ - **AND** allow the user to select a change to validate
82
+ - **AND** validate the selected change
83
+
84
+ #### Scenario: Non-interactive fallback keeps current behavior
85
+
86
+ - **GIVEN** stdin is not a TTY or `--no-interactive` is provided or environment variable `OPEN_SPEC_INTERACTIVE=0`
87
+ - **WHEN** executing `openspec change validate` without a change name
88
+ - **THEN** do not prompt interactively
89
+ - **AND** print the existing hint including available change IDs
90
+ - **AND** set `process.exitCode = 1`
91
+
@@ -0,0 +1,311 @@
1
+ # CLI Init Specification
2
+
3
+ ## Purpose
4
+
5
+ The `openspec init` command SHALL create a complete OpenSpec directory structure in any project, enabling immediate adoption of OpenSpec conventions with support for multiple AI coding assistants.
6
+ ## Requirements
7
+ ### Requirement: Progress Indicators
8
+
9
+ The command SHALL display progress indicators during initialization to provide clear feedback about each step.
10
+
11
+ #### Scenario: Displaying initialization progress
12
+
13
+ - **WHEN** executing initialization steps
14
+ - **THEN** validate environment silently in background (no output unless error)
15
+ - **AND** display progress with ora spinners:
16
+ - Show spinner: "⠋ Creating OpenSpec structure..."
17
+ - Then success: "✔ OpenSpec structure created"
18
+ - Show spinner: "⠋ Configuring AI tools..."
19
+ - Then success: "✔ AI tools configured"
20
+
21
+ ### Requirement: Directory Creation
22
+ The command SHALL create the complete OpenSpec directory structure with all required directories and files.
23
+
24
+ #### Scenario: Creating OpenSpec structure
25
+ - **WHEN** `openspec init` is executed
26
+ - **THEN** create the following directory structure:
27
+ ```
28
+ openspec/
29
+ ├── project.md
30
+ ├── AGENTS.md
31
+ ├── specs/
32
+ └── changes/
33
+ └── archive/
34
+ ```
35
+
36
+ ### Requirement: File Generation
37
+ The command SHALL generate required template files with appropriate content for immediate use.
38
+
39
+ #### Scenario: Generating template files
40
+ - **WHEN** initializing OpenSpec
41
+ - **THEN** generate `openspec/AGENTS.md` containing complete OpenSpec instructions for AI assistants
42
+ - **AND** generate `project.md` with project context template
43
+
44
+ ### Requirement: AI Tool Configuration
45
+ The command SHALL configure AI coding assistants with OpenSpec instructions using a grouped selection experience so teams can enable native integrations while always provisioning guidance for other assistants.
46
+
47
+ #### Scenario: Prompting for AI tool selection
48
+ - **WHEN** run interactively
49
+ - **THEN** present a multi-select wizard that separates options into two headings:
50
+ - **Natively supported providers** shows each available first-party integration (Claude Code, Cursor, OpenCode, …) with checkboxes
51
+ - **Other tools** explains that the root-level `AGENTS.md` stub is always generated for AGENTS-compatible assistants and cannot be deselected
52
+ - **AND** mark already configured native tools with "(already configured)" to signal that choosing them will refresh managed content
53
+ - **AND** keep disabled or unavailable providers labelled as "coming soon" so users know they cannot opt in yet
54
+ - **AND** allow confirming the selection even when no native provider is chosen because the root stub remains enabled by default
55
+ - **AND** change the base prompt copy in extend mode to "Which natively supported AI tools would you like to add or refresh?"
56
+
57
+ ### Requirement: AI Tool Configuration Details
58
+
59
+ The command SHALL properly configure selected AI tools with OpenSpec-specific instructions using a marker system.
60
+
61
+ #### Scenario: Configuring Claude Code
62
+
63
+ - **WHEN** Claude Code is selected
64
+ - **THEN** create or update `CLAUDE.md` in the project root directory (not inside openspec/)
65
+ - **AND** populate the managed block with a short stub that points teammates to `@/openspec/AGENTS.md`
66
+
67
+ #### Scenario: Configuring CodeBuddy Code
68
+
69
+ - **WHEN** CodeBuddy Code is selected
70
+ - **THEN** create or update `CODEBUDDY.md` in the project root directory (not inside openspec/)
71
+ - **AND** populate the managed block with a short stub that points teammates to `@/openspec/AGENTS.md`
72
+
73
+ #### Scenario: Configuring Cline
74
+
75
+ - **WHEN** Cline is selected
76
+ - **THEN** create or update `CLINE.md` in the project root directory (not inside openspec/)
77
+ - **AND** populate the managed block with a short stub that points teammates to `@/openspec/AGENTS.md`
78
+
79
+ #### Scenario: Configuring iFlow CLI
80
+
81
+ - **WHEN** iFlow CLI is selected
82
+ - **THEN** create or update `IFLOW.md` in the project root directory (not inside openspec/)
83
+ - **AND** populate the managed block with a short stub that points teammates to `@/openspec/AGENTS.md`
84
+
85
+ #### Scenario: Creating new CLAUDE.md
86
+
87
+ - **WHEN** CLAUDE.md does not exist
88
+ - **THEN** create new file with stub instructions wrapped in markers so the full workflow stays in `openspec/AGENTS.md`:
89
+ ```markdown
90
+ <!-- OPENSPEC:START -->
91
+ # OpenSpec Instructions
92
+
93
+ This project uses OpenSpec to manage AI assistant workflows.
94
+
95
+ - Full guidance lives in '@/openspec/AGENTS.md'.
96
+ - Keep this managed block so 'openspec update' can refresh the instructions.
97
+ <!-- OPENSPEC:END -->
98
+ ```
99
+
100
+ ### Requirement: Interactive Mode
101
+ The command SHALL provide an interactive menu for AI tool selection with clear navigation instructions.
102
+ #### Scenario: Displaying interactive menu
103
+ - **WHEN** run in fresh or extend mode
104
+ - **THEN** present a looping select menu that lets users toggle tools with Space and review selections with Enter
105
+ - **AND** when Enter is pressed on a highlighted selectable tool that is not already selected, automatically add it to the selection before moving to review so the highlighted tool is configured
106
+ - **AND** label already configured tools with "(already configured)" while keeping disabled options marked "coming soon"
107
+ - **AND** change the prompt copy in extend mode to "Which AI tools would you like to add or refresh?"
108
+ - **AND** display inline instructions clarifying that Space toggles tools and Enter selects the highlighted tool before reviewing selections
109
+
110
+ ### Requirement: Safety Checks
111
+ The command SHALL perform safety checks to prevent overwriting existing structures and ensure proper permissions.
112
+
113
+ #### Scenario: Detecting existing initialization
114
+ - **WHEN** the `openspec/` directory already exists
115
+ - **THEN** inform the user that OpenSpec is already initialized, skip recreating the base structure, and enter an extend mode
116
+ - **AND** continue to the AI tool selection step so additional tools can be configured
117
+ - **AND** display the existing-initialization error message only when the user declines to add any AI tools
118
+
119
+ ### Requirement: Success Output
120
+
121
+ The command SHALL provide clear, actionable next steps upon successful initialization.
122
+
123
+ #### Scenario: Displaying success message
124
+ - **WHEN** initialization completes successfully
125
+ - **THEN** include prompt: "Please explain the OpenSpec workflow from openspec/AGENTS.md and how I should work with you on this project"
126
+
127
+ #### Scenario: Displaying restart instruction
128
+ - **WHEN** initialization completes successfully and tools were created or refreshed
129
+ - **THEN** display a prominent restart instruction before the "Next steps" section
130
+ - **AND** inform users that slash commands are loaded at startup
131
+ - **AND** instruct users to restart their coding assistant to ensure /openspec commands appear
132
+
133
+ ### Requirement: Exit Codes
134
+
135
+ The command SHALL use consistent exit codes to indicate different failure modes.
136
+
137
+ #### Scenario: Returning exit codes
138
+
139
+ - **WHEN** the command completes
140
+ - **THEN** return appropriate exit code:
141
+ - 0: Success
142
+ - 1: General error (including when OpenSpec directory already exists)
143
+ - 2: Insufficient permissions (reserved for future use)
144
+ - 3: User cancelled operation (reserved for future use)
145
+
146
+ ### Requirement: Additional AI Tool Initialization
147
+ `openspec init` SHALL allow users to add configuration files for new AI coding assistants after the initial setup.
148
+
149
+ #### Scenario: Configuring an extra tool after initial setup
150
+ - **GIVEN** an `openspec/` directory already exists and at least one AI tool file is present
151
+ - **WHEN** the user runs `openspec init` and selects a different supported AI tool
152
+ - **THEN** generate that tool's configuration files with OpenSpec markers the same way as during first-time initialization
153
+ - **AND** leave existing tool configuration files unchanged except for managed sections that need refreshing
154
+ - **AND** exit with code 0 and display a success summary highlighting the newly added tool files
155
+
156
+ ### Requirement: Success Output Enhancements
157
+ `openspec init` SHALL summarize tool actions when initialization or extend mode completes.
158
+
159
+ #### Scenario: Showing tool summary
160
+ - **WHEN** the command completes successfully
161
+ - **THEN** display a categorized summary of tools that were created, refreshed, or skipped (including already-configured skips)
162
+ - **AND** personalize the "Next steps" header using the names of the selected tools, defaulting to a generic label when none remain
163
+
164
+ ### Requirement: Exit Code Adjustments
165
+ `openspec init` SHALL treat extend mode without new native tool selections as a successful refresh.
166
+
167
+ #### Scenario: Allowing empty extend runs
168
+ - **WHEN** OpenSpec is already initialized and the user selects no additional natively supported tools
169
+ - **THEN** complete successfully while refreshing the root `AGENTS.md` stub
170
+ - **AND** exit with code 0
171
+
172
+ ### Requirement: Slash Command Configuration
173
+ The init command SHALL generate slash command files for supported editors using shared templates.
174
+
175
+ #### Scenario: Generating slash commands for Claude Code
176
+ - **WHEN** the user selects Claude Code during initialization
177
+ - **THEN** create `.claude/commands/openspec/proposal.md`, `.claude/commands/openspec/apply.md`, and `.claude/commands/openspec/archive.md`
178
+ - **AND** populate each file from shared templates so command text matches other tools
179
+ - **AND** each template includes instructions for the relevant OpenSpec workflow stage
180
+
181
+ #### Scenario: Generating slash commands for CodeBuddy Code
182
+ - **WHEN** the user selects CodeBuddy Code during initialization
183
+ - **THEN** create `.codebuddy/commands/openspec/proposal.md`, `.codebuddy/commands/openspec/apply.md`, and `.codebuddy/commands/openspec/archive.md`
184
+ - **AND** populate each file from shared templates so command text matches other tools
185
+ - **AND** each template includes instructions for the relevant OpenSpec workflow stage
186
+
187
+ #### Scenario: Generating slash commands for Cline
188
+ - **WHEN** the user selects Cline during initialization
189
+ - **THEN** create `.clinerules/openspec-proposal.md`, `.clinerules/openspec-apply.md`, and `.clinerules/openspec-archive.md`
190
+ - **AND** populate each file from shared templates so command text matches other tools
191
+ - **AND** include Cline-specific Markdown heading frontmatter
192
+ - **AND** each template includes instructions for the relevant OpenSpec workflow stage
193
+
194
+ #### Scenario: Generating slash commands for Crush
195
+ - **WHEN** the user selects Crush during initialization
196
+ - **THEN** create `.crush/commands/openspec/proposal.md`, `.crush/commands/openspec/apply.md`, and `.crush/commands/openspec/archive.md`
197
+ - **AND** populate each file from shared templates so command text matches other tools
198
+ - **AND** include Crush-specific frontmatter with OpenSpec category and tags
199
+ - **AND** each template includes instructions for the relevant OpenSpec workflow stage
200
+
201
+ #### Scenario: Generating slash commands for Cursor
202
+ - **WHEN** the user selects Cursor during initialization
203
+ - **THEN** create `.cursor/commands/openspec-proposal.md`, `.cursor/commands/openspec-apply.md`, and `.cursor/commands/openspec-archive.md`
204
+ - **AND** populate each file from shared templates so command text matches other tools
205
+ - **AND** each template includes instructions for the relevant OpenSpec workflow stage
206
+
207
+ #### Scenario: Generating slash commands for Factory Droid
208
+ - **WHEN** the user selects Factory Droid during initialization
209
+ - **THEN** create `.factory/commands/openspec-proposal.md`, `.factory/commands/openspec-apply.md`, and `.factory/commands/openspec-archive.md`
210
+ - **AND** populate each file from shared templates that include Factory-compatible YAML frontmatter for the `description` and `argument-hint` fields
211
+ - **AND** include the `$ARGUMENTS` placeholder in the template body so droid receives any user-supplied input
212
+ - **AND** wrap the generated content in OpenSpec managed markers so `openspec update` can safely refresh the commands
213
+
214
+ #### Scenario: Generating slash commands for OpenCode
215
+ - **WHEN** the user selects OpenCode during initialization
216
+ - **THEN** create `.opencode/commands/openspec-proposal.md`, `.opencode/commands/openspec-apply.md`, and `.opencode/commands/openspec-archive.md`
217
+ - **AND** populate each file from shared templates so command text matches other tools
218
+ - **AND** each template includes instructions for the relevant OpenSpec workflow stage
219
+
220
+ #### Scenario: Generating slash commands for Windsurf
221
+ - **WHEN** the user selects Windsurf during initialization
222
+ - **THEN** create `.windsurf/workflows/openspec-proposal.md`, `.windsurf/workflows/openspec-apply.md`, and `.windsurf/workflows/openspec-archive.md`
223
+ - **AND** populate each file from shared templates (wrapped in OpenSpec markers) so workflow text matches other tools
224
+ - **AND** each template includes instructions for the relevant OpenSpec workflow stage
225
+
226
+ #### Scenario: Generating slash commands for Kilo Code
227
+ - **WHEN** the user selects Kilo Code during initialization
228
+ - **THEN** create `.kilocode/workflows/openspec-proposal.md`, `.kilocode/workflows/openspec-apply.md`, and `.kilocode/workflows/openspec-archive.md`
229
+ - **AND** populate each file from shared templates (wrapped in OpenSpec markers) so workflow text matches other tools
230
+ - **AND** each template includes instructions for the relevant OpenSpec workflow stage
231
+
232
+ #### Scenario: Generating slash commands for Codex
233
+ - **WHEN** the user selects Codex during initialization
234
+ - **THEN** create global prompt files at `~/.codex/prompts/openspec-proposal.md`, `~/.codex/prompts/openspec-apply.md`, and `~/.codex/prompts/openspec-archive.md` (or under `$CODEX_HOME/prompts` if set)
235
+ - **AND** populate each file from shared templates that map the first numbered placeholder (`$1`) to the primary user input (e.g., change identifier or question text)
236
+ - **AND** wrap the generated content in OpenSpec markers so `openspec update` can refresh the prompts without touching surrounding custom notes
237
+
238
+ #### Scenario: Generating slash commands for GitHub Copilot
239
+ - **WHEN** the user selects GitHub Copilot during initialization
240
+ - **THEN** create `.github/prompts/openspec-proposal.prompt.md`, `.github/prompts/openspec-apply.prompt.md`, and `.github/prompts/openspec-archive.prompt.md`
241
+ - **AND** populate each file with YAML frontmatter containing a `description` field that summarizes the workflow stage
242
+ - **AND** include `$ARGUMENTS` placeholder to capture user input
243
+ - **AND** wrap the shared template body with OpenSpec markers so `openspec update` can refresh the content
244
+ - **AND** each template includes instructions for the relevant OpenSpec workflow stage
245
+
246
+ #### Scenario: Generating slash commands for Gemini CLI
247
+ - **WHEN** the user selects Gemini CLI during initialization
248
+ - **THEN** create `.gemini/commands/openspec/proposal.toml`, `.gemini/commands/openspec/apply.toml`, and `.gemini/commands/openspec/archive.toml`
249
+ - **AND** populate each file as TOML that sets a stage-specific `description = "<summary>"` and a multi-line `prompt = """` block with the shared OpenSpec template
250
+ - **AND** wrap the OpenSpec managed markers (`<!-- OPENSPEC:START -->` / `<!-- OPENSPEC:END -->`) inside the `prompt` value so `openspec update` can safely refresh the body between markers without touching the TOML framing
251
+ - **AND** ensure the slash-command copy matches the existing proposal/apply/archive templates used by other tools
252
+
253
+ #### Scenario: Generating slash commands for iFlow CLI
254
+ - **WHEN** the user selects iFlow CLI during initialization
255
+ - **THEN** create `.iflow/commands/openspec-proposal.md`, `.iflow/commands/openspec-apply.md`, and `.iflow/commands/openspec-archive.md`
256
+ - **AND** populate each file from shared templates so command text matches other tools
257
+ - **AND** include YAML frontmatter with `name`, `id`, `category`, and `description` fields for each command
258
+ - **AND** wrap the generated content in OpenSpec managed markers so `openspec update` can safely refresh the commands
259
+ - **AND** each template includes instructions for the relevant OpenSpec workflow stage
260
+
261
+ #### Scenario: Generating slash commands for RooCode
262
+ - **WHEN** the user selects RooCode during initialization
263
+ - **THEN** create `.roo/commands/openspec-proposal.md`, `.roo/commands/openspec-apply.md`, and `.roo/commands/openspec-archive.md`
264
+ - **AND** populate each file from shared templates so command text matches other tools
265
+ - **AND** include simple Markdown headings (e.g., `# OpenSpec: Proposal`) without YAML frontmatter
266
+ - **AND** wrap the generated content in OpenSpec managed markers where applicable so `openspec update` can safely refresh the commands
267
+ - **AND** each template includes instructions for the relevant OpenSpec workflow stage
268
+
269
+ ### Requirement: Non-Interactive Mode
270
+ The command SHALL support non-interactive operation through command-line options for automation and CI/CD use cases.
271
+
272
+ #### Scenario: Select all tools non-interactively
273
+ - **WHEN** run with `--tools all`
274
+ - **THEN** automatically select every available AI tool without prompting
275
+ - **AND** proceed with initialization using the selected tools
276
+
277
+ #### Scenario: Select specific tools non-interactively
278
+ - **WHEN** run with `--tools claude,cursor`
279
+ - **THEN** parse the comma-separated tool IDs and validate against available tools
280
+ - **AND** proceed with initialization using only the specified valid tools
281
+
282
+ #### Scenario: Skip tool configuration non-interactively
283
+ - **WHEN** run with `--tools none`
284
+ - **THEN** skip AI tool configuration entirely
285
+ - **AND** only create the OpenSpec directory structure and template files
286
+
287
+ #### Scenario: Invalid tool specification
288
+ - **WHEN** run with `--tools` containing any IDs not present in the AI tool registry
289
+ - **THEN** exit with code 1 and display available values (`all`, `none`, or the supported tool IDs)
290
+
291
+ #### Scenario: Help text lists available tool IDs
292
+ - **WHEN** displaying CLI help for `openspec init`
293
+ - **THEN** show the `--tools` option description with the valid values derived from the AI tool registry
294
+
295
+ ### Requirement: Root instruction stub
296
+ `openspec init` SHALL always scaffold the root-level `AGENTS.md` hand-off so every teammate finds the primary OpenSpec instructions.
297
+
298
+ #### Scenario: Creating root `AGENTS.md`
299
+ - **GIVEN** the project may or may not already contain an `AGENTS.md` file
300
+ - **WHEN** initialization completes in fresh or extend mode
301
+ - **THEN** create or refresh `AGENTS.md` at the repository root using the managed marker block from `TemplateManager.getAgentsStandardTemplate()`
302
+ - **AND** preserve any existing content outside the managed markers while replacing the stub text inside them
303
+ - **AND** create the stub regardless of which native AI tools are selected
304
+
305
+ ## Why
306
+
307
+ Manual creation of OpenSpec structure is error-prone and creates adoption friction. A standardized init command ensures:
308
+ - Consistent structure across all projects
309
+ - Proper AI instruction files are always included
310
+ - Quick onboarding for new projects
311
+ - Clear conventions from the start