@jspg-ai/coding-bb 0.0.1 → 0.0.2-beta.22

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 (145) hide show
  1. package/cbb/bin/cbb.js +6 -0
  2. package/cbb/bin/cbbm.js +6 -0
  3. package/cbb/dev-standards/rules/cbb-ai-behavior.md +103 -103
  4. package/cbb/dev-standards/rules/cbb-priority.md +55 -55
  5. package/cbb/lib/install/claude-code.js +2 -0
  6. package/cbb/lib/install/init.js +496 -290
  7. package/cbb/lib/install/opencode.js +31 -0
  8. package/cbb/lib/install/qoder.js +2 -0
  9. package/cbb/lib/install/workspaces.js +53 -13
  10. package/cbb/lib/openspec/index.js +3 -3
  11. package/cbb/lib/superpowers/index.js +1 -1
  12. package/cbb/lib/utils/check-update.js +16 -14
  13. package/cbb/lib/utils/gitignore.js +2 -1
  14. package/cbb/lib/utils/output.js +92 -4
  15. package/cbb/lib/utils/version.js +2 -31
  16. package/cbb/lib/wiki/cli.js +25 -25
  17. package/cbb/lib/wiki/index.js +16 -16
  18. package/cbb/tools/cbb-design-to-wiki/SKILL.md +14 -14
  19. package/cbb/tools/cbb-wiki-ops/SKILL.md +22 -22
  20. package/cbb/worktrees/_shared/scripts/find-target-worktree.js +2 -2
  21. package/cbb/worktrees/_shared/scripts/find-workspace-root.js +7 -7
  22. package/cbb/worktrees/_shared/scripts/push-core.js +18 -0
  23. package/cbb/worktrees/commands/{close.md → worktree-close.md} +8 -8
  24. package/cbb/worktrees/commands/{init.md → worktree-init.md} +9 -9
  25. package/cbb/worktrees/commands/{push.md → worktree-push.md} +3 -3
  26. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/SKILL.md +20 -20
  27. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/check-env.js +4 -4
  28. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/check-unarchived.js +1 -1
  29. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/delete-branches.js +3 -3
  30. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/discover-apps.js +6 -6
  31. package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-close}/scripts/find-target-worktree.js +2 -2
  32. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-close}/scripts/find-workspace-root.js +7 -7
  33. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/remove-worktrees.js +4 -4
  34. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/safety-check.js +4 -4
  35. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/SKILL.md +81 -107
  36. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/auto-open.js +1 -1
  37. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/check-env-deep.js +4 -4
  38. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/check-env.js +6 -6
  39. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/check-repos.js +4 -4
  40. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/create-branches.js +4 -4
  41. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/create-worktrees.js +8 -7
  42. package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-init}/scripts/find-workspace-root.js +7 -7
  43. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/install-ai.js +33 -33
  44. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/parse-config.js +7 -7
  45. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/push-branches.js +9 -7
  46. package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-init}/scripts/push-core.js +18 -0
  47. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/sync-repos.js +10 -12
  48. package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-init}/scripts/update-gitignore.js +19 -6
  49. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/SKILL.md +16 -16
  50. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/commit-worktrees.js +2 -2
  51. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/find-target-worktree.js +2 -2
  52. package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-push}/scripts/find-workspace-root.js +7 -7
  53. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/push-core.js +18 -0
  54. package/cbb/worktrees/skills/{openspec-push-worktrees → cbb-worktree-push}/scripts/push-worktrees.js +7 -5
  55. package/config/workspace-config.sample.json +18 -0
  56. package/config/workspaces.json +11 -6
  57. package/openspec/.version +6 -6
  58. package/openspec/commands/apply.md +7 -7
  59. package/openspec/commands/archive.md +7 -7
  60. package/openspec/commands/bulk-archive.md +7 -7
  61. package/openspec/commands/continue.md +7 -7
  62. package/openspec/commands/explore.md +7 -7
  63. package/openspec/commands/ff.md +7 -7
  64. package/openspec/commands/new.md +7 -7
  65. package/openspec/commands/onboard.md +7 -7
  66. package/openspec/commands/propose.md +7 -7
  67. package/openspec/commands/sync.md +7 -7
  68. package/openspec/commands/update.md +7 -7
  69. package/openspec/commands/verify.md +7 -7
  70. package/openspec/skills/openspec-apply-change/SKILL.md +187 -187
  71. package/openspec/skills/openspec-archive-change/SKILL.md +181 -181
  72. package/openspec/skills/openspec-bulk-archive-change/SKILL.md +338 -338
  73. package/openspec/skills/openspec-continue-change/SKILL.md +117 -117
  74. package/openspec/skills/openspec-explore/SKILL.md +342 -342
  75. package/openspec/skills/openspec-ff-change/SKILL.md +116 -116
  76. package/openspec/skills/openspec-new-change/SKILL.md +76 -76
  77. package/openspec/skills/openspec-onboard/SKILL.md +560 -560
  78. package/openspec/skills/openspec-propose/SKILL.md +162 -162
  79. package/openspec/skills/openspec-sync-specs/SKILL.md +261 -261
  80. package/openspec/skills/openspec-update-change/SKILL.md +90 -90
  81. package/openspec/skills/openspec-verify-change/SKILL.md +174 -174
  82. package/package.json +4 -3
  83. package/superpowers/.version +6 -6
  84. package/superpowers/skills/brainstorming/SKILL.md +250 -250
  85. package/superpowers/skills/brainstorming/scripts/helper.js +167 -167
  86. package/superpowers/skills/brainstorming/scripts/start-server.sh +209 -209
  87. package/superpowers/skills/brainstorming/scripts/stop-server.sh +120 -120
  88. package/superpowers/skills/brainstorming/spec-document-reviewer-prompt.md +49 -49
  89. package/superpowers/skills/brainstorming/visual-companion.md +299 -299
  90. package/superpowers/skills/dispatching-parallel-agents/SKILL.md +167 -167
  91. package/superpowers/skills/executing-plans/SKILL.md +64 -64
  92. package/superpowers/skills/finishing-a-development-branch/SKILL.md +225 -225
  93. package/superpowers/skills/receiving-code-review/SKILL.md +205 -205
  94. package/superpowers/skills/requesting-code-review/SKILL.md +95 -95
  95. package/superpowers/skills/requesting-code-review/code-reviewer.md +181 -181
  96. package/superpowers/skills/subagent-driven-development/SKILL.md +568 -568
  97. package/superpowers/skills/subagent-driven-development/implementer-prompt.md +154 -154
  98. package/superpowers/skills/subagent-driven-development/re-review-prompt.md +115 -115
  99. package/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +207 -207
  100. package/superpowers/skills/systematic-debugging/CREATION-LOG.md +119 -119
  101. package/superpowers/skills/systematic-debugging/SKILL.md +283 -283
  102. package/superpowers/skills/systematic-debugging/condition-based-waiting-example.ts +158 -158
  103. package/superpowers/skills/systematic-debugging/condition-based-waiting.md +115 -115
  104. package/superpowers/skills/systematic-debugging/defense-in-depth.md +122 -122
  105. package/superpowers/skills/systematic-debugging/find-polluter.sh +72 -72
  106. package/superpowers/skills/systematic-debugging/root-cause-tracing.md +169 -169
  107. package/superpowers/skills/systematic-debugging/test-academic.md +14 -14
  108. package/superpowers/skills/systematic-debugging/test-pressure-1.md +58 -58
  109. package/superpowers/skills/systematic-debugging/test-pressure-2.md +68 -68
  110. package/superpowers/skills/systematic-debugging/test-pressure-3.md +69 -69
  111. package/superpowers/skills/test-driven-development/SKILL.md +320 -320
  112. package/superpowers/skills/test-driven-development/writing-good-tests.md +198 -198
  113. package/superpowers/skills/using-git-worktrees/SKILL.md +167 -167
  114. package/superpowers/skills/using-superpowers/SKILL.md +63 -63
  115. package/superpowers/skills/using-superpowers/references/antigravity-tools.md +23 -23
  116. package/superpowers/skills/using-superpowers/references/codex-tools.md +108 -108
  117. package/superpowers/skills/using-superpowers/references/gemini-tools.md +63 -63
  118. package/superpowers/skills/using-superpowers/references/hermes-tools.md +56 -56
  119. package/superpowers/skills/using-superpowers/references/pi-tools.md +16 -16
  120. package/superpowers/skills/verification-before-completion/SKILL.md +120 -120
  121. package/superpowers/skills/writing-plans/SKILL.md +171 -171
  122. package/superpowers/skills/writing-plans/plan-document-reviewer-prompt.md +49 -49
  123. package/superpowers/skills/writing-skills/SKILL.md +679 -679
  124. package/superpowers/skills/writing-skills/anthropic-best-practices.md +1150 -1150
  125. package/superpowers/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -189
  126. package/superpowers/skills/writing-skills/persuasion-principles.md +187 -187
  127. package/superpowers/skills/writing-skills/render-graphs.js +169 -169
  128. package/superpowers/skills/writing-skills/testing-skills-with-subagents.md +384 -384
  129. package/cbb/worktrees/commands/extend.md +0 -65
  130. package/cbb/worktrees/skills/openspec-close-worktree/scripts/find-target-worktree.js +0 -96
  131. package/cbb/worktrees/skills/openspec-extend-worktree/SKILL.md +0 -390
  132. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/check-env.js +0 -95
  133. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/check-repos.js +0 -98
  134. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/create-branches-and-worktrees.js +0 -135
  135. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/install-ai.js +0 -150
  136. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/list-available-apps.js +0 -88
  137. package/cbb/worktrees/skills/openspec-extend-worktree/scripts/sync-repos.js +0 -93
  138. package/cbb/worktrees/skills/openspec-init-worktree/scripts/find-workspace-root.js +0 -67
  139. package/cbb/worktrees/skills/openspec-init-worktree/scripts/generate-app-options.js +0 -93
  140. package/cbb/worktrees/skills/openspec-init-worktree/scripts/push-core.js +0 -136
  141. package/cbb/worktrees/skills/openspec-push-worktrees/scripts/silence-popup.js +0 -23
  142. package/config/config.sample.json +0 -16
  143. /package/cbb/worktrees/skills/{openspec-close-worktree → cbb-worktree-close}/scripts/silence-popup.js +0 -0
  144. /package/cbb/worktrees/skills/{openspec-extend-worktree → cbb-worktree-init}/scripts/silence-popup.js +0 -0
  145. /package/cbb/worktrees/skills/{openspec-init-worktree → cbb-worktree-push}/scripts/silence-popup.js +0 -0
