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,472 @@
1
+ # OpenSpec Instructions
2
+
3
+ This document provides instructions for AI coding assistants on how to use OpenSpec conventions for spec-driven development. Follow these rules precisely when working on OpenSpec-enabled projects.
4
+
5
+ ## Core Principle
6
+
7
+ OpenSpec is an AI-native system for change-driven development where:
8
+ - **Specs** (`specs/`) reflect what IS currently built and deployed
9
+ - **Changes** (`changes/`) contain proposals for what SHOULD be changed
10
+ - **AI drives the process** - You generate proposals, humans review and approve
11
+ - **Specs are living documentation** - Always kept in sync with deployed code
12
+
13
+ ## Start Simple
14
+
15
+ **Default to minimal implementations:**
16
+ - New features should be <100 lines of code initially
17
+ - Use the simplest solution that works
18
+ - Avoid premature optimization (no caching, parallelization, or complex patterns without proven need)
19
+ - Choose boring technology over cutting-edge solutions
20
+
21
+ **Complexity triggers** - Only add complexity when you have:
22
+ - **Performance data** showing current solution is too slow
23
+ - **Scale requirements** with specific numbers (>1000 users, >100MB data)
24
+ - **Multiple use cases** requiring the same abstraction
25
+ - **Regulatory compliance** mandating specific patterns
26
+ - **Security threats** that simple solutions cannot address
27
+
28
+ When triggered, document the specific justification in your change proposal.
29
+
30
+ ## Directory Structure
31
+
32
+ ```
33
+ openspec/
34
+ ├── project.md # Project-specific context (tech stack, conventions)
35
+ ├── README.md # This file - OpenSpec instructions
36
+ ├── specs/ # Current truth - what IS built
37
+ │ ├── [capability]/ # Single, focused capability
38
+ │ │ ├── spec.md # WHAT the capability does and WHY
39
+ │ │ └── design.md # HOW it's built (established patterns)
40
+ │ └── ...
41
+ ├── changes/ # Proposed changes - what we're CHANGING
42
+ │ ├── [change-name]/
43
+ │ │ ├── proposal.md # Why, what, impact (consolidated)
44
+ │ │ ├── tasks.md # Implementation checklist
45
+ │ │ ├── design.md # Technical decisions (optional, for complex changes)
46
+ │ │ └── specs/ # Future state of affected specs
47
+ │ │ └── [capability]/
48
+ │ │ └── spec.md # Clean markdown (no diff syntax)
49
+ │ └── archive/ # Completed changes (dated)
50
+ ```
51
+
52
+ ### Capability Organization
53
+
54
+ **Use capabilities, not features** - Each directory under `specs/` represents a single, focused responsibility:
55
+ - **Verb-noun naming**: `user-auth`, `payment-capture`, `order-checkout`
56
+ - **10-minute rule**: Each capability should be understandable in <10 minutes
57
+ - **Single purpose**: If it needs "AND" to describe it, split it
58
+
59
+ Examples:
60
+ ```
61
+ ✅ GOOD: user-auth, user-sessions, payment-capture, payment-refunds
62
+ ❌ BAD: users, payments, core, misc
63
+ ```
64
+
65
+ ## Key Behavioral Rules
66
+
67
+ ### 1. Always Start by Reading
68
+
69
+ Before any task:
70
+ 1. **Read relevant specs** in `specs/[capability]/spec.md` to understand current state
71
+ 2. **Check pending changes** in `changes/` directory for potential conflicts
72
+ 3. **Read project.md** for project-specific conventions
73
+
74
+ ### 2. When to Create Change Proposals
75
+
76
+ **ALWAYS create a change proposal for:**
77
+ - New features or functionality
78
+ - Breaking changes (API changes, schema updates)
79
+ - Architecture changes or new patterns
80
+ - Performance optimizations that change behavior
81
+ - Security updates affecting auth/access patterns
82
+ - Any change requiring multiple steps or affecting multiple systems
83
+
84
+ **SKIP proposals for:**
85
+ - Bug fixes that restore intended behavior
86
+ - Typos, formatting, or comment updates
87
+ - Dependency updates (unless breaking)
88
+ - Configuration or environment variable changes
89
+ - Adding tests for existing behavior
90
+ - Documentation fixes
91
+
92
+ **Complexity assessment:**
93
+ - If your solution requires >100 lines of new code, justify the complexity
94
+ - If adding dependencies, frameworks, or architectural patterns, document why simpler alternatives won't work
95
+ - Default to single-file implementations until proven insufficient
96
+
97
+ ### 3. Creating a Change Proposal
98
+
99
+ When a user requests a significant change:
100
+
101
+ ```bash
102
+ # 1. Create the change directory
103
+ openspec/changes/[descriptive-name]/
104
+
105
+ # 2. Generate proposal.md with all context
106
+ ## Why
107
+ [1-2 sentences on the problem/opportunity]
108
+
109
+ ## What Changes
110
+ [Bullet list of changes, including breaking changes]
111
+
112
+ ## Impact
113
+ - Affected specs: [list capabilities that will change]
114
+ - Affected code: [list key files/systems]
115
+
116
+ # 3. Create future state specs for ALL affected capabilities
117
+ # - Store complete spec files as they will exist after the change
118
+ # - Use clean markdown without diff syntax (+/- prefixes)
119
+ # - Include all formatting and structure of the final intended state
120
+ specs/
121
+ └── [capability]/
122
+ └── spec.md
123
+
124
+ # 4. Create tasks.md with implementation steps
125
+ ## 1. [Task Group]
126
+ - [ ] 1.1 [Specific task]
127
+ - [ ] 1.2 [Specific task]
128
+
129
+ # 5. For complex changes, add design.md
130
+ [Technical decisions and trade-offs]
131
+ ```
132
+
133
+ ### 4. The Change Lifecycle
134
+
135
+ 1. **Propose** → Create change directory with all documentation
136
+ 2. **Review** → User reviews and approves the proposal
137
+ 3. **Implement** → Follow the approved tasks.md (can be multiple PRs)
138
+ 4. **Deploy** → User confirms deployment
139
+ 5. **Update Specs** → Sync specs/ with new reality (IF the change affects system capabilities)
140
+ 6. **Archive** → Move to `changes/archive/YYYY-MM-DD-[name]/`
141
+
142
+ ### 5. Implementing Changes
143
+
144
+ When implementing an approved change:
145
+ 1. Follow the tasks.md checklist exactly
146
+ 2. **Mark completed tasks** in tasks.md as you finish them (e.g., `- [x] 1.1 Task completed`)
147
+ 3. Ensure code matches the proposed behavior
148
+ 4. Update any affected tests
149
+ 5. **Keep change in `changes/` directory** - do NOT archive in implementation PR
150
+
151
+ **Multiple Implementation PRs:**
152
+ - Changes can be implemented across multiple PRs
153
+ - Each PR should update tasks.md to mark what was completed
154
+ - Different developers can work on different task groups
155
+ - Example: PR #1 completes tasks 1.1-1.3, PR #2 completes tasks 2.1-2.4
156
+
157
+ ### 6. Updating Specs and Archiving After Deployment
158
+
159
+ **Create a separate PR after deployment** that:
160
+ 1. Moves change to `changes/archive/YYYY-MM-DD-[name]/`
161
+ 2. Updates relevant files in `specs/` to reflect new reality (if needed)
162
+ 3. If design.md exists, incorporates proven patterns into `specs/[capability]/design.md`
163
+
164
+ This ensures changes are only archived when truly complete and deployed.
165
+
166
+ ### 7. Types of Changes That Don't Require Specs
167
+
168
+ Some changes only affect development infrastructure and don't need specs:
169
+ - Initial project setup (package.json, tsconfig.json, etc.)
170
+ - Development tooling changes (linters, formatters, build tools)
171
+ - CI/CD configuration
172
+ - Development dependencies
173
+
174
+ For these changes:
175
+ 1. Implement → Deploy → Mark tasks complete → Archive
176
+ 2. Skip the "Update Specs" step entirely
177
+
178
+ ### What Deserves a Spec?
179
+
180
+ Ask yourself:
181
+ - Is this a system capability that users or other systems interact with?
182
+ - Does it have ongoing behavior that needs documentation?
183
+ - Would a new developer need to understand this to work with the system?
184
+
185
+ If NO to all → No spec needed (likely just tooling/infrastructure)
186
+
187
+ ## Understanding Specs vs Code
188
+
189
+ ### Specs Document WHAT and WHY
190
+ ```markdown
191
+ # Authentication Spec
192
+
193
+ Users SHALL authenticate with email and password.
194
+
195
+ WHEN credentials are valid THEN issue JWT token.
196
+ WHEN credentials are invalid THEN return generic error.
197
+
198
+ WHY: Prevent user enumeration attacks.
199
+ ```
200
+
201
+ ### Code Documents HOW
202
+ ```javascript
203
+ // Implementation details
204
+ const user = await db.users.findOne({ email });
205
+ const valid = await bcrypt.compare(password, user.hashedPassword);
206
+ ```
207
+
208
+ **Key Distinction**: Specs capture intent, constraints, and decisions that aren't obvious from code.
209
+
210
+ ## Common Scenarios
211
+
212
+ ### New Feature Request
213
+ ```
214
+ User: "Add password reset functionality"
215
+
216
+ You should:
217
+ 1. Read specs/user-auth/spec.md
218
+ 2. Check changes/ for pending auth changes
219
+ 3. Create changes/add-password-reset/ with proposal
220
+ 4. Wait for approval before implementing
221
+ ```
222
+
223
+ ### Bug Fix
224
+ ```
225
+ User: "Getting null pointer error when bio is empty"
226
+
227
+ You should:
228
+ 1. Check if spec says bios are optional
229
+ 2. If yes → Fix directly (it's a bug)
230
+ 3. If no → Create change proposal (it's a behavior change)
231
+ ```
232
+
233
+ ### Infrastructure Setup
234
+ ```
235
+ User: "Initialize TypeScript project"
236
+
237
+ You should:
238
+ 1. Create change proposal for TypeScript setup
239
+ 2. Implement configuration files (PR #1)
240
+ 3. Mark tasks complete in tasks.md
241
+ 4. After deployment, create separate PR to archive
242
+ (no specs update needed - this is tooling, not a capability)
243
+ ```
244
+
245
+ ## Summary Workflow
246
+
247
+ 1. **Receive request** → Determine if it needs a change proposal
248
+ 2. **Read current state** → Check specs and pending changes
249
+ 3. **Create proposal** → Generate complete change documentation
250
+ 4. **Get approval** → User reviews the proposal
251
+ 5. **Implement** → Follow approved tasks, mark completed items in tasks.md
252
+ 6. **Deploy** → User deploys the implementation
253
+ 7. **Archive PR** → Create separate PR to:
254
+ - Move change to archive
255
+ - Update specs if needed
256
+ - Mark change as complete
257
+
258
+ ## PR Workflow Examples
259
+
260
+ ### Single Developer, Simple Change
261
+ ```
262
+ PR #1: Implementation
263
+ - Implement all tasks
264
+ - Update tasks.md marking items complete
265
+ - Get merged and deployed
266
+
267
+ PR #2: Archive (after deployment)
268
+ - Move changes/feature-x/ → changes/archive/2025-01-15-feature-x/
269
+ - Update specs if needed
270
+ ```
271
+
272
+ ### Multiple Developers, Complex Change
273
+ ```
274
+ PR #1: Alice implements auth components
275
+ - Complete tasks 1.1, 1.2, 1.3
276
+ - Update tasks.md marking these complete
277
+
278
+ PR #2: Bob implements UI components
279
+ - Complete tasks 2.1, 2.2
280
+ - Update tasks.md marking these complete
281
+
282
+ PR #3: Alice fixes integration issues
283
+ - Complete remaining task 1.4
284
+ - Update tasks.md
285
+
286
+ [Deploy all changes]
287
+
288
+ PR #4: Archive
289
+ - Move to archive with deployment date
290
+ - Update specs to reflect new auth flow
291
+ ```
292
+
293
+ ### Key Rules
294
+ - **Never archive in implementation PRs** - changes aren't done until deployed
295
+ - **Always update tasks.md** - shows accurate progress
296
+ - **One archive PR per change** - clear completion boundary
297
+ - **Archive PR includes spec updates** - keeps specs current
298
+
299
+ ## Capability Organization Best Practices
300
+
301
+ ### Naming Capabilities
302
+ - Use **verb-noun** patterns: `user-auth`, `payment-capture`, `order-checkout`
303
+ - Be specific: `payment-capture` not just `payments`
304
+ - Keep flat: Avoid nesting capabilities within capabilities
305
+ - Singular focus: If you need "AND" to describe it, split it
306
+
307
+ ### When to Split Capabilities
308
+ Split when you have:
309
+ - Multiple unrelated API endpoints
310
+ - Different user personas or actors
311
+ - Separate deployment considerations
312
+ - Independent evolution paths
313
+
314
+ #### Capability Boundary Guidelines
315
+ - Would you import these separately? → Separate capabilities
316
+ - Different deployment cadence? → Separate capabilities
317
+ - Different teams own them? → Separate capabilities
318
+ - Shared data models are OK, shared business logic means combine
319
+
320
+ Examples:
321
+ - user-auth (login/logout) vs user-sessions (token management) → SEPARATE
322
+ - payment-capture vs payment-refunds → SEPARATE (different workflows)
323
+ - user-profile vs user-settings → COMBINE (same data model, same owner)
324
+
325
+ ### Cross-Cutting Concerns
326
+ For system-wide policies (rate limiting, error handling, security), document them in:
327
+ - `project.md` for project-wide conventions
328
+ - Within relevant capability specs where they apply
329
+ - Or create a dedicated capability if complex enough (e.g., `api-rate-limiting/`)
330
+
331
+ ### Examples of Well-Organized Capabilities
332
+ ```
333
+ specs/
334
+ ├── user-auth/ # Login, logout, password reset
335
+ ├── user-sessions/ # Token management, refresh
336
+ ├── user-profile/ # Profile CRUD operations
337
+ ├── payment-capture/ # Processing payments
338
+ ├── payment-refunds/ # Handling refunds
339
+ └── order-checkout/ # Checkout workflow
340
+ ```
341
+
342
+ For detailed guidance, see the [Capability Organization Guide](../docs/capability-organization.md).
343
+
344
+ ## Common Scenarios and Clarifications
345
+
346
+ ### Decision Ambiguity: Bug vs Behavior Change
347
+
348
+ When specs are missing or ambiguous:
349
+ - If NO spec exists → Treat current code behavior as implicit spec, require proposal
350
+ - If spec is VAGUE → Require proposal to clarify spec alongside fix
351
+ - If code and spec DISAGREE → Spec is truth, code is buggy (fix without proposal)
352
+ - If unsure → Default to creating a proposal (safer option)
353
+
354
+ Example:
355
+ ```
356
+ User: "The API returns 404 for missing users but should return 400"
357
+ AI: Is this a bug (spec says 400) or behavior change (spec says 404)?
358
+ ```
359
+
360
+ ### When You Don't Know the Scope
361
+ It's OK to explore first! Tell the user you need to investigate, then create an informed proposal.
362
+
363
+ ### Exploration Phase (When Needed)
364
+
365
+ BEFORE creating proposal, you may need exploration when:
366
+ - User request is vague or high-level
367
+ - Multiple implementation approaches exist
368
+ - Scope is unclear without seeing code
369
+
370
+ Exploration checklist:
371
+ 1. Tell user you need to explore first
372
+ 2. Use Grep/Read to understand current state
373
+ 3. Create initial proposal based on findings
374
+ 4. Refine with user feedback
375
+
376
+ Example:
377
+ ```
378
+ User: "Add caching to improve performance"
379
+ AI: "Let me explore the codebase to understand the current architecture and identify caching opportunities."
380
+ [After exploration]
381
+ AI: "Based on my analysis, I've identified three areas where caching would help. Here's my proposal..."
382
+ ```
383
+
384
+ ### When No Specs Exist
385
+ Treat current code as implicit spec. Your proposal should document current state AND proposed changes.
386
+
387
+ ### When in Doubt
388
+ Default to creating a proposal. It's easier to skip an unnecessary proposal than fix an undocumented change.
389
+
390
+ ### AI Workflow Adaptations
391
+
392
+ Task tracking with OpenSpec:
393
+ - Track exploration tasks separately from implementation
394
+ - Document proposal creation steps as you go
395
+ - Keep implementation tasks separate until proposal approved
396
+
397
+ Parallel operations encouraged:
398
+ - Read multiple specs simultaneously
399
+ - Check multiple pending changes at once
400
+ - Batch related searches for efficiency
401
+
402
+ Progress communication:
403
+ - "Exploring codebase to understand scope..."
404
+ - "Creating proposal based on findings..."
405
+ - "Implementing approved changes..."
406
+
407
+ ### For AI Assistants
408
+ - **Bias toward simplicity** - Propose the minimal solution that works
409
+ - Use your exploration tools liberally before proposing
410
+ - Batch operations for efficiency
411
+ - Communicate your progress
412
+ - It's OK to revise proposals based on discoveries
413
+ - **Question complexity** - If your solution feels complex, simplify first
414
+
415
+ ## Edge Case Handling
416
+
417
+ ### Multi-Capability Changes
418
+ Create ONE proposal that:
419
+ - Lists all affected capabilities
420
+ - Shows changes per capability
421
+ - Has unified task list
422
+ - Gets approved as a whole
423
+
424
+ ### Outdated Specs
425
+ If specs clearly outdated:
426
+ 1. Create proposal to update specs to match reality
427
+ 2. Implement new feature in separate proposal
428
+ 3. OR combine both in one proposal with clear sections
429
+
430
+ ### Emergency Hotfixes
431
+ For critical production issues:
432
+ 1. Announce: "This is an emergency fix"
433
+ 2. Implement fix immediately
434
+ 3. Create retroactive proposal
435
+ 4. Update specs after deployment
436
+ 5. Tag with [EMERGENCY] in archive
437
+
438
+ ### Pure Refactoring
439
+ No proposal needed for:
440
+ - Code formatting/style
441
+ - Internal refactoring (same API)
442
+ - Performance optimization (same behavior)
443
+ - Adding types to untyped code
444
+
445
+ Proposal REQUIRED for:
446
+ - API changes (even if compatible)
447
+ - Database schema changes
448
+ - Architecture changes
449
+ - New dependencies
450
+
451
+ ### Observability Additions
452
+ No proposal needed for:
453
+ - Adding log statements
454
+ - New metrics/traces
455
+ - Debugging additions
456
+ - Error tracking
457
+
458
+ Proposal REQUIRED if:
459
+ - Changes log format/structure
460
+ - Adds new monitoring service
461
+ - Changes what's logged (privacy)
462
+
463
+ ## Remember
464
+
465
+ - You are the process driver - automate documentation burden
466
+ - Specs must always reflect deployed reality
467
+ - Changes are proposed, not imposed
468
+ - Impact analysis prevents surprises
469
+ - **Simplicity is the power** - just markdown files, minimal solutions
470
+ - Start simple, add complexity only when justified
471
+
472
+ By following these conventions, you enable true spec-driven development where documentation stays current, changes are traceable, and evolution is intentional.
@@ -0,0 +1,9 @@
1
+ # Implementation Tasks
2
+
3
+ ## 1. Update OpenSpec README
4
+ - [x] 1.1 Add "Start Simple" section after Core Principle
5
+ - [x] 1.2 Add complexity triggers to "When to Create Change Proposals" section
6
+ - [x] 1.3 Update AI workflow guidance to emphasize minimal implementations
7
+
8
+ ## 2. Update CLAUDE.md
9
+ - [x] 2.1 Add complexity management rules to project instructions
@@ -0,0 +1,15 @@
1
+ ## Why
2
+ Need a command to archive completed changes to the archive folder with proper date prefixing, following OpenSpec conventions. Currently changes must be manually moved and renamed.
3
+
4
+ ## What Changes
5
+ - Add new `archive` command to CLI that moves changes to `changes/archive/YYYY-MM-DD-[change-name]/`
6
+ - Check for incomplete tasks before archiving and warn user
7
+ - Allow interactive selection of change to archive
8
+ - Prevent archiving if target directory already exists
9
+ - Update main specs from the change's future state specs (copy from `changes/[name]/specs/` to `openspec/specs/`)
10
+ - Show confirmation prompt before updating specs, displaying which specs will be created/updated
11
+ - Support `--yes` flag to skip confirmations for automation
12
+
13
+ ## Impact
14
+ - Affected specs: cli-archive (new)
15
+ - Affected code: src/cli/index.ts, src/core/archive.ts (new)
@@ -0,0 +1,111 @@
1
+ # CLI Archive Command Specification
2
+
3
+ ## Purpose
4
+ The archive command moves completed changes from the active changes directory to the archive folder with date-based naming, following OpenSpec conventions.
5
+
6
+ ## Command Syntax
7
+ ```bash
8
+ openspec archive [change-name] [--yes|-y]
9
+ ```
10
+
11
+ Options:
12
+ - `--yes`, `-y`: Skip confirmation prompts (for automation)
13
+
14
+ ## Behavior
15
+
16
+ ### Change Selection
17
+ WHEN no change-name is provided
18
+ THEN display interactive list of available changes (excluding archive/)
19
+ AND allow user to select one
20
+
21
+ WHEN change-name is provided
22
+ THEN use that change directly
23
+ AND validate it exists
24
+
25
+ ### Task Completion Check
26
+ The command SHALL scan the change's tasks.md file for incomplete tasks (marked with `- [ ]`)
27
+
28
+ WHEN incomplete tasks are found
29
+ THEN display all incomplete tasks to the user
30
+ AND prompt for confirmation to continue
31
+ AND default to "No" for safety
32
+
33
+ WHEN all tasks are complete OR no tasks.md exists
34
+ THEN proceed with archiving without prompting
35
+
36
+ ### Archive Process
37
+ The archive operation SHALL:
38
+ 1. Create archive/ directory if it doesn't exist
39
+ 2. Generate target name as `YYYY-MM-DD-[change-name]` using current date
40
+ 3. Check if target directory already exists
41
+ 4. Update main specs from the change's future state specs (see Spec Update Process below)
42
+ 5. Move the entire change directory to the archive location
43
+
44
+ WHEN target archive already exists
45
+ THEN fail with error message
46
+ AND do not overwrite existing archive
47
+
48
+ WHEN move succeeds
49
+ THEN display success message with archived name and list of updated specs
50
+
51
+ ### Spec Update Process
52
+ Before moving the change to archive, the command SHALL update main specs to reflect the deployed reality:
53
+
54
+ WHEN the change contains specs in `changes/[name]/specs/`
55
+ THEN:
56
+ 1. Analyze which specs will be affected by comparing with existing specs
57
+ 2. Display a summary of spec updates to the user (see Confirmation Behavior below)
58
+ 3. Prompt for confirmation unless `--yes` flag is provided
59
+ 4. If confirmed, for each capability spec in the change directory:
60
+ - Copy the spec from `changes/[name]/specs/[capability]/spec.md` to `openspec/specs/[capability]/spec.md`
61
+ - Create the target directory structure if it doesn't exist
62
+ - Overwrite existing spec files (specs represent current reality, change specs are the new reality)
63
+ - Track which specs were updated for the success message
64
+
65
+ WHEN no specs exist in the change
66
+ THEN skip the spec update step
67
+ AND proceed with archiving
68
+
69
+ ### Confirmation Behavior
70
+ The spec update confirmation SHALL:
71
+ - Display a clear summary showing:
72
+ - Which specs will be created (new capabilities)
73
+ - Which specs will be updated (existing capabilities)
74
+ - The source path for each spec
75
+ - Format the confirmation prompt as:
76
+ ```
77
+ The following specs will be updated:
78
+
79
+ NEW specs to be created:
80
+ - cli-archive (from changes/add-archive-command/specs/cli-archive/spec.md)
81
+
82
+ EXISTING specs to be updated:
83
+ - cli-init (from changes/update-init-command/specs/cli-init/spec.md)
84
+
85
+ Update 2 specs and archive 'add-archive-command'? [y/N]:
86
+ ```
87
+ - Default to "No" for safety (require explicit "y" or "yes")
88
+ - Skip confirmation when `--yes` or `-y` flag is provided
89
+
90
+ WHEN user declines the confirmation
91
+ THEN abort the entire archive operation
92
+ AND display message: "Archive cancelled. No changes were made."
93
+ AND exit with non-zero status code
94
+
95
+ ## Error Handling
96
+
97
+ SHALL handle the following error conditions:
98
+ - Missing openspec/changes/ directory
99
+ - Change not found
100
+ - Archive target already exists
101
+ - File system permissions issues
102
+
103
+ ## Why These Decisions
104
+
105
+ **Interactive selection**: Reduces typing and helps users see available changes
106
+ **Task checking**: Prevents accidental archiving of incomplete work
107
+ **Date prefixing**: Maintains chronological order and prevents naming conflicts
108
+ **No overwrite**: Preserves historical archives and prevents data loss
109
+ **Spec updates before archiving**: Specs in the main directory represent current reality; when a change is deployed and archived, its future state specs become the new reality and must replace the main specs
110
+ **Confirmation for spec updates**: Provides visibility into what will change, prevents accidental overwrites, and ensures users understand the impact before specs are modified
111
+ **--yes flag for automation**: Allows CI/CD pipelines to archive without interactive prompts while maintaining safety by default for manual use
@@ -0,0 +1,44 @@
1
+ # Implementation Tasks
2
+
3
+ ## 1. Core Implementation
4
+ - [ ] 1.1 Create `src/core/archive.ts` with ArchiveCommand class
5
+ - [ ] 1.1.1 Implement change selection (interactive if not provided)
6
+ - [ ] 1.1.2 Implement incomplete task checking from tasks.md
7
+ - [ ] 1.1.3 Implement confirmation prompt for incomplete tasks
8
+ - [ ] 1.1.4 Implement spec update functionality
9
+ - [ ] 1.1.4.1 Detect specs in change directory
10
+ - [ ] 1.1.4.2 Compare with existing main specs
11
+ - [ ] 1.1.4.3 Display summary of new vs updated specs
12
+ - [ ] 1.1.4.4 Show confirmation prompt for spec updates
13
+ - [ ] 1.1.4.5 Copy specs to main spec directory
14
+ - [ ] 1.1.5 Implement archive move with date prefixing
15
+ - [ ] 1.1.6 Support --yes flag to skip confirmations
16
+
17
+ ## 2. CLI Integration
18
+ - [ ] 2.1 Add archive command to `src/cli/index.ts`
19
+ - [ ] 2.1.1 Import ArchiveCommand
20
+ - [ ] 2.1.2 Register command with commander
21
+ - [ ] 2.1.3 Add --yes/-y flag option
22
+ - [ ] 2.1.4 Add proper error handling
23
+
24
+ ## 3. Error Handling
25
+ - [ ] 3.1 Handle missing openspec/changes/ directory
26
+ - [ ] 3.2 Handle change not found
27
+ - [ ] 3.3 Handle archive target already exists
28
+ - [ ] 3.4 Handle user cancellation
29
+
30
+ ## 4. Testing
31
+ - [ ] 4.1 Test with fully completed change
32
+ - [ ] 4.2 Test with incomplete tasks (warning shown)
33
+ - [ ] 4.3 Test interactive selection mode
34
+ - [ ] 4.4 Test duplicate archive prevention
35
+ - [ ] 4.5 Test spec update functionality
36
+ - [ ] 4.5.1 Test creating new specs
37
+ - [ ] 4.5.2 Test updating existing specs
38
+ - [ ] 4.5.3 Test confirmation prompt display
39
+ - [ ] 4.5.4 Test declining confirmation (no changes made)
40
+ - [ ] 4.5.5 Test --yes flag skips confirmation
41
+
42
+ ## 5. Build and Validation
43
+ - [ ] 5.1 Ensure TypeScript compilation succeeds
44
+ - [ ] 5.2 Test command execution
@@ -0,0 +1,19 @@
1
+ # Add Diff Command to OpenSpec CLI
2
+
3
+ ## Why
4
+
5
+ Developers need to easily view differences between proposed spec changes and current specs without manually comparing files.
6
+
7
+ ## What Changes
8
+
9
+ - Add `openspec diff [change-name]` command that shows differences between change specs and current specs
10
+ - Compare files in `changes/[change-name]/specs/` with corresponding files in `specs/`
11
+ - Display unified diff output showing added/removed/modified lines
12
+ - Support colored output for better readability
13
+
14
+ ## Impact
15
+
16
+ - Affected specs: New capability `cli-diff` will be added
17
+ - Affected code:
18
+ - `src/cli/index.ts` - Add diff command
19
+ - `src/core/diff.ts` - New file with diff logic (~80 lines)