@codewalla_india/openspec 1.3.1 → 1.3.3

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 (333) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +214 -133
  3. package/bin/openspec.js +5 -5
  4. package/dist/cli/index.js +99 -62
  5. package/dist/commands/change.d.ts +0 -2
  6. package/dist/commands/change.js +107 -86
  7. package/dist/commands/config.js +14 -16
  8. package/dist/commands/doctor.js +9 -4
  9. package/dist/commands/feedback.js +79 -30
  10. package/dist/commands/modify.d.ts +26 -0
  11. package/dist/commands/modify.js +147 -0
  12. package/dist/commands/schema.js +170 -91
  13. package/dist/commands/show.js +5 -2
  14. package/dist/commands/spec.js +49 -29
  15. package/dist/commands/store.js +15 -21
  16. package/dist/commands/validate.d.ts +8 -0
  17. package/dist/commands/validate.js +43 -20
  18. package/dist/commands/workflow/index.d.ts +2 -2
  19. package/dist/commands/workflow/index.js +1 -1
  20. package/dist/commands/workflow/instructions.d.ts +6 -26
  21. package/dist/commands/workflow/instructions.js +183 -376
  22. package/dist/commands/workflow/new-change.d.ts +0 -4
  23. package/dist/commands/workflow/new-change.js +10 -28
  24. package/dist/commands/workflow/shared.d.ts +34 -19
  25. package/dist/commands/workflow/shared.js +34 -4
  26. package/dist/commands/workflow/status.js +10 -32
  27. package/dist/commands/workflow/templates.js +15 -5
  28. package/dist/commands/workset.d.ts +2 -2
  29. package/dist/commands/workset.js +19 -22
  30. package/dist/comprehension-quiz/fingerprint.d.ts +39 -0
  31. package/dist/comprehension-quiz/fingerprint.js +84 -0
  32. package/dist/comprehension-quiz/index.d.ts +42 -0
  33. package/dist/comprehension-quiz/index.js +47 -0
  34. package/dist/comprehension-quiz/pass-record.d.ts +44 -0
  35. package/dist/comprehension-quiz/pass-record.js +98 -0
  36. package/dist/comprehension-quiz/providers/anthropic.d.ts +35 -0
  37. package/dist/comprehension-quiz/providers/anthropic.js +69 -0
  38. package/dist/comprehension-quiz/providers/factory.d.ts +44 -0
  39. package/dist/comprehension-quiz/providers/factory.js +174 -0
  40. package/dist/comprehension-quiz/providers/interface.d.ts +98 -0
  41. package/dist/comprehension-quiz/providers/interface.js +150 -0
  42. package/dist/comprehension-quiz/providers/local.d.ts +35 -0
  43. package/dist/comprehension-quiz/providers/local.js +69 -0
  44. package/dist/comprehension-quiz/providers/ollama.d.ts +35 -0
  45. package/dist/comprehension-quiz/providers/ollama.js +69 -0
  46. package/dist/comprehension-quiz/providers/openai.d.ts +35 -0
  47. package/dist/comprehension-quiz/providers/openai.js +72 -0
  48. package/dist/comprehension-quiz/question-generator.d.ts +117 -0
  49. package/dist/comprehension-quiz/question-generator.js +203 -0
  50. package/dist/comprehension-quiz/quiz-executor.d.ts +75 -0
  51. package/dist/comprehension-quiz/quiz-executor.js +181 -0
  52. package/dist/comprehension-quiz/types.d.ts +137 -0
  53. package/dist/comprehension-quiz/types.js +11 -0
  54. package/dist/core/archive.d.ts +14 -1
  55. package/dist/core/archive.js +1350 -190
  56. package/dist/core/artifact-graph/graph.d.ts +28 -9
  57. package/dist/core/artifact-graph/graph.js +94 -43
  58. package/dist/core/artifact-graph/index.d.ts +1 -1
  59. package/dist/core/artifact-graph/index.js +1 -1
  60. package/dist/core/artifact-graph/instruction-loader.d.ts +30 -3
  61. package/dist/core/artifact-graph/instruction-loader.js +70 -12
  62. package/dist/core/artifact-graph/outputs.d.ts +1 -0
  63. package/dist/core/artifact-graph/outputs.js +67 -5
  64. package/dist/core/artifact-graph/resolver.d.ts +14 -0
  65. package/dist/core/artifact-graph/resolver.js +69 -15
  66. package/dist/core/artifact-graph/types.js +21 -3
  67. package/dist/core/available-tools.d.ts +2 -2
  68. package/dist/core/available-tools.js +14 -3
  69. package/dist/core/change-metadata/schema.d.ts +2 -0
  70. package/dist/core/change-metadata/schema.js +13 -0
  71. package/dist/core/change-status-policy.d.ts +10 -1
  72. package/dist/core/change-status-policy.js +30 -2
  73. package/dist/core/command-generation/adapters/amazon-q.d.ts +4 -0
  74. package/dist/core/command-generation/adapters/amazon-q.js +11 -5
  75. package/dist/core/command-generation/adapters/antigravity.js +6 -5
  76. package/dist/core/command-generation/adapters/auggie.js +7 -6
  77. package/dist/core/command-generation/adapters/bob.d.ts +5 -1
  78. package/dist/core/command-generation/adapters/bob.js +11 -10
  79. package/dist/core/command-generation/adapters/claude.d.ts +1 -1
  80. package/dist/core/command-generation/adapters/claude.js +12 -17
  81. package/dist/core/command-generation/adapters/cline.js +5 -5
  82. package/dist/core/command-generation/adapters/codebuddy.js +8 -7
  83. package/dist/core/command-generation/adapters/continue.js +8 -7
  84. package/dist/core/command-generation/adapters/costrict.js +7 -6
  85. package/dist/core/command-generation/adapters/crush.js +9 -9
  86. package/dist/core/command-generation/adapters/cursor.js +8 -8
  87. package/dist/core/command-generation/adapters/devin.d.ts +19 -0
  88. package/dist/core/command-generation/adapters/devin.js +36 -0
  89. package/dist/core/command-generation/adapters/factory.js +7 -6
  90. package/dist/core/command-generation/adapters/gemini.js +40 -5
  91. package/dist/core/command-generation/adapters/github-copilot.js +6 -5
  92. package/dist/core/command-generation/adapters/iflow.js +9 -8
  93. package/dist/core/command-generation/adapters/index.d.ts +4 -2
  94. package/dist/core/command-generation/adapters/index.js +4 -2
  95. package/dist/core/command-generation/adapters/junie.js +6 -5
  96. package/dist/core/command-generation/adapters/kilocode.js +1 -1
  97. package/dist/core/command-generation/adapters/kiro.js +6 -5
  98. package/dist/core/command-generation/adapters/lingma.js +9 -9
  99. package/dist/core/command-generation/adapters/oh-my-pi.d.ts +21 -0
  100. package/dist/core/command-generation/adapters/oh-my-pi.js +42 -0
  101. package/dist/core/command-generation/adapters/opencode.js +6 -8
  102. package/dist/core/command-generation/adapters/pi.d.ts +2 -2
  103. package/dist/core/command-generation/adapters/pi.js +7 -10
  104. package/dist/core/command-generation/adapters/qoder.js +9 -9
  105. package/dist/core/command-generation/adapters/qwen.d.ts +7 -3
  106. package/dist/core/command-generation/adapters/qwen.js +14 -9
  107. package/dist/core/command-generation/adapters/roocode.d.ts +4 -4
  108. package/dist/core/command-generation/adapters/roocode.js +9 -9
  109. package/dist/core/command-generation/adapters/trae.d.ts +13 -0
  110. package/dist/core/command-generation/adapters/trae.js +28 -0
  111. package/dist/core/command-generation/adapters/zcode.d.ts +16 -0
  112. package/dist/core/command-generation/adapters/zcode.js +33 -0
  113. package/dist/core/command-generation/generator.d.ts +8 -0
  114. package/dist/core/command-generation/generator.js +15 -1
  115. package/dist/core/command-generation/index.d.ts +1 -1
  116. package/dist/core/command-generation/index.js +1 -1
  117. package/dist/core/command-generation/invocation.d.ts +73 -0
  118. package/dist/core/command-generation/invocation.js +77 -0
  119. package/dist/core/command-generation/registry.js +8 -4
  120. package/dist/core/command-generation/types.d.ts +9 -2
  121. package/dist/core/command-generation/yaml.d.ts +20 -6
  122. package/dist/core/command-generation/yaml.js +31 -21
  123. package/dist/core/command-surface.d.ts +15 -0
  124. package/dist/core/command-surface.js +33 -0
  125. package/dist/core/completions/command-registry.js +16 -61
  126. package/dist/core/completions/generators/bash-generator.js +41 -41
  127. package/dist/core/completions/generators/fish-generator.js +7 -7
  128. package/dist/core/completions/generators/powershell-generator.js +44 -37
  129. package/dist/core/completions/generators/zsh-generator.js +33 -33
  130. package/dist/core/completions/installers/zsh-installer.d.ts +9 -0
  131. package/dist/core/completions/installers/zsh-installer.js +20 -4
  132. package/dist/core/completions/templates/bash-templates.js +24 -24
  133. package/dist/core/completions/templates/fish-templates.js +38 -38
  134. package/dist/core/completions/templates/powershell-templates.js +28 -28
  135. package/dist/core/completions/templates/zsh-templates.js +39 -39
  136. package/dist/core/config-prompts.d.ts +1 -1
  137. package/dist/core/config-prompts.js +14 -1
  138. package/dist/core/config-schema.d.ts +10 -1
  139. package/dist/core/config-schema.js +67 -1
  140. package/dist/core/config.d.ts +15 -0
  141. package/dist/core/config.js +46 -5
  142. package/dist/core/file-state.js +56 -24
  143. package/dist/core/github-copilot/cloud-agent.d.ts +95 -0
  144. package/dist/core/github-copilot/cloud-agent.js +497 -0
  145. package/dist/core/global-config.d.ts +16 -0
  146. package/dist/core/init.d.ts +58 -0
  147. package/dist/core/init.js +474 -73
  148. package/dist/core/legacy-cleanup.d.ts +59 -0
  149. package/dist/core/legacy-cleanup.js +253 -24
  150. package/dist/core/list.js +23 -16
  151. package/dist/core/migration.d.ts +73 -1
  152. package/dist/core/migration.js +360 -11
  153. package/dist/core/modify/conflict-detector.d.ts +26 -0
  154. package/dist/core/modify/conflict-detector.js +62 -0
  155. package/dist/core/modify/dependency-propagator.d.ts +38 -0
  156. package/dist/core/modify/dependency-propagator.js +103 -0
  157. package/dist/core/modify/history-tracker.d.ts +34 -0
  158. package/dist/core/modify/history-tracker.js +114 -0
  159. package/dist/core/modify/index.d.ts +7 -0
  160. package/dist/core/modify/index.js +7 -0
  161. package/dist/core/onboarding-commands.d.ts +30 -0
  162. package/dist/core/onboarding-commands.js +38 -0
  163. package/dist/core/openspec-root.js +18 -15
  164. package/dist/core/parsers/change-parser.d.ts +17 -2
  165. package/dist/core/parsers/change-parser.js +35 -21
  166. package/dist/core/parsers/code-fence.d.ts +15 -0
  167. package/dist/core/parsers/code-fence.js +49 -0
  168. package/dist/core/parsers/markdown-parser.d.ts +0 -3
  169. package/dist/core/parsers/markdown-parser.js +7 -60
  170. package/dist/core/parsers/requirement-blocks.d.ts +29 -0
  171. package/dist/core/parsers/requirement-blocks.js +150 -31
  172. package/dist/core/parsers/requirement-text.d.ts +48 -0
  173. package/dist/core/parsers/requirement-text.js +98 -0
  174. package/dist/core/parsers/spec-structure.d.ts +1 -1
  175. package/dist/core/parsers/spec-structure.js +20 -30
  176. package/dist/core/profile-sync-drift.d.ts +0 -8
  177. package/dist/core/profile-sync-drift.js +49 -50
  178. package/dist/core/profiles.d.ts +2 -2
  179. package/dist/core/profiles.js +2 -2
  180. package/dist/core/project-config.d.ts +27 -18
  181. package/dist/core/project-config.js +101 -34
  182. package/dist/core/references.js +42 -4
  183. package/dist/core/relationship-health.d.ts +8 -0
  184. package/dist/core/relationship-health.js +13 -0
  185. package/dist/core/root-selection.d.ts +9 -6
  186. package/dist/core/root-selection.js +42 -5
  187. package/dist/core/schemas/base.schema.js +7 -2
  188. package/dist/core/shared/allowed-tools.d.ts +12 -0
  189. package/dist/core/shared/allowed-tools.js +12 -0
  190. package/dist/core/shared/index.d.ts +1 -0
  191. package/dist/core/shared/index.js +1 -0
  192. package/dist/core/shared/skill-content-equivalence.d.ts +7 -0
  193. package/dist/core/shared/skill-content-equivalence.js +41 -0
  194. package/dist/core/shared/skill-generation.js +17 -13
  195. package/dist/core/shared/skill-paths.d.ts +13 -0
  196. package/dist/core/shared/skill-paths.js +23 -0
  197. package/dist/core/shared/tool-detection.d.ts +27 -7
  198. package/dist/core/shared/tool-detection.js +167 -37
  199. package/dist/core/shared-skill-target.d.ts +16 -0
  200. package/dist/core/shared-skill-target.js +156 -0
  201. package/dist/core/specs-apply.d.ts +80 -33
  202. package/dist/core/specs-apply.js +667 -145
  203. package/dist/core/store/git.d.ts +13 -0
  204. package/dist/core/store/git.js +24 -0
  205. package/dist/core/store/operations.js +20 -0
  206. package/dist/core/templates/skill-templates.d.ts +3 -2
  207. package/dist/core/templates/skill-templates.js +3 -2
  208. package/dist/core/templates/workflows/apply-change.d.ts +10 -0
  209. package/dist/core/templates/workflows/apply-change.js +186 -224
  210. package/dist/core/templates/workflows/archive-change.js +387 -260
  211. package/dist/core/templates/workflows/bulk-archive-change.js +655 -475
  212. package/dist/core/templates/workflows/continue-change.js +210 -219
  213. package/dist/core/templates/workflows/explore.js +479 -443
  214. package/dist/core/templates/workflows/feedback.js +97 -97
  215. package/dist/core/templates/workflows/ff-change.js +200 -191
  216. package/dist/core/templates/workflows/modify-change.d.ts +4 -1
  217. package/dist/core/templates/workflows/modify-change.js +193 -71
  218. package/dist/core/templates/workflows/new-change.js +127 -134
  219. package/dist/core/templates/workflows/onboard.js +548 -542
  220. package/dist/core/templates/workflows/propose.js +273 -217
  221. package/dist/core/templates/workflows/store-selection.d.ts +1 -1
  222. package/dist/core/templates/workflows/store-selection.js +1 -1
  223. package/dist/core/templates/workflows/sync-specs.js +500 -273
  224. package/dist/core/templates/workflows/update-change.d.ts +10 -0
  225. package/dist/core/templates/workflows/update-change.js +177 -0
  226. package/dist/core/templates/workflows/verify-change.js +324 -326
  227. package/dist/core/update.d.ts +40 -5
  228. package/dist/core/update.js +411 -96
  229. package/dist/core/validation/constants.d.ts +4 -1
  230. package/dist/core/validation/constants.js +4 -1
  231. package/dist/core/validation/plan-validator.d.ts +8 -0
  232. package/dist/core/validation/plan-validator.js +45 -0
  233. package/dist/core/validation/task-numbering.d.ts +16 -0
  234. package/dist/core/validation/task-numbering.js +57 -0
  235. package/dist/core/validation/validator.d.ts +27 -3
  236. package/dist/core/validation/validator.js +337 -48
  237. package/dist/core/version-check.d.ts +152 -0
  238. package/dist/core/version-check.js +731 -0
  239. package/dist/core/view.js +13 -18
  240. package/dist/prompts/searchable-multi-select.js +1 -1
  241. package/dist/telemetry/caller-detection.d.ts +27 -0
  242. package/dist/telemetry/caller-detection.js +85 -0
  243. package/dist/telemetry/caller-detection.test.d.ts +5 -0
  244. package/dist/telemetry/config.d.ts +48 -2
  245. package/dist/telemetry/config.js +113 -11
  246. package/dist/telemetry/config.test.d.ts +5 -0
  247. package/dist/telemetry/deduplication.d.ts +35 -0
  248. package/dist/telemetry/deduplication.js +82 -0
  249. package/dist/telemetry/deduplication.test.d.ts +5 -0
  250. package/dist/telemetry/identity.d.ts +62 -22
  251. package/dist/telemetry/identity.js +147 -102
  252. package/dist/telemetry/index.d.ts +126 -15
  253. package/dist/telemetry/index.js +569 -37
  254. package/dist/telemetry/sanitization.d.ts +40 -0
  255. package/dist/telemetry/sanitization.js +114 -0
  256. package/dist/telemetry/sanitization.test.d.ts +5 -0
  257. package/dist/telemetry/throttling.d.ts +20 -0
  258. package/dist/telemetry/throttling.js +70 -0
  259. package/dist/ui/welcome-screen.d.ts +9 -1
  260. package/dist/ui/welcome-screen.js +91 -38
  261. package/dist/utils/change-metadata.d.ts +43 -0
  262. package/dist/utils/change-metadata.js +123 -7
  263. package/dist/utils/change-utils.d.ts +10 -4
  264. package/dist/utils/change-utils.js +20 -13
  265. package/dist/utils/ci.d.ts +12 -0
  266. package/dist/utils/ci.js +16 -0
  267. package/dist/utils/command-references.d.ts +92 -6
  268. package/dist/utils/command-references.js +180 -7
  269. package/dist/utils/date.d.ts +8 -0
  270. package/dist/utils/date.js +13 -0
  271. package/dist/utils/file-system.d.ts +10 -0
  272. package/dist/utils/file-system.js +70 -0
  273. package/dist/utils/index.d.ts +1 -1
  274. package/dist/utils/index.js +1 -1
  275. package/dist/utils/interactive.d.ts +23 -0
  276. package/dist/utils/interactive.js +32 -0
  277. package/dist/utils/item-discovery.d.ts +19 -0
  278. package/dist/utils/item-discovery.js +30 -48
  279. package/dist/utils/shell-detection.d.ts +1 -1
  280. package/dist/utils/shell-detection.js +64 -11
  281. package/dist/utils/spec-discovery.d.ts +40 -0
  282. package/dist/utils/spec-discovery.js +115 -0
  283. package/dist/utils/task-progress.d.ts +29 -1
  284. package/dist/utils/task-progress.js +109 -15
  285. package/package.json +96 -84
  286. package/schemas/spec-driven/schema.yaml +252 -184
  287. package/schemas/spec-driven/templates/design.md +19 -19
  288. package/schemas/spec-driven/templates/plan-template.md +91 -0
  289. package/schemas/spec-driven/templates/proposal.md +29 -24
  290. package/schemas/spec-driven/templates/spec.md +11 -8
  291. package/schemas/spec-driven/templates/tasks.md +9 -9
  292. package/scripts/postinstall.js +83 -83
  293. package/dist/core/command-generation/adapters/codex.d.ts +0 -16
  294. package/dist/core/command-generation/adapters/codex.js +0 -39
  295. package/dist/core/command-generation/adapters/windsurf.d.ts +0 -14
  296. package/dist/core/command-generation/adapters/windsurf.js +0 -38
  297. package/dist/core/comprehension/config.d.ts +0 -20
  298. package/dist/core/comprehension/config.js +0 -23
  299. package/dist/core/comprehension/fingerprint.d.ts +0 -14
  300. package/dist/core/comprehension/fingerprint.js +0 -33
  301. package/dist/core/comprehension/index.d.ts +0 -57
  302. package/dist/core/comprehension/index.js +0 -87
  303. package/dist/core/comprehension/pass-record.d.ts +0 -29
  304. package/dist/core/comprehension/pass-record.js +0 -64
  305. package/dist/core/comprehension/stats.d.ts +0 -35
  306. package/dist/core/comprehension/stats.js +0 -133
  307. package/dist/core/templates/workflows/comprehension-guidance.d.ts +0 -9
  308. package/dist/core/templates/workflows/comprehension-guidance.js +0 -73
  309. package/dist/core/templates/workflows/mcp-guidance.d.ts +0 -13
  310. package/dist/core/templates/workflows/mcp-guidance.js +0 -131
  311. package/dist/core/templates/workflows/user-prompt-guidance.d.ts +0 -16
  312. package/dist/core/templates/workflows/user-prompt-guidance.js +0 -48
  313. package/dist/telemetry/caller.d.ts +0 -5
  314. package/dist/telemetry/caller.js +0 -29
  315. package/dist/telemetry/client.d.ts +0 -27
  316. package/dist/telemetry/client.js +0 -127
  317. package/dist/telemetry/command-context.d.ts +0 -13
  318. package/dist/telemetry/command-context.js +0 -59
  319. package/dist/telemetry/comprehension.d.ts +0 -44
  320. package/dist/telemetry/comprehension.js +0 -105
  321. package/dist/telemetry/content.d.ts +0 -10
  322. package/dist/telemetry/content.js +0 -56
  323. package/dist/telemetry/git-stats.d.ts +0 -12
  324. package/dist/telemetry/git-stats.js +0 -69
  325. package/dist/telemetry/identify-cache.d.ts +0 -7
  326. package/dist/telemetry/identify-cache.js +0 -47
  327. package/dist/telemetry/input.d.ts +0 -17
  328. package/dist/telemetry/input.js +0 -68
  329. package/dist/telemetry/marker.d.ts +0 -37
  330. package/dist/telemetry/marker.js +0 -67
  331. package/dist/telemetry/workflow.d.ts +0 -85
  332. package/dist/telemetry/workflow.js +0 -318
  333. package/schemas/spec-driven/templates/plan.md +0 -19
