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,126 @@
1
+ import path from "path";
2
+ import os from "os";
3
+ import { SlashCommandConfigurator } from "./base.js";
4
+ import { SlashCommandId, TemplateManager } from "../../templates/index.js";
5
+ import { FileSystemUtils } from "../../../utils/file-system.js";
6
+ import { OPENSPEC_MARKERS } from "../../config.js";
7
+
8
+ // Use POSIX-style paths for consistent logging across platforms.
9
+ const FILE_PATHS: Record<SlashCommandId, string> = {
10
+ proposal: ".codex/prompts/openspec-proposal.md",
11
+ apply: ".codex/prompts/openspec-apply.md",
12
+ archive: ".codex/prompts/openspec-archive.md",
13
+ };
14
+
15
+ export class CodexSlashCommandConfigurator extends SlashCommandConfigurator {
16
+ readonly toolId = "codex";
17
+ readonly isAvailable = true;
18
+
19
+ protected getRelativePath(id: SlashCommandId): string {
20
+ return FILE_PATHS[id];
21
+ }
22
+
23
+ protected getFrontmatter(id: SlashCommandId): string | undefined {
24
+ // Codex supports YAML frontmatter with description and argument-hint fields,
25
+ // plus $ARGUMENTS to capture all arguments as a single string.
26
+ const frontmatter: Record<SlashCommandId, string> = {
27
+ proposal: `---
28
+ description: Scaffold a new OpenSpec change and validate strictly.
29
+ argument-hint: request or feature description
30
+ ---
31
+
32
+ $ARGUMENTS`,
33
+ apply: `---
34
+ description: Implement an approved OpenSpec change and keep tasks in sync.
35
+ argument-hint: change-id
36
+ ---
37
+
38
+ $ARGUMENTS`,
39
+ archive: `---
40
+ description: Archive a deployed OpenSpec change and update specs.
41
+ argument-hint: change-id
42
+ ---
43
+
44
+ $ARGUMENTS`,
45
+ };
46
+ return frontmatter[id];
47
+ }
48
+
49
+ private getGlobalPromptsDir(): string {
50
+ const home = (process.env.CODEX_HOME && process.env.CODEX_HOME.trim())
51
+ ? process.env.CODEX_HOME.trim()
52
+ : FileSystemUtils.joinPath(os.homedir(), ".codex");
53
+ return FileSystemUtils.joinPath(home, "prompts");
54
+ }
55
+
56
+ // Codex discovers prompts globally. Generate directly in the global directory
57
+ // and wrap shared body with markers.
58
+ async generateAll(projectPath: string, _openspecDir: string): Promise<string[]> {
59
+ const createdOrUpdated: string[] = [];
60
+ for (const target of this.getTargets()) {
61
+ const body = TemplateManager.getSlashCommandBody(target.id).trim();
62
+ const promptsDir = this.getGlobalPromptsDir();
63
+ const filePath = FileSystemUtils.joinPath(
64
+ promptsDir,
65
+ path.basename(target.path)
66
+ );
67
+
68
+ await FileSystemUtils.createDirectory(path.dirname(filePath));
69
+
70
+ if (await FileSystemUtils.fileExists(filePath)) {
71
+ await this.updateFullFile(filePath, target.id, body);
72
+ } else {
73
+ const frontmatter = this.getFrontmatter(target.id);
74
+ const sections: string[] = [];
75
+ if (frontmatter) sections.push(frontmatter.trim());
76
+ sections.push(`${OPENSPEC_MARKERS.start}\n${body}\n${OPENSPEC_MARKERS.end}`);
77
+ await FileSystemUtils.writeFile(filePath, sections.join("\n") + "\n");
78
+ }
79
+
80
+ createdOrUpdated.push(target.path);
81
+ }
82
+ return createdOrUpdated;
83
+ }
84
+
85
+ async updateExisting(projectPath: string, _openspecDir: string): Promise<string[]> {
86
+ const updated: string[] = [];
87
+ for (const target of this.getTargets()) {
88
+ const promptsDir = this.getGlobalPromptsDir();
89
+ const filePath = FileSystemUtils.joinPath(
90
+ promptsDir,
91
+ path.basename(target.path)
92
+ );
93
+ if (await FileSystemUtils.fileExists(filePath)) {
94
+ const body = TemplateManager.getSlashCommandBody(target.id).trim();
95
+ await this.updateFullFile(filePath, target.id, body);
96
+ updated.push(target.path);
97
+ }
98
+ }
99
+ return updated;
100
+ }
101
+
102
+ // Update both frontmatter and body in an existing file
103
+ private async updateFullFile(filePath: string, id: SlashCommandId, body: string): Promise<void> {
104
+ const content = await FileSystemUtils.readFile(filePath);
105
+ const startIndex = content.indexOf(OPENSPEC_MARKERS.start);
106
+
107
+ if (startIndex === -1) {
108
+ throw new Error(`Missing OpenSpec start marker in ${filePath}`);
109
+ }
110
+
111
+ // Replace everything before the start marker with the new frontmatter
112
+ const frontmatter = this.getFrontmatter(id);
113
+ const sections: string[] = [];
114
+ if (frontmatter) sections.push(frontmatter.trim());
115
+ sections.push(`${OPENSPEC_MARKERS.start}\n${body}\n${OPENSPEC_MARKERS.end}`);
116
+
117
+ await FileSystemUtils.writeFile(filePath, sections.join("\n") + "\n");
118
+ }
119
+
120
+ // Resolve to the global prompts location for configuration detection
121
+ resolveAbsolutePath(_projectPath: string, id: SlashCommandId): string {
122
+ const promptsDir = this.getGlobalPromptsDir();
123
+ const fileName = path.basename(FILE_PATHS[id]);
124
+ return FileSystemUtils.joinPath(promptsDir, fileName);
125
+ }
126
+ }
@@ -0,0 +1,36 @@
1
+ import { SlashCommandConfigurator } from './base.js';
2
+ import { SlashCommandId } from '../../templates/index.js';
3
+
4
+ const FILE_PATHS = {
5
+ proposal: '.cospec/openspec/commands/openspec-proposal.md',
6
+ apply: '.cospec/openspec/commands/openspec-apply.md',
7
+ archive: '.cospec/openspec/commands/openspec-archive.md',
8
+ } as const satisfies Record<SlashCommandId, string>;
9
+
10
+ const FRONTMATTER = {
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
+ } as const satisfies Record<SlashCommandId, string>;
24
+
25
+ export class CostrictSlashCommandConfigurator extends SlashCommandConfigurator {
26
+ readonly toolId = 'costrict';
27
+ readonly isAvailable = true;
28
+
29
+ protected getRelativePath(id: SlashCommandId): string {
30
+ return FILE_PATHS[id];
31
+ }
32
+
33
+ protected getFrontmatter(id: SlashCommandId): string | undefined {
34
+ return FRONTMATTER[id];
35
+ }
36
+ }
@@ -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: '.crush/commands/openspec/proposal.md',
6
+ apply: '.crush/commands/openspec/apply.md',
7
+ archive: '.crush/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 CrushSlashCommandConfigurator extends SlashCommandConfigurator {
32
+ readonly toolId = 'crush';
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,42 @@
1
+ import { SlashCommandConfigurator } from './base.js';
2
+ import { SlashCommandId } from '../../templates/index.js';
3
+
4
+ const FILE_PATHS: Record<SlashCommandId, string> = {
5
+ proposal: '.cursor/commands/openspec-proposal.md',
6
+ apply: '.cursor/commands/openspec-apply.md',
7
+ archive: '.cursor/commands/openspec-archive.md'
8
+ };
9
+
10
+ const FRONTMATTER: Record<SlashCommandId, string> = {
11
+ proposal: `---
12
+ name: /openspec-proposal
13
+ id: openspec-proposal
14
+ category: OpenSpec
15
+ description: Scaffold a new OpenSpec change and validate strictly.
16
+ ---`,
17
+ apply: `---
18
+ name: /openspec-apply
19
+ id: openspec-apply
20
+ category: OpenSpec
21
+ description: Implement an approved OpenSpec change and keep tasks in sync.
22
+ ---`,
23
+ archive: `---
24
+ name: /openspec-archive
25
+ id: openspec-archive
26
+ category: OpenSpec
27
+ description: Archive a deployed OpenSpec change and update specs.
28
+ ---`
29
+ };
30
+
31
+ export class CursorSlashCommandConfigurator extends SlashCommandConfigurator {
32
+ readonly toolId = 'cursor';
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,41 @@
1
+ import { SlashCommandConfigurator } from './base.js';
2
+ import { SlashCommandId } from '../../templates/index.js';
3
+
4
+ const FILE_PATHS: Record<SlashCommandId, string> = {
5
+ proposal: '.factory/commands/openspec-proposal.md',
6
+ apply: '.factory/commands/openspec-apply.md',
7
+ archive: '.factory/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: request or feature description
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 FactorySlashCommandConfigurator extends SlashCommandConfigurator {
26
+ readonly toolId = 'factory';
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
+ protected getBody(id: SlashCommandId): string {
38
+ const baseBody = super.getBody(id);
39
+ return `${baseBody}\n\n$ARGUMENTS`;
40
+ }
41
+ }
@@ -0,0 +1,27 @@
1
+ import { TomlSlashCommandConfigurator } from './toml-base.js';
2
+ import { SlashCommandId } from '../../templates/index.js';
3
+
4
+ const FILE_PATHS: Record<SlashCommandId, string> = {
5
+ proposal: '.gemini/commands/openspec/proposal.toml',
6
+ apply: '.gemini/commands/openspec/apply.toml',
7
+ archive: '.gemini/commands/openspec/archive.toml'
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 GeminiSlashCommandConfigurator extends TomlSlashCommandConfigurator {
17
+ readonly toolId = 'gemini';
18
+ readonly isAvailable = true;
19
+
20
+ protected getRelativePath(id: SlashCommandId): string {
21
+ return FILE_PATHS[id];
22
+ }
23
+
24
+ protected getDescription(id: SlashCommandId): string {
25
+ return DESCRIPTIONS[id];
26
+ }
27
+ }
@@ -0,0 +1,39 @@
1
+ import { SlashCommandConfigurator } from './base.js';
2
+ import { SlashCommandId } from '../../templates/index.js';
3
+
4
+ const FILE_PATHS: Record<SlashCommandId, string> = {
5
+ proposal: '.github/prompts/openspec-proposal.prompt.md',
6
+ apply: '.github/prompts/openspec-apply.prompt.md',
7
+ archive: '.github/prompts/openspec-archive.prompt.md'
8
+ };
9
+
10
+ const FRONTMATTER: Record<SlashCommandId, string> = {
11
+ proposal: `---
12
+ description: Scaffold a new OpenSpec change and validate strictly.
13
+ ---
14
+
15
+ $ARGUMENTS`,
16
+ apply: `---
17
+ description: Implement an approved OpenSpec change and keep tasks in sync.
18
+ ---
19
+
20
+ $ARGUMENTS`,
21
+ archive: `---
22
+ description: Archive a deployed OpenSpec change and update specs.
23
+ ---
24
+
25
+ $ARGUMENTS`
26
+ };
27
+
28
+ export class GitHubCopilotSlashCommandConfigurator extends SlashCommandConfigurator {
29
+ readonly toolId = 'github-copilot';
30
+ readonly isAvailable = true;
31
+
32
+ protected getRelativePath(id: SlashCommandId): string {
33
+ return FILE_PATHS[id];
34
+ }
35
+
36
+ protected getFrontmatter(id: SlashCommandId): string {
37
+ return FRONTMATTER[id];
38
+ }
39
+ }
@@ -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: '.iflow/commands/openspec-proposal.md',
6
+ apply: '.iflow/commands/openspec-apply.md',
7
+ archive: '.iflow/commands/openspec-archive.md'
8
+ };
9
+
10
+ const FRONTMATTER: Record<SlashCommandId, string> = {
11
+ proposal: `---
12
+ name: /openspec-proposal
13
+ id: openspec-proposal
14
+ category: OpenSpec
15
+ description: Scaffold a new OpenSpec change and validate strictly.
16
+ ---`,
17
+ apply: `---
18
+ name: /openspec-apply
19
+ id: openspec-apply
20
+ category: OpenSpec
21
+ description: Implement an approved OpenSpec change and keep tasks in sync.
22
+ ---`,
23
+ archive: `---
24
+ name: /openspec-archive
25
+ id: openspec-archive
26
+ category: OpenSpec
27
+ description: Archive a deployed OpenSpec change and update specs.
28
+ ---`
29
+ };
30
+
31
+ export class IflowSlashCommandConfigurator extends SlashCommandConfigurator {
32
+ readonly toolId = 'iflow';
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,21 @@
1
+ import { SlashCommandConfigurator } from "./base.js";
2
+ import { SlashCommandId } from "../../templates/index.js";
3
+
4
+ const FILE_PATHS: Record<SlashCommandId, string> = {
5
+ proposal: ".kilocode/workflows/openspec-proposal.md",
6
+ apply: ".kilocode/workflows/openspec-apply.md",
7
+ archive: ".kilocode/workflows/openspec-archive.md"
8
+ };
9
+
10
+ export class KiloCodeSlashCommandConfigurator extends SlashCommandConfigurator {
11
+ readonly toolId = "kilocode";
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
+ return undefined;
20
+ }
21
+ }
@@ -0,0 +1,83 @@
1
+ import { SlashCommandConfigurator } from "./base.js";
2
+ import { SlashCommandId } from "../../templates/index.js";
3
+ import { FileSystemUtils } from "../../../utils/file-system.js";
4
+ import { OPENSPEC_MARKERS } from "../../config.js";
5
+
6
+ const FILE_PATHS: Record<SlashCommandId, string> = {
7
+ proposal: ".opencode/command/openspec-proposal.md",
8
+ apply: ".opencode/command/openspec-apply.md",
9
+ archive: ".opencode/command/openspec-archive.md",
10
+ };
11
+
12
+ const FRONTMATTER: Record<SlashCommandId, string> = {
13
+ proposal: `---
14
+ description: Scaffold a new OpenSpec change and validate strictly.
15
+ ---
16
+ The user has requested the following change proposal. Use the openspec instructions to create their change proposal.
17
+ <UserRequest>
18
+ $ARGUMENTS
19
+ </UserRequest>
20
+ `,
21
+ apply: `---
22
+ description: Implement an approved OpenSpec change and keep tasks in sync.
23
+ ---
24
+ The user has requested to implement the following change proposal. Find the change proposal and follow the instructions below. If you're not sure or if ambiguous, ask for clarification from the user.
25
+ <UserRequest>
26
+ $ARGUMENTS
27
+ </UserRequest>
28
+ `,
29
+ archive: `---
30
+ description: Archive a deployed OpenSpec change and update specs.
31
+ ---
32
+ <ChangeId>
33
+ $ARGUMENTS
34
+ </ChangeId>
35
+ `,
36
+ };
37
+
38
+ export class OpenCodeSlashCommandConfigurator extends SlashCommandConfigurator {
39
+ readonly toolId = "opencode";
40
+ readonly isAvailable = true;
41
+
42
+ protected getRelativePath(id: SlashCommandId): string {
43
+ return FILE_PATHS[id];
44
+ }
45
+
46
+ protected getFrontmatter(id: SlashCommandId): string | undefined {
47
+ return FRONTMATTER[id];
48
+ }
49
+
50
+ async generateAll(projectPath: string, _openspecDir: string): Promise<string[]> {
51
+ const createdOrUpdated = await super.generateAll(projectPath, _openspecDir);
52
+ await this.rewriteArchiveFile(projectPath);
53
+ return createdOrUpdated;
54
+ }
55
+
56
+ async updateExisting(projectPath: string, _openspecDir: string): Promise<string[]> {
57
+ const updated = await super.updateExisting(projectPath, _openspecDir);
58
+ const rewroteArchive = await this.rewriteArchiveFile(projectPath);
59
+ if (rewroteArchive && !updated.includes(FILE_PATHS.archive)) {
60
+ updated.push(FILE_PATHS.archive);
61
+ }
62
+ return updated;
63
+ }
64
+
65
+ private async rewriteArchiveFile(projectPath: string): Promise<boolean> {
66
+ const archivePath = FileSystemUtils.joinPath(projectPath, FILE_PATHS.archive);
67
+ if (!await FileSystemUtils.fileExists(archivePath)) {
68
+ return false;
69
+ }
70
+
71
+ const body = this.getBody("archive");
72
+ const frontmatter = this.getFrontmatter("archive");
73
+ const sections: string[] = [];
74
+
75
+ if (frontmatter) {
76
+ sections.push(frontmatter.trim());
77
+ }
78
+
79
+ sections.push(`${OPENSPEC_MARKERS.start}\n${body}\n${OPENSPEC_MARKERS.end}`);
80
+ await FileSystemUtils.writeFile(archivePath, sections.join("\n") + "\n");
81
+ return true;
82
+ }
83
+ }
@@ -0,0 +1,84 @@
1
+ import { SlashCommandConfigurator } from './base.js';
2
+ import { SlashCommandId } from '../../templates/index.js';
3
+
4
+ /**
5
+ * File paths for Qoder slash commands
6
+ * Maps each OpenSpec workflow stage to its command file location
7
+ * Commands are stored in .qoder/commands/openspec/ directory
8
+ */
9
+ const FILE_PATHS: Record<SlashCommandId, string> = {
10
+ // Create and validate new change proposals
11
+ proposal: '.qoder/commands/openspec/proposal.md',
12
+
13
+ // Implement approved changes with task tracking
14
+ apply: '.qoder/commands/openspec/apply.md',
15
+
16
+ // Archive completed changes and update specs
17
+ archive: '.qoder/commands/openspec/archive.md'
18
+ };
19
+
20
+ /**
21
+ * YAML frontmatter for Qoder slash commands
22
+ * Defines metadata displayed in Qoder's command palette
23
+ * Each command is categorized and tagged for easy discovery
24
+ */
25
+ const FRONTMATTER: Record<SlashCommandId, string> = {
26
+ proposal: `---
27
+ name: OpenSpec: Proposal
28
+ description: Scaffold a new OpenSpec change and validate strictly.
29
+ category: OpenSpec
30
+ tags: [openspec, change]
31
+ ---`,
32
+ apply: `---
33
+ name: OpenSpec: Apply
34
+ description: Implement an approved OpenSpec change and keep tasks in sync.
35
+ category: OpenSpec
36
+ tags: [openspec, apply]
37
+ ---`,
38
+ archive: `---
39
+ name: OpenSpec: Archive
40
+ description: Archive a deployed OpenSpec change and update specs.
41
+ category: OpenSpec
42
+ tags: [openspec, archive]
43
+ ---`
44
+ };
45
+
46
+ /**
47
+ * Qoder Slash Command Configurator
48
+ *
49
+ * Manages OpenSpec slash commands for Qoder AI assistant.
50
+ * Creates three workflow commands: proposal, apply, and archive.
51
+ * Uses colon-separated command format (/openspec:proposal).
52
+ *
53
+ * @extends {SlashCommandConfigurator}
54
+ */
55
+ export class QoderSlashCommandConfigurator extends SlashCommandConfigurator {
56
+ /** Unique identifier for Qoder tool */
57
+ readonly toolId = 'qoder';
58
+
59
+ /** Indicates slash commands are available for this tool */
60
+ readonly isAvailable = true;
61
+
62
+ /**
63
+ * Get relative file path for a slash command
64
+ *
65
+ * @param {SlashCommandId} id - Command identifier (proposal, apply, or archive)
66
+ * @returns {string} Relative path from project root to command file
67
+ */
68
+ protected getRelativePath(id: SlashCommandId): string {
69
+ return FILE_PATHS[id];
70
+ }
71
+
72
+ /**
73
+ * Get YAML frontmatter for a slash command
74
+ *
75
+ * Frontmatter defines how the command appears in Qoder's UI,
76
+ * including display name, description, and categorization.
77
+ *
78
+ * @param {SlashCommandId} id - Command identifier (proposal, apply, or archive)
79
+ * @returns {string} YAML frontmatter block with command metadata
80
+ */
81
+ protected getFrontmatter(id: SlashCommandId): string {
82
+ return FRONTMATTER[id];
83
+ }
84
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Qwen slash command configurator for OpenSpec integration.
3
+ * This class handles the generation of Qwen-specific slash command files
4
+ * in the .qwen/commands directory structure.
5
+ *
6
+ * @implements {SlashCommandConfigurator}
7
+ */
8
+ import { TomlSlashCommandConfigurator } from './toml-base.js';
9
+ import { SlashCommandId } from '../../templates/index.js';
10
+
11
+ /**
12
+ * Mapping of slash command IDs to their corresponding file paths in .qwen/commands directory.
13
+ * @type {Record<SlashCommandId, string>}
14
+ */
15
+ const FILE_PATHS: Record<SlashCommandId, string> = {
16
+ proposal: '.qwen/commands/openspec-proposal.toml',
17
+ apply: '.qwen/commands/openspec-apply.toml',
18
+ archive: '.qwen/commands/openspec-archive.toml'
19
+ };
20
+
21
+ const DESCRIPTIONS: Record<SlashCommandId, string> = {
22
+ proposal: 'Scaffold a new OpenSpec change and validate strictly.',
23
+ apply: 'Implement an approved OpenSpec change and keep tasks in sync.',
24
+ archive: 'Archive a deployed OpenSpec change and update specs.'
25
+ };
26
+
27
+ /**
28
+ * QwenSlashCommandConfigurator class provides integration with Qwen Code
29
+ * by creating the necessary slash command files in the .qwen/commands directory.
30
+ *
31
+ * The slash commands include:
32
+ * - /openspec-proposal: Create an OpenSpec change proposal
33
+ * - /openspec-apply: Apply an approved OpenSpec change
34
+ * - /openspec-archive: Archive a deployed OpenSpec change
35
+ */
36
+ export class QwenSlashCommandConfigurator extends TomlSlashCommandConfigurator {
37
+ /** Unique identifier for the Qwen tool */
38
+ readonly toolId = 'qwen';
39
+
40
+ /** Availability status for the Qwen tool */
41
+ readonly isAvailable = true;
42
+
43
+ /**
44
+ * Returns the relative file path for a given slash command ID.
45
+ * @param {SlashCommandId} id - The slash command identifier
46
+ * @returns {string} The relative path to the command file
47
+ */
48
+ protected getRelativePath(id: SlashCommandId): string {
49
+ return FILE_PATHS[id];
50
+ }
51
+
52
+ protected getDescription(id: SlashCommandId): string {
53
+ return DESCRIPTIONS[id];
54
+ }
55
+ }