clavix 2.8.2 → 3.0.1

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 (55) hide show
  1. package/README.md +26 -6
  2. package/dist/cli/commands/deep.d.ts +3 -4
  3. package/dist/cli/commands/deep.js +162 -261
  4. package/dist/cli/commands/fast.d.ts +3 -4
  5. package/dist/cli/commands/fast.js +126 -303
  6. package/dist/cli/commands/init.js +184 -22
  7. package/dist/cli/commands/prd.d.ts +7 -6
  8. package/dist/cli/commands/prd.js +113 -132
  9. package/dist/cli/commands/summarize.d.ts +1 -12
  10. package/dist/cli/commands/summarize.js +63 -131
  11. package/dist/core/intelligence/index.d.ts +10 -0
  12. package/dist/core/intelligence/index.js +13 -0
  13. package/dist/core/intelligence/intent-detector.d.ts +33 -0
  14. package/dist/core/intelligence/intent-detector.js +311 -0
  15. package/dist/core/intelligence/pattern-library.d.ts +44 -0
  16. package/dist/core/intelligence/pattern-library.js +103 -0
  17. package/dist/core/intelligence/patterns/actionability-enhancer.d.ts +27 -0
  18. package/dist/core/intelligence/patterns/actionability-enhancer.js +162 -0
  19. package/dist/core/intelligence/patterns/base-pattern.d.ts +31 -0
  20. package/dist/core/intelligence/patterns/base-pattern.js +39 -0
  21. package/dist/core/intelligence/patterns/completeness-validator.d.ts +27 -0
  22. package/dist/core/intelligence/patterns/completeness-validator.js +135 -0
  23. package/dist/core/intelligence/patterns/conciseness-filter.d.ts +12 -0
  24. package/dist/core/intelligence/patterns/conciseness-filter.js +61 -0
  25. package/dist/core/intelligence/patterns/objective-clarifier.d.ts +14 -0
  26. package/dist/core/intelligence/patterns/objective-clarifier.js +97 -0
  27. package/dist/core/intelligence/patterns/structure-organizer.d.ts +31 -0
  28. package/dist/core/intelligence/patterns/structure-organizer.js +185 -0
  29. package/dist/core/intelligence/patterns/technical-context-enricher.d.ts +16 -0
  30. package/dist/core/intelligence/patterns/technical-context-enricher.js +132 -0
  31. package/dist/core/intelligence/quality-assessor.d.ts +42 -0
  32. package/dist/core/intelligence/quality-assessor.js +296 -0
  33. package/dist/core/intelligence/types.d.ts +81 -0
  34. package/dist/core/intelligence/types.js +3 -0
  35. package/dist/core/intelligence/universal-optimizer.d.ts +31 -0
  36. package/dist/core/intelligence/universal-optimizer.js +118 -0
  37. package/dist/core/prd-generator.d.ts +2 -2
  38. package/dist/core/task-manager.js +18 -5
  39. package/dist/templates/agents/agents.md +2 -2
  40. package/dist/templates/agents/copilot-instructions.md +15 -15
  41. package/dist/templates/agents/octo.md +35 -30
  42. package/dist/templates/agents/warp.md +3 -3
  43. package/dist/templates/full-prd-template.hbs +1 -1
  44. package/dist/templates/prd-questions.md +1 -1
  45. package/dist/templates/quick-prd-template.hbs +1 -1
  46. package/dist/templates/slash-commands/_canonical/deep.md +261 -122
  47. package/dist/templates/slash-commands/_canonical/fast.md +101 -69
  48. package/dist/templates/slash-commands/_canonical/implement.md +1 -1
  49. package/dist/templates/slash-commands/_canonical/plan.md +12 -12
  50. package/dist/templates/slash-commands/_canonical/prd.md +34 -24
  51. package/dist/templates/slash-commands/_canonical/start.md +13 -12
  52. package/dist/templates/slash-commands/_canonical/summarize.md +42 -25
  53. package/dist/utils/error-utils.d.ts +7 -0
  54. package/dist/utils/error-utils.js +17 -0
  55. package/package.json +21 -12
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: "Clavix: Summarize"
3
- description: Extract and CLEAR-optimize requirements from conversation
3
+ description: Extract and optimize requirements from conversation
4
4
  ---
5
5
 
6
- # Clavix Conversation Summarization - CLEAR Framework Enhanced
6
+ # Clavix Conversation Summarization
7
7
 
