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,23 @@
1
+ import path from 'path';
2
+ import { ToolConfigurator } from './base.js';
3
+ import { FileSystemUtils } from '../../utils/file-system.js';
4
+ import { TemplateManager } from '../templates/index.js';
5
+ import { OPENSPEC_MARKERS } from '../config.js';
6
+
7
+ export class ClaudeConfigurator implements ToolConfigurator {
8
+ name = 'Claude Code';
9
+ configFileName = 'CLAUDE.md';
10
+ isAvailable = true;
11
+
12
+ async configure(projectPath: string, openspecDir: string): Promise<void> {
13
+ const filePath = path.join(projectPath, this.configFileName);
14
+ const content = TemplateManager.getClaudeTemplate();
15
+
16
+ await FileSystemUtils.updateFileWithMarkers(
17
+ filePath,
18
+ content,
19
+ OPENSPEC_MARKERS.start,
20
+ OPENSPEC_MARKERS.end
21
+ );
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ import path from 'path';
2
+ import { ToolConfigurator } from './base.js';
3
+ import { FileSystemUtils } from '../../utils/file-system.js';
4
+ import { TemplateManager } from '../templates/index.js';
5
+ import { OPENSPEC_MARKERS } from '../config.js';
6
+
7
+ export class ClineConfigurator implements ToolConfigurator {
8
+ name = 'Cline';
9
+ configFileName = 'CLINE.md';
10
+ isAvailable = true;
11
+
12
+ async configure(projectPath: string, openspecDir: string): Promise<void> {
13
+ const filePath = path.join(projectPath, this.configFileName);
14
+ const content = TemplateManager.getClineTemplate();
15
+
16
+ await FileSystemUtils.updateFileWithMarkers(
17
+ filePath,
18
+ content,
19
+ OPENSPEC_MARKERS.start,
20
+ OPENSPEC_MARKERS.end
21
+ );
22
+ }
23
+ }
@@ -0,0 +1,24 @@
1
+ import path from 'path';
2
+ import { ToolConfigurator } from './base.js';
3
+ import { FileSystemUtils } from '../../utils/file-system.js';
4
+ import { TemplateManager } from '../templates/index.js';
5
+ import { OPENSPEC_MARKERS } from '../config.js';
6
+
7
+ export class CodeBuddyConfigurator implements ToolConfigurator {
8
+ name = 'CodeBuddy';
9
+ configFileName = 'CODEBUDDY.md';
10
+ isAvailable = true;
11
+
12
+ async configure(projectPath: string, openspecDir: string): Promise<void> {
13
+ const filePath = path.join(projectPath, this.configFileName);
14
+ const content = TemplateManager.getClaudeTemplate();
15
+
16
+ await FileSystemUtils.updateFileWithMarkers(
17
+ filePath,
18
+ content,
19
+ OPENSPEC_MARKERS.start,
20
+ OPENSPEC_MARKERS.end
21
+ );
22
+ }
23
+ }
24
+
@@ -0,0 +1,23 @@
1
+ import path from 'path';
2
+ import { ToolConfigurator } from './base.js';
3
+ import { FileSystemUtils } from '../../utils/file-system.js';
4
+ import { TemplateManager } from '../templates/index.js';
5
+ import { OPENSPEC_MARKERS } from '../config.js';
6
+
7
+ export class CostrictConfigurator implements ToolConfigurator {
8
+ name = 'CoStrict';
9
+ configFileName = 'COSTRICT.md';
10
+ isAvailable = true;
11
+
12
+ async configure(projectPath: string, openspecDir: string): Promise<void> {
13
+ const filePath = path.join(projectPath, this.configFileName);
14
+ const content = TemplateManager.getCostrictTemplate();
15
+
16
+ await FileSystemUtils.updateFileWithMarkers(
17
+ filePath,
18
+ content,
19
+ OPENSPEC_MARKERS.start,
20
+ OPENSPEC_MARKERS.end
21
+ );
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ import path from "path";
2
+ import { ToolConfigurator } from "./base.js";
3
+ import { FileSystemUtils } from "../../utils/file-system.js";
4
+ import { TemplateManager } from "../templates/index.js";
5
+ import { OPENSPEC_MARKERS } from "../config.js";
6
+
7
+ export class IflowConfigurator implements ToolConfigurator {
8
+ name = "iFlow";
9
+ configFileName = "IFLOW.md";
10
+ isAvailable = true;
11
+
12
+ async configure(projectPath: string, openspecDir: string): Promise<void> {
13
+ const filePath = path.join(projectPath, this.configFileName);
14
+ const content = TemplateManager.getClaudeTemplate();
15
+
16
+ await FileSystemUtils.updateFileWithMarkers(
17
+ filePath,
18
+ content,
19
+ OPENSPEC_MARKERS.start,
20
+ OPENSPEC_MARKERS.end
21
+ );
22
+ }
23
+ }
@@ -0,0 +1,53 @@
1
+ import path from 'path';
2
+ import { ToolConfigurator } from './base.js';
3
+ import { FileSystemUtils } from '../../utils/file-system.js';
4
+ import { TemplateManager } from '../templates/index.js';
5
+ import { OPENSPEC_MARKERS } from '../config.js';
6
+
7
+ /**
8
+ * Qoder AI Tool Configurator
9
+ *
10
+ * Configures OpenSpec integration for Qoder AI coding assistant.
11
+ * Creates and manages QODER.md configuration file with OpenSpec instructions.
12
+ *
13
+ * @implements {ToolConfigurator}
14
+ */
15
+ export class QoderConfigurator implements ToolConfigurator {
16
+ /** Display name for the Qoder tool */
17
+ name = 'Qoder';
18
+
19
+ /** Configuration file name at project root */
20
+ configFileName = 'QODER.md';
21
+
22
+ /** Indicates tool is available for configuration */
23
+ isAvailable = true;
24
+
25
+ /**
26
+ * Configure Qoder integration for a project
27
+ *
28
+ * Creates or updates QODER.md file with OpenSpec instructions.
29
+ * Uses Claude-compatible template for instruction content.
30
+ * Wrapped with OpenSpec markers for future updates.
31
+ *
32
+ * @param {string} projectPath - Absolute path to project root directory
33
+ * @param {string} openspecDir - Path to openspec directory (unused but required by interface)
34
+ * @returns {Promise<void>} Resolves when configuration is complete
35
+ */
36
+ async configure(projectPath: string, openspecDir: string): Promise<void> {
37
+ // Construct full path to QODER.md at project root
38
+ const filePath = path.join(projectPath, this.configFileName);
39
+
40
+ // Get Claude-compatible instruction template
41
+ // This ensures Qoder receives the same high-quality OpenSpec instructions
42
+ const content = TemplateManager.getClaudeTemplate();
43
+
44
+ // Write or update file with managed content between markers
45
+ // This allows future updates to refresh instructions automatically
46
+ await FileSystemUtils.updateFileWithMarkers(
47
+ filePath,
48
+ content,
49
+ OPENSPEC_MARKERS.start,
50
+ OPENSPEC_MARKERS.end
51
+ );
52
+ }
53
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Qwen Code configurator for OpenSpec integration.
3
+ * This class handles the configuration of Qwen Code as an AI tool within OpenSpec.
4
+ *
5
+ * @implements {ToolConfigurator}
6
+ */
7
+ import path from 'path';
8
+ import { ToolConfigurator } from './base.js';
9
+ import { FileSystemUtils } from '../../utils/file-system.js';
10
+ import { TemplateManager } from '../templates/index.js';
11
+ import { OPENSPEC_MARKERS } from '../config.js';
12
+
13
+ /**
14
+ * QwenConfigurator class provides integration with Qwen Code
15
+ * by creating and managing the necessary configuration files.
16
+ * Currently configures the QWEN.md file with OpenSpec instructions.
17
+ */
18
+ export class QwenConfigurator implements ToolConfigurator {
19
+ /** Display name for the Qwen Code tool */
20
+ name = 'Qwen Code';
21
+
22
+ /** Configuration file name for Qwen Code */
23
+ configFileName = 'QWEN.md';
24
+
25
+ /** Availability status for the Qwen Code tool */
26
+ isAvailable = true;
27
+
28
+ /**
29
+ * Configures the Qwen Code integration by creating or updating the QWEN.md file
30
+ * with OpenSpec instructions and markers.
31
+ *
32
+ * @param {string} projectPath - The path to the project root
33
+ * @param {string} _openspecDir - The path to the openspec directory (unused)
34
+ * @returns {Promise<void>} A promise that resolves when configuration is complete
35
+ */
36
+ async configure(projectPath: string, _openspecDir: string): Promise<void> {
37
+ const filePath = path.join(projectPath, this.configFileName);
38
+ const content = TemplateManager.getAgentsStandardTemplate();
39
+
40
+ await FileSystemUtils.updateFileWithMarkers(
41
+ filePath,
42
+ content,
43
+ OPENSPEC_MARKERS.start,
44
+ OPENSPEC_MARKERS.end
45
+ );
46
+ }
47
+ }
@@ -0,0 +1,49 @@
1
+ import { ToolConfigurator } from './base.js';
2
+ import { ClaudeConfigurator } from './claude.js';
3
+ import { ClineConfigurator } from './cline.js';
4
+ import { CodeBuddyConfigurator } from './codebuddy.js';
5
+ import { CostrictConfigurator } from './costrict.js';
6
+ import { QoderConfigurator } from './qoder.js';
7
+ import { IflowConfigurator } from './iflow.js';
8
+ import { AgentsStandardConfigurator } from './agents.js';
9
+ import { QwenConfigurator } from './qwen.js';
10
+
11
+ export class ToolRegistry {
12
+ private static tools: Map<string, ToolConfigurator> = new Map();
13
+
14
+ static {
15
+ const claudeConfigurator = new ClaudeConfigurator();
16
+ const clineConfigurator = new ClineConfigurator();
17
+ const codeBuddyConfigurator = new CodeBuddyConfigurator();
18
+ const costrictConfigurator = new CostrictConfigurator();
19
+ const qoderConfigurator = new QoderConfigurator();
20
+ const iflowConfigurator = new IflowConfigurator();
21
+ const agentsConfigurator = new AgentsStandardConfigurator();
22
+ const qwenConfigurator = new QwenConfigurator();
23
+ // Register with the ID that matches the checkbox value
24
+ this.tools.set('claude', claudeConfigurator);
25
+ this.tools.set('cline', clineConfigurator);
26
+ this.tools.set('codebuddy', codeBuddyConfigurator);
27
+ this.tools.set('costrict', costrictConfigurator);
28
+ this.tools.set('qoder', qoderConfigurator);
29
+ this.tools.set('iflow', iflowConfigurator);
30
+ this.tools.set('agents', agentsConfigurator);
31
+ this.tools.set('qwen', qwenConfigurator);
32
+ }
33
+
34
+ static register(tool: ToolConfigurator): void {
35
+ this.tools.set(tool.name.toLowerCase().replace(/\s+/g, '-'), tool);
36
+ }
37
+
38
+ static get(toolId: string): ToolConfigurator | undefined {
39
+ return this.tools.get(toolId);
40
+ }
41
+
42
+ static getAll(): ToolConfigurator[] {
43
+ return Array.from(this.tools.values());
44
+ }
45
+
46
+ static getAvailable(): ToolConfigurator[] {
47
+ return this.getAll().filter(tool => tool.isAvailable);
48
+ }
49
+ }
@@ -0,0 +1,51 @@
1
+ import { SlashCommandConfigurator } from './base.js';
2
+ import { SlashCommandId } from '../../templates/index.js';
3
+
4
+ const FILE_PATHS: Record<SlashCommandId, string> = {
5
+ proposal: '.amazonq/prompts/openspec-proposal.md',
6
+ apply: '.amazonq/prompts/openspec-apply.md',
7
+ archive: '.amazonq/prompts/openspec-archive.md'
8
+ };
9
+
10
+ const FRONTMATTER: Record<SlashCommandId, string> = {
11
+ proposal: `---
12
+ description: Scaffold a new OpenSpec change and validate strictly.
13
+ ---
14
+
15
+ The user has requested the following change proposal. Use the openspec instructions to create their change proposal.
16
+
17
+ <UserRequest>
18
+ $ARGUMENTS
19
+ </UserRequest>`,
20
+ apply: `---
21
+ description: Implement an approved OpenSpec change and keep tasks in sync.
22
+ ---
23
+
24
+ The user wants to apply the following change. Use the openspec instructions to implement the approved change.
25
+
26
+ <ChangeId>
27
+ $ARGUMENTS
28
+ </ChangeId>`,
29
+ archive: `---
30
+ description: Archive a deployed OpenSpec change and update specs.
31
+ ---
32
+
33
+ The user wants to archive the following deployed change. Use the openspec instructions to archive the change and update specs.
34
+
35
+ <ChangeId>
36
+ $ARGUMENTS
37
+ </ChangeId>`
38
+ };
39
+
40
+ export class AmazonQSlashCommandConfigurator extends SlashCommandConfigurator {
41
+ readonly toolId = 'amazon-q';
42
+ readonly isAvailable = true;
43
+
44
+ protected getRelativePath(id: SlashCommandId): string {
45
+ return FILE_PATHS[id];
46
+ }
47
+
48
+ protected getFrontmatter(id: SlashCommandId): string {
49
+ return FRONTMATTER[id];
50
+ }
51
+ }
@@ -0,0 +1,28 @@
1
+ import { SlashCommandConfigurator } from './base.js';
2
+ import { SlashCommandId } from '../../templates/index.js';
3
+
4
+ const FILE_PATHS: Record<SlashCommandId, string> = {
5
+ proposal: '.agent/workflows/openspec-proposal.md',
6
+ apply: '.agent/workflows/openspec-apply.md',
7
+ archive: '.agent/workflows/openspec-archive.md'
8
+ };
9
+
10
+ const DESCRIPTIONS: Record<SlashCommandId, string> = {
11
+ proposal: 'Scaffold a new OpenSpec change and validate strictly.',
12
+ apply: 'Implement an approved OpenSpec change and keep tasks in sync.',
13
+ archive: 'Archive a deployed OpenSpec change and update specs.'
14
+ };
15
+
16
+ export class AntigravitySlashCommandConfigurator extends SlashCommandConfigurator {
17
+ readonly toolId = 'antigravity';
18
+ readonly isAvailable = true;
19
+
20
+ protected getRelativePath(id: SlashCommandId): string {
21
+ return FILE_PATHS[id];
22
+ }
23
+
24
+ protected getFrontmatter(id: SlashCommandId): string | undefined {
25
+ const description = DESCRIPTIONS[id];
26
+ return `---\ndescription: ${description}\n---`;
27
+ }
28
+ }
@@ -0,0 +1,37 @@
1
+ import { SlashCommandConfigurator } from './base.js';
2
+ import { SlashCommandId } from '../../templates/index.js';
3
+
4
+ const FILE_PATHS: Record<SlashCommandId, string> = {
5
+ proposal: '.augment/commands/openspec-proposal.md',
6
+ apply: '.augment/commands/openspec-apply.md',
7
+ archive: '.augment/commands/openspec-archive.md'
8
+ };
9
+
10
+ const FRONTMATTER: Record<SlashCommandId, string> = {
11
+ proposal: `---
12
+ description: Scaffold a new OpenSpec change and validate strictly.
13
+ argument-hint: feature description or request
14
+ ---`,
15
+ apply: `---
16
+ description: Implement an approved OpenSpec change and keep tasks in sync.
17
+ argument-hint: change-id
18
+ ---`,
19
+ archive: `---
20
+ description: Archive a deployed OpenSpec change and update specs.
21
+ argument-hint: change-id
22
+ ---`
23
+ };
24
+
25
+ export class AuggieSlashCommandConfigurator extends SlashCommandConfigurator {
26
+ readonly toolId = 'auggie';
27
+ readonly isAvailable = true;
28
+
29
+ protected getRelativePath(id: SlashCommandId): string {
30
+ return FILE_PATHS[id];
31
+ }
32
+
33
+ protected getFrontmatter(id: SlashCommandId): string {
34
+ return FRONTMATTER[id];
35
+ }
36
+ }
37
+
@@ -0,0 +1,95 @@
1
+ import { FileSystemUtils } from '../../../utils/file-system.js';
2
+ import { TemplateManager, SlashCommandId } from '../../templates/index.js';
3
+ import { OPENSPEC_MARKERS } from '../../config.js';
4
+
5
+ export interface SlashCommandTarget {
6
+ id: SlashCommandId;
7
+ path: string;
8
+ kind: 'slash';
9
+ }
10
+
11
+ const ALL_COMMANDS: SlashCommandId[] = ['proposal', 'apply', 'archive'];
12
+
13
+ export abstract class SlashCommandConfigurator {
14
+ abstract readonly toolId: string;
15
+ abstract readonly isAvailable: boolean;
16
+
17
+ getTargets(): SlashCommandTarget[] {
18
+ return ALL_COMMANDS.map((id) => ({
19
+ id,
20
+ path: this.getRelativePath(id),
21
+ kind: 'slash'
22
+ }));
23
+ }
24
+
25
+ async generateAll(projectPath: string, _openspecDir: string): Promise<string[]> {
26
+ const createdOrUpdated: string[] = [];
27
+
28
+ for (const target of this.getTargets()) {
29
+ const body = this.getBody(target.id);
30
+ const filePath = FileSystemUtils.joinPath(projectPath, target.path);
31
+
32
+ if (await FileSystemUtils.fileExists(filePath)) {
33
+ await this.updateBody(filePath, body);
34
+ } else {
35
+ const frontmatter = this.getFrontmatter(target.id);
36
+ const sections: string[] = [];
37
+ if (frontmatter) {
38
+ sections.push(frontmatter.trim());
39
+ }
40
+ sections.push(`${OPENSPEC_MARKERS.start}\n${body}\n${OPENSPEC_MARKERS.end}`);
41
+ const content = sections.join('\n') + '\n';
42
+ await FileSystemUtils.writeFile(filePath, content);
43
+ }
44
+
45
+ createdOrUpdated.push(target.path);
46
+ }
47
+
48
+ return createdOrUpdated;
49
+ }
50
+
51
+ async updateExisting(projectPath: string, _openspecDir: string): Promise<string[]> {
52
+ const updated: string[] = [];
53
+
54
+ for (const target of this.getTargets()) {
55
+ const filePath = FileSystemUtils.joinPath(projectPath, target.path);
56
+ if (await FileSystemUtils.fileExists(filePath)) {
57
+ const body = this.getBody(target.id);
58
+ await this.updateBody(filePath, body);
59
+ updated.push(target.path);
60
+ }
61
+ }
62
+
63
+ return updated;
64
+ }
65
+
66
+ protected abstract getRelativePath(id: SlashCommandId): string;
67
+ protected abstract getFrontmatter(id: SlashCommandId): string | undefined;
68
+
69
+ protected getBody(id: SlashCommandId): string {
70
+ return TemplateManager.getSlashCommandBody(id).trim();
71
+ }
72
+
73
+ // Resolve absolute path for a given slash command target. Subclasses may override
74
+ // to redirect to tool-specific locations (e.g., global directories).
75
+ resolveAbsolutePath(projectPath: string, id: SlashCommandId): string {
76
+ const rel = this.getRelativePath(id);
77
+ return FileSystemUtils.joinPath(projectPath, rel);
78
+ }
79
+
80
+ protected async updateBody(filePath: string, body: string): Promise<void> {
81
+ const content = await FileSystemUtils.readFile(filePath);
82
+ const startIndex = content.indexOf(OPENSPEC_MARKERS.start);
83
+ const endIndex = content.indexOf(OPENSPEC_MARKERS.end);
84
+
85
+ if (startIndex === -1 || endIndex === -1 || endIndex <= startIndex) {
86
+ throw new Error(`Missing OpenSpec markers in ${filePath}`);
87
+ }
88
+
89
+ const before = content.slice(0, startIndex + OPENSPEC_MARKERS.start.length);
90
+ const after = content.slice(endIndex);
91
+ const updatedContent = `${before}\n${body}\n${after}`;
92
+
93
+ await FileSystemUtils.writeFile(filePath, updatedContent);
94
+ }
95
+ }
@@ -0,0 +1,42 @@
1
+ import { SlashCommandConfigurator } from './base.js';
2
+ import { SlashCommandId } from '../../templates/index.js';
3
+
4
+ const FILE_PATHS: Record<SlashCommandId, string> = {
5
+ proposal: '.claude/commands/openspec/proposal.md',
6
+ apply: '.claude/commands/openspec/apply.md',
7
+ archive: '.claude/commands/openspec/archive.md'
8
+ };
9
+
10
+ const FRONTMATTER: Record<SlashCommandId, string> = {
11
+ proposal: `---
12
+ name: OpenSpec: Proposal
13
+ description: Scaffold a new OpenSpec change and validate strictly.
14
+ category: OpenSpec
15
+ tags: [openspec, change]
16
+ ---`,
17
+ apply: `---
18
+ name: OpenSpec: Apply
19
+ description: Implement an approved OpenSpec change and keep tasks in sync.
20
+ category: OpenSpec
21
+ tags: [openspec, apply]
22
+ ---`,
23
+ archive: `---
24
+ name: OpenSpec: Archive
25
+ description: Archive a deployed OpenSpec change and update specs.
26
+ category: OpenSpec
27
+ tags: [openspec, archive]
28
+ ---`
29
+ };
30
+
31
+ export class ClaudeSlashCommandConfigurator extends SlashCommandConfigurator {
32
+ readonly toolId = 'claude';
33
+ readonly isAvailable = true;
34
+
35
+ protected getRelativePath(id: SlashCommandId): string {
36
+ return FILE_PATHS[id];
37
+ }
38
+
39
+ protected getFrontmatter(id: SlashCommandId): string {
40
+ return FRONTMATTER[id];
41
+ }
42
+ }
@@ -0,0 +1,27 @@
1
+ import { SlashCommandConfigurator } from './base.js';
2
+ import { SlashCommandId } from '../../templates/index.js';
3
+
4
+ const FILE_PATHS: Record<SlashCommandId, string> = {
5
+ proposal: '.clinerules/workflows/openspec-proposal.md',
6
+ apply: '.clinerules/workflows/openspec-apply.md',
7
+ archive: '.clinerules/workflows/openspec-archive.md'
8
+ };
9
+
10
+ export class ClineSlashCommandConfigurator extends SlashCommandConfigurator {
11
+ readonly toolId = 'cline';
12
+ readonly isAvailable = true;
13
+
14
+ protected getRelativePath(id: SlashCommandId): string {
15
+ return FILE_PATHS[id];
16
+ }
17
+
18
+ protected getFrontmatter(id: SlashCommandId): string | undefined {
19
+ const descriptions: Record<SlashCommandId, string> = {
20
+ proposal: 'Scaffold a new OpenSpec change and validate strictly.',
21
+ apply: 'Implement an approved OpenSpec change and keep tasks in sync.',
22
+ archive: 'Archive a deployed OpenSpec change and update specs.'
23
+ };
24
+ const description = descriptions[id];
25
+ return `# OpenSpec: ${id.charAt(0).toUpperCase() + id.slice(1)}\n\n${description}`;
26
+ }
27
+ }
@@ -0,0 +1,43 @@
1
+ import { SlashCommandConfigurator } from './base.js';
2
+ import { SlashCommandId } from '../../templates/index.js';
3
+
4
+ const FILE_PATHS: Record<SlashCommandId, string> = {
5
+ proposal: '.codebuddy/commands/openspec/proposal.md',
6
+ apply: '.codebuddy/commands/openspec/apply.md',
7
+ archive: '.codebuddy/commands/openspec/archive.md'
8
+ };
9
+
10
+ const FRONTMATTER: Record<SlashCommandId, string> = {
11
+ proposal: `---
12
+ name: OpenSpec: Proposal
13
+ description: Scaffold a new OpenSpec change and validate strictly.
14
+ category: OpenSpec
15
+ tags: [openspec, change]
16
+ ---`,
17
+ apply: `---
18
+ name: OpenSpec: Apply
19
+ description: Implement an approved OpenSpec change and keep tasks in sync.
20
+ category: OpenSpec
21
+ tags: [openspec, apply]
22
+ ---`,
23
+ archive: `---
24
+ name: OpenSpec: Archive
25
+ description: Archive a deployed OpenSpec change and update specs.
26
+ category: OpenSpec
27
+ tags: [openspec, archive]
28
+ ---`
29
+ };
30
+
31
+ export class CodeBuddySlashCommandConfigurator extends SlashCommandConfigurator {
32
+ readonly toolId = 'codebuddy';
33
+ readonly isAvailable = true;
34
+
35
+ protected getRelativePath(id: SlashCommandId): string {
36
+ return FILE_PATHS[id];
37
+ }
38
+
39
+ protected getFrontmatter(id: SlashCommandId): string {
40
+ return FRONTMATTER[id];
41
+ }
42
+ }
43
+