clavix 4.2.0 → 4.3.2
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.
- package/LICENSE +201 -21
- package/README.md +1 -1
- package/dist/cli/commands/deep.js +4 -58
- package/dist/cli/commands/init.js +13 -16
- package/dist/cli/commands/plan.js +2 -2
- package/dist/core/conversation-quality-tracker.d.ts +81 -0
- package/dist/core/conversation-quality-tracker.js +195 -0
- package/dist/core/intelligence/intent-detector.js +3 -0
- package/dist/core/intelligence/pattern-library.d.ts +18 -1
- package/dist/core/intelligence/pattern-library.js +131 -0
- package/dist/core/intelligence/patterns/conversation-summarizer.d.ts +25 -0
- package/dist/core/intelligence/patterns/conversation-summarizer.js +197 -0
- package/dist/core/intelligence/patterns/dependency-identifier.d.ts +21 -0
- package/dist/core/intelligence/patterns/dependency-identifier.js +149 -0
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.d.ts +20 -0
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.js +129 -0
- package/dist/core/intelligence/patterns/requirement-prioritizer.d.ts +22 -0
- package/dist/core/intelligence/patterns/requirement-prioritizer.js +117 -0
- package/dist/core/intelligence/patterns/success-metrics-enforcer.d.ts +22 -0
- package/dist/core/intelligence/patterns/success-metrics-enforcer.js +142 -0
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.d.ts +22 -0
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.js +140 -0
- package/dist/core/intelligence/patterns/user-persona-enricher.d.ts +22 -0
- package/dist/core/intelligence/patterns/user-persona-enricher.js +124 -0
- package/dist/core/intelligence/quality-assessor.js +2 -0
- package/dist/core/intelligence/types.d.ts +7 -2
- package/dist/core/intelligence/universal-optimizer.d.ts +27 -2
- package/dist/core/intelligence/universal-optimizer.js +65 -5
- package/dist/core/task-manager.d.ts +1 -2
- package/dist/core/task-manager.js +21 -26
- package/dist/templates/slash-commands/_canonical/deep.md +37 -69
- package/dist/templates/slash-commands/_canonical/fast.md +1 -0
- package/dist/templates/slash-commands/_components/sections/pattern-visibility.md +26 -2
- package/package.json +3 -3
- package/dist/templates/instructions/README 2.md +0 -311
- package/dist/templates/instructions/core 2/clavix-mode.md +0 -275
- package/dist/templates/instructions/core 2/file-operations.md +0 -330
- package/dist/templates/instructions/core 2/verification.md +0 -377
- package/dist/templates/instructions/troubleshooting 2/jumped-to-implementation.md +0 -234
- package/dist/templates/instructions/troubleshooting 2/mode-confusion.md +0 -402
- package/dist/templates/instructions/troubleshooting 2/skipped-file-creation.md +0 -385
- package/dist/templates/slash-commands/_canonical 2/archive.md +0 -410
- package/dist/templates/slash-commands/_canonical 2/deep.md +0 -512
- package/dist/templates/slash-commands/_canonical 2/execute.md +0 -80
- package/dist/templates/slash-commands/_canonical 2/fast.md +0 -370
- package/dist/templates/slash-commands/_canonical 2/implement.md +0 -364
- package/dist/templates/slash-commands/_canonical 2/plan.md +0 -329
- package/dist/templates/slash-commands/_canonical 2/prd.md +0 -320
- package/dist/templates/slash-commands/_canonical 2/prompts.md +0 -97
- package/dist/templates/slash-commands/_canonical 2/start.md +0 -204
- package/dist/templates/slash-commands/_canonical 2/summarize.md +0 -395
|
@@ -1,402 +0,0 @@
|
|
|
1
|
-
# Troubleshooting: Mode Confusion
|
|
2
|
-
|
|
3
|
-
## Problem Description
|
|
4
|
-
|
|
5
|
-
Agent is unclear whether they should be in planning mode (gathering requirements, creating PRDs) or implementation mode (writing code, building features).
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Symptoms
|
|
10
|
-
|
|
11
|
-
- Agent asks "Should I implement this or just plan it?"
|
|
12
|
-
- Agent alternates between asking questions and generating code
|
|
13
|
-
- Agent generates partial implementation then stops uncertainly
|
|
14
|
-
- User and agent have misaligned expectations about what's happening
|
|
15
|
-
- Agent starts multiple times with different approaches
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Why This Happens
|
|
20
|
-
|
|
21
|
-
**Root causes:**
|
|
22
|
-
|
|
23
|
-
1. **Ambiguous user request** - User says "build X" which could mean "plan to build X" or "implement X now"
|
|
24
|
-
2. **Missing CLAVIX MODE context** - Agent didn't see mode boundary instructions
|
|
25
|
-
3. **Implicit mode transitions** - No clear signal when switching between planning and implementation
|
|
26
|
-
4. **Conversation drift** - Started in planning mode but gradually shifted toward implementation
|
|
27
|
-
5. **Tool ambiguity** - Clavix commands not clearly distinguished from normal conversation
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## Immediate Fix
|
|
32
|
-
|
|
33
|
-
If mode is unclear:
|
|
34
|
-
|
|
35
|
-
### Step 1: Agent Should Ask Explicitly
|
|
36
|
-
|
|
37
|
-
When uncertain, agent should ALWAYS ask:
|
|
38
|
-
|
|
39
|
-
```markdown
|
|
40
|
-
Just to clarify - which mode should I be in?
|
|
41
|
-
|
|
42
|
-
**Option 1: Planning Mode (Clavix)**
|
|
43
|
-
- Gather requirements and create planning documents
|
|
44
|
-
- Generate PRDs and optimized prompts
|
|
45
|
-
- Ask clarifying questions
|
|
46
|
-
- **No implementation yet**
|
|
47
|
-
|
|
48
|
-
**Option 2: Implementation Mode**
|
|
49
|
-
- Write actual code
|
|
50
|
-
- Build the feature
|
|
51
|
-
- Create components/functions
|
|
52
|
-
- **Start implementing now**
|
|
53
|
-
|
|
54
|
-
Which would you like me to do?
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
### Step 2: User Should Clarify
|
|
60
|
-
|
|
61
|
-
User should explicitly state:
|
|
62
|
-
|
|
63
|
-
**For planning:**
|
|
64
|
-
```markdown
|
|
65
|
-
Just planning for now. Help me create a solid PRD first.
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
**For implementation:**
|
|
69
|
-
```markdown
|
|
70
|
-
Let's implement this now. Build the feature based on what we've discussed.
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
### Step 3: Agent Confirms Mode
|
|
76
|
-
|
|
77
|
-
Agent should acknowledge:
|
|
78
|
-
|
|
79
|
-
**Planning mode:**
|
|
80
|
-
```markdown
|
|
81
|
-
Got it - I'm in planning mode. I'll gather requirements and create documentation, but won't implement yet.
|
|
82
|
-
|
|
83
|
-
Let's start with some clarifying questions...
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
**Implementation mode:**
|
|
87
|
-
```markdown
|
|
88
|
-
Understood - I'll implement this now based on our requirements.
|
|
89
|
-
|
|
90
|
-
Let me start building...
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
## Prevention Strategies
|
|
96
|
-
|
|
97
|
-
### For Template Authors
|
|
98
|
-
|
|
99
|
-
**1. Clear Mode Declaration**
|
|
100
|
-
|
|
101
|
-
Every workflow should declare its mode upfront:
|
|
102
|
-
|
|
103
|
-
```markdown
|
|
104
|
-
## CLAVIX MODE: Requirements & Planning Only
|
|
105
|
-
|
|
106
|
-
You are in PLANNING mode. Do NOT implement.
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Or for implementation:
|
|
110
|
-
|
|
111
|
-
```markdown
|
|
112
|
-
## IMPLEMENTATION MODE
|
|
113
|
-
|
|
114
|
-
You are now in implementation mode. Write code based on requirements.
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
**2. Mode Transition Markers**
|
|
120
|
-
|
|
121
|
-
When transitioning between modes, make it explicit:
|
|
122
|
-
|
|
123
|
-
```markdown
|
|
124
|
-
**TRANSITION:** Entering planning mode
|
|
125
|
-
**TRANSITION:** Exiting planning mode, starting implementation
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
**3. Decision Points Have Clarification Prompts**
|
|
131
|
-
|
|
132
|
-
When agent might be uncertain:
|
|
133
|
-
|
|
134
|
-
```markdown
|
|
135
|
-
**If uncertain whether to implement:**
|
|
136
|
-
Ask user: "Should I implement this now, or continue planning?"
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
### For Users
|
|
142
|
-
|
|
143
|
-
**1. Use Explicit Commands**
|
|
144
|
-
|
|
145
|
-
**For planning:**
|
|
146
|
-
- `/clavix:start` - Start conversational planning
|
|
147
|
-
- `/clavix:prd` - Generate PRD
|
|
148
|
-
- `/clavix:summarize` - Extract requirements
|
|
149
|
-
|
|
150
|
-
**For implementation:**
|
|
151
|
-
- "Now implement this"
|
|
152
|
-
- "Build the feature"
|
|
153
|
-
- "Start coding"
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
**2. Set Expectations Early**
|
|
158
|
-
|
|
159
|
-
At conversation start:
|
|
160
|
-
|
|
161
|
-
```markdown
|
|
162
|
-
Let's plan this out first before implementing. I want a solid PRD.
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Or:
|
|
166
|
-
|
|
167
|
-
```markdown
|
|
168
|
-
I already have requirements. Let's jump straight to implementation.
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
---
|
|
172
|
-
|
|
173
|
-
**3. Clarify When Confused**
|
|
174
|
-
|
|
175
|
-
If agent seems confused:
|
|
176
|
-
|
|
177
|
-
```markdown
|
|
178
|
-
To be clear: we're just planning right now. Don't implement yet.
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
## Common Confusion Scenarios
|
|
184
|
-
|
|
185
|
-
### Scenario 1: Ambiguous "Build" Request
|
|
186
|
-
|
|
187
|
-
**User says:** "Help me build an authentication system"
|
|
188
|
-
|
|
189
|
-
**Agent thinks:**
|
|
190
|
-
- Option A: Help plan how to build it (planning mode)
|
|
191
|
-
- Option B: Implement it now (implementation mode)
|
|
192
|
-
|
|
193
|
-
**Solution:**
|
|
194
|
-
|
|
195
|
-
Agent asks:
|
|
196
|
-
```markdown
|
|
197
|
-
When you say "build an authentication system," do you want me to:
|
|
198
|
-
|
|
199
|
-
1. **Help plan it**: Gather requirements, create a PRD, document what needs to be built
|
|
200
|
-
2. **Implement it now**: Write the actual authentication code and components
|
|
201
|
-
|
|
202
|
-
Which would you prefer?
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
### Scenario 2: Mid-Conversation Shift
|
|
208
|
-
|
|
209
|
-
**Starts in planning:**
|
|
210
|
-
```markdown
|
|
211
|
-
User: /clavix:start
|
|
212
|
-
User: I want a dashboard
|
|
213
|
-
Agent: [Asks questions about dashboard]
|
|
214
|
-
User: [Answers 5 questions]
|
|
215
|
-
User: Looks good, let's do it!
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
**Agent thinks:** "Do it" = implement? Or "looks good" = continue planning?
|
|
219
|
-
|
|
220
|
-
**Solution:**
|
|
221
|
-
|
|
222
|
-
Agent asks:
|
|
223
|
-
```markdown
|
|
224
|
-
When you say "let's do it," do you mean:
|
|
225
|
-
|
|
226
|
-
1. Continue planning and create a PRD/summary?
|
|
227
|
-
2. Start implementing the dashboard now?
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
---
|
|
231
|
-
|
|
232
|
-
### Scenario 3: PRD Then Implementation
|
|
233
|
-
|
|
234
|
-
**Flow:**
|
|
235
|
-
```markdown
|
|
236
|
-
User: /clavix:prd
|
|
237
|
-
Agent: [Creates PRD]
|
|
238
|
-
User: Perfect! Now make it happen.
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
**Agent thinks:** "Make it happen" = implement? Or generate more docs?
|
|
242
|
-
|
|
243
|
-
**Solution:**
|
|
244
|
-
|
|
245
|
-
Agent interprets:
|
|
246
|
-
```markdown
|
|
247
|
-
**TRANSITION:** You've approved the PRD. I understand you want implementation now.
|
|
248
|
-
|
|
249
|
-
I'll build the features described in the PRD. Starting with [first feature]...
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
But if uncertain:
|
|
253
|
-
```markdown
|
|
254
|
-
By "make it happen," do you mean:
|
|
255
|
-
1. Implement the features in the PRD now?
|
|
256
|
-
2. Create additional planning documents?
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
## Decision Tree for Agents
|
|
262
|
-
|
|
263
|
-
```
|
|
264
|
-
User request received
|
|
265
|
-
│
|
|
266
|
-
├─ Is Clavix command? (/clavix:*) ────► Planning Mode
|
|
267
|
-
│
|
|
268
|
-
├─ User said "implement" / "build now" / "create code"? ────► Implementation Mode
|
|
269
|
-
│
|
|
270
|
-
├─ User said "plan" / "PRD" / "requirements"? ────► Planning Mode
|
|
271
|
-
│
|
|
272
|
-
├─ User said "help me build..."? ────► ASK FOR CLARIFICATION
|
|
273
|
-
│
|
|
274
|
-
├─ Currently in /clavix:* workflow? ────► Stay in Planning Mode
|
|
275
|
-
│
|
|
276
|
-
├─ User approved PRD and said "do it"? ────► Likely Implementation Mode (confirm if uncertain)
|
|
277
|
-
│
|
|
278
|
-
└─ Unclear? ────► ASK: "Should I plan or implement?"
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
---
|
|
282
|
-
|
|
283
|
-
## Mode Indicators
|
|
284
|
-
|
|
285
|
-
### Clear Planning Indicators
|
|
286
|
-
|
|
287
|
-
- `/clavix:start`
|
|
288
|
-
- `/clavix:prd`
|
|
289
|
-
- `/clavix:summarize`
|
|
290
|
-
- "Let's plan this"
|
|
291
|
-
- "Help me create a PRD"
|
|
292
|
-
- "I want to document requirements"
|
|
293
|
-
- "What should I build?"
|
|
294
|
-
|
|
295
|
-
---
|
|
296
|
-
|
|
297
|
-
### Clear Implementation Indicators
|
|
298
|
-
|
|
299
|
-
- "Now implement this"
|
|
300
|
-
- "Build the feature"
|
|
301
|
-
- "Write the code"
|
|
302
|
-
- "Create the component"
|
|
303
|
-
- "Let's start coding"
|
|
304
|
-
- "Make it work"
|
|
305
|
-
- User has approved PRD + says "go ahead"
|
|
306
|
-
|
|
307
|
-
---
|
|
308
|
-
|
|
309
|
-
### Ambiguous Phrases (ASK FOR CLARIFICATION)
|
|
310
|
-
|
|
311
|
-
- "Help me build X" ← Could be plan OR implement
|
|
312
|
-
- "Let's do X" ← Could be plan OR implement
|
|
313
|
-
- "Create an X" ← Could be PRD OR implementation
|
|
314
|
-
- "I need an X" ← Could be plan OR implement
|
|
315
|
-
- "Make it happen" ← Could be continue planning OR start implementing
|
|
316
|
-
|
|
317
|
-
**When hearing ambiguous phrase → Agent asks for clarification**
|
|
318
|
-
|
|
319
|
-
---
|
|
320
|
-
|
|
321
|
-
## Testing for Mode Confusion
|
|
322
|
-
|
|
323
|
-
### Test: Ambiguous Request Handling
|
|
324
|
-
|
|
325
|
-
**Input:**
|
|
326
|
-
```markdown
|
|
327
|
-
User: Help me build a todo app
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
**Expected behavior:**
|
|
331
|
-
- Agent asks: "Should I help plan it, or implement it now?"
|
|
332
|
-
- Agent does NOT assume one or the other
|
|
333
|
-
|
|
334
|
-
**Failure indicator:**
|
|
335
|
-
- Agent immediately starts planning without asking
|
|
336
|
-
- Agent immediately starts implementing without asking
|
|
337
|
-
|
|
338
|
-
---
|
|
339
|
-
|
|
340
|
-
### Test: Mid-Workflow Ambiguity
|
|
341
|
-
|
|
342
|
-
**Input:**
|
|
343
|
-
```markdown
|
|
344
|
-
User: /clavix:start
|
|
345
|
-
[Conversation about requirements]
|
|
346
|
-
User: Sounds great, let's go!
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
**Expected behavior:**
|
|
350
|
-
- Agent asks: "Should I summarize our requirements, or start implementing?"
|
|
351
|
-
- Agent does NOT assume "let's go" means implement
|
|
352
|
-
|
|
353
|
-
---
|
|
354
|
-
|
|
355
|
-
## Success Indicators
|
|
356
|
-
|
|
357
|
-
Mode clarity is working when:
|
|
358
|
-
- ✓ Agent knows whether to plan or implement
|
|
359
|
-
- ✓ Agent asks when uncertain instead of guessing
|
|
360
|
-
- ✓ User and agent expectations are aligned
|
|
361
|
-
- ✓ No confusion about what's being produced (PRD vs code)
|
|
362
|
-
- ✓ Clear transitions between modes when they occur
|
|
363
|
-
|
|
364
|
-
---
|
|
365
|
-
|
|
366
|
-
## Quick Reference
|
|
367
|
-
|
|
368
|
-
**Agent is confused?**
|
|
369
|
-
|
|
370
|
-
Agent should ask:
|
|
371
|
-
```markdown
|
|
372
|
-
Should I:
|
|
373
|
-
1. Plan and document (create PRDs, gather requirements)?
|
|
374
|
-
2. Implement (write code and build features)?
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
**User wants to clarify?**
|
|
378
|
-
|
|
379
|
-
User should say:
|
|
380
|
-
```markdown
|
|
381
|
-
Planning mode: "Just create a PRD / gather requirements for now"
|
|
382
|
-
Implementation mode: "Implement this now / start coding"
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
**Template authors preventing confusion?**
|
|
386
|
-
|
|
387
|
-
Add to templates:
|
|
388
|
-
```markdown
|
|
389
|
-
## CLAVIX MODE: Requirements & Planning Only
|
|
390
|
-
|
|
391
|
-
[Clear mode boundary]
|
|
392
|
-
|
|
393
|
-
**If uncertain whether to implement, ASK the user.**
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
---
|
|
397
|
-
|
|
398
|
-
## See Also
|
|
399
|
-
|
|
400
|
-
- `.clavix/instructions/core/clavix-mode.md` - Complete mode boundary explanation
|
|
401
|
-
- `.clavix/instructions/troubleshooting/jumped-to-implementation.md` - Agent implementing prematurely
|
|
402
|
-
- `.clavix/instructions/workflows/start.md` - Conversational mode workflow
|