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.
Files changed (77) hide show
  1. package/dist/core/adapters/instructions-generator.d.ts +2 -1
  2. package/dist/core/adapters/instructions-generator.js +21 -8
  3. package/dist/core/intelligence/confidence-calculator.d.ts +93 -0
  4. package/dist/core/intelligence/confidence-calculator.js +124 -0
  5. package/dist/core/intelligence/index.d.ts +1 -0
  6. package/dist/core/intelligence/index.js +2 -0
  7. package/dist/core/intelligence/intent-detector.js +10 -8
  8. package/dist/core/intelligence/pattern-library.d.ts +47 -10
  9. package/dist/core/intelligence/pattern-library.js +151 -79
  10. package/dist/core/intelligence/patterns/actionability-enhancer.d.ts +10 -10
  11. package/dist/core/intelligence/patterns/actionability-enhancer.js +31 -6
  12. package/dist/core/intelligence/patterns/alternative-phrasing-generator.d.ts +10 -8
  13. package/dist/core/intelligence/patterns/alternative-phrasing-generator.js +21 -3
  14. package/dist/core/intelligence/patterns/ambiguity-detector.d.ts +10 -8
  15. package/dist/core/intelligence/patterns/ambiguity-detector.js +31 -3
  16. package/dist/core/intelligence/patterns/assumption-explicitizer.d.ts +10 -8
  17. package/dist/core/intelligence/patterns/assumption-explicitizer.js +26 -3
  18. package/dist/core/intelligence/patterns/base-pattern.d.ts +166 -8
  19. package/dist/core/intelligence/patterns/base-pattern.js +64 -4
  20. package/dist/core/intelligence/patterns/completeness-validator.d.ts +10 -10
  21. package/dist/core/intelligence/patterns/completeness-validator.js +26 -5
  22. package/dist/core/intelligence/patterns/conciseness-filter.d.ts +15 -7
  23. package/dist/core/intelligence/patterns/conciseness-filter.js +36 -4
  24. package/dist/core/intelligence/patterns/context-precision.d.ts +10 -8
  25. package/dist/core/intelligence/patterns/context-precision.js +28 -5
  26. package/dist/core/intelligence/patterns/conversation-summarizer.d.ts +14 -9
  27. package/dist/core/intelligence/patterns/conversation-summarizer.js +109 -29
  28. package/dist/core/intelligence/patterns/dependency-identifier.d.ts +11 -9
  29. package/dist/core/intelligence/patterns/dependency-identifier.js +21 -4
  30. package/dist/core/intelligence/patterns/domain-context-enricher.d.ts +10 -8
  31. package/dist/core/intelligence/patterns/domain-context-enricher.js +27 -3
  32. package/dist/core/intelligence/patterns/edge-case-identifier.d.ts +10 -8
  33. package/dist/core/intelligence/patterns/edge-case-identifier.js +21 -3
  34. package/dist/core/intelligence/patterns/error-tolerance-enhancer.d.ts +10 -8
  35. package/dist/core/intelligence/patterns/error-tolerance-enhancer.js +22 -4
  36. package/dist/core/intelligence/patterns/implicit-requirement-extractor.d.ts +14 -10
  37. package/dist/core/intelligence/patterns/implicit-requirement-extractor.js +193 -63
  38. package/dist/core/intelligence/patterns/objective-clarifier.d.ts +15 -7
  39. package/dist/core/intelligence/patterns/objective-clarifier.js +46 -17
  40. package/dist/core/intelligence/patterns/output-format-enforcer.d.ts +10 -8
  41. package/dist/core/intelligence/patterns/output-format-enforcer.js +20 -3
  42. package/dist/core/intelligence/patterns/prd-structure-enforcer.d.ts +10 -8
  43. package/dist/core/intelligence/patterns/prd-structure-enforcer.js +25 -3
  44. package/dist/core/intelligence/patterns/prerequisite-identifier.d.ts +10 -8
  45. package/dist/core/intelligence/patterns/prerequisite-identifier.js +28 -4
  46. package/dist/core/intelligence/patterns/requirement-prioritizer.d.ts +11 -9
  47. package/dist/core/intelligence/patterns/requirement-prioritizer.js +21 -4
  48. package/dist/core/intelligence/patterns/scope-definer.d.ts +10 -8
  49. package/dist/core/intelligence/patterns/scope-definer.js +27 -3
  50. package/dist/core/intelligence/patterns/step-decomposer.d.ts +10 -8
  51. package/dist/core/intelligence/patterns/step-decomposer.js +21 -3
  52. package/dist/core/intelligence/patterns/structure-organizer.d.ts +10 -10
  53. package/dist/core/intelligence/patterns/structure-organizer.js +25 -5
  54. package/dist/core/intelligence/patterns/success-criteria-enforcer.d.ts +10 -8
  55. package/dist/core/intelligence/patterns/success-criteria-enforcer.js +20 -3
  56. package/dist/core/intelligence/patterns/success-metrics-enforcer.d.ts +11 -9
  57. package/dist/core/intelligence/patterns/success-metrics-enforcer.js +27 -4
  58. package/dist/core/intelligence/patterns/technical-context-enricher.d.ts +16 -7
  59. package/dist/core/intelligence/patterns/technical-context-enricher.js +71 -38
  60. package/dist/core/intelligence/patterns/topic-coherence-analyzer.d.ts +13 -9
  61. package/dist/core/intelligence/patterns/topic-coherence-analyzer.js +202 -42
  62. package/dist/core/intelligence/patterns/user-persona-enricher.d.ts +11 -9
  63. package/dist/core/intelligence/patterns/user-persona-enricher.js +21 -4
  64. package/dist/core/intelligence/patterns/validation-checklist-creator.d.ts +11 -8
  65. package/dist/core/intelligence/patterns/validation-checklist-creator.js +31 -3
  66. package/dist/templates/slash-commands/_canonical/deep.md +1 -1
  67. package/dist/templates/slash-commands/_canonical/execute.md +1 -1
  68. package/dist/templates/slash-commands/_canonical/fast.md +1 -1
  69. package/dist/templates/slash-commands/_canonical/implement.md +1 -1
  70. package/dist/templates/slash-commands/_canonical/plan.md +1 -1
  71. package/dist/templates/slash-commands/_canonical/prd.md +1 -1
  72. package/dist/templates/slash-commands/_canonical/start.md +21 -1
  73. package/dist/templates/slash-commands/_canonical/summarize.md +43 -2
  74. package/dist/templates/slash-commands/_components/references/intent-types.md +3 -1
  75. package/dist/templates/slash-commands/_components/sections/pattern-visibility.md +9 -9
  76. package/dist/types/config.d.ts +24 -0
  77. package/package.json +1 -1
