@ias-ai/zhima-spec 1.3.6 → 1.3.8

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 (59) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +206 -206
  3. package/bin/zhima.js +2 -2
  4. package/dist/commands/feedback.js +4 -4
  5. package/dist/commands/schema.js +60 -60
  6. package/dist/core/command-generation/adapters/amazon-q.js +5 -5
  7. package/dist/core/command-generation/adapters/antigravity.js +5 -5
  8. package/dist/core/command-generation/adapters/auggie.js +6 -6
  9. package/dist/core/command-generation/adapters/bob.js +6 -6
  10. package/dist/core/command-generation/adapters/claude.js +8 -8
  11. package/dist/core/command-generation/adapters/cline.js +5 -5
  12. package/dist/core/command-generation/adapters/codebuddy.js +7 -7
  13. package/dist/core/command-generation/adapters/codex.js +6 -6
  14. package/dist/core/command-generation/adapters/continue.js +7 -7
  15. package/dist/core/command-generation/adapters/costrict.js +6 -6
  16. package/dist/core/command-generation/adapters/crush.js +8 -8
  17. package/dist/core/command-generation/adapters/cursor.js +8 -8
  18. package/dist/core/command-generation/adapters/factory.js +6 -6
  19. package/dist/core/command-generation/adapters/gemini.js +5 -5
  20. package/dist/core/command-generation/adapters/github-copilot.js +5 -5
  21. package/dist/core/command-generation/adapters/iflow.js +8 -8
  22. package/dist/core/command-generation/adapters/junie.js +5 -5
  23. package/dist/core/command-generation/adapters/kilocode.js +1 -1
  24. package/dist/core/command-generation/adapters/kiro.js +5 -5
  25. package/dist/core/command-generation/adapters/lingma.js +8 -8
  26. package/dist/core/command-generation/adapters/opencode.js +5 -5
  27. package/dist/core/command-generation/adapters/pi.js +5 -5
  28. package/dist/core/command-generation/adapters/qoder.js +8 -8
  29. package/dist/core/command-generation/adapters/qwen.js +5 -5
  30. package/dist/core/command-generation/adapters/roocode.js +5 -5
  31. package/dist/core/command-generation/adapters/vjsp.d.ts +1 -1
  32. package/dist/core/command-generation/adapters/vjsp.js +8 -8
  33. package/dist/core/command-generation/adapters/windsurf.js +8 -8
  34. package/dist/core/command-generation/registry.js +2 -0
  35. package/dist/core/completions/generators/bash-generator.js +41 -41
  36. package/dist/core/completions/generators/fish-generator.js +7 -7
  37. package/dist/core/completions/generators/powershell-generator.js +29 -29
  38. package/dist/core/completions/generators/zsh-generator.js +33 -33
  39. package/dist/core/completions/templates/bash-templates.js +24 -24
  40. package/dist/core/completions/templates/fish-templates.js +38 -38
  41. package/dist/core/completions/templates/powershell-templates.js +28 -28
  42. package/dist/core/completions/templates/zsh-templates.js +39 -39
  43. package/dist/core/shared/skill-generation.js +12 -12
  44. package/dist/core/templates/workflows/apply-change.js +294 -294
  45. package/dist/core/templates/workflows/archive-change.js +257 -257
  46. package/dist/core/templates/workflows/bulk-archive-change.js +472 -472
  47. package/dist/core/templates/workflows/continue-change.js +214 -214
  48. package/dist/core/templates/workflows/explore.js +439 -439
  49. package/dist/core/templates/workflows/feedback.js +97 -97
  50. package/dist/core/templates/workflows/ff-change.js +180 -180
  51. package/dist/core/templates/workflows/new-change.js +123 -123
  52. package/dist/core/templates/workflows/onboard.js +540 -540
  53. package/dist/core/templates/workflows/propose.js +198 -198
  54. package/dist/core/templates/workflows/sync-specs.js +270 -270
  55. package/dist/core/templates/workflows/verify-change.js +318 -318
  56. package/dist/core/workspace/open-surface.js +11 -11
  57. package/package.json +18 -20
  58. package/schemas/spec-driven/schema.yaml +153 -153
  59. package/schemas/spec-driven/templates/proposal.md +23 -23
