clavix 2.3.0 → 2.4.0

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 (180) hide show
  1. package/dist/cli/commands/init.js +1 -1
  2. package/dist/core 2/adapters/agents-md-generator.d.ts +26 -0
  3. package/dist/core 2/adapters/agents-md-generator.js +102 -0
  4. package/dist/core 2/adapters/amp-adapter.d.ts +27 -0
  5. package/dist/core 2/adapters/amp-adapter.js +42 -0
  6. package/dist/core 2/adapters/augment-adapter.d.ts +22 -0
  7. package/dist/core 2/adapters/augment-adapter.js +77 -0
  8. package/dist/core 2/adapters/base-adapter.d.ts +45 -0
  9. package/dist/core 2/adapters/base-adapter.js +142 -0
  10. package/dist/core 2/adapters/claude-code-adapter.d.ts +32 -0
  11. package/dist/core 2/adapters/claude-code-adapter.js +116 -0
  12. package/dist/core 2/adapters/cline-adapter.d.ts +34 -0
  13. package/dist/core 2/adapters/cline-adapter.js +52 -0
  14. package/dist/core 2/adapters/codebuddy-adapter.d.ts +24 -0
  15. package/dist/core 2/adapters/codebuddy-adapter.js +82 -0
  16. package/dist/core 2/adapters/codex-adapter.d.ts +24 -0
  17. package/dist/core 2/adapters/codex-adapter.js +79 -0
  18. package/dist/core 2/adapters/copilot-instructions-generator.d.ts +26 -0
  19. package/dist/core 2/adapters/copilot-instructions-generator.js +104 -0
  20. package/dist/core 2/adapters/crush-adapter.d.ts +35 -0
  21. package/dist/core 2/adapters/crush-adapter.js +49 -0
  22. package/dist/core 2/adapters/cursor-adapter.d.ts +25 -0
  23. package/dist/core 2/adapters/cursor-adapter.js +40 -0
  24. package/dist/core 2/adapters/droid-adapter.d.ts +33 -0
  25. package/dist/core 2/adapters/droid-adapter.js +57 -0
  26. package/dist/core 2/adapters/gemini-adapter.d.ts +27 -0
  27. package/dist/core 2/adapters/gemini-adapter.js +90 -0
  28. package/dist/core 2/adapters/kilocode-adapter.d.ts +34 -0
  29. package/dist/core 2/adapters/kilocode-adapter.js +49 -0
  30. package/dist/core 2/adapters/octo-md-generator.d.ts +26 -0
  31. package/dist/core 2/adapters/octo-md-generator.js +102 -0
  32. package/dist/core 2/adapters/opencode-adapter.d.ts +33 -0
  33. package/dist/core 2/adapters/opencode-adapter.js +56 -0
  34. package/dist/core 2/adapters/qwen-adapter.d.ts +27 -0
  35. package/dist/core 2/adapters/qwen-adapter.js +90 -0
  36. package/dist/core 2/adapters/roocode-adapter.d.ts +40 -0
  37. package/dist/core 2/adapters/roocode-adapter.js +68 -0
  38. package/dist/core 2/adapters/warp-md-generator.d.ts +17 -0
  39. package/dist/core 2/adapters/warp-md-generator.js +88 -0
  40. package/dist/core 2/adapters/windsurf-adapter.d.ts +34 -0
  41. package/dist/core 2/adapters/windsurf-adapter.js +49 -0
  42. package/dist/core 2/agent-manager.d.ts +51 -0
  43. package/dist/core 2/agent-manager.js +126 -0
  44. package/dist/core 2/archive-manager.d.ts +100 -0
  45. package/dist/core 2/archive-manager.js +338 -0
  46. package/dist/core 2/conversation-analyzer.d.ts +86 -0
  47. package/dist/core 2/doc-injector.d.ts +51 -0
  48. package/dist/core 2/doc-injector.js +236 -0
  49. package/dist/core 2/git-manager.d.ts +100 -0
  50. package/dist/core 2/git-manager.js +214 -0
  51. package/dist/core 2/prompt-optimizer.d.ts +268 -0
  52. package/dist/core 2/prompt-optimizer.js +963 -0
  53. package/dist/core 2/question-engine.d.ts +167 -0
  54. package/dist/core 2/question-engine.js +395 -0
  55. package/dist/core 2/session-manager.d.ts +139 -0
  56. package/dist/core 2/session-manager.js +403 -0
  57. package/dist/core 2/task-manager.d.ts +155 -0
  58. package/dist/core 2/task-manager.js +689 -0
  59. package/dist/utils/template-loader.js +24 -22
  60. package/package.json +1 -1
  61. package/dist/templates/slash-commands/augment/archive.md +0 -291
  62. package/dist/templates/slash-commands/augment/deep.md +0 -207
  63. package/dist/templates/slash-commands/augment/fast.md +0 -183
  64. package/dist/templates/slash-commands/augment/implement.md +0 -267
  65. package/dist/templates/slash-commands/augment/plan.md +0 -173
  66. package/dist/templates/slash-commands/augment/prd.md +0 -178
  67. package/dist/templates/slash-commands/augment/start.md +0 -142
  68. package/dist/templates/slash-commands/augment/summarize.md +0 -179
  69. package/dist/templates/slash-commands/claude-code/archive.md +0 -291
  70. package/dist/templates/slash-commands/claude-code/deep.md +0 -207
  71. package/dist/templates/slash-commands/claude-code/fast.md +0 -183
  72. package/dist/templates/slash-commands/claude-code/implement.md +0 -267
  73. package/dist/templates/slash-commands/claude-code/plan.md +0 -173
  74. package/dist/templates/slash-commands/claude-code/prd.md +0 -178
  75. package/dist/templates/slash-commands/claude-code/start.md +0 -142
  76. package/dist/templates/slash-commands/claude-code/summarize.md +0 -179
  77. package/dist/templates/slash-commands/cline/archive.md +0 -291
  78. package/dist/templates/slash-commands/cline/deep.md +0 -207
  79. package/dist/templates/slash-commands/cline/fast.md +0 -183
  80. package/dist/templates/slash-commands/cline/implement.md +0 -267
  81. package/dist/templates/slash-commands/cline/plan.md +0 -173
  82. package/dist/templates/slash-commands/cline/prd.md +0 -178
  83. package/dist/templates/slash-commands/cline/start.md +0 -142
  84. package/dist/templates/slash-commands/cline/summarize.md +0 -179
  85. package/dist/templates/slash-commands/codebuddy/archive.md +0 -291
  86. package/dist/templates/slash-commands/codebuddy/deep.md +0 -207
  87. package/dist/templates/slash-commands/codebuddy/fast.md +0 -183
  88. package/dist/templates/slash-commands/codebuddy/implement.md +0 -267
  89. package/dist/templates/slash-commands/codebuddy/plan.md +0 -173
  90. package/dist/templates/slash-commands/codebuddy/prd.md +0 -178
  91. package/dist/templates/slash-commands/codebuddy/start.md +0 -142
  92. package/dist/templates/slash-commands/codebuddy/summarize.md +0 -179
  93. package/dist/templates/slash-commands/codex/archive.md +0 -291
  94. package/dist/templates/slash-commands/codex/deep.md +0 -207
  95. package/dist/templates/slash-commands/codex/fast.md +0 -183
  96. package/dist/templates/slash-commands/codex/implement.md +0 -267
  97. package/dist/templates/slash-commands/codex/plan.md +0 -173
  98. package/dist/templates/slash-commands/codex/prd.md +0 -178
  99. package/dist/templates/slash-commands/codex/start.md +0 -142
  100. package/dist/templates/slash-commands/codex/summarize.md +0 -179
  101. package/dist/templates/slash-commands/crush/archive.md +0 -291
  102. package/dist/templates/slash-commands/crush/deep.md +0 -207
  103. package/dist/templates/slash-commands/crush/fast.md +0 -183
  104. package/dist/templates/slash-commands/crush/implement.md +0 -267
  105. package/dist/templates/slash-commands/crush/plan.md +0 -173
  106. package/dist/templates/slash-commands/crush/prd.md +0 -178
  107. package/dist/templates/slash-commands/crush/start.md +0 -142
  108. package/dist/templates/slash-commands/crush/summarize.md +0 -179
  109. package/dist/templates/slash-commands/cursor/archive.md +0 -291
  110. package/dist/templates/slash-commands/cursor/deep.md +0 -207
  111. package/dist/templates/slash-commands/cursor/fast.md +0 -183
  112. package/dist/templates/slash-commands/cursor/implement.md +0 -267
  113. package/dist/templates/slash-commands/cursor/plan.md +0 -173
  114. package/dist/templates/slash-commands/cursor/prd.md +0 -178
  115. package/dist/templates/slash-commands/cursor/start.md +0 -142
  116. package/dist/templates/slash-commands/cursor/summarize.md +0 -179
  117. package/dist/templates/slash-commands/droid/archive.md +0 -291
  118. package/dist/templates/slash-commands/droid/deep.md +0 -207
  119. package/dist/templates/slash-commands/droid/fast.md +0 -183
  120. package/dist/templates/slash-commands/droid/implement.md +0 -267
  121. package/dist/templates/slash-commands/droid/plan.md +0 -173
  122. package/dist/templates/slash-commands/droid/prd.md +0 -178
  123. package/dist/templates/slash-commands/droid/start.md +0 -142
  124. package/dist/templates/slash-commands/droid/summarize.md +0 -179
  125. package/dist/templates/slash-commands/gemini/archive.toml +0 -290
  126. package/dist/templates/slash-commands/gemini/deep.toml +0 -206
  127. package/dist/templates/slash-commands/gemini/fast.toml +0 -182
  128. package/dist/templates/slash-commands/gemini/implement.toml +0 -266
  129. package/dist/templates/slash-commands/gemini/plan.toml +0 -170
  130. package/dist/templates/slash-commands/gemini/prd.toml +0 -177
  131. package/dist/templates/slash-commands/gemini/start.toml +0 -141
  132. package/dist/templates/slash-commands/gemini/summarize.toml +0 -178
  133. package/dist/templates/slash-commands/kilocode/archive.md +0 -291
  134. package/dist/templates/slash-commands/kilocode/deep.md +0 -207
  135. package/dist/templates/slash-commands/kilocode/fast.md +0 -183
  136. package/dist/templates/slash-commands/kilocode/implement.md +0 -267
  137. package/dist/templates/slash-commands/kilocode/plan.md +0 -173
  138. package/dist/templates/slash-commands/kilocode/prd.md +0 -178
  139. package/dist/templates/slash-commands/kilocode/start.md +0 -142
  140. package/dist/templates/slash-commands/kilocode/summarize.md +0 -179
  141. package/dist/templates/slash-commands/opencode/archive.md +0 -291
  142. package/dist/templates/slash-commands/opencode/deep.md +0 -207
  143. package/dist/templates/slash-commands/opencode/fast.md +0 -183
  144. package/dist/templates/slash-commands/opencode/implement.md +0 -267
  145. package/dist/templates/slash-commands/opencode/plan.md +0 -173
  146. package/dist/templates/slash-commands/opencode/prd.md +0 -178
  147. package/dist/templates/slash-commands/opencode/start.md +0 -142
  148. package/dist/templates/slash-commands/opencode/summarize.md +0 -179
  149. package/dist/templates/slash-commands/qwen/archive.toml +0 -290
  150. package/dist/templates/slash-commands/qwen/deep.toml +0 -206
  151. package/dist/templates/slash-commands/qwen/fast.toml +0 -182
  152. package/dist/templates/slash-commands/qwen/implement.toml +0 -266
  153. package/dist/templates/slash-commands/qwen/plan.toml +0 -170
  154. package/dist/templates/slash-commands/qwen/prd.toml +0 -177
  155. package/dist/templates/slash-commands/qwen/start.toml +0 -141
  156. package/dist/templates/slash-commands/qwen/summarize.toml +0 -178
  157. package/dist/templates/slash-commands/roocode/archive.md +0 -291
  158. package/dist/templates/slash-commands/roocode/deep.md +0 -207
  159. package/dist/templates/slash-commands/roocode/fast.md +0 -183
  160. package/dist/templates/slash-commands/roocode/implement.md +0 -267
  161. package/dist/templates/slash-commands/roocode/plan.md +0 -173
  162. package/dist/templates/slash-commands/roocode/prd.md +0 -178
  163. package/dist/templates/slash-commands/roocode/start.md +0 -142
  164. package/dist/templates/slash-commands/roocode/summarize.md +0 -179
  165. package/dist/templates/slash-commands/windsurf/archive.md +0 -291
  166. package/dist/templates/slash-commands/windsurf/deep.md +0 -207
  167. package/dist/templates/slash-commands/windsurf/fast.md +0 -183
  168. package/dist/templates/slash-commands/windsurf/implement.md +0 -267
  169. package/dist/templates/slash-commands/windsurf/plan.md +0 -173
  170. package/dist/templates/slash-commands/windsurf/prd.md +0 -178
  171. package/dist/templates/slash-commands/windsurf/start.md +0 -142
  172. package/dist/templates/slash-commands/windsurf/summarize.md +0 -179
  173. /package/dist/templates/slash-commands/{amp → _canonical}/archive.md +0 -0
  174. /package/dist/templates/slash-commands/{amp → _canonical}/deep.md +0 -0
  175. /package/dist/templates/slash-commands/{amp → _canonical}/fast.md +0 -0
  176. /package/dist/templates/slash-commands/{amp → _canonical}/implement.md +0 -0
  177. /package/dist/templates/slash-commands/{amp → _canonical}/plan.md +0 -0
  178. /package/dist/templates/slash-commands/{amp → _canonical}/prd.md +0 -0
  179. /package/dist/templates/slash-commands/{amp → _canonical}/start.md +0 -0
  180. /package/dist/templates/slash-commands/{amp → _canonical}/summarize.md +0 -0