@@ -1,17 +1,89 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, } from './base-pattern.js';
2
+ import { calculateAdditiveConfidence } from '../confidence-calculator.js';
2
3
  /**
3
- * v4.3.2 Conversational Pattern: ConversationSummarizer
4
+ * v4.5 Pattern: Conversation Summarizer
4
5
  *
5
6
  * Extracts structured requirements from conversational messages.
6
7
  * Organizes free-form discussion into actionable requirements.
8
+ * Enhanced with expanded marker detection and confidence scoring.
7
9
  */
8
10
  export class ConversationSummarizer extends BasePattern {
11
+ // -------------------------------------------------------------------------
12
+ // Pattern Metadata (v4.5 unified types)
13
+ // -------------------------------------------------------------------------
9
14
  id = 'conversation-summarizer';
10
- name = 'ConversationSummarizer';
15
+ name = 'Conversation Summarizer';
11
16
  description = 'Extracts structured requirements from messages';
12
17
  applicableIntents = ['summarization', 'planning', 'prd-generation'];
13
18
  mode = 'deep';
14
- priority = 8;
19
+ priority = 8; // HIGH - core enhancement
20
+ phases = ['summarization'];
21
+ // -------------------------------------------------------------------------
22
+ // Configuration Schema (v4.5)
23
+ // -------------------------------------------------------------------------
24
+ static configSchema = {
25
+ maxRequirements: {
26
+ type: 'number',
27
+ default: 10,
28
+ description: 'Maximum number of requirements to extract',
29
+ validation: { min: 1, max: 20 },
30
+ },
31
+ maxGoals: {
32
+ type: 'number',
33
+ default: 3,
34
+ description: 'Maximum number of goals to extract',
35
+ validation: { min: 1, max: 5 },
36
+ },
37
+ showConfidence: {
38
+ type: 'boolean',
39
+ default: true,
40
+ description: 'Show extraction confidence percentage',
41
+ },
42
+ };
43
+ // -------------------------------------------------------------------------
44
+ // Pattern Data
45
+ // -------------------------------------------------------------------------
46
+ // Expanded conversational markers (~30 markers)
47
+ conversationalMarkers = [
48
+ // Intent expressions
49
+ 'i want',
50
+ 'i need',
51
+ 'we need',
52
+ 'we want',
53
+ 'i would like',
54
+ 'we would like',
55
+ 'would like to',
56
+ 'should be able to',
57
+ 'needs to',
58
+ // Thinking/exploring
59
+ 'thinking about',
60
+ 'maybe we could',
61
+ 'what if',
62
+ 'how about',
63
+ 'perhaps we',
64
+ 'considering',
65
+ 'wondering if',
66
+ // Conversational connectors
67
+ "let's",
68
+ 'let me',
69
+ 'also',
70
+ 'and then',
71
+ 'plus',
72
+ 'another thing',
73
+ 'oh and',
74
+ 'by the way',
75
+ // Informal markers
76
+ 'basically',
77
+ 'so basically',
78
+ 'essentially',
79
+ 'kind of like',
80
+ 'sort of',
81
+ 'something like',
82
+ // Collaborative
83
+ 'can we',
84
+ 'could we',
85
+ 'shall we',
86
+ ];
15
87
  apply(prompt, _context) {
16
88
  // Check if content is already well-structured
17
89
  if (this.isAlreadyStructured(prompt)) {
@@ -65,36 +137,29 @@ export class ConversationSummarizer extends BasePattern {
65
137
  return matches.length >= 3;
66
138
  }
67
139
  isConversationalContent(prompt) {
68
- // Conversational markers
69
- const conversationalMarkers = [
70
- 'i want',
71
- 'i need',
72
- 'we need',
73
- 'should be able to',
74
- 'would like',
75
- 'thinking about',
76
- 'maybe we could',
77
- 'what if',
78
- 'how about',
79
- 'let me',
80
- "let's",
81
- 'also',
82
- 'and then',
83
- 'basically',
84
- 'so basically',
85
- ];
86
140
  const lowerPrompt = prompt.toLowerCase();
87
- const matches = conversationalMarkers.filter((marker) => lowerPrompt.includes(marker));
141
+ const matches = this.conversationalMarkers.filter((marker) => lowerPrompt.includes(marker));
88
142
  // Also check for lack of structure (sentences without bullet points)
89
143
  const sentences = this.extractSentences(prompt);
90
144
  const hasBulletPoints = prompt.includes('- ') || prompt.includes('* ');
145
+ // More lenient threshold with expanded markers
91
146
  return matches.length >= 2 || (sentences.length > 3 && !hasBulletPoints);
92
147
  }
148
+ calculateConfidence(requirements, goals, constraints) {
149
+ // v4.5: Use shared confidence calculator
150
+ return calculateAdditiveConfidence(50, [
151
+ [requirements.length > 0, 20],
152
+ [goals.length > 0, 15],
153
+ [constraints.length > 0, 15],
154
+ ]);
155
+ }
93
156
  extractAndStructure(prompt) {
94
157
  const requirements = this.extractRequirements(prompt);
95
158
  const constraints = this.extractConstraints(prompt);
96
159
  const goals = this.extractGoals(prompt);
160
+ const confidence = this.calculateConfidence(requirements, goals, constraints);
97
161
  let structured = '### Extracted Requirements\n\n';
162
+ structured += `*Extraction confidence: ${confidence}%*\n\n`;
98
163
  if (goals.length > 0) {
99
164
  structured += '**Goals:**\n';
100
165
  structured += goals.map((g) => `- ${g}`).join('\n');
@@ -110,16 +175,27 @@ export class ConversationSummarizer extends BasePattern {
110
175
  structured += constraints.map((c) => `- ${c}`).join('\n');
111
176
  structured += '\n\n';
112
177
  }
178
+ // Add verification prompt if confidence is below 80%
179
+ if (confidence < 80) {
180
+ structured +=
181
+ '> **Note:** Please verify these extracted requirements are complete and accurate.\n\n';
182
+ }
113
183
  structured += '---\n\n**Original Context:**\n' + prompt;
114
184
  return structured;
115
185
  }
116
186
  extractRequirements(prompt) {
117
187
  const requirements = [];
118
188
  const sentences = this.extractSentences(prompt);
189
+ // Expanded requirement patterns
119
190
  const requirementPatterns = [
120
- /(?:need|want|should|must|require)\s+(?:to\s+)?(.+)/i,
121
- /(?:should be able to|needs to)\s+(.+)/i,
122
- /(?:feature|functionality):\s*(.+)/i,
191
+ /(?:i |we )?(?:need|want|should|must|require)\s+(?:to\s+)?(.+)/i,
192
+ /(?:should be able to|needs to|has to|have to)\s+(.+)/i,
193
+ /(?:feature|functionality|capability):\s*(.+)/i,
194
+ /(?:it should|it must|it needs to)\s+(.+)/i,
195
+ /(?:users? (?:can|should|will|must))\s+(.+)/i,
196
+ /(?:the system (?:should|must|will))\s+(.+)/i,
197
+ /(?:support(?:s|ing)?)\s+(.+)/i,
198
+ /(?:provide(?:s)?|enable(?:s)?|allow(?:s)?)\s+(.+)/i,
123
199
  ];
124
200
  for (const sentence of sentences) {
125
201
  for (const pattern of requirementPatterns) {
@@ -168,10 +244,14 @@ export class ConversationSummarizer extends BasePattern {
168
244
  }
169
245
  extractGoals(prompt) {
170
246
  const goals = [];
247
+ // Expanded goal patterns
171
248
  const goalPatterns = [
172
- /(?:goal is to|aim to|objective is to)\s+(.+)/gi,
173
- /(?:trying to|looking to|hoping to)\s+(.+)/gi,
174
- /(?:so that|in order to)\s+(.+)/gi,
249
+ /(?:goal is to|aim(?:ing)? to|objective is to)\s+(.+)/gi,
250
+ /(?:trying to|looking to|hoping to|want(?:ing)? to)\s+(.+)/gi,
251
+ /(?:so that|in order to|to achieve)\s+(.+)/gi,
252
+ /(?:the purpose is|main purpose|key purpose)\s+(.+)/gi,
253
+ /(?:ultimately|end goal|final goal|main goal)\s+(.+)/gi,
254
+ /(?:we're building this to|this will help)\s+(.+)/gi,
175
255
  ];
176
256
  for (const pattern of goalPatterns) {
177
257
  const matches = prompt.matchAll(pattern);
@@ -1,18 +1,20 @@
1
- import { BasePattern } from './base-pattern.js';
2
- import { PromptIntent, OptimizationMode, PatternContext, PatternResult } from '../types.js';
1
+ import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
+ import { PromptIntent, PatternContext, PatternResult } from '../types.js';
3
3
  /**
4
- * v4.3.2 PRD Pattern: DependencyIdentifier
4
+ * v4.5 Pattern: Dependency Identifier
5
5
  *
6
6
  * Identifies technical and external dependencies in PRD content.
7
7
  * Helps surface hidden requirements and blockers.
8
8
  */
9
9
  export declare class DependencyIdentifier extends BasePattern {
10
- id: string;
11
- name: string;
12
- description: string;
13
- applicableIntents: PromptIntent[];
14
- mode: OptimizationMode | 'both';
15
- priority: number;
10
+ readonly id = "dependency-identifier";
11
+ readonly name = "Dependency Identifier";
12
+ readonly description = "Identifies technical and external dependencies";
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 hasDependencySection;
18
20
  private identifyDependencies;
@@ -1,17 +1,34 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, } from './base-pattern.js';
2
2
  /**
3
- * v4.3.2 PRD Pattern: DependencyIdentifier
3
+ * v4.5 Pattern: Dependency Identifier
4
4
  *
5
5
  * Identifies technical and external dependencies in PRD content.
6
6
  * Helps surface hidden requirements and blockers.
7
7
  */
8
8
  export class DependencyIdentifier extends BasePattern {
9
+ // -------------------------------------------------------------------------
10
+ // Pattern Metadata (v4.5 unified types)
11
+ // -------------------------------------------------------------------------
9
12
  id = 'dependency-identifier';
10
- name = 'DependencyIdentifier';
13
+ name = 'Dependency Identifier';
11
14
  description = 'Identifies technical and external dependencies';
12
15
  applicableIntents = ['prd-generation', 'planning', 'migration'];
13
16
  mode = 'deep';
14
- priority = 5;
17
+ priority = 5; // MEDIUM-LOW - supplementary
18
+ phases = ['question-validation', 'output-generation'];
19
+ // -------------------------------------------------------------------------
20
+ // Configuration Schema (v4.5)
21
+ // -------------------------------------------------------------------------
22
+ static configSchema = {
23
+ categorizeDependencies: {
24
+ type: 'boolean',
25
+ default: true,
26
+ description: 'Separate technical from external dependencies',
27
+ },
28
+ };
29
+ // -------------------------------------------------------------------------
30
+ // Pattern Application
31
+ // -------------------------------------------------------------------------
15
32
  apply(prompt, _context) {
16
33
  // Check if dependencies are already documented
17
34
  if (this.hasDependencySection(prompt)) {
@@ -1,18 +1,20 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
2
  import { PatternContext, PatternResult, PromptIntent } from '../types.js';
3
3
  /**
4
- * DomainContextEnricher Pattern (v4.1)
4
+ * v4.5 Pattern: Domain Context Enricher
5
5
  *
6
6
  * Adds domain-specific context and best practices based on detected
7
7
  * technical domain. Helps agents apply domain expertise.
8
8
  */
9
9
  export declare class DomainContextEnricher extends BasePattern {
10
- id: string;
11
- name: string;
12
- description: string;
13
- applicableIntents: PromptIntent[];
14
- mode: 'fast' | 'deep' | 'both';
15
- priority: number;
10
+ readonly id = "domain-context-enricher";
11
+ readonly name = "Domain Context Enricher";
12
+ readonly description = "Adds domain-specific best practices and context";
13
+ readonly applicableIntents: PromptIntent[];
14
+ readonly mode: PatternMode;
15
+ readonly priority: PatternPriority;
16
+ readonly phases: PatternPhase[];
17
+ static readonly configSchema: PatternConfigSchema;
16
18
  private domainPatterns;
17
19
  apply(prompt: string, _context: PatternContext): PatternResult;
18
20
  }
@@ -1,11 +1,14 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, } from './base-pattern.js';
2
2
  /**
3
- * DomainContextEnricher Pattern (v4.1)
3
+ * v4.5 Pattern: Domain Context Enricher
4
4
  *
5
5
  * Adds domain-specific context and best practices based on detected
6
6
  * technical domain. Helps agents apply domain expertise.
7
7
  */
8
8
  export class DomainContextEnricher extends BasePattern {
9
+ // -------------------------------------------------------------------------
10
+ // Pattern Metadata (v4.5 unified types)
11
+ // -------------------------------------------------------------------------
9
12
  id = 'domain-context-enricher';
10
13
  name = 'Domain Context Enricher';
11
14
  description = 'Adds domain-specific best practices and context';
@@ -19,7 +22,28 @@ export class DomainContextEnricher extends BasePattern {
19
22
  'migration',
20
23
  ];
21
24
  mode = 'both';
22
- priority = 5; // Medium priority
25
+ priority = 5; // MEDIUM-LOW - supplementary
26
+ phases = ['all'];
27
+ // -------------------------------------------------------------------------
28
+ // Configuration Schema (v4.5)
29
+ // -------------------------------------------------------------------------
30
+ static configSchema = {
31
+ maxDomains: {
32
+ type: 'number',
33
+ default: 2,
34
+ description: 'Maximum number of domains to detect',
35
+ validation: { min: 1, max: 4 },
36
+ },
37
+ practicesPerDomain: {
38
+ type: 'number',
39
+ default: 3,
40
+ description: 'Number of best practices per domain',
41
+ validation: { min: 1, max: 6 },
42
+ },
43
+ };
44
+ // -------------------------------------------------------------------------
45
+ // Pattern Data
46
+ // -------------------------------------------------------------------------
23
47
  // Domain detection patterns
24
48
  domainPatterns = {
25
49
  authentication: {
@@ -1,18 +1,20 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
2
  import { PromptIntent, PatternContext, PatternResult } from '../types.js';
3
3
  /**
4
- * v4.0 Deep Mode Pattern: Edge Case Identifier
4
+ * v4.5 Pattern: Edge Case Identifier
5
5
  *
6
6
  * Identifies potential edge cases by domain/intent to ensure
7
7
  * comprehensive requirement coverage.
8
8
  */
9
9
  export declare class EdgeCaseIdentifier extends BasePattern {
10
- id: string;
11
- name: string;
12
- description: string;
13
- applicableIntents: PromptIntent[];
14
- mode: "deep";
15
- priority: number;
10
+ readonly id = "edge-case-identifier";
11
+ readonly name = "Edge Case Identifier";
12
+ readonly description = "Identify potential edge cases and failure modes by domain";
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 identifyEdgeCases;
18
20
  private getGeneralEdgeCases;
@@ -1,11 +1,14 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, } from './base-pattern.js';
2
2
  /**
3
- * v4.0 Deep Mode Pattern: Edge Case Identifier
3
+ * v4.5 Pattern: Edge Case Identifier
4
4
  *
5
5
  * Identifies potential edge cases by domain/intent to ensure
6
6
  * comprehensive requirement coverage.
7
7
  */
8
8
  export class EdgeCaseIdentifier extends BasePattern {
9
+ // -------------------------------------------------------------------------
10
+ // Pattern Metadata (v4.5 unified types)
11
+ // -------------------------------------------------------------------------
9
12
  id = 'edge-case-identifier';
10
13
  name = 'Edge Case Identifier';
11
14
  description = 'Identify potential edge cases and failure modes by domain';
@@ -17,7 +20,22 @@ export class EdgeCaseIdentifier extends BasePattern {
17
20
  'security-review',
18
21
  ];
19
22
  mode = 'deep';
20
- priority = 4;
23
+ priority = 4; // LOW - polish phase
24
+ phases = ['all'];
25
+ // -------------------------------------------------------------------------
26
+ // Configuration Schema (v4.5)
27
+ // -------------------------------------------------------------------------
28
+ static configSchema = {
29
+ maxEdgeCases: {
30
+ type: 'number',
31
+ default: 8,
32
+ description: 'Maximum number of edge cases to identify',
33
+ validation: { min: 1, max: 15 },
34
+ },
35
+ };
36
+ // -------------------------------------------------------------------------
37
+ // Pattern Application
38
+ // -------------------------------------------------------------------------
21
39
  apply(prompt, context) {
22
40
  const edgeCases = this.identifyEdgeCases(prompt, context.intent.primaryIntent);
23
41
  if (edgeCases.length === 0) {
@@ -1,18 +1,20 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
2
  import { PatternContext, PatternResult, PromptIntent } from '../types.js';
3
3
  /**
4
- * ErrorToleranceEnhancer Pattern (v4.1)
4
+ * v4.5 Pattern: Error Tolerance Enhancer
5
5
  *
6
6
  * Adds error handling requirements and considerations to prompts.
7
7
  * Ensures implementations are robust and handle failure gracefully.
8
8
  */
9
9
  export declare class ErrorToleranceEnhancer extends BasePattern {
10
- id: string;
11
- name: string;
12
- description: string;
13
- applicableIntents: PromptIntent[];
14
- mode: 'fast' | 'deep' | 'both';
15
- priority: number;
10
+ readonly id = "error-tolerance-enhancer";
11
+ readonly name = "Error Tolerance Enhancer";
12
+ readonly description = "Adds error handling requirements and failure mode considerations";
13
+ readonly applicableIntents: PromptIntent[];
14
+ readonly mode: PatternMode;
15
+ readonly priority: PatternPriority;
16
+ readonly phases: PatternPhase[];
17
+ static readonly configSchema: PatternConfigSchema;
16
18
  private errorIndicators;
17
19
  private errorScenarios;
18
20
  apply(prompt: string, _context: PatternContext): PatternResult;
@@ -1,11 +1,14 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, } from './base-pattern.js';
2
2
  /**
3
- * ErrorToleranceEnhancer Pattern (v4.1)
3
+ * v4.5 Pattern: Error Tolerance Enhancer
4
4
  *
5
5
  * Adds error handling requirements and considerations to prompts.
6
6
  * Ensures implementations are robust and handle failure gracefully.
7
7
  */
8
8
  export class ErrorToleranceEnhancer extends BasePattern {
9
+ // -------------------------------------------------------------------------
10
+ // Pattern Metadata (v4.5 unified types)
11
+ // -------------------------------------------------------------------------
9
12
  id = 'error-tolerance-enhancer';
10
13
  name = 'Error Tolerance Enhancer';
11
14
  description = 'Adds error handling requirements and failure mode considerations';
@@ -16,8 +19,23 @@ export class ErrorToleranceEnhancer extends BasePattern {
16
19
  'migration',
17
20
  'testing',
18
21
  ];
19
- mode = 'deep'; // Only in deep mode for comprehensive analysis
20
- priority = 5; // Medium priority
22
+ mode = 'deep';
23
+ priority = 5; // MEDIUM-LOW - supplementary
24
+ phases = ['all'];
25
+ // -------------------------------------------------------------------------
26
+ // Configuration Schema (v4.5)
27
+ // -------------------------------------------------------------------------
28
+ static configSchema = {
29
+ maxErrorScenarios: {
30
+ type: 'number',
31
+ default: 6,
32
+ description: 'Maximum number of error scenarios to surface',
33
+ validation: { min: 1, max: 10 },
34
+ },
35
+ };
36
+ // -------------------------------------------------------------------------
37
+ // Pattern Data
38
+ // -------------------------------------------------------------------------
21
39
  // Indicators that error handling is already addressed
22
40
  errorIndicators = [
23
41
  'error handling',
@@ -1,20 +1,24 @@
1
- import { BasePattern } from './base-pattern.js';
2
- import { PromptIntent, OptimizationMode, PatternContext, PatternResult } from '../types.js';
1
+ import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
+ import { PromptIntent, PatternContext, PatternResult } from '../types.js';
3
3
  /**
4
- * v4.3.2 Conversational Pattern: ImplicitRequirementExtractor
4
+ * v4.5 Pattern: Implicit Requirement Extractor
5
5
  *
6
6
  * Surfaces requirements mentioned indirectly in conversations.
7
7
  * Identifies hidden assumptions and unstated needs.
8
+ * Enhanced with more detection patterns and categorization.
8
9
  */
9
10
  export declare class ImplicitRequirementExtractor extends BasePattern {
10
- id: string;
11
- name: string;
12
- description: string;
13
- applicableIntents: PromptIntent[];
14
- mode: OptimizationMode | 'both';
15
- priority: number;
11
+ readonly id = "implicit-requirement-extractor";
12
+ readonly name = "Implicit Requirement Extractor";
13
+ readonly description = "Surfaces requirements mentioned indirectly";
14
+ readonly applicableIntents: PromptIntent[];
15
+ readonly mode: PatternMode;
16
+ readonly priority: PatternPriority;
17
+ readonly phases: PatternPhase[];
18
+ static readonly configSchema: PatternConfigSchema;
19
+ private readonly implicitPatterns;
16
20
  apply(prompt: string, _context: PatternContext): PatternResult;
17
21
  private extractImplicitRequirements;
18
- private addImplicitRequirements;
22
+ private addImplicitRequirementsSection;
19
23
  }
20
24
  //# sourceMappingURL=implicit-requirement-extractor.d.ts.map