clavix 4.11.2 → 5.0.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.
- package/README.md +72 -60
- package/dist/cli/commands/update.js +9 -10
- package/dist/templates/agents/agents.md +14 -8
- package/dist/templates/agents/copilot-instructions.md +1 -1
- package/dist/templates/instructions/core/verification.md +2 -2
- package/dist/templates/slash-commands/_canonical/archive.md +83 -121
- package/dist/templates/slash-commands/_canonical/execute.md +32 -42
- package/dist/templates/slash-commands/_canonical/implement.md +32 -44
- package/dist/templates/slash-commands/_canonical/improve.md +14 -53
- package/dist/templates/slash-commands/_canonical/start.md +1 -1
- package/dist/templates/slash-commands/_canonical/summarize.md +8 -8
- package/dist/templates/slash-commands/_components/agent-protocols/cli-reference.md +84 -180
- package/dist/templates/slash-commands/_components/agent-protocols/error-handling.md +2 -2
- package/dist/templates/slash-commands/_components/agent-protocols/file-formats.md +41 -59
- package/dist/templates/slash-commands/_components/agent-protocols/state-assertion.md +1 -1
- package/dist/templates/slash-commands/_components/references/intent-types.md +1 -1
- package/dist/templates/slash-commands/_components/sections/file-saving-protocol.md +20 -27
- package/dist/templates/slash-commands/_components/sections/pattern-visibility.md +29 -46
- package/dist/templates/slash-commands/_components/troubleshooting/file-not-saved.md +4 -5
- package/dist/types/config.d.ts +57 -0
- package/dist/utils/legacy-command-cleanup.js +31 -4
- package/package.json +5 -4
- package/dist/cli/commands/analyze.d.ts +0 -17
- package/dist/cli/commands/analyze.js +0 -133
- package/dist/cli/commands/archive.d.ts +0 -36
- package/dist/cli/commands/archive.js +0 -266
- package/dist/cli/commands/deep.d.ts +0 -17
- package/dist/cli/commands/deep.js +0 -170
- package/dist/cli/commands/execute.d.ts +0 -15
- package/dist/cli/commands/execute.js +0 -168
- package/dist/cli/commands/fast.d.ts +0 -18
- package/dist/cli/commands/fast.js +0 -219
- package/dist/cli/commands/implement.d.ts +0 -24
- package/dist/cli/commands/implement.js +0 -289
- package/dist/cli/commands/improve.d.ts +0 -32
- package/dist/cli/commands/improve.js +0 -250
- package/dist/cli/commands/list.d.ts +0 -17
- package/dist/cli/commands/list.js +0 -217
- package/dist/cli/commands/plan.d.ts +0 -21
- package/dist/cli/commands/plan.js +0 -297
- package/dist/cli/commands/prd.d.ts +0 -24
- package/dist/cli/commands/prd.js +0 -321
- package/dist/cli/commands/prompts/clear.d.ts +0 -16
- package/dist/cli/commands/prompts/clear.js +0 -222
- package/dist/cli/commands/prompts/list.d.ts +0 -8
- package/dist/cli/commands/prompts/list.js +0 -88
- package/dist/cli/commands/show.d.ts +0 -21
- package/dist/cli/commands/show.js +0 -191
- package/dist/cli/commands/start.d.ts +0 -40
- package/dist/cli/commands/start.js +0 -210
- package/dist/cli/commands/summarize.d.ts +0 -17
- package/dist/cli/commands/summarize.js +0 -196
- package/dist/cli/commands/task-complete.d.ts +0 -27
- package/dist/cli/commands/task-complete.js +0 -269
- package/dist/cli/commands/verify.d.ts +0 -28
- package/dist/cli/commands/verify.js +0 -349
- package/dist/core/archive-manager.d.ts +0 -100
- package/dist/core/archive-manager.js +0 -302
- package/dist/core/basic-checklist-generator.d.ts +0 -35
- package/dist/core/basic-checklist-generator.js +0 -344
- package/dist/core/checklist-parser.d.ts +0 -48
- package/dist/core/checklist-parser.js +0 -238
- package/dist/core/config-manager.d.ts +0 -149
- package/dist/core/config-manager.js +0 -230
- package/dist/core/conversation-analyzer.d.ts +0 -86
- package/dist/core/conversation-analyzer.js +0 -387
- package/dist/core/conversation-quality-tracker.d.ts +0 -81
- package/dist/core/conversation-quality-tracker.js +0 -195
- package/dist/core/git-manager.d.ts +0 -126
- package/dist/core/git-manager.js +0 -282
- package/dist/core/intelligence/confidence-calculator.d.ts +0 -93
- package/dist/core/intelligence/confidence-calculator.js +0 -124
- package/dist/core/intelligence/index.d.ts +0 -11
- package/dist/core/intelligence/index.js +0 -15
- package/dist/core/intelligence/intent-detector.d.ts +0 -54
- package/dist/core/intelligence/intent-detector.js +0 -723
- package/dist/core/intelligence/pattern-library.d.ts +0 -104
- package/dist/core/intelligence/pattern-library.js +0 -339
- package/dist/core/intelligence/patterns/actionability-enhancer.d.ts +0 -27
- package/dist/core/intelligence/patterns/actionability-enhancer.js +0 -192
- package/dist/core/intelligence/patterns/alternative-phrasing-generator.d.ts +0 -29
- package/dist/core/intelligence/patterns/alternative-phrasing-generator.js +0 -239
- package/dist/core/intelligence/patterns/ambiguity-detector.d.ts +0 -22
- package/dist/core/intelligence/patterns/ambiguity-detector.js +0 -196
- package/dist/core/intelligence/patterns/assumption-explicitizer.d.ts +0 -30
- package/dist/core/intelligence/patterns/assumption-explicitizer.js +0 -296
- package/dist/core/intelligence/patterns/base-pattern.d.ts +0 -192
- package/dist/core/intelligence/patterns/base-pattern.js +0 -103
- package/dist/core/intelligence/patterns/completeness-validator.d.ts +0 -27
- package/dist/core/intelligence/patterns/completeness-validator.js +0 -221
- package/dist/core/intelligence/patterns/conciseness-filter.d.ts +0 -20
- package/dist/core/intelligence/patterns/conciseness-filter.js +0 -92
- package/dist/core/intelligence/patterns/context-precision.d.ts +0 -32
- package/dist/core/intelligence/patterns/context-precision.js +0 -389
- package/dist/core/intelligence/patterns/conversation-summarizer.d.ts +0 -30
- package/dist/core/intelligence/patterns/conversation-summarizer.js +0 -277
- package/dist/core/intelligence/patterns/dependency-identifier.d.ts +0 -23
- package/dist/core/intelligence/patterns/dependency-identifier.js +0 -166
- package/dist/core/intelligence/patterns/domain-context-enricher.d.ts +0 -21
- package/dist/core/intelligence/patterns/domain-context-enricher.js +0 -198
- package/dist/core/intelligence/patterns/edge-case-identifier.d.ts +0 -30
- package/dist/core/intelligence/patterns/edge-case-identifier.js +0 -269
- package/dist/core/intelligence/patterns/error-tolerance-enhancer.d.ts +0 -22
- package/dist/core/intelligence/patterns/error-tolerance-enhancer.js +0 -179
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.d.ts +0 -24
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.js +0 -259
- package/dist/core/intelligence/patterns/objective-clarifier.d.ts +0 -22
- package/dist/core/intelligence/patterns/objective-clarifier.js +0 -126
- package/dist/core/intelligence/patterns/output-format-enforcer.d.ts +0 -22
- package/dist/core/intelligence/patterns/output-format-enforcer.js +0 -151
- package/dist/core/intelligence/patterns/prd-structure-enforcer.d.ts +0 -23
- package/dist/core/intelligence/patterns/prd-structure-enforcer.js +0 -183
- package/dist/core/intelligence/patterns/prerequisite-identifier.d.ts +0 -23
- package/dist/core/intelligence/patterns/prerequisite-identifier.js +0 -221
- package/dist/core/intelligence/patterns/requirement-prioritizer.d.ts +0 -24
- package/dist/core/intelligence/patterns/requirement-prioritizer.js +0 -134
- package/dist/core/intelligence/patterns/scope-definer.d.ts +0 -26
- package/dist/core/intelligence/patterns/scope-definer.js +0 -236
- package/dist/core/intelligence/patterns/step-decomposer.d.ts +0 -31
- package/dist/core/intelligence/patterns/step-decomposer.js +0 -242
- package/dist/core/intelligence/patterns/structure-organizer.d.ts +0 -31
- package/dist/core/intelligence/patterns/structure-organizer.js +0 -218
- package/dist/core/intelligence/patterns/success-criteria-enforcer.d.ts +0 -22
- package/dist/core/intelligence/patterns/success-criteria-enforcer.js +0 -165
- package/dist/core/intelligence/patterns/success-metrics-enforcer.d.ts +0 -24
- package/dist/core/intelligence/patterns/success-metrics-enforcer.js +0 -165
- package/dist/core/intelligence/patterns/technical-context-enricher.d.ts +0 -25
- package/dist/core/intelligence/patterns/technical-context-enricher.js +0 -165
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.d.ts +0 -26
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.js +0 -300
- package/dist/core/intelligence/patterns/user-persona-enricher.d.ts +0 -24
- package/dist/core/intelligence/patterns/user-persona-enricher.js +0 -141
- package/dist/core/intelligence/patterns/validation-checklist-creator.d.ts +0 -31
- package/dist/core/intelligence/patterns/validation-checklist-creator.js +0 -242
- package/dist/core/intelligence/quality-assessor.d.ts +0 -51
- package/dist/core/intelligence/quality-assessor.js +0 -505
- package/dist/core/intelligence/types.d.ts +0 -111
- package/dist/core/intelligence/types.js +0 -3
- package/dist/core/intelligence/universal-optimizer.d.ts +0 -84
- package/dist/core/intelligence/universal-optimizer.js +0 -371
- package/dist/core/prd-generator.d.ts +0 -76
- package/dist/core/prd-generator.js +0 -173
- package/dist/core/prompt-manager.d.ts +0 -110
- package/dist/core/prompt-manager.js +0 -274
- package/dist/core/prompt-optimizer.d.ts +0 -268
- package/dist/core/prompt-optimizer.js +0 -959
- package/dist/core/question-engine.d.ts +0 -167
- package/dist/core/question-engine.js +0 -356
- package/dist/core/session-manager.d.ts +0 -139
- package/dist/core/session-manager.js +0 -365
- package/dist/core/task-manager.d.ts +0 -211
- package/dist/core/task-manager.js +0 -981
- package/dist/core/verification-hooks.d.ts +0 -67
- package/dist/core/verification-hooks.js +0 -309
- package/dist/core/verification-manager.d.ts +0 -107
- package/dist/core/verification-manager.js +0 -415
- package/dist/index 2.js +0 -13
- package/dist/index.d 2.ts +0 -4
- package/dist/types/session.d.ts +0 -78
- package/dist/types/session.js +0 -8
- package/dist/types/verification.d.ts +0 -205
- package/dist/types/verification.js +0 -9
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
import { BasePattern, } from './base-pattern.js';
|
|
2
|
-
/**
|
|
3
|
-
* v4.5 Pattern: Context Precision Booster
|
|
4
|
-
*
|
|
5
|
-
* Adds precise context when missing to ensure
|
|
6
|
-
* the AI has sufficient information for accurate responses.
|
|
7
|
-
*/
|
|
8
|
-
export class ContextPrecisionBooster extends BasePattern {
|
|
9
|
-
// -------------------------------------------------------------------------
|
|
10
|
-
// Pattern Metadata (v4.5 unified types)
|
|
11
|
-
// -------------------------------------------------------------------------
|
|
12
|
-
id = 'context-precision';
|
|
13
|
-
name = 'Context Precision Booster';
|
|
14
|
-
description = 'Add precise context when missing';
|
|
15
|
-
applicableIntents = [
|
|
16
|
-
'code-generation',
|
|
17
|
-
'debugging',
|
|
18
|
-
'refinement',
|
|
19
|
-
'documentation',
|
|
20
|
-
'testing',
|
|
21
|
-
'migration',
|
|
22
|
-
'security-review',
|
|
23
|
-
];
|
|
24
|
-
scope = 'both';
|
|
25
|
-
priority = 6; // MEDIUM - standard enhancement
|
|
26
|
-
phases = ['all'];
|
|
27
|
-
// -------------------------------------------------------------------------
|
|
28
|
-
// Configuration Schema (v4.5)
|
|
29
|
-
// -------------------------------------------------------------------------
|
|
30
|
-
static configSchema = {
|
|
31
|
-
maxContextGaps: {
|
|
32
|
-
type: 'number',
|
|
33
|
-
default: 6,
|
|
34
|
-
description: 'Maximum number of context gaps to surface',
|
|
35
|
-
validation: { min: 1, max: 10 },
|
|
36
|
-
},
|
|
37
|
-
checkVersionInfo: {
|
|
38
|
-
type: 'boolean',
|
|
39
|
-
default: true,
|
|
40
|
-
description: 'Check for missing version information',
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
// -------------------------------------------------------------------------
|
|
44
|
-
// Pattern Application
|
|
45
|
-
// -------------------------------------------------------------------------
|
|
46
|
-
apply(prompt, context) {
|
|
47
|
-
const missingContext = this.identifyMissingContext(prompt, context.intent.primaryIntent);
|
|
48
|
-
if (missingContext.length === 0) {
|
|
49
|
-
return {
|
|
50
|
-
enhancedPrompt: prompt,
|
|
51
|
-
improvement: {
|
|
52
|
-
dimension: 'completeness',
|
|
53
|
-
description: 'Context appears sufficient',
|
|
54
|
-
impact: 'low',
|
|
55
|
-
},
|
|
56
|
-
applied: false,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
// Append context requirements section
|
|
60
|
-
const contextSection = this.formatContextSection(missingContext);
|
|
61
|
-
const enhancedPrompt = `${prompt}\n\n${contextSection}`;
|
|
62
|
-
return {
|
|
63
|
-
enhancedPrompt,
|
|
64
|
-
improvement: {
|
|
65
|
-
dimension: 'completeness',
|
|
66
|
-
description: `Identified ${missingContext.length} areas needing context clarification`,
|
|
67
|
-
impact: 'high',
|
|
68
|
-
},
|
|
69
|
-
applied: true,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
identifyMissingContext(prompt, intent) {
|
|
73
|
-
const gaps = [];
|
|
74
|
-
const lowerPrompt = prompt.toLowerCase();
|
|
75
|
-
// General context checks
|
|
76
|
-
gaps.push(...this.checkGeneralContext(lowerPrompt));
|
|
77
|
-
// Intent-specific context checks
|
|
78
|
-
switch (intent) {
|
|
79
|
-
case 'code-generation':
|
|
80
|
-
gaps.push(...this.checkCodeGenerationContext(lowerPrompt));
|
|
81
|
-
break;
|
|
82
|
-
case 'debugging':
|
|
83
|
-
gaps.push(...this.checkDebuggingContext(lowerPrompt));
|
|
84
|
-
break;
|
|
85
|
-
case 'refinement':
|
|
86
|
-
// Refinement covers code review and refactoring
|
|
87
|
-
gaps.push(...this.checkCodeReviewContext(lowerPrompt));
|
|
88
|
-
gaps.push(...this.checkRefactoringContext(lowerPrompt));
|
|
89
|
-
break;
|
|
90
|
-
case 'documentation':
|
|
91
|
-
// Documentation covers explanations
|
|
92
|
-
break;
|
|
93
|
-
case 'testing':
|
|
94
|
-
gaps.push(...this.checkTestingContext(lowerPrompt));
|
|
95
|
-
break;
|
|
96
|
-
case 'migration':
|
|
97
|
-
gaps.push(...this.checkMigrationContext(lowerPrompt));
|
|
98
|
-
break;
|
|
99
|
-
case 'security-review':
|
|
100
|
-
gaps.push(...this.checkSecurityContext(lowerPrompt));
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
// Deduplicate and limit
|
|
104
|
-
return this.deduplicateGaps(gaps).slice(0, 6);
|
|
105
|
-
}
|
|
106
|
-
checkGeneralContext(prompt) {
|
|
107
|
-
const gaps = [];
|
|
108
|
-
// Check for file/path references
|
|
109
|
-
if (!this.hasSection(prompt, [
|
|
110
|
-
'.ts',
|
|
111
|
-
'.js',
|
|
112
|
-
'.py',
|
|
113
|
-
'.java',
|
|
114
|
-
'.go',
|
|
115
|
-
'file',
|
|
116
|
-
'path',
|
|
117
|
-
'/src',
|
|
118
|
-
'/lib',
|
|
119
|
-
])) {
|
|
120
|
-
if (this.hasSection(prompt, ['code', 'function', 'class', 'module', 'component'])) {
|
|
121
|
-
gaps.push({
|
|
122
|
-
type: 'file-location',
|
|
123
|
-
question: 'Which file(s) should this be implemented in?',
|
|
124
|
-
suggestion: 'Specify the file path (e.g., src/utils/helpers.ts)',
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
// Check for version/technology specifics
|
|
129
|
-
if (this.hasSection(prompt, ['version', 'upgrade', 'update', 'latest'])) {
|
|
130
|
-
if (!this.hasVersionNumber(prompt)) {
|
|
131
|
-
gaps.push({
|
|
132
|
-
type: 'version',
|
|
133
|
-
question: 'Which version are you targeting?',
|
|
134
|
-
suggestion: 'Specify exact versions (e.g., React 18, Node 20, TypeScript 5.x)',
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
// Check for environment context
|
|
139
|
-
if (!this.hasSection(prompt, ['production', 'development', 'staging', 'local', 'test', 'ci'])) {
|
|
140
|
-
if (this.hasSection(prompt, ['deploy', 'config', 'env', 'environment'])) {
|
|
141
|
-
gaps.push({
|
|
142
|
-
type: 'environment',
|
|
143
|
-
question: 'Which environment is this for?',
|
|
144
|
-
suggestion: 'Specify environment (development, staging, production)',
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return gaps;
|
|
149
|
-
}
|
|
150
|
-
checkCodeGenerationContext(prompt) {
|
|
151
|
-
const gaps = [];
|
|
152
|
-
// Check for input/output specification
|
|
153
|
-
if (!this.hasSection(prompt, [
|
|
154
|
-
'input',
|
|
155
|
-
'output',
|
|
156
|
-
'returns',
|
|
157
|
-
'param',
|
|
158
|
-
'argument',
|
|
159
|
-
'takes',
|
|
160
|
-
'accepts',
|
|
161
|
-
])) {
|
|
162
|
-
gaps.push({
|
|
163
|
-
type: 'interface',
|
|
164
|
-
question: 'What are the expected inputs and outputs?',
|
|
165
|
-
suggestion: 'Define function signature: inputs, return type, and data structures',
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
// Check for existing code context
|
|
169
|
-
if (!this.hasSection(prompt, ['existing', 'current', 'already', 'codebase', 'project'])) {
|
|
170
|
-
gaps.push({
|
|
171
|
-
type: 'existing-code',
|
|
172
|
-
question: 'Is there existing code this should integrate with?',
|
|
173
|
-
suggestion: 'Reference existing patterns, imports, or dependencies in the project',
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
// Check for error handling expectations
|
|
177
|
-
if (!this.hasSection(prompt, ['error', 'exception', 'fail', 'invalid', 'null', 'undefined'])) {
|
|
178
|
-
gaps.push({
|
|
179
|
-
type: 'error-handling',
|
|
180
|
-
question: 'How should errors be handled?',
|
|
181
|
-
suggestion: 'Specify error handling strategy (throw, return null, default value)',
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
return gaps;
|
|
185
|
-
}
|
|
186
|
-
checkDebuggingContext(prompt) {
|
|
187
|
-
const gaps = [];
|
|
188
|
-
// Check for error message/stack trace
|
|
189
|
-
if (!this.hasSection(prompt, [
|
|
190
|
-
'error:',
|
|
191
|
-
'exception:',
|
|
192
|
-
'stack',
|
|
193
|
-
'trace',
|
|
194
|
-
'at line',
|
|
195
|
-
'typeerror',
|
|
196
|
-
'referenceerror',
|
|
197
|
-
])) {
|
|
198
|
-
gaps.push({
|
|
199
|
-
type: 'error-details',
|
|
200
|
-
question: 'What is the exact error message or stack trace?',
|
|
201
|
-
suggestion: 'Include the full error message and stack trace',
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
// Check for reproduction steps
|
|
205
|
-
if (!this.hasSection(prompt, ['steps', 'reproduce', 'when i', 'after', 'before', 'sequence'])) {
|
|
206
|
-
gaps.push({
|
|
207
|
-
type: 'reproduction',
|
|
208
|
-
question: 'What are the steps to reproduce this issue?',
|
|
209
|
-
suggestion: 'List the exact steps that trigger the bug',
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
// Check for expected vs actual behavior
|
|
213
|
-
if (!this.hasSection(prompt, ['expected', 'should', 'instead', 'actual', 'but'])) {
|
|
214
|
-
gaps.push({
|
|
215
|
-
type: 'expected-behavior',
|
|
216
|
-
question: 'What is the expected behavior vs what actually happens?',
|
|
217
|
-
suggestion: 'Describe what should happen and what actually happens',
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
return gaps;
|
|
221
|
-
}
|
|
222
|
-
checkCodeReviewContext(prompt) {
|
|
223
|
-
const gaps = [];
|
|
224
|
-
// Check for review focus areas
|
|
225
|
-
if (!this.hasSection(prompt, [
|
|
226
|
-
'performance',
|
|
227
|
-
'security',
|
|
228
|
-
'maintainability',
|
|
229
|
-
'readability',
|
|
230
|
-
'bug',
|
|
231
|
-
'best practice',
|
|
232
|
-
])) {
|
|
233
|
-
gaps.push({
|
|
234
|
-
type: 'review-focus',
|
|
235
|
-
question: 'What aspects should the review focus on?',
|
|
236
|
-
suggestion: 'Specify: security, performance, readability, best practices, or all',
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
// Check for context about the change
|
|
240
|
-
if (!this.hasSection(prompt, ['pr', 'pull request', 'change', 'diff', 'commit', 'modification'])) {
|
|
241
|
-
gaps.push({
|
|
242
|
-
type: 'change-context',
|
|
243
|
-
question: 'What is the purpose of these changes?',
|
|
244
|
-
suggestion: 'Explain what the code is meant to accomplish',
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
return gaps;
|
|
248
|
-
}
|
|
249
|
-
checkRefactoringContext(prompt) {
|
|
250
|
-
const gaps = [];
|
|
251
|
-
// Check for refactoring goals
|
|
252
|
-
if (!this.hasSection(prompt, ['goal', 'improve', 'simplify', 'extract', 'consolidate', 'split'])) {
|
|
253
|
-
gaps.push({
|
|
254
|
-
type: 'refactoring-goal',
|
|
255
|
-
question: 'What is the goal of this refactoring?',
|
|
256
|
-
suggestion: 'Specify: improve readability, reduce duplication, improve testability, etc.',
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
// Check for constraints
|
|
260
|
-
if (!this.hasSection(prompt, [
|
|
261
|
-
'constraint',
|
|
262
|
-
'backward',
|
|
263
|
-
'compatible',
|
|
264
|
-
'api',
|
|
265
|
-
'interface',
|
|
266
|
-
'break',
|
|
267
|
-
])) {
|
|
268
|
-
gaps.push({
|
|
269
|
-
type: 'constraints',
|
|
270
|
-
question: 'Are there any constraints or backward compatibility requirements?',
|
|
271
|
-
suggestion: 'Specify if public APIs must remain unchanged',
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
return gaps;
|
|
275
|
-
}
|
|
276
|
-
checkTestingContext(prompt) {
|
|
277
|
-
const gaps = [];
|
|
278
|
-
// Check for test framework
|
|
279
|
-
if (!this.hasSection(prompt, ['jest', 'vitest', 'mocha', 'pytest', 'junit', 'rspec', 'framework'])) {
|
|
280
|
-
gaps.push({
|
|
281
|
-
type: 'test-framework',
|
|
282
|
-
question: 'Which test framework should be used?',
|
|
283
|
-
suggestion: 'Specify: Jest, Vitest, Mocha, pytest, etc.',
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
// Check for test type
|
|
287
|
-
if (!this.hasSection(prompt, ['unit', 'integration', 'e2e', 'end-to-end', 'component', 'smoke'])) {
|
|
288
|
-
gaps.push({
|
|
289
|
-
type: 'test-type',
|
|
290
|
-
question: 'What type of tests are needed?',
|
|
291
|
-
suggestion: 'Specify: unit tests, integration tests, e2e tests',
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
// Check for coverage requirements
|
|
295
|
-
if (!this.hasSection(prompt, ['coverage', 'percent', '%', 'all cases', 'edge case'])) {
|
|
296
|
-
gaps.push({
|
|
297
|
-
type: 'coverage',
|
|
298
|
-
question: 'What test coverage is required?',
|
|
299
|
-
suggestion: 'Specify coverage target or specific scenarios to cover',
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
return gaps;
|
|
303
|
-
}
|
|
304
|
-
checkMigrationContext(prompt) {
|
|
305
|
-
const gaps = [];
|
|
306
|
-
// Check for source and target
|
|
307
|
-
if (!this.hasSection(prompt, ['from', 'to', 'source', 'target', 'current', 'new'])) {
|
|
308
|
-
gaps.push({
|
|
309
|
-
type: 'migration-endpoints',
|
|
310
|
-
question: 'What is the source and target of this migration?',
|
|
311
|
-
suggestion: 'Specify: from [current system/version] to [target system/version]',
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
// Check for data considerations
|
|
315
|
-
if (!this.hasSection(prompt, ['data', 'records', 'users', 'content', 'preserve'])) {
|
|
316
|
-
gaps.push({
|
|
317
|
-
type: 'data-handling',
|
|
318
|
-
question: 'How should existing data be handled?',
|
|
319
|
-
suggestion: 'Specify data migration strategy and what must be preserved',
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
// Check for downtime requirements
|
|
323
|
-
if (!this.hasSection(prompt, ['downtime', 'zero-downtime', 'maintenance', 'window'])) {
|
|
324
|
-
gaps.push({
|
|
325
|
-
type: 'downtime',
|
|
326
|
-
question: 'What are the downtime requirements?',
|
|
327
|
-
suggestion: 'Specify: zero-downtime required, or acceptable maintenance window',
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
return gaps;
|
|
331
|
-
}
|
|
332
|
-
checkSecurityContext(prompt) {
|
|
333
|
-
const gaps = [];
|
|
334
|
-
// Check for threat model
|
|
335
|
-
if (!this.hasSection(prompt, ['threat', 'attack', 'vulnerability', 'owasp', 'risk'])) {
|
|
336
|
-
gaps.push({
|
|
337
|
-
type: 'threat-model',
|
|
338
|
-
question: 'What are the main security concerns or threats?',
|
|
339
|
-
suggestion: 'Specify threat model or specific vulnerabilities to check',
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
// Check for compliance requirements
|
|
343
|
-
if (!this.hasSection(prompt, ['compliance', 'gdpr', 'hipaa', 'pci', 'soc2', 'regulation'])) {
|
|
344
|
-
gaps.push({
|
|
345
|
-
type: 'compliance',
|
|
346
|
-
question: 'Are there specific compliance requirements?',
|
|
347
|
-
suggestion: 'Specify: GDPR, HIPAA, PCI-DSS, SOC2, or internal policies',
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
// Check for scope of review
|
|
351
|
-
if (!this.hasSection(prompt, ['authentication', 'authorization', 'input', 'encryption', 'all'])) {
|
|
352
|
-
gaps.push({
|
|
353
|
-
type: 'security-scope',
|
|
354
|
-
question: 'What aspects of security should be reviewed?',
|
|
355
|
-
suggestion: 'Specify: auth, input validation, encryption, or comprehensive review',
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
return gaps;
|
|
359
|
-
}
|
|
360
|
-
hasVersionNumber(prompt) {
|
|
361
|
-
// Check for version patterns like v1.0, 1.2.3, React 18, Node 20
|
|
362
|
-
const versionPatterns = [/v?\d+\.\d+(\.\d+)?/, /\b(react|vue|angular|node|python|java)\s*\d+/i];
|
|
363
|
-
return versionPatterns.some((pattern) => pattern.test(prompt));
|
|
364
|
-
}
|
|
365
|
-
deduplicateGaps(gaps) {
|
|
366
|
-
const seen = new Set();
|
|
367
|
-
return gaps.filter((gap) => {
|
|
368
|
-
if (seen.has(gap.type))
|
|
369
|
-
return false;
|
|
370
|
-
seen.add(gap.type);
|
|
371
|
-
return true;
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
formatContextSection(gaps) {
|
|
375
|
-
const lines = [
|
|
376
|
-
'### Context Needed',
|
|
377
|
-
'',
|
|
378
|
-
'Please provide additional context for better results:',
|
|
379
|
-
'',
|
|
380
|
-
];
|
|
381
|
-
gaps.forEach((gap, index) => {
|
|
382
|
-
lines.push(`**${index + 1}. ${gap.question}**`);
|
|
383
|
-
lines.push(` _Suggestion: ${gap.suggestion}_`);
|
|
384
|
-
lines.push('');
|
|
385
|
-
});
|
|
386
|
-
return lines.join('\n');
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
//# sourceMappingURL=context-precision.js.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { BasePattern, PatternScope, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
|
|
2
|
-
import { PromptIntent, PatternContext, PatternResult } from '../types.js';
|
|
3
|
-
/**
|
|
4
|
-
* v4.5 Pattern: Conversation Summarizer
|
|
5
|
-
*
|
|
6
|
-
* Extracts structured requirements from conversational messages.
|
|
7
|
-
* Organizes free-form discussion into actionable requirements.
|
|
8
|
-
* Enhanced with expanded marker detection and confidence scoring.
|
|
9
|
-
*/
|
|
10
|
-
export declare class ConversationSummarizer extends BasePattern {
|
|
11
|
-
readonly id = "conversation-summarizer";
|
|
12
|
-
readonly name = "Conversation Summarizer";
|
|
13
|
-
readonly description = "Extracts structured requirements from messages";
|
|
14
|
-
readonly applicableIntents: PromptIntent[];
|
|
15
|
-
readonly scope: PatternScope;
|
|
16
|
-
readonly priority: PatternPriority;
|
|
17
|
-
readonly phases: PatternPhase[];
|
|
18
|
-
static readonly configSchema: PatternConfigSchema;
|
|
19
|
-
private readonly conversationalMarkers;
|
|
20
|
-
apply(prompt: string, _context: PatternContext): PatternResult;
|
|
21
|
-
private isAlreadyStructured;
|
|
22
|
-
private isConversationalContent;
|
|
23
|
-
private calculateConfidence;
|
|
24
|
-
private extractAndStructure;
|
|
25
|
-
private extractRequirements;
|
|
26
|
-
private extractConstraints;
|
|
27
|
-
private extractGoals;
|
|
28
|
-
private cleanRequirement;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=conversation-summarizer.d.ts.map
|