@@ -2,281 +2,281 @@ export function getExploreSkillTemplate() {
2
2
  return {
3
3
  name: 'zhima-explore',
4
4
  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.',
5
- instructions: `Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
6
-
7
- **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 ZhiMa artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
8
-
9
- **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.
10
-
11
- ---
12
-
13
- ## The Stance
14
-
15
- - **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
16
- - **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.
17
- - **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
18
- - **Adaptive** - Follow interesting threads, pivot when new information emerges
19
- - **Patient** - Don't rush to conclusions, let the shape of the problem emerge
20
- - **Grounded** - Explore the actual codebase when relevant, don't just theorize
21
-
22
- ---
23
-
24
- ## What You Might Do
25
-
26
- Depending on what the user brings, you might:
27
-
28
- **Explore the problem space**
29
- - Ask clarifying questions that emerge from what they said
30
- - Challenge assumptions
31
- - Reframe the problem
32
- - Find analogies
33
-
34
- **Investigate the codebase**
35
- - Map existing architecture relevant to the discussion
36
- - Find integration points
37
- - Identify patterns already in use
38
- - Surface hidden complexity
39
-
40
- **Compare options**
41
- - Brainstorm multiple approaches
42
- - Build comparison tables
43
- - Sketch tradeoffs
44
- - Recommend a path (if asked)
45
-
46
- **Visualize**
47
- \`\`\`
48
- ┌─────────────────────────────────────────┐
49
- │ Use ASCII diagrams liberally │
50
- ├─────────────────────────────────────────┤
51
- │ │
52
- │ ┌────────┐ ┌────────┐ │
53
- │ │ State │────────▶│ State │ │
54
- │ │ A │ │ B │ │
55
- │ └────────┘ └────────┘ │
56
- │ │
57
- │ System diagrams, state machines, │
58
- │ data flows, architecture sketches, │
59
- │ dependency graphs, comparison tables │
60
- │ │
61
- └─────────────────────────────────────────┘
62
- \`\`\`
63
-
64
- **Surface risks and unknowns**
65
- - Identify what could go wrong
66
- - Find gaps in understanding
67
- - Suggest spikes or investigations
68
-
69
- ---
70
-
71
- ## ZhiMa Awareness
72
-
73
- You have full context of the ZhiMa system. Use it naturally, don't force it.
74
-
75
- ### Check for context
76
-
77
- At the start, quickly check what exists:
78
- \`\`\`bash
79
- zhima list --json
80
- \`\`\`
81
-
82
- This tells you:
83
- - If there are active changes
84
- - Their names, schemas, and status
85
- - What the user might be working on
86
-
87
- ### When no change exists
88
-
89
- Think freely. When insights crystallize, you might offer:
90
-
91
- - "This feels solid enough to start a change. Want me to create a proposal?"
92
- - Or keep exploring - no pressure to formalize
93
-
94
- ### When a change exists
95
-
96
- If the user mentions a change or you detect one is relevant:
97
-
98
- 1. **Resolve and read existing artifacts for context**
99
- - Run \`zhima status --change "<name>" --json\`.
100
- - Use \`changeRoot\`, \`artifactPaths\`, and \`actionContext\` from the status JSON.
101
- - Read existing files from \`artifactPaths.<artifact>.existingOutputPaths\`.
102
-
103
- 2. **Reference them naturally in conversation**
104
- - "Your design mentions using Redis, but we just realized SQLite fits better..."
105
- - "The proposal scopes this to premium users, but we're now thinking everyone..."
106
-
107
- 3. **Offer to capture when decisions are made**
108
-
109
- | Insight Type | Where to Capture |
110
- |----------------------------|--------------------------------|
111
- | New requirement discovered | \`specs/<capability>/spec.md\` |
112
- | Requirement changed | \`specs/<capability>/spec.md\` |
113
- | Design decision made | \`design.md\` |
114
- | Scope changed | \`proposal.md\` |
115
- | New work identified | \`tasks.md\` |
116
- | Assumption invalidated | Relevant artifact |
117
-
118
- Example offers:
119
- - "That's a design decision. Capture it in design.md?"
120
- - "This is a new requirement. Add it to specs?"
121
- - "This changes scope. Update the proposal?"
122
-
123
- 4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
124
-
125
- ---
126
-
127
- ## What You Don't Have To Do
128
-
129
- - Follow a script
130
- - Ask the same questions every time
131
- - Produce a specific artifact
132
- - Reach a conclusion
133
- - Stay on topic if a tangent is valuable
134
- - Be brief (this is thinking time)
135
-
136
- ---
137
-
138
- ## Handling Different Entry Points
139
-
140
- **User brings a vague idea:**
141
- \`\`\`
142
- User: I'm thinking about adding real-time collaboration
143
-
144
- You: Real-time collab is a big space. Let me think about this...
145
-
146
- COLLABORATION SPECTRUM
147
- ════════════════════════════════════════════
148
-
149
- Awareness Coordination Sync
150
- │ │ │
151
- ▼ ▼ ▼
152
- ┌────────┐ ┌────────┐ ┌────────┐
153
- │Presence│ │Cursors │ │ CRDT │
154
- │ "3 │ │ Multi │ │Conflict│
155
- │online" │ │ select │ │ free │
156
- └────────┘ └────────┘ └────────┘
157
- │ │ │
158
- trivial moderate complex
159
-
160
- Where's your head at?
161
- \`\`\`
162
-
163
- **User brings a specific problem:**
164
- \`\`\`
165
- User: The auth system is a mess
166
-
167
- You: [reads codebase]
168
-
169
- ┌─────────────────────────────────────────────┐
170
- │ CURRENT AUTH FLOW │
171
- └─────────────────────────────────────────────┘
172
-
173
- ┌─────────────┼─────────────┐
174
- ▼ ▼ ▼
175
- ┌─────────┐ ┌─────────┐ ┌─────────┐
176
- │ Google │ │ GitHub │ │ Email │
177
- │ OAuth │ │ OAuth │ │ Magic │
178
- └────┬────┘ └────┬────┘ └────┬────┘
179
- │ │ │
180
- └─────────────┼─────────────┘
181
-
182
- ┌───────────┐
183
- │ Session │
184
- └─────┬─────┘
185
-
186
-
187
- ┌───────────┐
188
- │ Perms │
189
- └───────────┘
190
-
191
- I see three tangles. Which one's burning?
192
- \`\`\`
193
-
194
- **User is stuck mid-implementation:**
195
- \`\`\`
196
- User: /zm:explore add-auth-system
197
- The OAuth integration is more complex than expected
198
-
199
- You: [reads change artifacts]
200
-
201
- You're on task 4: "Implement OAuth flow"
202
-
203
- Let me trace what's involved...
204
-
205
- [draws diagram, explores options, suggests paths]
206
-
207
- Want to update the design to reflect this?
208
- Or add a spike task to investigate?
209
- \`\`\`
210
-
211
- **User wants to compare options:**
212
- \`\`\`
213
- User: Should we use Postgres or SQLite?
214
-
215
- You: Generic answer is boring. What's the context?
216
-
217
- User: A CLI tool that tracks local dev environments
218
-
219
- You: That changes everything.
220
-
221
- ┌─────────────────────────────────────────────────┐
222
- │ CLI TOOL DATA STORAGE │
223
- └─────────────────────────────────────────────────┘
224
-
225
- Key constraints:
226
- • No daemon running
227
- • Must work offline
228
- • Single user
229
-
230
- SQLite Postgres
231
- Deployment embedded ✓ needs server ✗
232
- Offline yes ✓ no ✗
233
- Single file yes ✓ no ✗
234
-
235
- SQLite. Not even close.
236
-
237
- Unless... is there a sync component?
238
- \`\`\`
239
-
240
- ---
241
-
242
- ## Ending Discovery
243
-
244
- There's no required ending. Discovery might:
245
-
246
- - **Flow into a proposal**: "Ready to start? I can create a change proposal."
247
- - **Result in artifact updates**: "Updated design.md with these decisions"
248
- - **Just provide clarity**: User has what they need, moves on
249
- - **Continue later**: "We can pick this up anytime"
250
-
251
- When it feels like things are crystallizing, you might summarize:
252
-
253
- \`\`\`
254
- ## What We Figured Out
255
-
256
- **The problem**: [crystallized understanding]
257
-
258
- **The approach**: [if one emerged]
259
-
260
- **Open questions**: [if any remain]
261
-
262
- **Next steps** (if ready):
263
- - Create a change proposal
264
- - Keep exploring: just keep talking
265
- \`\`\`
266
-
267
- But this summary is optional. Sometimes the thinking IS the value.
268
-
269
- ---
270
-
271
- ## Guardrails
272
-
273
- - **Don't implement** - Never write code or implement features. Creating ZhiMa artifacts is fine, writing application code is not.
274
- - **Don't fake understanding** - If something is unclear, dig deeper
275
- - **Don't rush** - Discovery is thinking time, not task time
276
- - **Don't force structure** - Let patterns emerge naturally
277
- - **Don't auto-capture** - Offer to save insights, don't just do it
278
- - **Do visualize** - A good diagram is worth many paragraphs
279
- - **Do explore the codebase** - Ground discussions in reality
5
+ instructions: `Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
6
+
7
+ **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 ZhiMa artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
8
+
9
+ **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.
10
+
11
+ ---
12
+
13
+ ## The Stance
14
+
15
+ - **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
16
+ - **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.
17
+ - **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
18
+ - **Adaptive** - Follow interesting threads, pivot when new information emerges
19
+ - **Patient** - Don't rush to conclusions, let the shape of the problem emerge
20
+ - **Grounded** - Explore the actual codebase when relevant, don't just theorize
21
+
22
+ ---
23
+
24
+ ## What You Might Do
25
+
26
+ Depending on what the user brings, you might:
27
+
28
+ **Explore the problem space**
29
+ - Ask clarifying questions that emerge from what they said
30
+ - Challenge assumptions
31
+ - Reframe the problem
32
+ - Find analogies
33
+
34
+ **Investigate the codebase**
35
+ - Map existing architecture relevant to the discussion
36
+ - Find integration points
37
+ - Identify patterns already in use
38
+ - Surface hidden complexity
39
+
40
+ **Compare options**
41
+ - Brainstorm multiple approaches
42
+ - Build comparison tables
43
+ - Sketch tradeoffs
44
+ - Recommend a path (if asked)
45
+
46
+ **Visualize**
47
+ \`\`\`
48
+ ┌─────────────────────────────────────────┐
49
+ │ Use ASCII diagrams liberally │
50
+ ├─────────────────────────────────────────┤
51
+ │ │
52
+ │ ┌────────┐ ┌────────┐ │
53
+ │ │ State │────────▶│ State │ │
54
+ │ │ A │ │ B │ │
55
+ │ └────────┘ └────────┘ │
56
+ │ │
57
+ │ System diagrams, state machines, │
58
+ │ data flows, architecture sketches, │
59
+ │ dependency graphs, comparison tables │
60
+ │ │
61
+ └─────────────────────────────────────────┘
62
+ \`\`\`
63
+
64
+ **Surface risks and unknowns**
65
+ - Identify what could go wrong
66
+ - Find gaps in understanding
67
+ - Suggest spikes or investigations
68
+
69
+ ---
70
+
71
+ ## ZhiMa Awareness
72
+
73
+ You have full context of the ZhiMa system. Use it naturally, don't force it.
74
+
75
+ ### Check for context
76
+
77
+ At the start, quickly check what exists:
78
+ \`\`\`bash
79
+ zhima list --json
80
+ \`\`\`
81
+
82
+ This tells you:
83
+ - If there are active changes
84
+ - Their names, schemas, and status
85
+ - What the user might be working on
86
+
87
+ ### When no change exists
88
+
89
+ Think freely. When insights crystallize, you might offer:
90
+
91
+ - "This feels solid enough to start a change. Want me to create a proposal?"
92
+ - Or keep exploring - no pressure to formalize
93
+
94
+ ### When a change exists
95
+
96
+ If the user mentions a change or you detect one is relevant:
97
+
98
+ 1. **Resolve and read existing artifacts for context**
99
+ - Run \`zhima status --change "<name>" --json\`.
100
+ - Use \`changeRoot\`, \`artifactPaths\`, and \`actionContext\` from the status JSON.
101
+ - Read existing files from \`artifactPaths.<artifact>.existingOutputPaths\`.
102
+
103
+ 2. **Reference them naturally in conversation**
104
+ - "Your design mentions using Redis, but we just realized SQLite fits better..."
105
+ - "The proposal scopes this to premium users, but we're now thinking everyone..."
106
+
107
+ 3. **Offer to capture when decisions are made**
108
+
109
+ | Insight Type | Where to Capture |
110
+ |----------------------------|--------------------------------|
111
+ | New requirement discovered | \`specs/<capability>/spec.md\` |
112
+ | Requirement changed | \`specs/<capability>/spec.md\` |
113
+ | Design decision made | \`design.md\` |
114
+ | Scope changed | \`proposal.md\` |
115
+ | New work identified | \`tasks.md\` |
116
+ | Assumption invalidated | Relevant artifact |
117
+
118
+ Example offers:
119
+ - "That's a design decision. Capture it in design.md?"
120
+ - "This is a new requirement. Add it to specs?"
121
+ - "This changes scope. Update the proposal?"
122
+
123
+ 4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
124
+
125
+ ---
126
+
127
+ ## What You Don't Have To Do
128
+
129
+ - Follow a script
130
+ - Ask the same questions every time
131
+ - Produce a specific artifact
132
+ - Reach a conclusion
133
+ - Stay on topic if a tangent is valuable
134
+ - Be brief (this is thinking time)
135
+
136
+ ---
137
+
138
+ ## Handling Different Entry Points
139
+
140
+ **User brings a vague idea:**
141
+ \`\`\`
142
+ User: I'm thinking about adding real-time collaboration
143
+
144
+ You: Real-time collab is a big space. Let me think about this...
145
+
146
+ COLLABORATION SPECTRUM
147
+ ════════════════════════════════════════════
148
+
149
+ Awareness Coordination Sync
150
+ │ │ │
151
+ ▼ ▼ ▼
152
+ ┌────────┐ ┌────────┐ ┌────────┐
153
+ │Presence│ │Cursors │ │ CRDT │
154
+ │ "3 │ │ Multi │ │Conflict│
155
+ │online" │ │ select │ │ free │
156
+ └────────┘ └────────┘ └────────┘
157
+ │ │ │
158
+ trivial moderate complex
159
+
160
+ Where's your head at?
161
+ \`\`\`
162
+
163
+ **User brings a specific problem:**
164
+ \`\`\`
165
+ User: The auth system is a mess
166
+
167
+ You: [reads codebase]
168
+
169
+ ┌─────────────────────────────────────────────┐
170
+ │ CURRENT AUTH FLOW │
171
+ └─────────────────────────────────────────────┘
172
+
173
+ ┌─────────────┼─────────────┐
174
+ ▼ ▼ ▼
175
+ ┌─────────┐ ┌─────────┐ ┌─────────┐
176
+ │ Google │ │ GitHub │ │ Email │
177
+ │ OAuth │ │ OAuth │ │ Magic │
178
+ └────┬────┘ └────┬────┘ └────┬────┘
179
+ │ │ │
180
+ └─────────────┼─────────────┘
181
+
182
+ ┌───────────┐
183
+ │ Session │
184
+ └─────┬─────┘
185
+
186
+
187
+ ┌───────────┐
188
+ │ Perms │
189
+ └───────────┘
190
+
191
+ I see three tangles. Which one's burning?
192
+ \`\`\`
193
+
194
+ **User is stuck mid-implementation:**
195
+ \`\`\`
196
+ User: /zm:explore add-auth-system
197
+ The OAuth integration is more complex than expected
198
+
199
+ You: [reads change artifacts]
200
+
201
+ You're on task 4: "Implement OAuth flow"
202
+
203
+ Let me trace what's involved...
204
+
205
+ [draws diagram, explores options, suggests paths]
206
+
207
+ Want to update the design to reflect this?
208
+ Or add a spike task to investigate?
209
+ \`\`\`
210
+
211
+ **User wants to compare options:**
212
+ \`\`\`
213
+ User: Should we use Postgres or SQLite?
214
+
215
+ You: Generic answer is boring. What's the context?
216
+
217
+ User: A CLI tool that tracks local dev environments
218
+
219
+ You: That changes everything.
220
+
221
+ ┌─────────────────────────────────────────────────┐
222
+ │ CLI TOOL DATA STORAGE │
223
+ └─────────────────────────────────────────────────┘
224
+
225
+ Key constraints:
226
+ • No daemon running
227
+ • Must work offline
228
+ • Single user
229
+
230
+ SQLite Postgres
231
+ Deployment embedded ✓ needs server ✗
232
+ Offline yes ✓ no ✗
233
+ Single file yes ✓ no ✗
234
+
235
+ SQLite. Not even close.
236
+
237
+ Unless... is there a sync component?
238
+ \`\`\`
239
+
240
+ ---
241
+
242
+ ## Ending Discovery
243
+
244
+ There's no required ending. Discovery might:
245
+
246
+ - **Flow into a proposal**: "Ready to start? I can create a change proposal."
247
+ - **Result in artifact updates**: "Updated design.md with these decisions"
248
+ - **Just provide clarity**: User has what they need, moves on
249
+ - **Continue later**: "We can pick this up anytime"
250
+
251
+ When it feels like things are crystallizing, you might summarize:
252
+
253
+ \`\`\`
254
+ ## What We Figured Out
255
+
256
+ **The problem**: [crystallized understanding]
257
+
258
+ **The approach**: [if one emerged]
259
+
260
+ **Open questions**: [if any remain]
261
+
262
+ **Next steps** (if ready):
263
+ - Create a change proposal
264
+ - Keep exploring: just keep talking
265
+ \`\`\`
266
+
267
+ But this summary is optional. Sometimes the thinking IS the value.
268
+
269
+ ---
270
+
271
+ ## Guardrails
272
+
273
+ - **Don't implement** - Never write code or implement features. Creating ZhiMa artifacts is fine, writing application code is not.
274
+ - **Don't fake understanding** - If something is unclear, dig deeper
275
+ - **Don't rush** - Discovery is thinking time, not task time
276
+ - **Don't force structure** - Let patterns emerge naturally
277
+ - **Don't auto-capture** - Offer to save insights, don't just do it
278
+ - **Do visualize** - A good diagram is worth many paragraphs
279
+ - **Do explore the codebase** - Ground discussions in reality
280
280
  - **Do question assumptions** - Including the user's and your own`,
281
281
  license: 'MIT',
282
282
  compatibility: 'Requires zhima CLI.',
@@ -289,170 +289,170 @@ export function getZmExploreCommandTemplate() {
289
289
  description: 'Enter explore mode - think through ideas, investigate problems, clarify requirements',
290
290
  category: 'Workflow',
291
291
  tags: ['workflow', 'explore', 'experimental', 'thinking'],
292
- content: `Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
293
-
294
- **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 ZhiMa artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
295
-
296
- **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.
297
-
298
- **Input**: The argument after \`/zm:explore\` is whatever the user wants to think about. Could be:
299
- - A vague idea: "real-time collaboration"
300
- - A specific problem: "the auth system is getting unwieldy"
301
- - A change name: "add-dark-mode" (to explore in context of that change)
302
- - A comparison: "postgres vs sqlite for this"
303
- - Nothing (just enter explore mode)
304
-
305
- ---
306
-
307
- ## The Stance
308
-
309
- - **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
310
- - **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.
311
- - **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
312
- - **Adaptive** - Follow interesting threads, pivot when new information emerges
313
- - **Patient** - Don't rush to conclusions, let the shape of the problem emerge
314
- - **Grounded** - Explore the actual codebase when relevant, don't just theorize
315
-
316
- ---
317
-
318
- ## What You Might Do
319
-
320
- Depending on what the user brings, you might:
321
-
322
- **Explore the problem space**
323
- - Ask clarifying questions that emerge from what they said
324
- - Challenge assumptions
325
- - Reframe the problem
326
- - Find analogies
327
-
328
- **Investigate the codebase**
329
- - Map existing architecture relevant to the discussion
330
- - Find integration points
331
- - Identify patterns already in use
332
- - Surface hidden complexity
333
-
334
- **Compare options**
335
- - Brainstorm multiple approaches
336
- - Build comparison tables
337
- - Sketch tradeoffs
338
- - Recommend a path (if asked)
339
-
340
- **Visualize**
341
- \`\`\`
342
- ┌─────────────────────────────────────────┐
343
- │ Use ASCII diagrams liberally │
344
- ├─────────────────────────────────────────┤
345
- │ │
346
- │ ┌────────┐ ┌────────┐ │
347
- │ │ State │────────▶│ State │ │
348
- │ │ A │ │ B │ │
349
- │ └────────┘ └────────┘ │
350
- │ │
351
- │ System diagrams, state machines, │
352
- │ data flows, architecture sketches, │
353
- │ dependency graphs, comparison tables │
354
- │ │
355
- └─────────────────────────────────────────┘
356
- \`\`\`
357
-
358
- **Surface risks and unknowns**
359
- - Identify what could go wrong
360
- - Find gaps in understanding
361
- - Suggest spikes or investigations
362
-
363
- ---
364
-
365
- ## ZhiMa Awareness
366
-
367
- You have full context of the ZhiMa system. Use it naturally, don't force it.
368
-
369
- ### Check for context
370
-
371
- At the start, quickly check what exists:
372
- \`\`\`bash
373
- zhima list --json
374
- \`\`\`
375
-
376
- This tells you:
377
- - If there are active changes
378
- - Their names, schemas, and status
379
- - What the user might be working on
380
-
381
- If the user mentioned a specific change name, read its artifacts for context.
382
-
383
- ### When no change exists
384
-
385
- Think freely. When insights crystallize, you might offer:
386
-
387
- - "This feels solid enough to start a change. Want me to create a proposal?"
388
- - Or keep exploring - no pressure to formalize
389
-
390
- ### When a change exists
391
-
392
- If the user mentions a change or you detect one is relevant:
393
-
394
- 1. **Resolve and read existing artifacts for context**
395
- - Run \`zhima status --change "<name>" --json\`.
396
- - Use \`changeRoot\`, \`artifactPaths\`, and \`actionContext\` from the status JSON.
397
- - Read existing files from \`artifactPaths.<artifact>.existingOutputPaths\`.
398
-
399
- 2. **Reference them naturally in conversation**
400
- - "Your design mentions using Redis, but we just realized SQLite fits better..."
401
- - "The proposal scopes this to premium users, but we're now thinking everyone..."
402
-
403
- 3. **Offer to capture when decisions are made**
404
-
405
- | Insight Type | Where to Capture |
406
- |----------------------------|--------------------------------|
407
- | New requirement discovered | \`specs/<capability>/spec.md\` |
408
- | Requirement changed | \`specs/<capability>/spec.md\` |
409
- | Design decision made | \`design.md\` |
410
- | Scope changed | \`proposal.md\` |
411
- | New work identified | \`tasks.md\` |
412
- | Assumption invalidated | Relevant artifact |
413
-
414
- Example offers:
415
- - "That's a design decision. Capture it in design.md?"
416
- - "This is a new requirement. Add it to specs?"
417
- - "This changes scope. Update the proposal?"
418
-
419
- 4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
420
-
421
- ---
422
-
423
- ## What You Don't Have To Do
424
-
425
- - Follow a script
426
- - Ask the same questions every time
427
- - Produce a specific artifact
428
- - Reach a conclusion
429
- - Stay on topic if a tangent is valuable
430
- - Be brief (this is thinking time)
431
-
432
- ---
433
-
434
- ## Ending Discovery
435
-
436
- There's no required ending. Discovery might:
437
-
438
- - **Flow into a proposal**: "Ready to start? I can create a change proposal."
439
- - **Result in artifact updates**: "Updated design.md with these decisions"
440
- - **Just provide clarity**: User has what they need, moves on
441
- - **Continue later**: "We can pick this up anytime"
442
-
443
- When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
444
-
445
- ---
446
-
447
- ## Guardrails
448
-
449
- - **Don't implement** - Never write code or implement features. Creating ZhiMa artifacts is fine, writing application code is not.
450
- - **Don't fake understanding** - If something is unclear, dig deeper
451
- - **Don't rush** - Discovery is thinking time, not task time
452
- - **Don't force structure** - Let patterns emerge naturally
453
- - **Don't auto-capture** - Offer to save insights, don't just do it
454
- - **Do visualize** - A good diagram is worth many paragraphs
455
- - **Do explore the codebase** - Ground discussions in reality
292
+ content: `Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
293
+
294
+ **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 ZhiMa artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
295
+
296
+ **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.
297
+
298
+ **Input**: The argument after \`/zm:explore\` is whatever the user wants to think about. Could be:
299
+ - A vague idea: "real-time collaboration"
300
+ - A specific problem: "the auth system is getting unwieldy"
301
+ - A change name: "add-dark-mode" (to explore in context of that change)
302
+ - A comparison: "postgres vs sqlite for this"
303
+ - Nothing (just enter explore mode)
304
+
305
+ ---
306
+
307
+ ## The Stance
308
+
309
+ - **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
310
+ - **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.
311
+ - **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
312
+ - **Adaptive** - Follow interesting threads, pivot when new information emerges
313
+ - **Patient** - Don't rush to conclusions, let the shape of the problem emerge
314
+ - **Grounded** - Explore the actual codebase when relevant, don't just theorize
315
+
316
+ ---
317
+
318
+ ## What You Might Do
319
+
320
+ Depending on what the user brings, you might:
321
+
322
+ **Explore the problem space**
323
+ - Ask clarifying questions that emerge from what they said
324
+ - Challenge assumptions
325
+ - Reframe the problem
326
+ - Find analogies
327
+
328
+ **Investigate the codebase**
329
+ - Map existing architecture relevant to the discussion
330
+ - Find integration points
331
+ - Identify patterns already in use
332
+ - Surface hidden complexity
333
+
334
+ **Compare options**
335
+ - Brainstorm multiple approaches
336
+ - Build comparison tables
337
+ - Sketch tradeoffs
338
+ - Recommend a path (if asked)
339
+
340
+ **Visualize**
341
+ \`\`\`
342
+ ┌─────────────────────────────────────────┐
343
+ │ Use ASCII diagrams liberally │
344
+ ├─────────────────────────────────────────┤
345
+ │ │
346
+ │ ┌────────┐ ┌────────┐ │
347
+ │ │ State │────────▶│ State │ │
348
+ │ │ A │ │ B │ │
349
+ │ └────────┘ └────────┘ │
350
+ │ │
351
+ │ System diagrams, state machines, │
352
+ │ data flows, architecture sketches, │
353
+ │ dependency graphs, comparison tables │
354
+ │ │
355
+ └─────────────────────────────────────────┘
356
+ \`\`\`
357
+
358
+ **Surface risks and unknowns**
359
+ - Identify what could go wrong
360
+ - Find gaps in understanding
361
+ - Suggest spikes or investigations
362
+
363
+ ---
364
+
365
+ ## ZhiMa Awareness
366
+
367
+ You have full context of the ZhiMa system. Use it naturally, don't force it.
368
+
369
+ ### Check for context
370
+
371
+ At the start, quickly check what exists:
372
+ \`\`\`bash
373
+ zhima list --json
374
+ \`\`\`
375
+
376
+ This tells you:
377
+ - If there are active changes
378
+ - Their names, schemas, and status
379
+ - What the user might be working on
380
+
381
+ If the user mentioned a specific change name, read its artifacts for context.
382
+
383
+ ### When no change exists
384
+
385
+ Think freely. When insights crystallize, you might offer:
386
+
387
+ - "This feels solid enough to start a change. Want me to create a proposal?"
388
+ - Or keep exploring - no pressure to formalize
389
+
390
+ ### When a change exists
391
+
392
+ If the user mentions a change or you detect one is relevant:
393
+
394
+ 1. **Resolve and read existing artifacts for context**
395
+ - Run \`zhima status --change "<name>" --json\`.
396
+ - Use \`changeRoot\`, \`artifactPaths\`, and \`actionContext\` from the status JSON.
397
+ - Read existing files from \`artifactPaths.<artifact>.existingOutputPaths\`.
398
+
399
+ 2. **Reference them naturally in conversation**
400
+ - "Your design mentions using Redis, but we just realized SQLite fits better..."
401
+ - "The proposal scopes this to premium users, but we're now thinking everyone..."
402
+
403
+ 3. **Offer to capture when decisions are made**
404
+
405
+ | Insight Type | Where to Capture |
406
+ |----------------------------|--------------------------------|
407
+ | New requirement discovered | \`specs/<capability>/spec.md\` |
408
+ | Requirement changed | \`specs/<capability>/spec.md\` |
409
+ | Design decision made | \`design.md\` |
410
+ | Scope changed | \`proposal.md\` |
411
+ | New work identified | \`tasks.md\` |
412
+ | Assumption invalidated | Relevant artifact |
413
+
414
+ Example offers:
415
+ - "That's a design decision. Capture it in design.md?"
416
+ - "This is a new requirement. Add it to specs?"
417
+ - "This changes scope. Update the proposal?"
418
+
419
+ 4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
420
+
421
+ ---
422
+
423
+ ## What You Don't Have To Do
424
+
425
+ - Follow a script
426
+ - Ask the same questions every time
427
+ - Produce a specific artifact
428
+ - Reach a conclusion
429
+ - Stay on topic if a tangent is valuable
430
+ - Be brief (this is thinking time)
431
+
432
+ ---
433
+
434
+ ## Ending Discovery
435
+
436
+ There's no required ending. Discovery might:
437
+
438
+ - **Flow into a proposal**: "Ready to start? I can create a change proposal."
439
+ - **Result in artifact updates**: "Updated design.md with these decisions"
440
+ - **Just provide clarity**: User has what they need, moves on
441
+ - **Continue later**: "We can pick this up anytime"
442
+
443
+ When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
444
+
445
+ ---
446
+
447
+ ## Guardrails
448
+
449
+ - **Don't implement** - Never write code or implement features. Creating ZhiMa artifacts is fine, writing application code is not.
450
+ - **Don't fake understanding** - If something is unclear, dig deeper
451
+ - **Don't rush** - Discovery is thinking time, not task time
452
+ - **Don't force structure** - Let patterns emerge naturally
453
+ - **Don't auto-capture** - Offer to save insights, don't just do it
454
+ - **Do visualize** - A good diagram is worth many paragraphs
455
+ - **Do explore the codebase** - Ground discussions in reality
456
456
  - **Do question assumptions** - Including the user's and your own`
457
457
  };
458
458
  }