@@ -1,342 +1,342 @@
1
- ---
2
- name: openspec-explore
3
- 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.
4
- allowed-tools: Bash(openspec:*)
5
- license: MIT
6
- compatibility: Requires openspec CLI.
7
- metadata:
8
- author: openspec
9
- version: "1.0"
10
- ---
11
-
12
- Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
13
-
14
- **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, investigate the codebase, and run read-only commands or tools without confirmation, 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 or update OpenSpec change artifacts (proposals, designs, specs) within a confirmed scope—that's capturing thinking, not implementing. Answering design or clarifying questions is never consent to write. Before the first write-capable action, name the artifacts or files you would change and what you would do, ask a direct yes/no question, and wait for the user's confirmation in a separate message. Confirmation covers only the scope you described; ask again before expanding it. For a new change, scaffold it first as described below.
15
-
16
- **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.
17
-
18
- **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
19
-
20
- ---
21
-
22
- ## The Stance
23
-
24
- - **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
25
- - **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.
26
- - **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
27
- - **Adaptive** - Follow interesting threads, pivot when new information emerges
28
- - **Patient** - Don't rush to conclusions, let the shape of the problem emerge
29
- - **Grounded** - Explore the actual codebase when relevant, don't just theorize
30
-
31
- ---
32
-
33
- ## Planning a Change
34
-
35
- When the user is planning a change, guide them toward shared understanding with focused discovery questions. For open-ended discussion, follow the conversation without imposing an interview or a required output.
36
-
37
- Before asking a factual question, follow the context discovery below and inspect relevant OpenSpec artifacts, source, tests, docs, and configuration. Do not ask the user to repeat facts you can verify. Summarize relevant findings without reproducing private context or rules. If evidence is missing, conflicting, or inaccessible, state that limitation and ask only for the clarification needed to proceed.
38
-
39
- - **Follow dependencies** - Resolve the next blocking decision before its dependent details. For example, clarify the user's outcome and scope before choosing an API or data model. Revisit downstream assumptions when an earlier answer changes. Skip branches that do not matter to this goal.
40
- - **Keep questions focused** - Ask one focused question at a time, and briefly explain why it matters and which decision it unlocks. Batch questions only if the user asks for a batch; keep them small and group related decisions.
41
- - **Offer grounded recommendations** - When evidence supports a recommendation, state your preferred option and why it fits the user's goals, with alternatives and their tradeoffs when useful. Do not invent intent, priorities, or external constraints: ask the user when only they can answer. Avoid a fixed question format.
42
- - **Keep a conversational record** - Track decisions in the conversation, not in files. Separate confirmed decisions from proposed defaults and unresolved questions. Silence is not acceptance. Accepting an answer or a batch of recommendations is not permission to write. Keep file-write confirmation separate from discovery questions and follow the guardrails below.
43
-
44
- Stop asking when the user has enough clarity. Let them pause, pivot, or defer a decision; do not exhaust every branch or force a proposal.
45
-
46
- For example, after inspecting the relevant code:
47
-
48
- ```text
49
- The CLI already uses SQLite and has no remote service. Is sharing state
50
- across devices in scope? That determines whether local storage is enough.
51
- If this stays a single-device tool, I recommend keeping SQLite to avoid
52
- adding a service to operate; shared state would need a separate sync design.
53
- ```
54
-
55
- ---
56
-
57
- ## What You Might Do
58
-
59
- Depending on what the user brings, you might:
60
-
61
- **Explore the problem space**
62
- - Ask clarifying questions that emerge from what they said
63
- - Challenge assumptions
64
- - Reframe the problem
65
- - Find analogies
66
-
67
- **Investigate the codebase**
68
- - Map existing architecture relevant to the discussion
69
- - Find integration points
70
- - Identify patterns already in use
71
- - Surface hidden complexity
72
-
73
- **Compare options**
74
- - Brainstorm multiple approaches
75
- - Build comparison tables
76
- - Sketch tradeoffs
77
- - Recommend a path (if asked)
78
-
79
- **Visualize**
80
- ```
81
- +------------------------------------------+
82
- | Use ASCII diagrams liberally |
83
- +------------------------------------------+
84
- | |
85
- | [State A] -------> [State B] |
86
- | | |
87
- | v |
88
- | [State C] |
89
- | |
90
- | System diagrams, state machines, |
91
- | data flows, architecture sketches, |
92
- | dependency graphs, comparison tables |
93
- | |
94
- +------------------------------------------+
95
- ```
96
-
97
- **Draw with plain ASCII only** — borders `+` `-` `|`, arrows `-->` `<--` `^` `v`, markers `*` `x`.
98
- Unicode diagram glyphs can render at different widths across terminals, fonts, and locales, so padded boxes and aligned tables can drift. Keep every diagram character ASCII.
99
-
100
- **Surface risks and unknowns**
101
- - Identify what could go wrong
102
- - Find gaps in understanding
103
- - Suggest spikes or investigations
104
-
105
- ---
106
-
107
- ## OpenSpec Awareness
108
-
109
- You have full context of the OpenSpec system. Use it naturally, don't force it.
110
-
111
- ### Check for context
112
-
113
- At the start, quickly check what exists:
114
- ```bash
115
- openspec list --json
116
- ```
117
-
118
- This tells you:
119
- - If there are active changes
120
- - Their names, schemas, and status
121
- - What the user might be working on
122
-
123
- That is the *change* list - work in flight. It does not include the project's durable capabilities, so list those too:
124
- ```bash
125
- openspec list --specs
126
- ```
127
- Add `--json` for ids and requirement counts, and append `--store "<id>"` only for a registered standalone store. This is the inventory of what the project already claims to do, and `openspec list` on its own never shows it. To look at one, run `openspec show "<spec-id>" --type spec --json --no-scenarios` (same `--store` rule) - it returns that capability's purpose and requirement texts without pulling the whole spec file into context, and `--type spec` stops a change of the same name from making it ambiguous.
128
-
129
- The filtered read is only an overview. Before deciding what is already covered or what should change, read each relevant spec in full, including scenarios, with `openspec show "<spec-id>" --type spec` (same `--store` rule).
130
-
131
- 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:
132
- - `context`: project background - tech stack, conventions, constraints
133
- - `rules`: keyed by artifact id - the entries for an artifact apply only when you write that artifact
134
-
135
- 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.
136
-
137
- ### When no change exists
138
-
139
- Think freely. When insights crystallize, you might offer:
140
-
141
- - "This feels solid enough to start a change. Want me to create a proposal?"
142
- - Or keep exploring - no pressure to formalize
143
-
144
- If the user asks you to capture the exploration as a new change, transition seamlessly into the requested capture:
145
-
146
- 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.
147
- 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.
148
- 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.
149
- 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.
150
-
151
- 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.
152
-
153
- ### When a change exists
154
-
155
- If the user mentions a change or you detect one is relevant:
156
-
157
- 1. **Resolve and read existing artifacts for context**
158
- - Run `openspec status --change "<name>" --json`.
159
- - Use `changeRoot`, `artifactPaths`, and `actionContext` from the status JSON.
160
- - Read existing files from `artifactPaths.<artifact>.existingOutputPaths`.
161
-
162
- 2. **Reference them naturally in conversation**
163
- - "Your design mentions using Redis, but we just realized SQLite fits better..."
164
- - "The proposal scopes this to premium users, but we're now thinking everyone..."
165
-
166
- 3. **Offer to capture when decisions are made**
167
-
168
- `<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.
169
-
170
- | Insight Type | Where to Capture |
171
- |----------------------------|-------------------------------------|
172
- | New requirement discovered | `specs/<capability-path>/spec.md` |
173
- | Requirement changed | `specs/<capability-path>/spec.md` |
174
- | Design decision made | `design.md` |
175
- | Scope changed | `proposal.md` |
176
- | New work identified | `tasks.md` |
177
- | Assumption invalidated | Relevant artifact |
178
-
179
- Example offers:
180
- - "That's a design decision. Capture it in design.md?"
181
- - "This is a new requirement. Add it to specs?"
182
- - "This changes scope. Update the proposal?"
183
-
184
- 4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
185
-
186
- ---
187
-
188
- ## What You Don't Have To Do
189
-
190
- - Follow a script
191
- - Ask the same questions every time
192
- - Produce a specific artifact
193
- - Reach a conclusion
194
- - Stay on topic if a tangent is valuable
195
- - Be brief (this is thinking time)
196
-
197
- ---
198
-
199
- ## Handling Different Entry Points
200
-
201
- **User brings a vague idea:**
202
- ```
203
- User: I'm thinking about adding real-time collaboration
204
-
205
- You: Real-time collab is a big space. Let me think about this...
206
-
207
- COLLABORATION SPECTRUM
208
- ============================================
209
-
210
- Awareness Coordination Sync
211
- | | |
212
- v v v
213
- +--------+ +--------+ +--------+
214
- |Presence| |Cursors | | CRDT |
215
- | "3 | | Multi | |Conflict|
216
- |online" | | select | | free |
217
- +--------+ +--------+ +--------+
218
- | | |
219
- trivial moderate complex
220
-
221
- Where's your head at?
222
- ```
223
-
224
- **User brings a specific problem:**
225
- ```
226
- User: The auth system is a mess
227
-
228
- You: [reads codebase]
229
-
230
- +---------------------------------------------+
231
- | CURRENT AUTH FLOW |
232
- +---------------------------------------------+
233
- |
234
- +-------------+-------------+
235
- v v v
236
- +---------+ +---------+ +---------+
237
- | Google | | GitHub | | Email |
238
- | OAuth | | OAuth | | Magic |
239
- +----+----+ +----+----+ +----+----+
240
- | | |
241
- +-------------+-------------+
242
- v
243
- +-----------+
244
- | Session |
245
- +-----+-----+
246
- |
247
- v
248
- +-----------+
249
- | Perms |
250
- +-----------+
251
-
252
- I see three tangles. Which one's burning?
253
- ```
254
-
255
- **User is stuck mid-implementation:**
256
- ```
257
- User: /openspec-explore add-auth-system
258
- The OAuth integration is more complex than expected
259
-
260
- You: [reads change artifacts]
261
-
262
- You're on task 4: "Implement OAuth flow"
263
-
264
- Let me trace what's involved...
265
-
266
- [draws diagram, explores options, suggests paths]
267
-
268
- Want to update the design to reflect this?
269
- Or add a spike task to investigate?
270
- ```
271
-
272
- **User wants to compare options:**
273
- ```
274
- User: Should we use Postgres or SQLite?
275
-
276
- You: Generic answer is boring. What's the context?
277
-
278
- User: A CLI tool that tracks local dev environments
279
-
280
- You: That changes everything.
281
-
282
- +-------------------------------------------------+
283
- | CLI TOOL DATA STORAGE |
284
- +-------------------------------------------------+
285
-
286
- Key constraints:
287
- - No daemon running
288
- - Must work offline
289
- - Single user
290
-
291
- SQLite Postgres
292
- Deployment embedded needs server
293
- Offline yes no
294
- Single file yes no
295
-
296
- SQLite. Not even close.
297
-
298
- Unless... is there a sync component?
299
- ```
300
-
301
- ---
302
-
303
- ## Ending Discovery
304
-
305
- There's no required ending. Discovery might:
306
-
307
- - **Flow into a proposal**: "Ready to start? I can create a change proposal."
308
- - **Result in artifact updates**: "Updated design.md with these decisions"
309
- - **Just provide clarity**: User has what they need, moves on
310
- - **Continue later**: "We can pick this up anytime"
311
-
312
- When it feels like things are crystallizing, you might summarize:
313
-
314
- ```
315
- ## What We Figured Out
316
-
317
- **The problem**: [crystallized understanding]
318
-
319
- **The approach**: [if one emerged]
320
-
321
- **Open questions**: [if any remain]
322
-
323
- **Next steps** (if ready):
324
- - Create a change proposal
325
- - Keep exploring: just keep talking
326
- ```
327
-
328
- But this summary is optional. Sometimes the thinking IS the value.
329
-
330
- ---
331
-
332
- ## Guardrails
333
-
334
- - **Don't implement** - Never write code or implement features. Workflow configuration counts too: creating or editing schemas, templates, or `openspec/config.yaml` is a change, not thinking. Creating or updating OpenSpec change artifacts within the confirmed scope is fine, writing anything else is not.
335
- - **Don't fake understanding** - If something is unclear, dig deeper
336
- - **Don't rush** - Discovery is thinking time, not task time
337
- - **Don't force structure** - Let patterns emerge naturally
338
- - **Don't auto-capture** - Offer to save insights, don't just do it. Read-only commands and tools need no confirmation. Before the first write-capable action—including `openspec new change` or another command that writes files—name the artifacts or files and proposed changes, ask a direct yes/no question, and wait for explicit confirmation in a separate user message. That confirmation covers only the described scope; ask again before expanding it. Answers to design or clarifying questions are never consent to write.
339
- - **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.
340
- - **Do visualize** - A good diagram is worth many paragraphs
341
- - **Do explore the codebase** - Ground discussions in reality
342
- - **Do question assumptions** - Including the user's and your own
1
+ ---
2
+ name: openspec-explore
3
+ 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.
4
+ allowed-tools: Bash(openspec:*)
5
+ license: MIT
6
+ compatibility: Requires openspec CLI.
7
+ metadata:
8
+ author: openspec
9
+ version: "1.0"
10
+ ---
11
+
12
+ Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
13
+
14
+ **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, investigate the codebase, and run read-only commands or tools without confirmation, 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 or update OpenSpec change artifacts (proposals, designs, specs) within a confirmed scope—that's capturing thinking, not implementing. Answering design or clarifying questions is never consent to write. Before the first write-capable action, name the artifacts or files you would change and what you would do, ask a direct yes/no question, and wait for the user's confirmation in a separate message. Confirmation covers only the scope you described; ask again before expanding it. For a new change, scaffold it first as described below.
15
+
16
+ **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.
17
+
18
+ **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
19
+
20
+ ---
21
+
22
+ ## The Stance
23
+
24
+ - **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
25
+ - **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.
26
+ - **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
27
+ - **Adaptive** - Follow interesting threads, pivot when new information emerges
28
+ - **Patient** - Don't rush to conclusions, let the shape of the problem emerge
29
+ - **Grounded** - Explore the actual codebase when relevant, don't just theorize
30
+
31
+ ---
32
+
33
+ ## Planning a Change
34
+
35
+ When the user is planning a change, guide them toward shared understanding with focused discovery questions. For open-ended discussion, follow the conversation without imposing an interview or a required output.
36
+
37
+ Before asking a factual question, follow the context discovery below and inspect relevant OpenSpec artifacts, source, tests, docs, and configuration. Do not ask the user to repeat facts you can verify. Summarize relevant findings without reproducing private context or rules. If evidence is missing, conflicting, or inaccessible, state that limitation and ask only for the clarification needed to proceed.
38
+
39
+ - **Follow dependencies** - Resolve the next blocking decision before its dependent details. For example, clarify the user's outcome and scope before choosing an API or data model. Revisit downstream assumptions when an earlier answer changes. Skip branches that do not matter to this goal.
40
+ - **Keep questions focused** - Ask one focused question at a time, and briefly explain why it matters and which decision it unlocks. Batch questions only if the user asks for a batch; keep them small and group related decisions.
41
+ - **Offer grounded recommendations** - When evidence supports a recommendation, state your preferred option and why it fits the user's goals, with alternatives and their tradeoffs when useful. Do not invent intent, priorities, or external constraints: ask the user when only they can answer. Avoid a fixed question format.
42
+ - **Keep a conversational record** - Track decisions in the conversation, not in files. Separate confirmed decisions from proposed defaults and unresolved questions. Silence is not acceptance. Accepting an answer or a batch of recommendations is not permission to write. Keep file-write confirmation separate from discovery questions and follow the guardrails below.
43
+
44
+ Stop asking when the user has enough clarity. Let them pause, pivot, or defer a decision; do not exhaust every branch or force a proposal.
45
+
46
+ For example, after inspecting the relevant code:
47
+
48
+ ```text
49
+ The CLI already uses SQLite and has no remote service. Is sharing state
50
+ across devices in scope? That determines whether local storage is enough.
51
+ If this stays a single-device tool, I recommend keeping SQLite to avoid
52
+ adding a service to operate; shared state would need a separate sync design.
53
+ ```
54
+
55
+ ---
56
+
57
+ ## What You Might Do
58
+
59
+ Depending on what the user brings, you might:
60
+
61
+ **Explore the problem space**
62
+ - Ask clarifying questions that emerge from what they said
63
+ - Challenge assumptions
64
+ - Reframe the problem
65
+ - Find analogies
66
+
67
+ **Investigate the codebase**
68
+ - Map existing architecture relevant to the discussion
69
+ - Find integration points
70
+ - Identify patterns already in use
71
+ - Surface hidden complexity
72
+
73
+ **Compare options**
74
+ - Brainstorm multiple approaches
75
+ - Build comparison tables
76
+ - Sketch tradeoffs
77
+ - Recommend a path (if asked)
78
+
79
+ **Visualize**
80
+ ```
81
+ +------------------------------------------+
82
+ | Use ASCII diagrams liberally |
83
+ +------------------------------------------+
84
+ | |
85
+ | [State A] -------> [State B] |
86
+ | | |
87
+ | v |
88
+ | [State C] |
89
+ | |
90
+ | System diagrams, state machines, |
91
+ | data flows, architecture sketches, |
92
+ | dependency graphs, comparison tables |
93
+ | |
94
+ +------------------------------------------+
95
+ ```
96
+
97
+ **Draw with plain ASCII only** — borders `+` `-` `|`, arrows `-->` `<--` `^` `v`, markers `*` `x`.
98
+ Unicode diagram glyphs can render at different widths across terminals, fonts, and locales, so padded boxes and aligned tables can drift. Keep every diagram character ASCII.
99
+
100
+ **Surface risks and unknowns**
101
+ - Identify what could go wrong
102
+ - Find gaps in understanding
103
+ - Suggest spikes or investigations
104
+
105
+ ---
106
+
107
+ ## OpenSpec Awareness
108
+
109
+ You have full context of the OpenSpec system. Use it naturally, don't force it.
110
+
111
+ ### Check for context
112
+
113
+ At the start, quickly check what exists:
114
+ ```bash
115
+ openspec list --json
116
+ ```
117
+
118
+ This tells you:
119
+ - If there are active changes
120
+ - Their names, schemas, and status
121
+ - What the user might be working on
122
+
123
+ That is the *change* list - work in flight. It does not include the project's durable capabilities, so list those too:
124
+ ```bash
125
+ openspec list --specs
126
+ ```
127
+ Add `--json` for ids and requirement counts, and append `--store "<id>"` only for a registered standalone store. This is the inventory of what the project already claims to do, and `openspec list` on its own never shows it. To look at one, run `openspec show "<spec-id>" --type spec --json --no-scenarios` (same `--store` rule) - it returns that capability's purpose and requirement texts without pulling the whole spec file into context, and `--type spec` stops a change of the same name from making it ambiguous.
128
+
129
+ The filtered read is only an overview. Before deciding what is already covered or what should change, read each relevant spec in full, including scenarios, with `openspec show "<spec-id>" --type spec` (same `--store` rule).
130
+
131
+ 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:
132
+ - `context`: project background - tech stack, conventions, constraints
133
+ - `rules`: keyed by artifact id - the entries for an artifact apply only when you write that artifact
134
+
135
+ 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.
136
+
137
+ ### When no change exists
138
+
139
+ Think freely. When insights crystallize, you might offer:
140
+
141
+ - "This feels solid enough to start a change. Want me to create a proposal?"
142
+ - Or keep exploring - no pressure to formalize
143
+
144
+ If the user asks you to capture the exploration as a new change, transition seamlessly into the requested capture:
145
+
146
+ 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.
147
+ 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.
148
+ 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.
149
+ 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.
150
+
151
+ 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.
152
+
153
+ ### When a change exists
154
+
155
+ If the user mentions a change or you detect one is relevant:
156
+
157
+ 1. **Resolve and read existing artifacts for context**
158
+ - Run `openspec status --change "<name>" --json`.
159
+ - Use `changeRoot`, `artifactPaths`, and `actionContext` from the status JSON.
160
+ - Read existing files from `artifactPaths.<artifact>.existingOutputPaths`.
161
+
162
+ 2. **Reference them naturally in conversation**
163
+ - "Your design mentions using Redis, but we just realized SQLite fits better..."
164
+ - "The proposal scopes this to premium users, but we're now thinking everyone..."
165
+
166
+ 3. **Offer to capture when decisions are made**
167
+
168
+ `<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.
169
+
170
+ | Insight Type | Where to Capture |
171
+ |----------------------------|-------------------------------------|
172
+ | New requirement discovered | `specs/<capability-path>/spec.md` |
173
+ | Requirement changed | `specs/<capability-path>/spec.md` |
174
+ | Design decision made | `design.md` |
175
+ | Scope changed | `proposal.md` |
176
+ | New work identified | `tasks.md` |
177
+ | Assumption invalidated | Relevant artifact |
178
+
179
+ Example offers:
180
+ - "That's a design decision. Capture it in design.md?"
181
+ - "This is a new requirement. Add it to specs?"
182
+ - "This changes scope. Update the proposal?"
183
+
184
+ 4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
185
+
186
+ ---
187
+
188
+ ## What You Don't Have To Do
189
+
190
+ - Follow a script
191
+ - Ask the same questions every time
192
+ - Produce a specific artifact
193
+ - Reach a conclusion
194
+ - Stay on topic if a tangent is valuable
195
+ - Be brief (this is thinking time)
196
+
197
+ ---
198
+
199
+ ## Handling Different Entry Points
200
+
201
+ **User brings a vague idea:**
202
+ ```
203
+ User: I'm thinking about adding real-time collaboration
204
+
205
+ You: Real-time collab is a big space. Let me think about this...
206
+
207
+ COLLABORATION SPECTRUM
208
+ ============================================
209
+
210
+ Awareness Coordination Sync
211
+ | | |
212
+ v v v
213
+ +--------+ +--------+ +--------+
214
+ |Presence| |Cursors | | CRDT |
215
+ | "3 | | Multi | |Conflict|
216
+ |online" | | select | | free |
217
+ +--------+ +--------+ +--------+
218
+ | | |
219
+ trivial moderate complex
220
+
221
+ Where's your head at?
222
+ ```
223
+
224
+ **User brings a specific problem:**
225
+ ```
226
+ User: The auth system is a mess
227
+
228
+ You: [reads codebase]
229
+
230
+ +---------------------------------------------+
231
+ | CURRENT AUTH FLOW |
232
+ +---------------------------------------------+
233
+ |
234
+ +-------------+-------------+
235
+ v v v
236
+ +---------+ +---------+ +---------+
237
+ | Google | | GitHub | | Email |
238
+ | OAuth | | OAuth | | Magic |
239
+ +----+----+ +----+----+ +----+----+
240
+ | | |
241
+ +-------------+-------------+
242
+ v
243
+ +-----------+
244
+ | Session |
245
+ +-----+-----+
246
+ |
247
+ v
248
+ +-----------+
249
+ | Perms |
250
+ +-----------+
251
+
252
+ I see three tangles. Which one's burning?
253
+ ```
254
+
255
+ **User is stuck mid-implementation:**
256
+ ```
257
+ User: /openspec-explore add-auth-system
258
+ The OAuth integration is more complex than expected
259
+
260
+ You: [reads change artifacts]
261
+
262
+ You're on task 4: "Implement OAuth flow"
263
+
264
+ Let me trace what's involved...
265
+
266
+ [draws diagram, explores options, suggests paths]
267
+
268
+ Want to update the design to reflect this?
269
+ Or add a spike task to investigate?
270
+ ```
271
+
272
+ **User wants to compare options:**
273
+ ```
274
+ User: Should we use Postgres or SQLite?
275
+
276
+ You: Generic answer is boring. What's the context?
277
+
278
+ User: A CLI tool that tracks local dev environments
279
+
280
+ You: That changes everything.
281
+
282
+ +-------------------------------------------------+
283
+ | CLI TOOL DATA STORAGE |
284
+ +-------------------------------------------------+
285
+
286
+ Key constraints:
287
+ - No daemon running
288
+ - Must work offline
289
+ - Single user
290
+
291
+ SQLite Postgres
292
+ Deployment embedded needs server
293
+ Offline yes no
294
+ Single file yes no
295
+
296
+ SQLite. Not even close.
297
+
298
+ Unless... is there a sync component?
299
+ ```
300
+
301
+ ---
302
+
303
+ ## Ending Discovery
304
+
305
+ There's no required ending. Discovery might:
306
+
307
+ - **Flow into a proposal**: "Ready to start? I can create a change proposal."
308
+ - **Result in artifact updates**: "Updated design.md with these decisions"
309
+ - **Just provide clarity**: User has what they need, moves on
310
+ - **Continue later**: "We can pick this up anytime"
311
+
312
+ When it feels like things are crystallizing, you might summarize:
313
+
314
+ ```
315
+ ## What We Figured Out
316
+
317
+ **The problem**: [crystallized understanding]
318
+
319
+ **The approach**: [if one emerged]
320
+
321
+ **Open questions**: [if any remain]
322
+
323
+ **Next steps** (if ready):
324
+ - Create a change proposal
325
+ - Keep exploring: just keep talking
326
+ ```
327
+
328
+ But this summary is optional. Sometimes the thinking IS the value.
329
+
330
+ ---
331
+
332
+ ## Guardrails
333
+
334
+ - **Don't implement** - Never write code or implement features. Workflow configuration counts too: creating or editing schemas, templates, or `openspec/config.yaml` is a change, not thinking. Creating or updating OpenSpec change artifacts within the confirmed scope is fine, writing anything else is not.
335
+ - **Don't fake understanding** - If something is unclear, dig deeper
336
+ - **Don't rush** - Discovery is thinking time, not task time
337
+ - **Don't force structure** - Let patterns emerge naturally
338
+ - **Don't auto-capture** - Offer to save insights, don't just do it. Read-only commands and tools need no confirmation. Before the first write-capable action—including `openspec new change` or another command that writes files—name the artifacts or files and proposed changes, ask a direct yes/no question, and wait for explicit confirmation in a separate user message. That confirmation covers only the described scope; ask again before expanding it. Answers to design or clarifying questions are never consent to write.
339
+ - **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.
340
+ - **Do visualize** - A good diagram is worth many paragraphs
341
+ - **Do explore the codebase** - Ground discussions in reality
342
+ - **Do question assumptions** - Including the user's and your own