8
- You are analyzing the conversation history and extracting optimized requirements. **Extracted prompts are automatically enhanced using the CLEAR Framework** (Concise, Logical, Explicit) for optimal AI consumption.
8
+ You are analyzing the conversation history and extracting optimized requirements. **Extracted prompts are automatically enhanced using universal prompt intelligence** for optimal AI consumption.
9
9
 
10
10
  ## Instructions
11
11
 
@@ -72,18 +72,20 @@ You are analyzing the conversation history and extracting optimized requirements
72
72
  [Success criteria and any important context]
73
73
  ```
74
74
 
75
- 3. **CLEAR Framework Optimization** (automatic with labeled improvements):
76
- - After extracting the optimized prompt, analyze using CLEAR framework
77
- - Apply Conciseness, Logic, and Explicitness enhancements
78
- - **Label all improvements** with CLEAR component tags:
79
- - **[C]**: "Removed 12 conversational words, reduced from 45 to 28 words"
80
- - **[L]**: "Restructured flow: context → requirements → constraints → success criteria"
81
- - **[E]**: "Added explicit output format (React component), persona (senior dev), success metrics (load time < 2s)"
82
- - Display both raw extraction and CLEAR-enhanced version
83
- - Show CLEAR scores (before/after) and labeled improvements
75
+ 3. **Universal Optimization** (automatic with labeled improvements):
76
+ - After extracting the prompt, analyze using universal prompt intelligence
77
+ - Apply optimizations for Clarity, Efficiency, Structure, Completeness, and Actionability
78
+ - **Label all improvements** with quality dimension tags:
79
+ - **[Efficiency]**: "Removed 12 conversational words, reduced from 45 to 28 words"
80
+ - **[Structure]**: "Reorganized flow: context → requirements → constraints → success criteria"
81
+ - **[Clarity]**: "Added explicit output format (React component), persona (senior dev)"
82
+ - **[Completeness]**: "Added missing success metrics (load time < 2s, user adoption rate)"
83
+ - **[Actionability]**: "Converted vague goals into specific, measurable requirements"
84
+ - Display both raw extraction and optimized version
85
+ - Show quality scores (before/after) and labeled improvements
84
86
  - Save both versions:
85
- - `optimized-prompt.md` (raw extraction)
86
- - `clear-optimized-prompt.md` (CLEAR-enhanced with improvement notes)
87
+ - `original-prompt.md` (raw extraction from conversation)
88
+ - `optimized-prompt.md` (enhanced with improvements)
87
89
 
88
90
  4. Highlight key insights discovered during the conversation.
89
91
 
@@ -91,16 +93,19 @@ You are analyzing the conversation history and extracting optimized requirements
91
93
 
92
94
  6. If anything is still unclear or missing, point it out and suggest areas for further discussion.
93
95
 
94
- ## CLEAR Enhancement
96
+ ## Quality Enhancement
95
97
 
96
98
  **What gets optimized:**
97
- - **[C] Concise**: Remove any verbosity from extracted requirements
98
- - **[L] Logical**: Ensure coherent flow (context → requirements → constraints → output)
99
- - **[E] Explicit**: Add missing specifications, formats, success criteria
99
+ - **Clarity**: Remove ambiguity from extracted requirements
100
+ - **Efficiency**: Remove verbosity and conversational fluff
101
+ - **Structure**: Ensure logical flow (context requirements → constraints → output)
102
+ - **Completeness**: Add missing specifications, formats, success criteria
103
+ - **Actionability**: Make requirements specific and executable
100
104
 
101
105
  **Output files:**
102
- - `optimized-prompt.md` - Raw extraction from conversation
103
- - `clear-optimized-prompt.md` - CLEAR-enhanced version (recommended for AI agents)
106
+ - `original-prompt.md` - Raw extraction from conversation
107
+ - `optimized-prompt.md` - Enhanced version (recommended for AI agents)
108
+ - `mini-prd.md` - Structured requirements document
104
109
 
105
110
  ## Quality Checks
106
111
 
@@ -109,14 +114,14 @@ You are analyzing the conversation history and extracting optimized requirements
109
114
  - Technical constraints identified
110
115
  - Success criteria defined
111
116
  - User needs considered
112
- - CLEAR framework applied for AI consumption
117
+ - Universal prompt intelligence applied for AI consumption
113
118
 
114
119
  ## Workflow Navigation
115
120
 
116
121
  **You are here:** Summarize (Conversation Extraction)
117
122
 
118
123
  **Common workflows:**
119
- - **Standard flow**: `/clavix:start` → [conversation] → `/clavix:summarize` → Use CLEAR-optimized prompt
124
+ - **Standard flow**: `/clavix:start` → [conversation] → `/clavix:summarize` → Use optimized prompt
120
125
  - **To implementation**: `/clavix:summarize` → `/clavix:plan` → `/clavix:implement` → `/clavix:archive`
121
126
  - **Standalone use**: [Any conversation] → `/clavix:summarize` → Extract and optimize
122
127
 
@@ -129,6 +134,11 @@ You are analyzing the conversation history and extracting optimized requirements
129
134
 
130
135
  From conversation about "analytics dashboard for sales team"...
131
136
 
137
+ **Original Extraction**:
138
+ ```
139
+ We discussed building a dashboard for the sales team that shows analytics. They want to see revenue trends and who's performing well. It should update in real-time and help managers spot problems. We talked about using React and connecting to Salesforce.
140
+ ```
141
+
132
142
  **Optimized Prompt**:
133
143
  ```