@@ -3,283 +3,301 @@ export function getExploreSkillTemplate() {
3
3
  return {
4
4
  name: 'openspec-explore',
5
5
  description: 'Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.',
6
- instructions: `Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
7
-
8
- **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
9
-
10
- **This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
11
-
12
- ${STORE_SELECTION_GUIDANCE}
13
-
14
- ---
15
-
16
- ## The Stance
17
-
18
- - **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
19
- - **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
20
- - **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
21
- - **Adaptive** - Follow interesting threads, pivot when new information emerges
22
- - **Patient** - Don't rush to conclusions, let the shape of the problem emerge
23
- - **Grounded** - Explore the actual codebase when relevant, don't just theorize
24
-
25
- ---
26
-
27
- ## What You Might Do
28
-
29
- Depending on what the user brings, you might:
30
-
31
- **Explore the problem space**
32
- - Ask clarifying questions that emerge from what they said
33
- - Challenge assumptions
34
- - Reframe the problem
35
- - Find analogies
36
-
37
- **Investigate the codebase**
38
- - Map existing architecture relevant to the discussion
39
- - Find integration points
40
- - Identify patterns already in use
41
- - Surface hidden complexity
42
-
43
- **Compare options**
44
- - Brainstorm multiple approaches
45
- - Build comparison tables
46
- - Sketch tradeoffs
47
- - Recommend a path (if asked)
48
-
49
- **Visualize**
50
- \`\`\`
51
- ┌─────────────────────────────────────────┐
52
- │ Use ASCII diagrams liberally │
53
- ├─────────────────────────────────────────┤
54
- │ │
55
- │ ┌────────┐ ┌────────┐ │
56
- │ │ State │────────▶│ State │ │
57
- │ │ A │ │ B │ │
58
- │ └────────┘ └────────┘ │
59
- │ │
60
- │ System diagrams, state machines, │
61
- │ data flows, architecture sketches, │
62
- │ dependency graphs, comparison tables │
63
- │ │
64
- └─────────────────────────────────────────┘
65
- \`\`\`
66
-
67
- **Surface risks and unknowns**
68
- - Identify what could go wrong
69
- - Find gaps in understanding
70
- - Suggest spikes or investigations
71
-
72
- ---
73
-
74
- ## OpenSpec Awareness
75
-
76
- You have full context of the OpenSpec system. Use it naturally, don't force it.
77
-
78
- ### Check for context
79
-
80
- At the start, quickly check what exists:
81
- \`\`\`bash
82
- openspec list --json
83
- \`\`\`
84
-
85
- This tells you:
86
- - If there are active changes
87
- - Their names, schemas, and status
88
- - What the user might be working on
89
-
90
- ### When no change exists
91
-
92
- Think freely. When insights crystallize, you might offer:
93
-
94
- - "This feels solid enough to start a change. Want me to create a proposal?"
95
- - Or keep exploring - no pressure to formalize
96
-
97
- ### When a change exists
98
-
99
- If the user mentions a change or you detect one is relevant:
100
-
101
- 1. **Resolve and read existing artifacts for context**
102
- - Run \`openspec status --change "<name>" --json\`.
103
- - Use \`changeRoot\`, \`artifactPaths\`, and \`actionContext\` from the status JSON.
104
- - Read existing files from \`artifactPaths.<artifact>.existingOutputPaths\`.
105
-
106
- 2. **Reference them naturally in conversation**
107
- - "Your design mentions using Redis, but we just realized SQLite fits better..."
108
- - "The proposal scopes this to premium users, but we're now thinking everyone..."
109
-
110
- 3. **Offer to capture when decisions are made**
111
-
112
- | Insight Type | Where to Capture |
113
- |----------------------------|--------------------------------|
114
- | New requirement discovered | \`specs/<capability>/spec.md\` |
115
- | Requirement changed | \`specs/<capability>/spec.md\` |
116
- | Design decision made | \`design.md\` |
117
- | Scope changed | \`proposal.md\` |
118
- | New work identified | \`tasks.md\` |
119
- | Assumption invalidated | Relevant artifact |
120
-
121
- Example offers:
122
- - "That's a design decision. Capture it in design.md?"
123
- - "This is a new requirement. Add it to specs?"
124
- - "This changes scope. Update the proposal?"
125
-
126
- 4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
127
-
128
- ---
129
-
130
- ## What You Don't Have To Do
131
-
132
- - Follow a script
133
- - Ask the same questions every time
134
- - Produce a specific artifact
135
- - Reach a conclusion
136
- - Stay on topic if a tangent is valuable
137
- - Be brief (this is thinking time)
138
-
139
- ---
140
-
141
- ## Handling Different Entry Points
142
-
143
- **User brings a vague idea:**
144
- \`\`\`
145
- User: I'm thinking about adding real-time collaboration
146
-
147
- You: Real-time collab is a big space. Let me think about this...
148
-
149
- COLLABORATION SPECTRUM
150
- ════════════════════════════════════════════
151
-
152
- Awareness Coordination Sync
153
- │ │ │
154
- ▼ ▼ ▼
155
- ┌────────┐ ┌────────┐ ┌────────┐
156
- │Presence│ │Cursors │ │ CRDT │
157
- │ "3 │ │ Multi │ │Conflict│
158
- │online" │ │ select │ │ free │
159
- └────────┘ └────────┘ └────────┘
160
- │ │ │
161
- trivial moderate complex
162
-
163
- Where's your head at?
164
- \`\`\`
165
-
166
- **User brings a specific problem:**
167
- \`\`\`
168
- User: The auth system is a mess
169
-
170
- You: [reads codebase]
171
-
172
- ┌─────────────────────────────────────────────┐
173
- CURRENT AUTH FLOW
174
- └─────────────────────────────────────────────┘
175
-
176
- ┌─────────────┼─────────────┐
177
- ▼ ▼ ▼
178
- ┌─────────┐ ┌─────────┐ ┌─────────┐
179
- │ Google │ │ GitHub │ │ Email │
180
- │ OAuth │ │ OAuth │ │ Magic │
181
- └────┬────┘ └────┬────┘ └────┬────┘
182
- │ │ │
183
- └─────────────┼─────────────┘
184
-
185
- ┌───────────┐
186
- │ Session │
187
- └─────┬─────┘
188
-
189
-
190
- ┌───────────┐
191
- │ Perms │
192
- └───────────┘
193
-
194
- I see three tangles. Which one's burning?
195
- \`\`\`
196
-
197
- **User is stuck mid-implementation:**
198
- \`\`\`
199
- User: /opsx:explore add-auth-system
200
- The OAuth integration is more complex than expected
201
-
202
- You: [reads change artifacts]
203
-
204
- You're on task 4: "Implement OAuth flow"
205
-
206
- Let me trace what's involved...
207
-
208
- [draws diagram, explores options, suggests paths]
209
-
210
- Want to update the design to reflect this?
211
- Or add a spike task to investigate?
212
- \`\`\`
213
-
214
- **User wants to compare options:**
215
- \`\`\`
216
- User: Should we use Postgres or SQLite?
217
-
218
- You: Generic answer is boring. What's the context?
219
-
220
- User: A CLI tool that tracks local dev environments
221
-
222
- You: That changes everything.
223
-
224
- ┌─────────────────────────────────────────────────┐
225
- │ CLI TOOL DATA STORAGE │
226
- └─────────────────────────────────────────────────┘
227
-
228
- Key constraints:
229
- • No daemon running
230
- • Must work offline
231
- Single user
232
-
233
- SQLite Postgres
234
- Deployment embedded ✓ needs server ✗
235
- Offline yes ✓ no
236
- Single file yes ✓ no ✗
237
-
238
- SQLite. Not even close.
239
-
240
- Unless... is there a sync component?
241
- \`\`\`
242
-
243
- ---
244
-
245
- ## Ending Discovery
246
-
247
- There's no required ending. Discovery might:
248
-
249
- - **Flow into a proposal**: "Ready to start? I can create a change proposal."
250
- - **Result in artifact updates**: "Updated design.md with these decisions"
251
- - **Just provide clarity**: User has what they need, moves on
252
- - **Continue later**: "We can pick this up anytime"
253
-
254
- When it feels like things are crystallizing, you might summarize:
255
-
256
- \`\`\`
257
- ## What We Figured Out
258
-
259
- **The problem**: [crystallized understanding]
260
-
261
- **The approach**: [if one emerged]
262
-
263
- **Open questions**: [if any remain]
264
-
265
- **Next steps** (if ready):
266
- - Create a change proposal
267
- - Keep exploring: just keep talking
268
- \`\`\`
269
-
270
- But this summary is optional. Sometimes the thinking IS the value.
271
-
272
- ---
273
-
274
- ## Guardrails
275
-
276
- - **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
277
- - **Don't fake understanding** - If something is unclear, dig deeper
278
- - **Don't rush** - Discovery is thinking time, not task time
279
- - **Don't force structure** - Let patterns emerge naturally
280
- - **Don't auto-capture** - Offer to save insights, don't just do it
281
- - **Do visualize** - A good diagram is worth many paragraphs
282
- - **Do explore the codebase** - Ground discussions in reality
6
+ instructions: `Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
7
+
8
+ **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing. For a new change, scaffold it first as described below.
9
+
10
+ **This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
11
+
12
+ ${STORE_SELECTION_GUIDANCE}
13
+
14
+ ---
15
+
16
+ ## The Stance
17
+
18
+ - **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
19
+ - **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
20
+ - **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
21
+ - **Adaptive** - Follow interesting threads, pivot when new information emerges
22
+ - **Patient** - Don't rush to conclusions, let the shape of the problem emerge
23
+ - **Grounded** - Explore the actual codebase when relevant, don't just theorize
24
+
25
+ ---
26
+
27
+ ## What You Might Do
28
+
29
+ Depending on what the user brings, you might:
30
+
31
+ **Explore the problem space**
32
+ - Ask clarifying questions that emerge from what they said
33
+ - Challenge assumptions
34
+ - Reframe the problem
35
+ - Find analogies
36
+
37
+ **Investigate the codebase**
38
+ - Map existing architecture relevant to the discussion
39
+ - Find integration points
40
+ - Identify patterns already in use
41
+ - Surface hidden complexity
42
+
43
+ **Compare options**
44
+ - Brainstorm multiple approaches
45
+ - Build comparison tables
46
+ - Sketch tradeoffs
47
+ - Recommend a path (if asked)
48
+
49
+ **Visualize**
50
+ \`\`\`
51
+ ┌─────────────────────────────────────────┐
52
+ │ Use ASCII diagrams liberally │
53
+ ├─────────────────────────────────────────┤
54
+ │ │
55
+ │ ┌────────┐ ┌────────┐ │
56
+ │ │ State │────────▶│ State │ │
57
+ │ │ A │ │ B │ │
58
+ │ └────────┘ └────────┘ │
59
+ │ │
60
+ │ System diagrams, state machines, │
61
+ │ data flows, architecture sketches, │
62
+ │ dependency graphs, comparison tables │
63
+ │ │
64
+ └─────────────────────────────────────────┘
65
+ \`\`\`
66
+
67
+ **Surface risks and unknowns**
68
+ - Identify what could go wrong
69
+ - Find gaps in understanding
70
+ - Suggest spikes or investigations
71
+
72
+ ---
73
+
74
+ ## OpenSpec Awareness
75
+
76
+ You have full context of the OpenSpec system. Use it naturally, don't force it.
77
+
78
+ ### Check for context
79
+
80
+ At the start, quickly check what exists:
81
+ \`\`\`bash
82
+ openspec list --json
83
+ \`\`\`
84
+
85
+ This tells you:
86
+ - If there are active changes
87
+ - Their names, schemas, and status
88
+ - What the user might be working on
89
+
90
+ Then read the project's own context from the resolved root - \`<root.path>/openspec/config.yaml\` (or \`config.yml\`). Use the \`root.path\` returned above, and skip this if neither file exists:
91
+ - \`context\`: project background - tech stack, conventions, constraints
92
+ - \`rules\`: keyed by artifact id - the entries for an artifact apply only when you write that artifact
93
+
94
+ Ground your thinking in these. They are constraints for you to follow, not content to reproduce: do NOT copy them into the conversation or into any artifact you create.
95
+
96
+ ### When no change exists
97
+
98
+ Think freely. When insights crystallize, you might offer:
99
+
100
+ - "This feels solid enough to start a change. Want me to create a proposal?"
101
+ - Or keep exploring - no pressure to formalize
102
+
103
+ If the user asks you to capture the exploration as a new change, transition seamlessly into the requested capture:
104
+
105
+ 1. Run \`openspec new change "<name>"\` (with \`--store <id>\` when applicable) before creating any artifacts. Never create a new change directory under \`openspec/changes/\` by hand; the CLI scaffold creates required metadata such as \`.openspec.yaml\`. Keep the selected \`--store <id>\` on every applicable follow-up \`status\` and \`instructions\` command.
106
+ 2. Run \`openspec status --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store), then process the requested artifacts in dependency order. For each requested artifact that is \`ready\`, run \`openspec instructions "<artifact-id>" --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store). Before creating a requested artifact, evaluate any condition in its own \`instruction\` against the explored change; record a deliberate skip instead when the condition does not apply. If a requested artifact is blocked by a direct prerequisite the user did not request, run \`openspec instructions "<prerequisite-id>" --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store) for that prerequisite whether it is \`ready\` or \`blocked\`. If its own \`instruction\` states a condition, evaluate that condition against the explored change and record a deliberate skip only when the condition does not apply. If the condition applies, or the prerequisite is not conditional, treat it as a normal prerequisite and ask before expanding the capture. Do not create an unrequested prerequisite unless the user approves.
107
+ 3. Follow the returned \`template\` and \`instruction\` fields. Read completed dependency files listed in \`dependencies\`, and apply \`context\` and \`rules\` as constraints without copying them into the artifact. If the instruction delegates creation to a specific skill or command, invoke it; otherwise write the artifact to \`resolvedOutputPath\`, using the instruction to choose a concrete path when it is a glob. Verify that the selected concrete output exists.
108
+ 4. After creating each artifact, re-run \`openspec status --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store) and continue until every requested artifact is \`done\`, \`skipped\`, or was deliberately skipped because its own \`instruction\` stated a condition that did not apply. Tell the user about a deliberate conditional skip, remember it, and do not reconsider it. Dependencies are enablers, not gates: if a requested artifact is still \`blocked\` only because you deliberately skipped a conditional prerequisite, run \`openspec instructions "<artifact-id>" --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store) despite the blocked status, then create it using step 3 only when those recorded conditional skips are its sole missing dependencies. If a requested artifact is blocked by a prerequisite the user did not ask to capture and cannot be conditionally skipped, explain that dependency and ask before expanding the capture.
109
+
110
+ Capture the artifact(s) the user requested without asking them to invoke another workflow command. If they asked only to start a change, stop after scaffolding and show its status.
111
+
112
+ ### When a change exists
113
+
114
+ If the user mentions a change or you detect one is relevant:
115
+
116
+ 1. **Resolve and read existing artifacts for context**
117
+ - Run \`openspec status --change "<name>" --json\`.
118
+ - Use \`changeRoot\`, \`artifactPaths\`, and \`actionContext\` from the status JSON.
119
+ - Read existing files from \`artifactPaths.<artifact>.existingOutputPaths\`.
120
+
121
+ 2. **Reference them naturally in conversation**
122
+ - "Your design mentions using Redis, but we just realized SQLite fits better..."
123
+ - "The proposal scopes this to premium users, but we're now thinking everyone..."
124
+
125
+ 3. **Offer to capture when decisions are made**
126
+
127
+ \`<capability-path>\` is the spec directory relative to \`specs/\` (for example, \`user-auth\` or \`identity/user-auth\`). Preserve an existing capability's full path and follow the project's established organization for new capabilities.
128
+
129
+ | Insight Type | Where to Capture |
130
+ |----------------------------|-------------------------------------|
131
+ | New requirement discovered | \`specs/<capability-path>/spec.md\` |
132
+ | Requirement changed | \`specs/<capability-path>/spec.md\` |
133
+ | Design decision made | \`design.md\` |
134
+ | Scope changed | \`proposal.md\` |
135
+ | New work identified | \`tasks.md\` |
136
+ | Assumption invalidated | Relevant artifact |
137
+
138
+ Example offers:
139
+ - "That's a design decision. Capture it in design.md?"
140
+ - "This is a new requirement. Add it to specs?"
141
+ - "This changes scope. Update the proposal?"
142
+
143
+ 4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
144
+
145
+ ---
146
+
147
+ ## What You Don't Have To Do
148
+
149
+ - Follow a script
150
+ - Ask the same questions every time
151
+ - Produce a specific artifact
152
+ - Reach a conclusion
153
+ - Stay on topic if a tangent is valuable
154
+ - Be brief (this is thinking time)
155
+
156
+ ---
157
+
158
+ ## Handling Different Entry Points
159
+
160
+ **User brings a vague idea:**
161
+ \`\`\`
162
+ User: I'm thinking about adding real-time collaboration
163
+
164
+ You: Real-time collab is a big space. Let me think about this...
165
+
166
+ COLLABORATION SPECTRUM
167
+ ════════════════════════════════════════════
168
+
169
+ Awareness Coordination Sync
170
+ │ │ │
171
+ ▼ ▼ ▼
172
+ ┌────────┐ ┌────────┐ ┌────────┐
173
+ Presence│ │Cursors │ CRDT │
174
+ │ "3 │ │ Multi │ │Conflict│
175
+ online" │ │ select │ │ free │
176
+ └────────┘ └────────┘ └────────┘
177
+ │ │ │
178
+ trivial moderate complex
179
+
180
+ Where's your head at?
181
+ \`\`\`
182
+
183
+ **User brings a specific problem:**
184
+ \`\`\`
185
+ User: The auth system is a mess
186
+
187
+ You: [reads codebase]
188
+
189
+ ┌─────────────────────────────────────────────┐
190
+ │ CURRENT AUTH FLOW │
191
+ └─────────────────────────────────────────────┘
192
+
193
+ ┌─────────────┼─────────────┐
194
+ ▼ ▼ ▼
195
+ ┌─────────┐ ┌─────────┐ ┌─────────┐
196
+ │ Google │ │ GitHub │ │ Email │
197
+ │ OAuth │ │ OAuth │ │ Magic │
198
+ └────┬────┘ └────┬────┘ └────┬────┘
199
+ │ │ │
200
+ └─────────────┼─────────────┘
201
+
202
+ ┌───────────┐
203
+ │ Session │
204
+ └─────┬─────┘
205
+
206
+
207
+ ┌───────────┐
208
+ │ Perms │
209
+ └───────────┘
210
+
211
+ I see three tangles. Which one's burning?
212
+ \`\`\`
213
+
214
+ **User is stuck mid-implementation:**
215
+ \`\`\`
216
+ User: /opsx:explore add-auth-system
217
+ The OAuth integration is more complex than expected
218
+
219
+ You: [reads change artifacts]
220
+
221
+ You're on task 4: "Implement OAuth flow"
222
+
223
+ Let me trace what's involved...
224
+
225
+ [draws diagram, explores options, suggests paths]
226
+
227
+ Want to update the design to reflect this?
228
+ Or add a spike task to investigate?
229
+ \`\`\`
230
+
231
+ **User wants to compare options:**
232
+ \`\`\`
233
+ User: Should we use Postgres or SQLite?
234
+
235
+ You: Generic answer is boring. What's the context?
236
+
237
+ User: A CLI tool that tracks local dev environments
238
+
239
+ You: That changes everything.
240
+
241
+ ┌─────────────────────────────────────────────────┐
242
+ │ CLI TOOL DATA STORAGE │
243
+ └─────────────────────────────────────────────────┘
244
+
245
+ Key constraints:
246
+ • No daemon running
247
+ Must work offline
248
+ • Single user
249
+
250
+ SQLite Postgres
251
+ Deployment embedded ✓ needs server
252
+ Offline yes ✓ no
253
+ Single file yes ✓ no ✗
254
+
255
+ SQLite. Not even close.
256
+
257
+ Unless... is there a sync component?
258
+ \`\`\`
259
+
260
+ ---
261
+
262
+ ## Ending Discovery
263
+
264
+ There's no required ending. Discovery might:
265
+
266
+ - **Flow into a proposal**: "Ready to start? I can create a change proposal."
267
+ - **Result in artifact updates**: "Updated design.md with these decisions"
268
+ - **Just provide clarity**: User has what they need, moves on
269
+ - **Continue later**: "We can pick this up anytime"
270
+
271
+ When it feels like things are crystallizing, you might summarize:
272
+
273
+ \`\`\`
274
+ ## What We Figured Out
275
+
276
+ **The problem**: [crystallized understanding]
277
+
278
+ **The approach**: [if one emerged]
279
+
280
+ **Open questions**: [if any remain]
281
+
282
+ **Next steps** (if ready):
283
+ - Create a change proposal
284
+ - Keep exploring: just keep talking
285
+ \`\`\`
286
+
287
+ But this summary is optional. Sometimes the thinking IS the value.
288
+
289
+ ---
290
+
291
+ ## Guardrails
292
+
293
+ - **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
294
+ - **Don't fake understanding** - If something is unclear, dig deeper
295
+ - **Don't rush** - Discovery is thinking time, not task time
296
+ - **Don't force structure** - Let patterns emerge naturally
297
+ - **Don't auto-capture** - Offer to save insights, don't just do it
298
+ - **Don't manually scaffold changes** - Never create a new change directory under \`openspec/changes/\` by hand. Always use \`openspec new change "<name>"\` (with \`--store <id>\` when applicable) so required metadata such as \`.openspec.yaml\` is created before writing artifacts.
299
+ - **Do visualize** - A good diagram is worth many paragraphs
300
+ - **Do explore the codebase** - Ground discussions in reality
283
301
  - **Do question assumptions** - Including the user's and your own`,
284
302
  license: 'MIT',
285
303
  compatibility: 'Requires openspec CLI.',
@@ -292,172 +310,190 @@ export function getOpsxExploreCommandTemplate() {
292
310
  description: 'Enter explore mode - think through ideas, investigate problems, clarify requirements',
293
311
  category: 'Workflow',
294
312
  tags: ['workflow', 'explore', 'experimental', 'thinking'],
295
- content: `Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
296
-
297
- **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
298
-
299
- **This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
300
-
301
- ${STORE_SELECTION_GUIDANCE}
302
-
303
- **Input**: The argument after \`/opsx:explore\` is whatever the user wants to think about. Could be:
304
- - A vague idea: "real-time collaboration"
305
- - A specific problem: "the auth system is getting unwieldy"
306
- - A change name: "add-dark-mode" (to explore in context of that change)
307
- - A comparison: "postgres vs sqlite for this"
308
- - Nothing (just enter explore mode)
309
-
310
- ---
311
-
312
- ## The Stance
313
-
314
- - **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
315
- - **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
316
- - **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
317
- - **Adaptive** - Follow interesting threads, pivot when new information emerges
318
- - **Patient** - Don't rush to conclusions, let the shape of the problem emerge
319
- - **Grounded** - Explore the actual codebase when relevant, don't just theorize
320
-
321
- ---
322
-
323
- ## What You Might Do
324
-
325
- Depending on what the user brings, you might:
326
-
327
- **Explore the problem space**
328
- - Ask clarifying questions that emerge from what they said
329
- - Challenge assumptions
330
- - Reframe the problem
331
- - Find analogies
332
-
333
- **Investigate the codebase**
334
- - Map existing architecture relevant to the discussion
335
- - Find integration points
336
- - Identify patterns already in use
337
- - Surface hidden complexity
338
-
339
- **Compare options**
340
- - Brainstorm multiple approaches
341
- - Build comparison tables
342
- - Sketch tradeoffs
343
- - Recommend a path (if asked)
344
-
345
- **Visualize**
346
- \`\`\`
347
- ┌─────────────────────────────────────────┐
348
- │ Use ASCII diagrams liberally │
349
- ├─────────────────────────────────────────┤
350
- │ │
351
- │ ┌────────┐ ┌────────┐ │
352
- │ │ State │────────▶│ State │ │
353
- │ │ A │ │ B │ │
354
- │ └────────┘ └────────┘ │
355
- │ │
356
- │ System diagrams, state machines, │
357
- │ data flows, architecture sketches, │
358
- │ dependency graphs, comparison tables │
359
- │ │
360
- └─────────────────────────────────────────┘
361
- \`\`\`
362
-
363
- **Surface risks and unknowns**
364
- - Identify what could go wrong
365
- - Find gaps in understanding
366
- - Suggest spikes or investigations
367
-
368
- ---
369
-
370
- ## OpenSpec Awareness
371
-
372
- You have full context of the OpenSpec system. Use it naturally, don't force it.
373
-
374
- ### Check for context
375
-
376
- At the start, quickly check what exists:
377
- \`\`\`bash
378
- openspec list --json
379
- \`\`\`
380
-
381
- This tells you:
382
- - If there are active changes
383
- - Their names, schemas, and status
384
- - What the user might be working on
385
-
386
- If the user mentioned a specific change name, read its artifacts for context.
387
-
388
- ### When no change exists
389
-
390
- Think freely. When insights crystallize, you might offer:
391
-
392
- - "This feels solid enough to start a change. Want me to create a proposal?"
393
- - Or keep exploring - no pressure to formalize
394
-
395
- ### When a change exists
396
-
397
- If the user mentions a change or you detect one is relevant:
398
-
399
- 1. **Resolve and read existing artifacts for context**
400
- - Run \`openspec status --change "<name>" --json\`.
401
- - Use \`changeRoot\`, \`artifactPaths\`, and \`actionContext\` from the status JSON.
402
- - Read existing files from \`artifactPaths.<artifact>.existingOutputPaths\`.
403
-
404
- 2. **Reference them naturally in conversation**
405
- - "Your design mentions using Redis, but we just realized SQLite fits better..."
406
- - "The proposal scopes this to premium users, but we're now thinking everyone..."
407
-
408
- 3. **Offer to capture when decisions are made**
409
-
410
- | Insight Type | Where to Capture |
411
- |----------------------------|--------------------------------|
412
- | New requirement discovered | \`specs/<capability>/spec.md\` |
413
- | Requirement changed | \`specs/<capability>/spec.md\` |
414
- | Design decision made | \`design.md\` |
415
- | Scope changed | \`proposal.md\` |
416
- | New work identified | \`tasks.md\` |
417
- | Assumption invalidated | Relevant artifact |
418
-
419
- Example offers:
420
- - "That's a design decision. Capture it in design.md?"
421
- - "This is a new requirement. Add it to specs?"
422
- - "This changes scope. Update the proposal?"
423
-
424
- 4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
425
-
426
- ---
427
-
428
- ## What You Don't Have To Do
429
-
430
- - Follow a script
431
- - Ask the same questions every time
432
- - Produce a specific artifact
433
- - Reach a conclusion
434
- - Stay on topic if a tangent is valuable
435
- - Be brief (this is thinking time)
436
-
437
- ---
438
-
439
- ## Ending Discovery
440
-
441
- There's no required ending. Discovery might:
442
-
443
- - **Flow into a proposal**: "Ready to start? I can create a change proposal."
444
- - **Result in artifact updates**: "Updated design.md with these decisions"
445
- - **Just provide clarity**: User has what they need, moves on
446
- - **Continue later**: "We can pick this up anytime"
447
-
448
- When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
449
-
450
- ---
451
-
452
- ## Guardrails
453
-
454
- - **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
455
- - **Don't fake understanding** - If something is unclear, dig deeper
456
- - **Don't rush** - Discovery is thinking time, not task time
457
- - **Don't force structure** - Let patterns emerge naturally
458
- - **Don't auto-capture** - Offer to save insights, don't just do it
459
- - **Do visualize** - A good diagram is worth many paragraphs
460
- - **Do explore the codebase** - Ground discussions in reality
313
+ content: `Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
314
+
315
+ **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing. For a new change, scaffold it first as described below.
316
+
317
+ **This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
318
+
319
+ ${STORE_SELECTION_GUIDANCE}
320
+
321
+ **Input**: The argument after \`/opsx:explore\` is whatever the user wants to think about. Could be:
322
+ - A vague idea: "real-time collaboration"
323
+ - A specific problem: "the auth system is getting unwieldy"
324
+ - A change name: "add-dark-mode" (to explore in context of that change)
325
+ - A comparison: "postgres vs sqlite for this"
326
+ - Nothing (just enter explore mode)
327
+
328
+ ---
329
+
330
+ ## The Stance
331
+
332
+ - **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
333
+ - **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
334
+ - **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
335
+ - **Adaptive** - Follow interesting threads, pivot when new information emerges
336
+ - **Patient** - Don't rush to conclusions, let the shape of the problem emerge
337
+ - **Grounded** - Explore the actual codebase when relevant, don't just theorize
338
+
339
+ ---
340
+
341
+ ## What You Might Do
342
+
343
+ Depending on what the user brings, you might:
344
+
345
+ **Explore the problem space**
346
+ - Ask clarifying questions that emerge from what they said
347
+ - Challenge assumptions
348
+ - Reframe the problem
349
+ - Find analogies
350
+
351
+ **Investigate the codebase**
352
+ - Map existing architecture relevant to the discussion
353
+ - Find integration points
354
+ - Identify patterns already in use
355
+ - Surface hidden complexity
356
+
357
+ **Compare options**
358
+ - Brainstorm multiple approaches
359
+ - Build comparison tables
360
+ - Sketch tradeoffs
361
+ - Recommend a path (if asked)
362
+
363
+ **Visualize**
364
+ \`\`\`
365
+ ┌─────────────────────────────────────────┐
366
+ │ Use ASCII diagrams liberally │
367
+ ├─────────────────────────────────────────┤
368
+ │ │
369
+ │ ┌────────┐ ┌────────┐ │
370
+ │ │ State │────────▶│ State │ │
371
+ │ │ A │ │ B │ │
372
+ │ └────────┘ └────────┘ │
373
+ │ │
374
+ │ System diagrams, state machines, │
375
+ │ data flows, architecture sketches, │
376
+ │ dependency graphs, comparison tables │
377
+ │ │
378
+ └─────────────────────────────────────────┘
379
+ \`\`\`
380
+
381
+ **Surface risks and unknowns**
382
+ - Identify what could go wrong
383
+ - Find gaps in understanding
384
+ - Suggest spikes or investigations
385
+
386
+ ---
387
+
388
+ ## OpenSpec Awareness
389
+
390
+ You have full context of the OpenSpec system. Use it naturally, don't force it.
391
+
392
+ ### Check for context
393
+
394
+ At the start, quickly check what exists:
395
+ \`\`\`bash
396
+ openspec list --json
397
+ \`\`\`
398
+
399
+ This tells you:
400
+ - If there are active changes
401
+ - Their names, schemas, and status
402
+ - What the user might be working on
403
+
404
+ Then read the project's own context from the resolved root - \`<root.path>/openspec/config.yaml\` (or \`config.yml\`). Use the \`root.path\` returned above, and skip this if neither file exists:
405
+ - \`context\`: project background - tech stack, conventions, constraints
406
+ - \`rules\`: keyed by artifact id - the entries for an artifact apply only when you write that artifact
407
+
408
+ Ground your thinking in these. They are constraints for you to follow, not content to reproduce: do NOT copy them into the conversation or into any artifact you create.
409
+
410
+ If the user mentioned a specific change name, read its artifacts for context.
411
+
412
+ ### When no change exists
413
+
414
+ Think freely. When insights crystallize, you might offer:
415
+
416
+ - "This feels solid enough to start a change. Want me to create a proposal?"
417
+ - Or keep exploring - no pressure to formalize
418
+
419
+ If the user asks you to capture the exploration as a new change, transition seamlessly into the requested capture:
420
+
421
+ 1. Run \`openspec new change "<name>"\` (with \`--store <id>\` when applicable) before creating any artifacts. Never create a new change directory under \`openspec/changes/\` by hand; the CLI scaffold creates required metadata such as \`.openspec.yaml\`. Keep the selected \`--store <id>\` on every applicable follow-up \`status\` and \`instructions\` command.
422
+ 2. Run \`openspec status --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store), then process the requested artifacts in dependency order. For each requested artifact that is \`ready\`, run \`openspec instructions "<artifact-id>" --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store). Before creating a requested artifact, evaluate any condition in its own \`instruction\` against the explored change; record a deliberate skip instead when the condition does not apply. If a requested artifact is blocked by a direct prerequisite the user did not request, run \`openspec instructions "<prerequisite-id>" --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store) for that prerequisite whether it is \`ready\` or \`blocked\`. If its own \`instruction\` states a condition, evaluate that condition against the explored change and record a deliberate skip only when the condition does not apply. If the condition applies, or the prerequisite is not conditional, treat it as a normal prerequisite and ask before expanding the capture. Do not create an unrequested prerequisite unless the user approves.
423
+ 3. Follow the returned \`template\` and \`instruction\` fields. Read completed dependency files listed in \`dependencies\`, and apply \`context\` and \`rules\` as constraints without copying them into the artifact. If the instruction delegates creation to a specific skill or command, invoke it; otherwise write the artifact to \`resolvedOutputPath\`, using the instruction to choose a concrete path when it is a glob. Verify that the selected concrete output exists.
424
+ 4. After creating each artifact, re-run \`openspec status --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store) and continue until every requested artifact is \`done\`, \`skipped\`, or was deliberately skipped because its own \`instruction\` stated a condition that did not apply. Tell the user about a deliberate conditional skip, remember it, and do not reconsider it. Dependencies are enablers, not gates: if a requested artifact is still \`blocked\` only because you deliberately skipped a conditional prerequisite, run \`openspec instructions "<artifact-id>" --change "<name>" --json\` (append the confirmed \`--store "<id>"\` only for a registered standalone store) despite the blocked status, then create it using step 3 only when those recorded conditional skips are its sole missing dependencies. If a requested artifact is blocked by a prerequisite the user did not ask to capture and cannot be conditionally skipped, explain that dependency and ask before expanding the capture.
425
+
426
+ Capture the artifact(s) the user requested without asking them to invoke another workflow command. If they asked only to start a change, stop after scaffolding and show its status.
427
+
428
+ ### When a change exists
429
+
430
+ If the user mentions a change or you detect one is relevant:
431
+
432
+ 1. **Resolve and read existing artifacts for context**
433
+ - Run \`openspec status --change "<name>" --json\`.
434
+ - Use \`changeRoot\`, \`artifactPaths\`, and \`actionContext\` from the status JSON.
435
+ - Read existing files from \`artifactPaths.<artifact>.existingOutputPaths\`.
436
+
437
+ 2. **Reference them naturally in conversation**
438
+ - "Your design mentions using Redis, but we just realized SQLite fits better..."
439
+ - "The proposal scopes this to premium users, but we're now thinking everyone..."
440
+
441
+ 3. **Offer to capture when decisions are made**
442
+
443
+ \`<capability-path>\` is the spec directory relative to \`specs/\` (for example, \`user-auth\` or \`identity/user-auth\`). Preserve an existing capability's full path and follow the project's established organization for new capabilities.
444
+
445
+ | Insight Type | Where to Capture |
446
+ |----------------------------|-------------------------------------|
447
+ | New requirement discovered | \`specs/<capability-path>/spec.md\` |
448
+ | Requirement changed | \`specs/<capability-path>/spec.md\` |
449
+ | Design decision made | \`design.md\` |
450
+ | Scope changed | \`proposal.md\` |
451
+ | New work identified | \`tasks.md\` |
452
+ | Assumption invalidated | Relevant artifact |
453
+
454
+ Example offers:
455
+ - "That's a design decision. Capture it in design.md?"
456
+ - "This is a new requirement. Add it to specs?"
457
+ - "This changes scope. Update the proposal?"
458
+
459
+ 4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
460
+
461
+ ---
462
+
463
+ ## What You Don't Have To Do
464
+
465
+ - Follow a script
466
+ - Ask the same questions every time
467
+ - Produce a specific artifact
468
+ - Reach a conclusion
469
+ - Stay on topic if a tangent is valuable
470
+ - Be brief (this is thinking time)
471
+
472
+ ---
473
+
474
+ ## Ending Discovery
475
+
476
+ There's no required ending. Discovery might:
477
+
478
+ - **Flow into a proposal**: "Ready to start? I can create a change proposal."
479
+ - **Result in artifact updates**: "Updated design.md with these decisions"
480
+ - **Just provide clarity**: User has what they need, moves on
481
+ - **Continue later**: "We can pick this up anytime"
482
+
483
+ When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
484
+
485
+ ---
486
+
487
+ ## Guardrails
488
+
489
+ - **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
490
+ - **Don't fake understanding** - If something is unclear, dig deeper
491
+ - **Don't rush** - Discovery is thinking time, not task time
492
+ - **Don't force structure** - Let patterns emerge naturally
493
+ - **Don't auto-capture** - Offer to save insights, don't just do it
494
+ - **Don't manually scaffold changes** - Never create a new change directory under \`openspec/changes/\` by hand. Always use \`openspec new change "<name>"\` (with \`--store <id>\` when applicable) so required metadata such as \`.openspec.yaml\` is created before writing artifacts.
495
+ - **Do visualize** - A good diagram is worth many paragraphs
496
+ - **Do explore the codebase** - Ground discussions in reality
461
497
  - **Do question assumptions** - Including the user's and your own`
462
498
  };
463
499
  }