@@ -0,0 +1,268 @@
1
+ /**
2
+ * PromptOptimizer - Analyzes and improves prompts using the CLEAR Framework
3
+ * CLEAR Framework: Concise, Logical, Explicit, Adaptive, Reflective
4
+ * Developed by Dr. Leo Lo, University of New Mexico
5
+ * Reference: https://guides.library.tamucc.edu/prompt-engineering/clear
6
+ */
7
+ export type OptimizerMode = 'fast' | 'deep';
8
+ export interface PromptAnalysis {
9
+ gaps: string[];
10
+ ambiguities: string[];
11
+ strengths: string[];
12
+ suggestions: string[];
13
+ }
14
+ export interface ConciseAnalysis {
15
+ score: number;
16
+ verbosityCount: number;
17
+ pleasantriesCount: number;
18
+ signalToNoiseRatio: number;
19
+ issues: string[];
20
+ suggestions: string[];
21
+ }
22
+ export interface LogicAnalysis {
23
+ score: number;
24
+ hasCoherentFlow: boolean;
25
+ sequencingIssues: string[];
26
+ suggestedOrder: string[];
27
+ issues: string[];
28
+ suggestions: string[];
29
+ }
30
+ export interface ExplicitAnalysis {
31
+ score: number;
32
+ hasPersona: boolean;
33
+ hasOutputFormat: boolean;
34
+ hasToneStyle: boolean;
35
+ hasSuccessCriteria: boolean;
36
+ hasExamples: boolean;
37
+ issues: string[];
38
+ suggestions: string[];
39
+ }
40
+ export interface AdaptiveAnalysis {
41
+ score: number;
42
+ alternativePhrasings: string[];
43
+ alternativeStructures: Array<{
44
+ name: string;
45
+ structure: string;
46
+ benefits: string;
47
+ }>;
48
+ temperatureRecommendation: number;
49
+ issues: string[];
50
+ suggestions: string[];
51
+ }
52
+ export interface ReflectiveAnalysis {
53
+ score: number;
54
+ validationChecklist: string[];
55
+ edgeCases: string[];
56
+ potentialIssues: string[];
57
+ factCheckingSteps: string[];
58
+ qualityCriteria: string[];
59
+ issues: string[];
60
+ suggestions: string[];
61
+ }
62
+ export interface CLEARResult {
63
+ conciseness: ConciseAnalysis;
64
+ logic: LogicAnalysis;
65
+ explicitness: ExplicitAnalysis;
66
+ adaptiveness?: AdaptiveAnalysis;
67
+ reflectiveness?: ReflectiveAnalysis;
68
+ overallScore: number;
69
+ improvedPrompt: string;
70
+ changesSummary: Array<{
71
+ component: 'C' | 'L' | 'E' | 'A' | 'R';
72
+ change: string;
73
+ }>;
74
+ }
75
+ export interface CLEARScore {
76
+ overall: number;
77
+ conciseness: number;
78
+ logic: number;
79
+ explicitness: number;
80
+ adaptiveness?: number;
81
+ reflectiveness?: number;
82
+ rating: 'excellent' | 'good' | 'needs-improvement' | 'poor';
83
+ }
84
+ export interface TriageResult {
85
+ needsDeepAnalysis: boolean;
86
+ reasons: string[];
87
+ }
88
+ export interface QualityAssessment {
89
+ isAlreadyGood: boolean;
90
+ criteriaMetCount: number;
91
+ totalCriteria: number;
92
+ criteriaResults: {
93
+ clearGoal: boolean;
94
+ sufficientContext: boolean;
95
+ actionableLanguage: boolean;
96
+ reasonableScope: boolean;
97
+ };
98
+ }
99
+ export interface ChangesSummary {
100
+ changes: string[];
101
+ }
102
+ export interface ImprovedPrompt {
103
+ original: string;
104
+ analysis: PromptAnalysis;
105
+ improved: string;
106
+ changesSummary?: ChangesSummary;
107
+ triageResult?: TriageResult;
108
+ qualityAssessment?: QualityAssessment;
109
+ alternativePhrasings?: string[];
110
+ edgeCases?: string[];
111
+ implementationExamples?: {
112
+ good: string[];
113
+ bad: string[];
114
+ };
115
+ alternativeStructures?: Array<{
116
+ structure: string;
117
+ benefits: string;
118
+ }>;
119
+ potentialIssues?: string[];
120
+ }
121
+ export declare class PromptOptimizer {
122
+ /**
123
+ * Analyze a prompt and identify issues
124
+ */
125
+ analyze(prompt: string): PromptAnalysis;
126
+ /**
127
+ * Perform smart triage to determine if deep analysis is recommended
128
+ */
129
+ performTriage(prompt: string): TriageResult;
130
+ /**
131
+ * Assess prompt quality
132
+ */
133
+ assessQuality(prompt: string): QualityAssessment;
134
+ /**
135
+ * Generate an improved version of the prompt
136
+ */
137
+ improve(prompt: string, mode?: OptimizerMode): ImprovedPrompt;
138
+ /**
139
+ * Apply CLEAR Framework analysis to a prompt
140
+ * C = Concise, L = Logical, E = Explicit, A = Adaptive (deep only), R = Reflective (deep only)
141
+ */
142
+ applyCLEARFramework(prompt: string, mode?: OptimizerMode): CLEARResult;
143
+ /**
144
+ * Analyze Conciseness (C): Brevity and clarity
145
+ */
146
+ analyzeConciseness(prompt: string): ConciseAnalysis;
147
+ /**
148
+ * Analyze Logic (L): Structured and coherent prompts
149
+ */
150
+ analyzeLogic(prompt: string): LogicAnalysis;
151
+ /**
152
+ * Analyze Explicitness (E): Clear output specifications
153
+ */
154
+ analyzeExplicitness(prompt: string): ExplicitAnalysis;
155
+ /**
156
+ * Analyze Adaptiveness (A): Flexibility and customization
157
+ */
158
+ analyzeAdaptiveness(prompt: string): AdaptiveAnalysis;
159
+ /**
160
+ * Analyze Reflectiveness (R): Continuous evaluation and improvement
161
+ */
162
+ analyzeReflectiveness(prompt: string): ReflectiveAnalysis;
163
+ /**
164
+ * Calculate overall CLEAR score with weighted components
165
+ */
166
+ calculateCLEARScore(analysis: {
167
+ conciseness: ConciseAnalysis;
168
+ logic: LogicAnalysis;
169
+ explicitness: ExplicitAnalysis;
170
+ adaptiveness?: AdaptiveAnalysis;
171
+ reflectiveness?: ReflectiveAnalysis;
172
+ }): CLEARScore;
173
+ /**
174
+ * Generate improved prompt using CLEAR framework insights
175
+ */
176
+ private generateCLEARImprovedPrompt;
177
+ /**
178
+ * Generate CLEAR-labeled changes summary
179
+ */
180
+ private generateCLEARChangesSummary;
181
+ /**
182
+ * Map CLEAR result to legacy PromptAnalysis format for backward compatibility
183
+ */
184
+ mapCLEARToLegacy(clearResult: CLEARResult): PromptAnalysis;
185
+ /**
186
+ * Extract strengths from CLEAR analysis
187
+ */
188
+ private extractCLEARStrengths;
189
+ /**
190
+ * Find gaps in the prompt
191
+ */
192
+ private findGaps;
193
+ /**
194
+ * Find ambiguities in the prompt
195
+ */
196
+ private findAmbiguities;
197
+ /**
198
+ * Find strengths in the prompt
199
+ */
200
+ private findStrengths;
201
+ /**
202
+ * Generate improvement suggestions
203
+ */
204
+ private generateSuggestions;
205
+ /**
206
+ * Generate improved prompt with structure
207
+ */
208
+ private generateImprovedPrompt;
209
+ private hasContext;
210
+ private hasSuccessCriteria;
211
+ private hasTechnicalDetails;
212
+ private hasUserNeeds;
213
+ private hasExpectedOutput;
214
+ private extractOrInferObjective;
215
+ private extractOrInferRequirements;
216
+ private extractOrInferTechnical;
217
+ private extractOrInferOutput;
218
+ private extractOrInferSuccess;
219
+ /**
220
+ * Count missing critical elements
221
+ */
222
+ private countMissingCriticalElements;
223
+ /**
224
+ * Check for vague scope words without sufficient context
225
+ */
226
+ private hasVagueScopeWithoutContext;
227
+ /**
228
+ * Check if prompt has a clear goal
229
+ */
230
+ private hasClearGoal;
231
+ /**
232
+ * Check if prompt uses actionable language
233
+ */
234
+ private hasActionableLanguage;
235
+ /**
236
+ * Check if prompt has reasonable scope
237
+ */
238
+ private hasReasonableScope;
239
+ /**
240
+ * Generate changes summary
241
+ */
242
+ private generateChangesSummary;
243
+ /**
244
+ * Generate alternative phrasings (deep mode)
245
+ */
246
+ private generateAlternativePhrasings;
247
+ /**
248
+ * Identify edge cases in requirements (deep mode)
249
+ */
250
+ private identifyEdgeCases;
251
+ /**
252
+ * Generate implementation examples (deep mode)
253
+ */
254
+ private generateImplementationExamples;
255
+ /**
256
+ * Suggest alternative prompt structures (deep mode)
257
+ */
258
+ private suggestAlternativeStructures;
259
+ /**
260
+ * Identify potential issues with the prompt (deep mode)
261
+ */
262
+ private identifyPotentialIssues;
263
+ /**
264
+ * Extract core requirement from prompt
265
+ */
266
+ private extractCoreRequirement;
267
+ }
268
+ //# sourceMappingURL=prompt-optimizer.d.ts.map