134
144
  Build a real-time sales analytics dashboard for the sales team showing revenue trends, top performers, pipeline status, and conversion rates. The dashboard should update live as deals progress, support filtering by date range/region/rep, and display key metrics prominently. Users need to quickly identify at-risk deals and celebrate wins.
@@ -138,6 +148,13 @@ Technical stack: React + TypeScript frontend, integrate with existing Salesforce
138
148
  Success: Sales managers can identify issues within 30 seconds of opening, dashboard loads in <2 seconds, 90% of team uses it daily within first month.
139
149
  ```
140
150
 
151
+ **Improvements Applied**:
152
+ - **[Efficiency]**: Removed 8 conversational phrases, increased information density
153
+ - **[Structure]**: Organized into objective → requirements → technical → success
154
+ - **[Clarity]**: Specified exact features (filtering, metrics display) instead of vague "shows analytics"
155
+ - **[Completeness]**: Added performance requirements (10K+ deals, <2s load), success metrics (30s to identify issues, 90% adoption)
156
+ - **[Actionability]**: Converted "help managers spot problems" into specific, measurable outcome
157
+
141
158
  ## Troubleshooting
142
159
 
143
160
  ### Issue: Pre-extraction validation fails (missing objective/requirements)
@@ -156,12 +173,12 @@ Success: Sales managers can identify issues within 30 seconds of opening, dashbo
156
173
  - Mark multi-topic extraction with [MULTI-TOPIC] indicator
157
174
  - Suggest breaking into separate PRDs for each topic
158
175
 
159
- ### Issue: CLEAR optimization doesn't significantly improve extracted prompt
176
+ ### Issue: Optimization doesn't significantly improve extracted prompt
160
177
  **Cause**: Conversation was already well-structured and detailed
161
178
  **Solution**:
162
179
  - Minor improvements are normal for good conversations
163
- - Show CLEAR scores (should be high: >80%)
164
- - Still provide both versions but note that original extraction was already CLEAR
180
+ - Show quality scores (should be high: >80%)
181
+ - Still provide both versions but note that original extraction was already high quality
165
182
 
166
183
  ### Issue: Low confidence indicators across all extracted elements
167
184
  **Cause**: Conversation was too vague or high-level
@@ -32,5 +32,12 @@ interface NodeJSError extends Error {
32
32
  * Type guard to check if error is a NodeJS error with code property
33
33
  */
34
34
  export declare function isNodeError(error: unknown): error is NodeJSError;
35
+ /**
36
+ * Handles CLI errors, formatting OCLIF errors nicely and falling back to default handler.
37
+ * @param error The error to handle
38
+ * @param defaultHandler The default handler function (usually handle from @oclif/core)
39
+ * @param exitFn Optional exit function (defaults to process.exit)
40
+ */
41
+ export declare function handleCliError(error: any, defaultHandler: (err: any) => Promise<void>, exitFn?: (code: number) => void): Promise<void>;
35
42
  export {};
36
43
  //# sourceMappingURL=error-utils.d.ts.map
@@ -65,4 +65,21 @@ export function isNodeError(error) {
65
65
  'code' in error &&
66
66
  typeof error.code === 'string');
67
67
  }
68
+ /**
69
+ * Handles CLI errors, formatting OCLIF errors nicely and falling back to default handler.
70
+ * @param error The error to handle
71
+ * @param defaultHandler The default handler function (usually handle from @oclif/core)
72
+ * @param exitFn Optional exit function (defaults to process.exit)
73
+ */
74
+ export async function handleCliError(error, defaultHandler, exitFn = process.exit) {
75
+ // For CLIError, show only the formatted message
76
+ if (error && error.oclif && error.oclif.exit !== undefined) {
77
+ // Format error message (hints are now included in error.message)
78
+ console.error(' › Error: ' + error.message);
79
+ exitFn(error.oclif.exit);
80
+ return;
81
+ }
82
+ // For other errors, use default handler
83
+ return defaultHandler(error);
84
+ }
68
85
  //# sourceMappingURL=error-utils.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "clavix",
3
- "version": "2.8.2",
4
- "description": "Transform vague ideas into production-ready prompts. AI agent tool with CLI interface using the CLEAR framework to analyze, improve, and generate PRDs for AI coding assistants (Claude Code, Cursor, Windsurf, and more)",
3
+ "version": "3.0.1",
4
+ "description": "Universal prompt intelligence for AI coding. Automatically optimizes prompts with intent detection, quality assessment, and adaptive patterns—no framework to learn. Works with Claude Code, Cursor, Windsurf, and 19+ other AI coding tools.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -17,12 +17,12 @@
17
17
  "build:prod": "npm run build && npm run remove-sourcemaps",
18
18
  "copy-templates": "copyfiles -u 1 \"src/templates/**/*\" dist/",
19
19
  "remove-sourcemaps": "find dist -name '*.map' -type f -delete",
20
- "dev": "ts-node src/index.ts",
21
- "test": "NODE_OPTIONS=\"--experimental-vm-modules\" jest",
22
- "test:watch": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --watch",
23
- "test:coverage": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --coverage",
24
- "lint": "eslint src --ext .ts",
25
- "lint:fix": "eslint src --ext .ts --fix",
20
+ "dev": "node --loader ts-node/esm src/index.ts",
21
+ "test": "NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" jest",
22
+ "test:watch": "NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" jest --watch",
23
+ "test:coverage": "NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" jest --coverage",
24
+ "lint": "eslint",
25
+ "lint:fix": "eslint --fix",
26
26
  "format": "prettier --write \"src/**/*.ts\"",
27
27
  "format:check": "prettier --check \"src/**/*.ts\"",
28
28
  "prepublishOnly": "npm run build:prod"
@@ -35,14 +35,21 @@
35
35
  "cli",
36
36
  "ai",
37
37
  "prompt",
38
+ "prompt-optimization",
39
+ "prompt-intelligence",
40
+ "intent-detection",
41
+ "quality-assessment",
38
42
  "prd",
39
43
  "claude",
40
44
  "claude-code",
45
+ "cursor",
46
+ "windsurf",
41
47
  "developer-tools",
42
48
  "prompt-engineering",
49
+ "ai-coding-tools",
43
50
  "requirements"
44
51
  ],
45
- "author": "Bob5k",
52
+ "author": "ClavixDev",
46
53
  "license": "MIT",
47
54
  "bugs": {
48
55
  "url": "https://github.com/ClavixDev/Clavix/issues"
@@ -62,6 +69,7 @@
62
69
  "uuid": "^9.0.1"
63
70
  },
64
71
  "devDependencies": {
72
+ "@eslint/js": "^9.17.0",
65
73
  "@oclif/test": "^4.1.15",
66
74
  "@types/fs-extra": "^11.0.4",
67
75
  "@types/handlebars": "^4.0.40",
@@ -72,12 +80,13 @@
72
80
  "@typescript-eslint/eslint-plugin": "^8.46.4",
73
81
  "@typescript-eslint/parser": "^8.46.4",
74
82
  "copyfiles": "^2.4.1",
75
- "eslint": "^8.57.0",
76
- "jest": "^30.2.0",
83
+ "eslint": "^9.17.0",
84
+ "jest": "^29.7.0",
77
85
  "prettier": "^3.6.2",
78
86
  "ts-jest": "^29.4.5",
79
87
  "ts-node": "^10.9.2",
80
- "typescript": "^5.9.3"
88
+ "typescript": "^5.9.3",
89
+ "typescript-eslint": "^8.46.4"
81
90
  },
82
91
  "oclif": {
83
92
  "bin": "clavix",