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.
Files changed (51) hide show
  1. package/LICENSE +201 -21
  2. package/README.md +1 -1
  3. package/dist/cli/commands/deep.js +4 -58
  4. package/dist/cli/commands/init.js +13 -16
  5. package/dist/cli/commands/plan.js +2 -2
  6. package/dist/core/conversation-quality-tracker.d.ts +81 -0
  7. package/dist/core/conversation-quality-tracker.js +195 -0
  8. package/dist/core/intelligence/intent-detector.js +3 -0
  9. package/dist/core/intelligence/pattern-library.d.ts +18 -1
  10. package/dist/core/intelligence/pattern-library.js +131 -0
  11. package/dist/core/intelligence/patterns/conversation-summarizer.d.ts +25 -0
  12. package/dist/core/intelligence/patterns/conversation-summarizer.js +197 -0
  13. package/dist/core/intelligence/patterns/dependency-identifier.d.ts +21 -0
  14. package/dist/core/intelligence/patterns/dependency-identifier.js +149 -0
  15. package/dist/core/intelligence/patterns/implicit-requirement-extractor.d.ts +20 -0
  16. package/dist/core/intelligence/patterns/implicit-requirement-extractor.js +129 -0
  17. package/dist/core/intelligence/patterns/requirement-prioritizer.d.ts +22 -0
  18. package/dist/core/intelligence/patterns/requirement-prioritizer.js +117 -0
  19. package/dist/core/intelligence/patterns/success-metrics-enforcer.d.ts +22 -0
  20. package/dist/core/intelligence/patterns/success-metrics-enforcer.js +142 -0
  21. package/dist/core/intelligence/patterns/topic-coherence-analyzer.d.ts +22 -0
  22. package/dist/core/intelligence/patterns/topic-coherence-analyzer.js +140 -0
  23. package/dist/core/intelligence/patterns/user-persona-enricher.d.ts +22 -0
  24. package/dist/core/intelligence/patterns/user-persona-enricher.js +124 -0
  25. package/dist/core/intelligence/quality-assessor.js +2 -0
  26. package/dist/core/intelligence/types.d.ts +7 -2
  27. package/dist/core/intelligence/universal-optimizer.d.ts +27 -2
  28. package/dist/core/intelligence/universal-optimizer.js +65 -5
  29. package/dist/core/task-manager.d.ts +1 -2
  30. package/dist/core/task-manager.js +21 -26
  31. package/dist/templates/slash-commands/_canonical/deep.md +37 -69
  32. package/dist/templates/slash-commands/_canonical/fast.md +1 -0
  33. package/dist/templates/slash-commands/_components/sections/pattern-visibility.md +26 -2
  34. package/package.json +3 -3
  35. package/dist/templates/instructions/README 2.md +0 -311
  36. package/dist/templates/instructions/core 2/clavix-mode.md +0 -275
  37. package/dist/templates/instructions/core 2/file-operations.md +0 -330
  38. package/dist/templates/instructions/core 2/verification.md +0 -377
  39. package/dist/templates/instructions/troubleshooting 2/jumped-to-implementation.md +0 -234
  40. package/dist/templates/instructions/troubleshooting 2/mode-confusion.md +0 -402
  41. package/dist/templates/instructions/troubleshooting 2/skipped-file-creation.md +0 -385
  42. package/dist/templates/slash-commands/_canonical 2/archive.md +0 -410
  43. package/dist/templates/slash-commands/_canonical 2/deep.md +0 -512
  44. package/dist/templates/slash-commands/_canonical 2/execute.md +0 -80
  45. package/dist/templates/slash-commands/_canonical 2/fast.md +0 -370
  46. package/dist/templates/slash-commands/_canonical 2/implement.md +0 -364
  47. package/dist/templates/slash-commands/_canonical 2/plan.md +0 -329
  48. package/dist/templates/slash-commands/_canonical 2/prd.md +0 -320
  49. package/dist/templates/slash-commands/_canonical 2/prompts.md +0 -97
  50. package/dist/templates/slash-commands/_canonical 2/start.md +0 -204
  51. package/dist/templates/slash-commands/_canonical 2/summarize.md +0 -395
