clavix 4.3.2 → 4.5.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/dist/core/adapters/instructions-generator.d.ts +2 -1
- package/dist/core/adapters/instructions-generator.js +21 -8
- package/dist/core/intelligence/confidence-calculator.d.ts +93 -0
- package/dist/core/intelligence/confidence-calculator.js +124 -0
- package/dist/core/intelligence/index.d.ts +1 -0
- package/dist/core/intelligence/index.js +2 -0
- package/dist/core/intelligence/intent-detector.js +10 -8
- package/dist/core/intelligence/pattern-library.d.ts +47 -10
- package/dist/core/intelligence/pattern-library.js +151 -79
- package/dist/core/intelligence/patterns/actionability-enhancer.d.ts +10 -10
- package/dist/core/intelligence/patterns/actionability-enhancer.js +31 -6
- package/dist/core/intelligence/patterns/alternative-phrasing-generator.d.ts +10 -8
- package/dist/core/intelligence/patterns/alternative-phrasing-generator.js +21 -3
- package/dist/core/intelligence/patterns/ambiguity-detector.d.ts +10 -8
- package/dist/core/intelligence/patterns/ambiguity-detector.js +31 -3
- package/dist/core/intelligence/patterns/assumption-explicitizer.d.ts +10 -8
- package/dist/core/intelligence/patterns/assumption-explicitizer.js +26 -3
- package/dist/core/intelligence/patterns/base-pattern.d.ts +166 -8
- package/dist/core/intelligence/patterns/base-pattern.js +64 -4
- package/dist/core/intelligence/patterns/completeness-validator.d.ts +10 -10
- package/dist/core/intelligence/patterns/completeness-validator.js +26 -5
- package/dist/core/intelligence/patterns/conciseness-filter.d.ts +15 -7
- package/dist/core/intelligence/patterns/conciseness-filter.js +36 -4
- package/dist/core/intelligence/patterns/context-precision.d.ts +10 -8
- package/dist/core/intelligence/patterns/context-precision.js +28 -5
- package/dist/core/intelligence/patterns/conversation-summarizer.d.ts +14 -9
- package/dist/core/intelligence/patterns/conversation-summarizer.js +109 -29
- package/dist/core/intelligence/patterns/dependency-identifier.d.ts +11 -9
- package/dist/core/intelligence/patterns/dependency-identifier.js +21 -4
- package/dist/core/intelligence/patterns/domain-context-enricher.d.ts +10 -8
- package/dist/core/intelligence/patterns/domain-context-enricher.js +27 -3
- package/dist/core/intelligence/patterns/edge-case-identifier.d.ts +10 -8
- package/dist/core/intelligence/patterns/edge-case-identifier.js +21 -3
- package/dist/core/intelligence/patterns/error-tolerance-enhancer.d.ts +10 -8
- package/dist/core/intelligence/patterns/error-tolerance-enhancer.js +22 -4
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.d.ts +14 -10
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.js +193 -63
- package/dist/core/intelligence/patterns/objective-clarifier.d.ts +15 -7
- package/dist/core/intelligence/patterns/objective-clarifier.js +46 -17
- package/dist/core/intelligence/patterns/output-format-enforcer.d.ts +10 -8
- package/dist/core/intelligence/patterns/output-format-enforcer.js +20 -3
- package/dist/core/intelligence/patterns/prd-structure-enforcer.d.ts +10 -8
- package/dist/core/intelligence/patterns/prd-structure-enforcer.js +25 -3
- package/dist/core/intelligence/patterns/prerequisite-identifier.d.ts +10 -8
- package/dist/core/intelligence/patterns/prerequisite-identifier.js +28 -4
- package/dist/core/intelligence/patterns/requirement-prioritizer.d.ts +11 -9
- package/dist/core/intelligence/patterns/requirement-prioritizer.js +21 -4
- package/dist/core/intelligence/patterns/scope-definer.d.ts +10 -8
- package/dist/core/intelligence/patterns/scope-definer.js +27 -3
- package/dist/core/intelligence/patterns/step-decomposer.d.ts +10 -8
- package/dist/core/intelligence/patterns/step-decomposer.js +21 -3
- package/dist/core/intelligence/patterns/structure-organizer.d.ts +10 -10
- package/dist/core/intelligence/patterns/structure-organizer.js +25 -5
- package/dist/core/intelligence/patterns/success-criteria-enforcer.d.ts +10 -8
- package/dist/core/intelligence/patterns/success-criteria-enforcer.js +20 -3
- package/dist/core/intelligence/patterns/success-metrics-enforcer.d.ts +11 -9
- package/dist/core/intelligence/patterns/success-metrics-enforcer.js +27 -4
- package/dist/core/intelligence/patterns/technical-context-enricher.d.ts +16 -7
- package/dist/core/intelligence/patterns/technical-context-enricher.js +71 -38
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.d.ts +13 -9
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.js +202 -42
- package/dist/core/intelligence/patterns/user-persona-enricher.d.ts +11 -9
- package/dist/core/intelligence/patterns/user-persona-enricher.js +21 -4
- package/dist/core/intelligence/patterns/validation-checklist-creator.d.ts +11 -8
- package/dist/core/intelligence/patterns/validation-checklist-creator.js +31 -3
- package/dist/templates/slash-commands/_canonical/deep.md +1 -1
- package/dist/templates/slash-commands/_canonical/execute.md +1 -1
- package/dist/templates/slash-commands/_canonical/fast.md +1 -1
- package/dist/templates/slash-commands/_canonical/implement.md +1 -1
- package/dist/templates/slash-commands/_canonical/plan.md +1 -1
- package/dist/templates/slash-commands/_canonical/prd.md +1 -1
- package/dist/templates/slash-commands/_canonical/start.md +21 -1
- package/dist/templates/slash-commands/_canonical/summarize.md +43 -2
- package/dist/templates/slash-commands/_components/references/intent-types.md +3 -1
- package/dist/templates/slash-commands/_components/sections/pattern-visibility.md +9 -9
- package/dist/types/config.d.ts +24 -0
- package/package.json +1 -1
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { BasePattern } from './base-pattern.js';
|
|
2
|
-
import { PromptIntent,
|
|
1
|
+
import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
|
|
2
|
+
import { PromptIntent, PatternContext, PatternResult } from '../types.js';
|
|
3
3
|
/**
|
|
4
|
-
* v4.
|
|
4
|
+
* v4.5 Pattern: Topic Coherence Analyzer
|
|
5
5
|
*
|
|
6
6
|
* Detects topic shifts and multi-topic conversations.
|
|
7
7
|
* Helps organize scattered discussions into coherent themes.
|
|
8
|
+
* Enhanced with expanded topic dictionary and better detection.
|
|
8
9
|
*/
|
|
9
10
|
export declare class TopicCoherenceAnalyzer extends BasePattern {
|
|
10
|
-
id
|
|
11
|
-
name
|
|
12
|
-
description
|
|
13
|
-
applicableIntents: PromptIntent[];
|
|
14
|
-
mode:
|
|
15
|
-
priority:
|
|
11
|
+
readonly id = "topic-coherence-analyzer";
|
|
12
|
+
readonly name = "Topic Coherence Analyzer";
|
|
13
|
+
readonly description = "Detects topic shifts and multi-topic conversations";
|
|
14
|
+
readonly applicableIntents: PromptIntent[];
|
|
15
|
+
readonly mode: PatternMode;
|
|
16
|
+
readonly priority: PatternPriority;
|
|
17
|
+
readonly phases: PatternPhase[];
|
|
18
|
+
static readonly configSchema: PatternConfigSchema;
|
|
19
|
+
private readonly topicIndicators;
|
|
16
20
|
apply(prompt: string, _context: PatternContext): PatternResult;
|
|
17
21
|
private detectTopics;
|
|
18
22
|
private hasTopicOrganization;
|
|
@@ -1,17 +1,213 @@
|
|
|
1
|
-
import { BasePattern } from './base-pattern.js';
|
|
1
|
+
import { BasePattern, } from './base-pattern.js';
|
|
2
2
|
/**
|
|
3
|
-
* v4.
|
|
3
|
+
* v4.5 Pattern: Topic Coherence Analyzer
|
|
4
4
|
*
|
|
5
5
|
* Detects topic shifts and multi-topic conversations.
|
|
6
6
|
* Helps organize scattered discussions into coherent themes.
|
|
7
|
+
* Enhanced with expanded topic dictionary and better detection.
|
|
7
8
|
*/
|
|
8
9
|
export class TopicCoherenceAnalyzer extends BasePattern {
|
|
10
|
+
// -------------------------------------------------------------------------
|
|
11
|
+
// Pattern Metadata (v4.5 unified types)
|
|
12
|
+
// -------------------------------------------------------------------------
|
|
9
13
|
id = 'topic-coherence-analyzer';
|
|
10
|
-
name = '
|
|
14
|
+
name = 'Topic Coherence Analyzer';
|
|
11
15
|
description = 'Detects topic shifts and multi-topic conversations';
|
|
12
16
|
applicableIntents = ['summarization', 'planning'];
|
|
13
17
|
mode = 'deep';
|
|
14
|
-
priority = 6;
|
|
18
|
+
priority = 6; // MEDIUM - standard enhancement
|
|
19
|
+
phases = ['conversation-tracking', 'summarization'];
|
|
20
|
+
// -------------------------------------------------------------------------
|
|
21
|
+
// Configuration Schema (v4.5)
|
|
22
|
+
// -------------------------------------------------------------------------
|
|
23
|
+
static configSchema = {
|
|
24
|
+
minTopicsForOrganization: {
|
|
25
|
+
type: 'number',
|
|
26
|
+
default: 2,
|
|
27
|
+
description: 'Minimum number of topics before organizing',
|
|
28
|
+
validation: { min: 2, max: 5 },
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
// -------------------------------------------------------------------------
|
|
32
|
+
// Pattern Data
|
|
33
|
+
// -------------------------------------------------------------------------
|
|
34
|
+
// Expanded topic indicators (~15 topics with more keywords)
|
|
35
|
+
topicIndicators = {
|
|
36
|
+
'User Interface': [
|
|
37
|
+
'ui',
|
|
38
|
+
'interface',
|
|
39
|
+
'design',
|
|
40
|
+
'layout',
|
|
41
|
+
'button',
|
|
42
|
+
'form',
|
|
43
|
+
'page',
|
|
44
|
+
'screen',
|
|
45
|
+
'component',
|
|
46
|
+
'modal',
|
|
47
|
+
'dialog',
|
|
48
|
+
'navigation',
|
|
49
|
+
'menu',
|
|
50
|
+
'sidebar',
|
|
51
|
+
'header',
|
|
52
|
+
'footer',
|
|
53
|
+
],
|
|
54
|
+
'Backend/API': [
|
|
55
|
+
'api',
|
|
56
|
+
'backend',
|
|
57
|
+
'server',
|
|
58
|
+
'endpoint',
|
|
59
|
+
'route',
|
|
60
|
+
'controller',
|
|
61
|
+
'service',
|
|
62
|
+
'middleware',
|
|
63
|
+
'rest',
|
|
64
|
+
'graphql',
|
|
65
|
+
'websocket',
|
|
66
|
+
],
|
|
67
|
+
Database: [
|
|
68
|
+
'database',
|
|
69
|
+
'db',
|
|
70
|
+
'schema',
|
|
71
|
+
'table',
|
|
72
|
+
'query',
|
|
73
|
+
'migration',
|
|
74
|
+
'model',
|
|
75
|
+
'orm',
|
|
76
|
+
'sql',
|
|
77
|
+
'nosql',
|
|
78
|
+
'index',
|
|
79
|
+
'relationship',
|
|
80
|
+
],
|
|
81
|
+
Authentication: [
|
|
82
|
+
'auth',
|
|
83
|
+
'login',
|
|
84
|
+
'password',
|
|
85
|
+
'session',
|
|
86
|
+
'token',
|
|
87
|
+
'permission',
|
|
88
|
+
'role',
|
|
89
|
+
'oauth',
|
|
90
|
+
'jwt',
|
|
91
|
+
'sso',
|
|
92
|
+
'mfa',
|
|
93
|
+
'2fa',
|
|
94
|
+
],
|
|
95
|
+
Performance: [
|
|
96
|
+
'performance',
|
|
97
|
+
'speed',
|
|
98
|
+
'cache',
|
|
99
|
+
'optimize',
|
|
100
|
+
'latency',
|
|
101
|
+
'load time',
|
|
102
|
+
'bundle',
|
|
103
|
+
'lazy',
|
|
104
|
+
'memory',
|
|
105
|
+
'cpu',
|
|
106
|
+
],
|
|
107
|
+
Testing: [
|
|
108
|
+
'test',
|
|
109
|
+
'spec',
|
|
110
|
+
'coverage',
|
|
111
|
+
'qa',
|
|
112
|
+
'validation',
|
|
113
|
+
'unit test',
|
|
114
|
+
'integration',
|
|
115
|
+
'e2e',
|
|
116
|
+
'mock',
|
|
117
|
+
'fixture',
|
|
118
|
+
],
|
|
119
|
+
Deployment: [
|
|
120
|
+
'deploy',
|
|
121
|
+
'ci/cd',
|
|
122
|
+
'pipeline',
|
|
123
|
+
'release',
|
|
124
|
+
'environment',
|
|
125
|
+
'production',
|
|
126
|
+
'staging',
|
|
127
|
+
'docker',
|
|
128
|
+
'kubernetes',
|
|
129
|
+
],
|
|
130
|
+
'User Experience': [
|
|
131
|
+
'ux',
|
|
132
|
+
'usability',
|
|
133
|
+
'accessibility',
|
|
134
|
+
'user flow',
|
|
135
|
+
'journey',
|
|
136
|
+
'experience',
|
|
137
|
+
'onboarding',
|
|
138
|
+
'feedback',
|
|
139
|
+
],
|
|
140
|
+
'Business Logic': [
|
|
141
|
+
'business',
|
|
142
|
+
'workflow',
|
|
143
|
+
'process',
|
|
144
|
+
'rule',
|
|
145
|
+
'logic',
|
|
146
|
+
'requirement',
|
|
147
|
+
'feature',
|
|
148
|
+
'use case',
|
|
149
|
+
],
|
|
150
|
+
Integration: [
|
|
151
|
+
'integration',
|
|
152
|
+
'third-party',
|
|
153
|
+
'external',
|
|
154
|
+
'webhook',
|
|
155
|
+
'sync',
|
|
156
|
+
'connect',
|
|
157
|
+
'import',
|
|
158
|
+
'export',
|
|
159
|
+
],
|
|
160
|
+
Security: [
|
|
161
|
+
'security',
|
|
162
|
+
'encryption',
|
|
163
|
+
'vulnerability',
|
|
164
|
+
'xss',
|
|
165
|
+
'csrf',
|
|
166
|
+
'injection',
|
|
167
|
+
'sanitize',
|
|
168
|
+
'audit',
|
|
169
|
+
],
|
|
170
|
+
Analytics: [
|
|
171
|
+
'analytics',
|
|
172
|
+
'tracking',
|
|
173
|
+
'metrics',
|
|
174
|
+
'dashboard',
|
|
175
|
+
'report',
|
|
176
|
+
'insight',
|
|
177
|
+
'data',
|
|
178
|
+
'statistics',
|
|
179
|
+
],
|
|
180
|
+
'Error Handling': [
|
|
181
|
+
'error',
|
|
182
|
+
'exception',
|
|
183
|
+
'fallback',
|
|
184
|
+
'retry',
|
|
185
|
+
'timeout',
|
|
186
|
+
'failure',
|
|
187
|
+
'recovery',
|
|
188
|
+
'logging',
|
|
189
|
+
],
|
|
190
|
+
Documentation: [
|
|
191
|
+
'documentation',
|
|
192
|
+
'docs',
|
|
193
|
+
'readme',
|
|
194
|
+
'guide',
|
|
195
|
+
'tutorial',
|
|
196
|
+
'api docs',
|
|
197
|
+
'comment',
|
|
198
|
+
'jsdoc',
|
|
199
|
+
],
|
|
200
|
+
'State Management': [
|
|
201
|
+
'state',
|
|
202
|
+
'store',
|
|
203
|
+
'redux',
|
|
204
|
+
'context',
|
|
205
|
+
'global state',
|
|
206
|
+
'local state',
|
|
207
|
+
'persist',
|
|
208
|
+
'hydrate',
|
|
209
|
+
],
|
|
210
|
+
};
|
|
15
211
|
apply(prompt, _context) {
|
|
16
212
|
// Detect topics in the content
|
|
17
213
|
const topics = this.detectTopics(prompt);
|
|
@@ -54,20 +250,7 @@ export class TopicCoherenceAnalyzer extends BasePattern {
|
|
|
54
250
|
detectTopics(prompt) {
|
|
55
251
|
const topics = [];
|
|
56
252
|
const lowerPrompt = prompt.toLowerCase();
|
|
57
|
-
|
|
58
|
-
const topicIndicators = {
|
|
59
|
-
'User Interface': ['ui', 'interface', 'design', 'layout', 'button', 'form', 'page', 'screen'],
|
|
60
|
-
'Backend/API': ['api', 'backend', 'server', 'endpoint', 'route', 'controller'],
|
|
61
|
-
Database: ['database', 'db', 'schema', 'table', 'query', 'migration'],
|
|
62
|
-
Authentication: ['auth', 'login', 'password', 'session', 'token', 'permission'],
|
|
63
|
-
Performance: ['performance', 'speed', 'cache', 'optimize', 'latency'],
|
|
64
|
-
Testing: ['test', 'spec', 'coverage', 'qa', 'validation'],
|
|
65
|
-
Deployment: ['deploy', 'ci/cd', 'pipeline', 'release', 'environment'],
|
|
66
|
-
'User Experience': ['ux', 'usability', 'accessibility', 'user flow', 'journey'],
|
|
67
|
-
'Business Logic': ['business', 'workflow', 'process', 'rule', 'logic'],
|
|
68
|
-
Integration: ['integration', 'third-party', 'external', 'webhook', 'sync'],
|
|
69
|
-
};
|
|
70
|
-
for (const [topic, keywords] of Object.entries(topicIndicators)) {
|
|
253
|
+
for (const [topic, keywords] of Object.entries(this.topicIndicators)) {
|
|
71
254
|
const hasKeyword = keywords.some((kw) => lowerPrompt.includes(kw));
|
|
72
255
|
if (hasKeyword) {
|
|
73
256
|
topics.push(topic);
|
|
@@ -99,30 +282,7 @@ export class TopicCoherenceAnalyzer extends BasePattern {
|
|
|
99
282
|
return organized;
|
|
100
283
|
}
|
|
101
284
|
extractTopicContent(prompt, topic) {
|
|
102
|
-
|
|
103
|
-
const topicKeywords = {
|
|
104
|
-
'User Interface': [
|
|
105
|
-
'ui',
|
|
106
|
-
'interface',
|
|
107
|
-
'design',
|
|
108
|
-
'layout',
|
|
109
|
-
'button',
|
|
110
|
-
'form',
|
|
111
|
-
'page',
|
|
112
|
-
'screen',
|
|
113
|
-
'component',
|
|
114
|
-
],
|
|
115
|
-
'Backend/API': ['api', 'backend', 'server', 'endpoint', 'route', 'controller', 'service'],
|
|
116
|
-
Database: ['database', 'db', 'schema', 'table', 'query', 'migration', 'model'],
|
|
117
|
-
Authentication: ['auth', 'login', 'password', 'session', 'token', 'permission', 'user'],
|
|
118
|
-
Performance: ['performance', 'speed', 'cache', 'optimize', 'latency', 'fast', 'slow'],
|
|
119
|
-
Testing: ['test', 'spec', 'coverage', 'qa', 'validation', 'verify'],
|
|
120
|
-
Deployment: ['deploy', 'ci/cd', 'pipeline', 'release', 'environment', 'production'],
|
|
121
|
-
'User Experience': ['ux', 'usability', 'accessibility', 'user flow', 'journey', 'experience'],
|
|
122
|
-
'Business Logic': ['business', 'workflow', 'process', 'rule', 'logic', 'requirement'],
|
|
123
|
-
Integration: ['integration', 'third-party', 'external', 'webhook', 'sync', 'connect'],
|
|
124
|
-
};
|
|
125
|
-
const keywords = topicKeywords[topic] || [];
|
|
285
|
+
const keywords = this.topicIndicators[topic] || [];
|
|
126
286
|
const sentences = this.extractSentences(prompt);
|
|
127
287
|
const relevantSentences = sentences.filter((sentence) => {
|
|
128
288
|
const lower = sentence.toLowerCase();
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { BasePattern } from './base-pattern.js';
|
|
2
|
-
import { PromptIntent,
|
|
1
|
+
import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
|
|
2
|
+
import { PromptIntent, PatternContext, PatternResult } from '../types.js';
|
|
3
3
|
/**
|
|
4
|
-
* v4.
|
|
4
|
+
* v4.5 Pattern: User Persona Enricher
|
|
5
5
|
*
|
|
6
6
|
* Adds missing user context and personas to PRD content.
|
|
7
7
|
* Ensures the "who" is clearly defined alongside the "what".
|
|
8
8
|
*/
|
|
9
9
|
export declare class UserPersonaEnricher extends BasePattern {
|
|
10
|
-
id
|
|
11
|
-
name
|
|
12
|
-
description
|
|
13
|
-
applicableIntents: PromptIntent[];
|
|
14
|
-
mode:
|
|
15
|
-
priority:
|
|
10
|
+
readonly id = "user-persona-enricher";
|
|
11
|
+
readonly name = "User Persona Enricher";
|
|
12
|
+
readonly description = "Adds missing user context and personas";
|
|
13
|
+
readonly applicableIntents: PromptIntent[];
|
|
14
|
+
readonly mode: PatternMode;
|
|
15
|
+
readonly priority: PatternPriority;
|
|
16
|
+
readonly phases: PatternPhase[];
|
|
17
|
+
static readonly configSchema: PatternConfigSchema;
|
|
16
18
|
apply(prompt: string, _context: PatternContext): PatternResult;
|
|
17
19
|
private hasUserContext;
|
|
18
20
|
private needsUserContext;
|
|
@@ -1,17 +1,34 @@
|
|
|
1
|
-
import { BasePattern } from './base-pattern.js';
|
|
1
|
+
import { BasePattern, } from './base-pattern.js';
|
|
2
2
|
/**
|
|
3
|
-
* v4.
|
|
3
|
+
* v4.5 Pattern: User Persona Enricher
|
|
4
4
|
*
|
|
5
5
|
* Adds missing user context and personas to PRD content.
|
|
6
6
|
* Ensures the "who" is clearly defined alongside the "what".
|
|
7
7
|
*/
|
|
8
8
|
export class UserPersonaEnricher extends BasePattern {
|
|
9
|
+
// -------------------------------------------------------------------------
|
|
10
|
+
// Pattern Metadata (v4.5 unified types)
|
|
11
|
+
// -------------------------------------------------------------------------
|
|
9
12
|
id = 'user-persona-enricher';
|
|
10
|
-
name = '
|
|
13
|
+
name = 'User Persona Enricher';
|
|
11
14
|
description = 'Adds missing user context and personas';
|
|
12
15
|
applicableIntents = ['prd-generation', 'planning'];
|
|
13
16
|
mode = 'deep';
|
|
14
|
-
priority = 6;
|
|
17
|
+
priority = 6; // MEDIUM - standard enhancement
|
|
18
|
+
phases = ['question-validation', 'output-generation'];
|
|
19
|
+
// -------------------------------------------------------------------------
|
|
20
|
+
// Configuration Schema (v4.5)
|
|
21
|
+
// -------------------------------------------------------------------------
|
|
22
|
+
static configSchema = {
|
|
23
|
+
inferUserType: {
|
|
24
|
+
type: 'boolean',
|
|
25
|
+
default: true,
|
|
26
|
+
description: 'Attempt to infer user type from content',
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
// -------------------------------------------------------------------------
|
|
30
|
+
// Pattern Application
|
|
31
|
+
// -------------------------------------------------------------------------
|
|
15
32
|
apply(prompt, _context) {
|
|
16
33
|
// Check if user/persona context already exists
|
|
17
34
|
if (this.hasUserContext(prompt)) {
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { BasePattern } from './base-pattern.js';
|
|
1
|
+
import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema, PatternDependency } from './base-pattern.js';
|
|
2
2
|
import { PromptIntent, PatternContext, PatternResult } from '../types.js';
|
|
3
3
|
/**
|
|
4
|
-
* v4.
|
|
4
|
+
* v4.5 Pattern: Validation Checklist Creator
|
|
5
5
|
*
|
|
6
6
|
* Creates implementation validation checklists to ensure
|
|
7
7
|
* comprehensive verification of completed work.
|
|
8
8
|
*/
|
|
9
9
|
export declare class ValidationChecklistCreator extends BasePattern {
|
|
10
|
-
id
|
|
11
|
-
name
|
|
12
|
-
description
|
|
13
|
-
applicableIntents: PromptIntent[];
|
|
14
|
-
mode:
|
|
15
|
-
priority:
|
|
10
|
+
readonly id = "validation-checklist-creator";
|
|
11
|
+
readonly name = "Validation Checklist Creator";
|
|
12
|
+
readonly description = "Create implementation validation checklist for verification";
|
|
13
|
+
readonly applicableIntents: PromptIntent[];
|
|
14
|
+
readonly mode: PatternMode;
|
|
15
|
+
readonly priority: PatternPriority;
|
|
16
|
+
readonly phases: PatternPhase[];
|
|
17
|
+
readonly dependencies: PatternDependency;
|
|
18
|
+
static readonly configSchema: PatternConfigSchema;
|
|
16
19
|
apply(prompt: string, context: PatternContext): PatternResult;
|
|
17
20
|
private createChecklist;
|
|
18
21
|
private getCodeGenerationChecklist;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { BasePattern } from './base-pattern.js';
|
|
1
|
+
import { BasePattern, } from './base-pattern.js';
|
|
2
2
|
/**
|
|
3
|
-
* v4.
|
|
3
|
+
* v4.5 Pattern: Validation Checklist Creator
|
|
4
4
|
*
|
|
5
5
|
* Creates implementation validation checklists to ensure
|
|
6
6
|
* comprehensive verification of completed work.
|
|
7
7
|
*/
|
|
8
8
|
export class ValidationChecklistCreator extends BasePattern {
|
|
9
|
+
// -------------------------------------------------------------------------
|
|
10
|
+
// Pattern Metadata (v4.5 unified types)
|
|
11
|
+
// -------------------------------------------------------------------------
|
|
9
12
|
id = 'validation-checklist-creator';
|
|
10
13
|
name = 'Validation Checklist Creator';
|
|
11
14
|
description = 'Create implementation validation checklist for verification';
|
|
@@ -17,7 +20,32 @@ export class ValidationChecklistCreator extends BasePattern {
|
|
|
17
20
|
'debugging',
|
|
18
21
|
];
|
|
19
22
|
mode = 'deep';
|
|
20
|
-
priority = 3;
|
|
23
|
+
priority = 3; // VERY LOW - final touches
|
|
24
|
+
phases = ['all'];
|
|
25
|
+
// v4.5: Dependencies
|
|
26
|
+
dependencies = {
|
|
27
|
+
runAfter: ['success-criteria-enforcer'], // Checklist should include success criteria
|
|
28
|
+
enhancedBy: ['edge-case-identifier'],
|
|
29
|
+
};
|
|
30
|
+
// -------------------------------------------------------------------------
|
|
31
|
+
// Configuration Schema (v4.5)
|
|
32
|
+
// -------------------------------------------------------------------------
|
|
33
|
+
static configSchema = {
|
|
34
|
+
maxChecklistItems: {
|
|
35
|
+
type: 'number',
|
|
36
|
+
default: 12,
|
|
37
|
+
description: 'Maximum number of checklist items',
|
|
38
|
+
validation: { min: 5, max: 20 },
|
|
39
|
+
},
|
|
40
|
+
groupByCategory: {
|
|
41
|
+
type: 'boolean',
|
|
42
|
+
default: true,
|
|
43
|
+
description: 'Group checklist items by category',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
// -------------------------------------------------------------------------
|
|
47
|
+
// Pattern Application
|
|
48
|
+
// -------------------------------------------------------------------------
|
|
21
49
|
apply(prompt, context) {
|
|
22
50
|
const checklist = this.createChecklist(prompt, context.intent.primaryIntent);
|
|
23
51
|
if (checklist.length === 0) {
|
|
@@ -190,7 +190,27 @@ The goal is natural exploration of requirements, not a rigid questionnaire. Foll
|
|
|
190
190
|
|
|
191
191
|
---
|
|
192
192
|
|
|
193
|
-
## Agent Transparency (v4.
|
|
193
|
+
## Agent Transparency (v4.4)
|
|
194
|
+
|
|
195
|
+
### Enhanced Conversational Analysis (v4.4)
|
|
196
|
+
|
|
197
|
+
Clavix Intelligence™ now includes enhanced conversational pattern recognition:
|
|
198
|
+
|
|
199
|
+
**Topic Detection** (~15 topic areas):
|
|
200
|
+
- Automatically detects: User Interface, Backend/API, Database, Authentication, Performance, Testing, Deployment, User Experience, Business Logic, Integration, Security, Analytics, Error Handling, Documentation, State Management
|
|
201
|
+
- Groups related keywords for more accurate multi-topic detection
|
|
202
|
+
- Triggers focus suggestions when 3+ distinct topics detected
|
|
203
|
+
|
|
204
|
+
**Conversational Markers** (~30 patterns):
|
|
205
|
+
- Intent expressions: "i want", "we need", "should be able to"
|
|
206
|
+
- Thinking/exploring: "thinking about", "what if", "how about"
|
|
207
|
+
- Informal markers: "basically", "kind of like", "something like"
|
|
208
|
+
- Collaborative: "can we", "could we", "shall we"
|
|
209
|
+
|
|
210
|
+
**Implicit Requirement Detection**:
|
|
211
|
+
- Surfaces unstated requirements from context
|
|
212
|
+
- Categories: Infrastructure, Security, Performance, UX, Integration
|
|
213
|
+
- Examples: "mobile" → responsive design, "real-time" → WebSocket infrastructure
|
|
194
214
|
|
|
195
215
|
### Agent Decision Rules
|
|
196
216
|
{{INCLUDE:agent-protocols/decision-rules.md}}
|
|
@@ -104,7 +104,15 @@ Implementation: BLOCKED - I will extract requirements, not implement them
|
|
|
104
104
|
- **Success Criteria** [confidence]: How will success be measured?
|
|
105
105
|
- **Context** [confidence]: Any important background or constraints?
|
|
106
106
|
|
|
107
|
-
**
|
|
107
|
+
**Calculate Extraction Confidence (v4.4):**
|
|
108
|
+
- Start with 50% base (conversational content detected)
|
|
109
|
+
- Add 20% if concrete requirements extracted
|
|
110
|
+
- Add 15% if clear goals identified
|
|
111
|
+
- Add 15% if constraints defined
|
|
112
|
+
- Display: "*Extraction confidence: X%*"
|
|
113
|
+
- If confidence < 80%, include verification prompt in output
|
|
114
|
+
|
|
115
|
+
**CHECKPOINT:** Extracted [N] requirements, [M] constraints from conversation (confidence: X%)
|
|
108
116
|
|
|
109
117
|
3. **CREATE OUTPUT FILES (REQUIRED)** - You MUST create three files. This is not optional.
|
|
110
118
|
|
|
@@ -156,6 +164,12 @@ Implementation: BLOCKED - I will extract requirements, not implement them
|
|
|
156
164
|
- [Edge case 1 and how it should be handled]
|
|
157
165
|
- [Open question 1 - needs clarification]
|
|
158
166
|
|
|
167
|
+
## Implicit Requirements (v4.4)
|
|
168
|
+
*Inferred from conversation context - please verify:*
|
|
169
|
+
- [Category] [Requirement inferred from discussion]
|
|
170
|
+
- [Category] [Another requirement]
|
|
171
|
+
> **Note:** These requirements were surfaced by analyzing conversation patterns.
|
|
172
|
+
|
|
159
173
|
## Success Criteria
|
|
160
174
|
How we know this is complete and working:
|
|
161
175
|
- ✓ [Specific success criterion 1]
|
|
@@ -344,7 +358,34 @@ Implementation: BLOCKED - I will extract requirements, not implement them
|
|
|
344
358
|
|
|
345
359
|
---
|
|
346
360
|
|
|
347
|
-
## Agent Transparency (v4.
|
|
361
|
+
## Agent Transparency (v4.4)
|
|
362
|
+
|
|
363
|
+
### Enhanced Extraction Capabilities (v4.4)
|
|
364
|
+
|
|
365
|
+
Clavix Intelligence™ now includes enhanced extraction with confidence scoring:
|
|
366
|
+
|
|
367
|
+
**Extraction Confidence** (auto-calculated):
|
|
368
|
+
- Base confidence: 50% (conversational content detected)
|
|
369
|
+
- +20% if concrete requirements extracted
|
|
370
|
+
- +15% if clear goals identified
|
|
371
|
+
- +15% if constraints defined
|
|
372
|
+
- Display: "Extraction confidence: X%"
|
|
373
|
+
- If <80%, add verification prompt to output
|
|
374
|
+
|
|
375
|
+
**Implicit Requirements** (auto-surfaced):
|
|
376
|
+
- Inferred from conversation context, grouped by category:
|
|
377
|
+
- **Infrastructure**: Mobile-responsive, real-time, scalability, offline, multi-tenant
|
|
378
|
+
- **Security**: Audit compliance, data privacy, encryption
|
|
379
|
+
- **Performance**: Speed optimization, low-latency
|
|
380
|
+
- **UX**: Simplicity focus, accessibility (WCAG)
|
|
381
|
+
- **Integration**: Notifications, search, analytics, APIs, data import/export
|
|
382
|
+
- Up to 10 implicit requirements per extraction
|
|
383
|
+
- Always marked with verification note
|
|
384
|
+
|
|
385
|
+
**Topic Organization**:
|
|
386
|
+
- Detects 15 topic categories with expanded keyword matching
|
|
387
|
+
- Groups multi-topic extractions by area
|
|
388
|
+
- Suggests separate PRDs for 3+ distinct topics
|
|
348
389
|
|
|
349
390
|
### Quality Output Format
|
|
350
391
|
{{INCLUDE:agent-protocols/quality-output.md}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## Intent Types Reference
|
|
2
2
|
|
|
3
|
-
Clavix Intelligence™ detects
|
|
3
|
+
Clavix Intelligence™ detects 11 primary intent types. This reference is synchronized with `src/core/intelligence/types.ts`.
|
|
4
4
|
|
|
5
5
|
### Intent Categories
|
|
6
6
|
|
|
@@ -16,6 +16,7 @@ Clavix Intelligence™ detects 10 primary intent types. This reference is synchr
|
|
|
16
16
|
| **migration** | Version upgrades, porting code | "migrate", "upgrade", "port", "convert", "transition" |
|
|
17
17
|
| **security-review** | Security audits, vulnerability checks | "security", "audit", "vulnerability", "OWASP", "CVE" |
|
|
18
18
|
| **learning** | Conceptual understanding, tutorials | "explain", "how does", "tutorial", "understand" |
|
|
19
|
+
| **summarization** | Extracting requirements from conversations | "summarize", "extract", "requirements from" |
|
|
19
20
|
|
|
20
21
|
### Intent Detection Confidence Levels
|
|
21
22
|
|
|
@@ -35,3 +36,4 @@ Different intents enable different optimization patterns:
|
|
|
35
36
|
- **debugging**: ErrorToleranceEnhancer, EdgeCaseIdentifier
|
|
36
37
|
- **testing**: ValidationChecklistCreator, EdgeCaseIdentifier
|
|
37
38
|
- **prd-generation**: PRDStructureEnforcer, CompletenessValidator
|
|
39
|
+
- **summarization**: ConversationSummarizer, TopicCoherenceAnalyzer, ImplicitRequirementExtractor
|