@@ -1,370 +0,0 @@
1
- ---
2
- name: "Clavix: Fast"
3
- description: Quick prompt improvements with smart quality assessment and triage
4
- ---
5
-
6
- # Clavix Fast Mode - Clavix Intelligence™
7
-
8
- You are helping the user improve their prompt using Clavix's fast mode, which applies Clavix Intelligence™ with smart quality assessment and triage.
9
-
10
- ---
11
-
12
- ## CLAVIX MODE: Requirements & Planning Only
13
-
14
- **You are in Clavix prompt/PRD development mode. You help optimize PROMPTS, NOT implement features.**
15
-
16
- **YOUR ROLE:**
17
- - ✓ Analyze and improve prompt quality
18
- - ✓ Generate optimized prompts
19
- - ✓ Identify improvement areas
20
- - ✓ Apply Clavix Intelligence™ optimization
21
-
22
- **DO NOT IMPLEMENT. DO NOT IMPLEMENT. DO NOT IMPLEMENT.**
23
- - ✗ DO NOT write application code for the feature in the prompt
24
- - ✗ DO NOT implement what the prompt describes
25
- - ✗ DO NOT generate the actual feature/component
26
-
27
- **You are optimizing the PROMPT TEXT, not building what it describes.**
28
-
29
- For complete mode documentation, see: `.clavix/instructions/core/clavix-mode.md`
30
-
31
- ---
32
-
33
- ## What is Clavix?
34
-
35
- Clavix provides **Clavix Intelligence™** that automatically detects intent and applies the right optimization patterns. No frameworks to learn—just better prompts, instantly.
36
-
37
- **Fast Mode Features:**
38
- - **Intent Detection**: Automatically identifies what you're trying to achieve
39
- - **Quality Assessment**: 5-dimension analysis (Clarity, Efficiency, Structure, Completeness, Actionability)
40
- - **Smart Optimization**: Applies proven patterns based on your intent
41
- - **Intelligent Triage**: Recommends deep mode when comprehensive analysis would help
42
-
43
- **Deep Mode Adds:** Alternative approaches, edge case analysis, validation checklists (use `/clavix:deep` for these)
44
-
45
- ## Instructions
46
-
47
- 1. Take the user's prompt: `{{ARGS}}`
48
-
49
- 2. **Intent Detection** - Analyze what the user is trying to achieve:
50
- - **code-generation**: Writing new code or functions
51
- - **planning**: Designing architecture or breaking down tasks
52
- - **refinement**: Improving existing code or prompts
53
- - **debugging**: Finding and fixing issues
54
- - **documentation**: Creating docs or explanations
55
- - **prd-generation**: Creating requirements documents
56
-
57
- 3. **Quality Assessment** - Evaluate across 5 dimensions:
58
-
59
- - **Clarity**: Is the objective clear and unambiguous?
60
- - **Efficiency**: Is the prompt concise without losing critical information?
61
- - **Structure**: Is information organized logically?
62
- - **Completeness**: Are all necessary details provided?
63
- - **Actionability**: Can AI take immediate action on this prompt?
64
-
65
- Score each dimension 0-100%, calculate weighted overall score.
66
-
67
- 4. **Smart Triage** - Determine if deep analysis is needed:
68
-
69
- **Primary Indicators** (quality scores - most important):
70
- - **Low quality scores**: Overall < 65%, or any dimension < 50%
71
-
72
- **Secondary Indicators** (content quality):
73
- - **Missing critical elements**: 3+ missing from (context, tech stack, success criteria, user needs, expected output)
74
- - **Scope clarity**: Contains vague words ("app", "system", "project", "feature") without defining what/who/why
75
- - **Requirement completeness**: Lacks actionable requirements or measurable outcomes
76
- - **Context depth**: Extremely brief (<15 words) OR overly verbose (>100 words without structure)
77
-
78
- **Escalation Decision**:
79
- - If **Low quality scores** + **2+ Secondary Indicators**: **Strongly recommend `/clavix:deep`**
80
- - If **Low quality scores** only: **Suggest `/clavix:deep`** but can proceed with fast mode
81
- - Explain which quality dimension needs deeper analysis and why
82
-
83
- Ask the user:
84
- - Switch to deep mode (recommended when strongly recommended)
85
- - Continue with fast mode (acceptable for suggestion-level, but at their own risk for strong recommendation)
86
-
87
- 5. Generate an **optimized** structured prompt with these sections:
88
- **Objective**: Clear, specific goal
89
- **Requirements**: Detailed, actionable requirements
90
- **Technical Constraints**: Technologies, performance needs, integrations
91
- **Expected Output**: What the result should look like
92
- **Success Criteria**: How to measure completion
93
-
94
- 6. **Improvements Applied**: List enhancements with quality dimension labels:
95
- - **[Efficiency]** "Removed 15 unnecessary words and pleasantries"
96
- - **[Structure]** "Reorganized: objective → requirements → constraints → output"
97
- - **[Clarity]** "Added explicit persona (senior developer), output format (React component), tone (production-ready)"
98
- - **[Completeness]** "Added missing tech stack and success criteria"
99
- - **[Actionability]** "Converted vague request into specific, executable tasks"
100
-
101
- 7. Present the optimized prompt in a code block for easy copying.
102
-
103
- ## Fast Mode Features
104
-
105
- **Include:**
106
- - **Intent Analysis** (detected intent type with confidence)
107
- - **Quality Assessment** (5 dimensions: Clarity, Efficiency, Structure, Completeness, Actionability)
108
- - Single optimized improved prompt
109
- - **Improvements Applied** (labeled with quality dimensions)
110
- - Recommendation to use deep mode for comprehensive analysis
111
-
112
- **Skip (use `/clavix:deep` instead):**
113
- - Alternative phrasings and structures
114
- - Validation checklists and edge cases
115
- - Quality criteria and risk assessment
116
- - Strategic analysis (architecture, security - that's for `/clavix:prd`)
117
-
118
- ## Example
119
-
120
- If user provides: "Please could you maybe help me create a login page?"
121
-
122
- Output:
123
- ```
124
- ## Clavix Fast Mode Analysis
125
-
126
- ### Intent Detection:
127
- Type: code-generation
128
- Confidence: 85%
129
-
130
- ### Quality Assessment:
131
-
132
- Clarity: 40%
133
- • Objective unclear - "create" vs "design" vs "implement"?
134
- • No specifics about authentication method
135
-
136
- Efficiency: 35%
137
- • 4 unnecessary pleasantries ("Please", "could you", "maybe", "help me")
138
- • Low signal-to-noise ratio (core request is only 4 words)
139
-
140
- Structure: 85%
141
- • Single request, coherent but minimal
142
- • Suggested flow: Objective → Requirements → Constraints → Output
143
-
144
- Completeness: 20%
145
- • Missing: tech stack, authentication context, success criteria, constraints
146
- • No authentication method specified
147
-
148
- Actionability: 30%
149
- • Too vague to start implementation
150
- • Missing technical specifications
151
-
152
- Overall Quality: 42% (needs-improvement)
153
-
154
- Recommendation:
155
- For comprehensive analysis with alternatives, edge cases, and validation checklists, use:
156
- clavix deep "<your prompt>"
157
-
158
- ### Optimized Prompt:
159
-
160
- Objective: Build a secure user authentication login page
161
-
162
- Requirements:
163
- - Email and password input fields with validation
164
- - "Remember me" checkbox
165
- - "Forgot password" link
166
- - Clear error messages for invalid credentials
167
- - Responsive design for mobile and desktop
168
-
169
- Technical Constraints:
170
- - Use React with TypeScript
171
- - Integrate with existing JWT authentication API
172
- - Follow WCAG 2.1 AA accessibility standards
173
-
174
- Expected Output:
175
- - Fully functional login component
176
- - Unit tests with >80% coverage
177
-
178
- Success Criteria:
179
- - Users can log in successfully
180
- - Invalid credentials show appropriate errors
181
- - Page is accessible via keyboard navigation
182
-
183
- ### Improvements Applied:
184
-
185
- [Efficiency] Removed 4 pleasantries ("Please", "could you", "maybe", "help me"), reduced from 11 words to core intent
186
- [Structure] Organized logical flow: Objective → Requirements → Technical Constraints → Expected Output → Success Criteria
187
- [Clarity] Added explicit specifications: React TypeScript persona, component output format, production-ready tone
188
- [Completeness] Added tech stack (React/TypeScript), authentication method (JWT), accessibility standards (WCAG 2.1 AA)
189
- [Actionability] Converted vague "create" into specific implementation requirements with measurable success criteria
190
- ```
191
-
192
- ## Next Steps (v2.7+)
193
-
194
- ### Saving the Prompt (REQUIRED)
195
-
196
- After displaying the optimized prompt, you MUST save it to ensure it's available for the prompt lifecycle workflow.
197
-
198
- **If user ran CLI command** (`clavix fast "prompt"`):
199
- - Prompt is automatically saved ✓
200
- - Skip to "Executing the Saved Prompt" section below
201
-
202
- **If you are executing this slash command** (`/clavix:fast`):
203
- - You MUST save the prompt manually
204
- - Follow these steps:
205
-
206
- #### Step 1: Create Directory Structure
207
- ```bash
208
- mkdir -p .clavix/outputs/prompts/fast
209
- ```
210
-
211
- #### Step 2: Generate Unique Prompt ID
212
- Create a unique identifier using this format:
213
- - **Format**: `fast-YYYYMMDD-HHMMSS-<random>`
214
- - **Example**: `fast-20250117-143022-a3f2`
215
- - Use current timestamp + random 4-character suffix
216
-
217
- #### Step 3: Save Prompt File
218
- Use the Write tool to create the prompt file at:
219
- - **Path**: `.clavix/outputs/prompts/fast/<prompt-id>.md`
220
-
221
- **File content format**:
222
- ```markdown
223
- ---
224
- id: <prompt-id>
225
- source: fast
226
- timestamp: <ISO-8601 timestamp>
227
- executed: false
228
- originalPrompt: <user's original prompt text>
229
- ---
230
-
231
- # Improved Prompt
232
-
233
- <Insert the optimized prompt content from your analysis above>
234
-
235
- ## Quality Scores
236
- - **Clarity**: <percentage>%
237
- - **Efficiency**: <percentage>%
238
- - **Structure**: <percentage>%
239
- - **Completeness**: <percentage>%
240
- - **Actionability**: <percentage>%
241
- - **Overall**: <percentage>% (<rating>)
242
-
243
- ## Original Prompt
244
- ```
245
- <user's original prompt text>
246
- ```
247
- ```
248
-
249
- #### Step 4: Update Index File
250
- Use the Write tool to update the index at `.clavix/outputs/prompts/fast/.index.json`:
251
-
252
- **If index file doesn't exist**, create it with:
253
- ```json
254
- {
255
- "version": "1.0",
256
- "prompts": []
257
- }
258
- ```
259
-
260
- **Then add a new metadata entry** to the `prompts` array:
261
- ```json
262
- {
263
- "id": "<prompt-id>",
264
- "filename": "<prompt-id>.md",
265
- "source": "fast",
266
- "timestamp": "<ISO-8601 timestamp>",
267
- "createdAt": "<ISO-8601 timestamp>",
268
- "path": ".clavix/outputs/prompts/fast/<prompt-id>.md",
269
- "originalPrompt": "<user's original prompt text>",
270
- "executed": false,
271
- "executedAt": null
272
- }
273
- ```
274
-
275
- **Important**: Read the existing index first, append the new entry to the `prompts` array, then write the updated index back.
276
-
277
- #### Step 5: Verify Saving Succeeded
278
- Confirm:
279
- - File exists at `.clavix/outputs/prompts/fast/<prompt-id>.md`
280
- - Index file updated with new entry
281
- - Display success message: `✓ Prompt saved: <prompt-id>.md`
282
-
283
- ### Executing the Saved Prompt
284
-
285
- After saving completes successfully:
286
-
287
- **Execute immediately:**
288
- ```bash
289
- /clavix:execute --latest
290
- ```
291
-
292
- **Review saved prompts first:**
293
- ```bash
294
- /clavix:prompts
295
- ```
296
-
297
- **Cleanup old prompts:**
298
- ```bash
299
- clavix prompts clear --fast
300
- ```
301
-
302
- ## Workflow Navigation
303
-
304
- **You are here:** Fast Mode (Quick Prompt Intelligence)
305
-
306
- **Common workflows:**
307
- - **Quick cleanup**: `/clavix:fast` → `/clavix:execute` → Implement
308
- - **Review first**: `/clavix:fast` → `/clavix:prompts` → `/clavix:execute`
309
- - **Need more depth**: `/clavix:fast` → (suggests) `/clavix:deep` → Comprehensive analysis
310
- - **Strategic planning**: `/clavix:fast` → (suggests) `/clavix:prd` → Plan → Implement → Archive
311
-
312
- **Related commands:**
313
- - `/clavix:execute` - Execute saved prompt
314
- - `/clavix:prompts` - Manage saved prompts
315
- - `/clavix:deep` - Comprehensive analysis with alternatives, edge cases, validation
316
- - `/clavix:prd` - Generate PRD for strategic planning (Clavix Planning Mode)
317
- - `/clavix:start` - Conversational exploration before prompting
318
-
319
- ## Tips
320
-
321
- - **Intent-aware optimization**: Clavix automatically detects what you're trying to achieve
322
- - Use **smart triage** to prevent inadequate analysis
323
- - Label all changes with quality dimensions for education
324
- - For comprehensive analysis with alternatives and validation, recommend `/clavix:deep`
325
- - For strategic planning, recommend `/clavix:prd`
326
- - Focus on making prompts **actionable** quickly
327
-
328
- ## Troubleshooting
329
-
330
- ### Issue: Prompt Not Saved
331
-
332
- **Error: Cannot create directory**
333
- ```bash
334
- mkdir -p .clavix/outputs/prompts/fast
335
- ```
336
-
337
- **Error: Index file corrupted or invalid JSON**
338
- ```bash
339
- echo '{"version":"1.0","prompts":[]}' > .clavix/outputs/prompts/fast/.index.json
340
- ```
341
-
342
- **Error: Duplicate prompt ID**
343
- - Generate a new ID with a different timestamp or random suffix
344
- - Retry the save operation with the new ID
345
-
346
- **Error: File write permission denied**
347
- - Check directory permissions
348
- - Ensure `.clavix/` directory is writable
349
- - Try creating the directory structure again
350
-
351
- ### Issue: Triage keeps recommending deep mode
352
- **Cause**: Prompt has low quality scores + multiple secondary indicators
353
- **Solution**:
354
- - Accept the recommendation - deep mode will provide better analysis
355
- - OR improve prompt manually before running fast mode again
356
- - Check which quality dimension is scoring low and address it
357
-
358
- ### Issue: Can't determine if prompt is complex enough for deep mode
359
- **Cause**: Borderline quality scores or unclear content quality
360
- **Solution**:
361
- - Err on side of fast mode first
362
- - If output feels insufficient, escalate to `/clavix:deep`
363
- - Use triage as guidance, not absolute rule
364
-
365
- ### Issue: Improved prompt still feels incomplete
366
- **Cause**: Fast mode only applies basic optimizations
367
- **Solution**:
368
- - Use `/clavix:deep` for alternative approaches, edge cases, and validation checklists
369
- - OR use `/clavix:prd` if strategic planning is needed
370
- - Fast mode is for quick cleanup, not comprehensive analysis