@vfarcic/dot-ai 0.49.0 → 0.51.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 (43) hide show
  1. package/README.md +49 -2
  2. package/dist/core/base-vector-service.d.ts +4 -4
  3. package/dist/core/base-vector-service.d.ts.map +1 -1
  4. package/dist/core/base-vector-service.js +31 -39
  5. package/dist/core/capabilities.d.ts +71 -0
  6. package/dist/core/capabilities.d.ts.map +1 -0
  7. package/dist/core/capabilities.js +208 -0
  8. package/dist/core/capability-vector-service.d.ts +80 -0
  9. package/dist/core/capability-vector-service.d.ts.map +1 -0
  10. package/dist/core/capability-vector-service.js +142 -0
  11. package/dist/core/claude.d.ts +14 -1
  12. package/dist/core/claude.d.ts.map +1 -1
  13. package/dist/core/claude.js +109 -13
  14. package/dist/core/discovery.d.ts +0 -7
  15. package/dist/core/discovery.d.ts.map +1 -1
  16. package/dist/core/discovery.js +0 -18
  17. package/dist/core/embedding-service.d.ts +3 -3
  18. package/dist/core/embedding-service.d.ts.map +1 -1
  19. package/dist/core/embedding-service.js +6 -7
  20. package/dist/core/index.d.ts +1 -0
  21. package/dist/core/index.d.ts.map +1 -1
  22. package/dist/core/index.js +5 -4
  23. package/dist/core/schema.d.ts +11 -30
  24. package/dist/core/schema.d.ts.map +1 -1
  25. package/dist/core/schema.js +107 -126
  26. package/dist/core/vector-db-service.d.ts +6 -0
  27. package/dist/core/vector-db-service.d.ts.map +1 -1
  28. package/dist/core/vector-db-service.js +40 -10
  29. package/dist/tools/organizational-data.d.ts +5 -3
  30. package/dist/tools/organizational-data.d.ts.map +1 -1
  31. package/dist/tools/organizational-data.js +1714 -52
  32. package/dist/tools/recommend.d.ts.map +1 -1
  33. package/dist/tools/recommend.js +3 -7
  34. package/dist/tools/version.d.ts +9 -0
  35. package/dist/tools/version.d.ts.map +1 -1
  36. package/dist/tools/version.js +115 -5
  37. package/package.json +1 -1
  38. package/prompts/capability-inference.md +122 -0
  39. package/prompts/doc-testing-test-section.md +40 -2
  40. package/prompts/resource-selection.md +10 -3
  41. package/shared-prompts/prd-update-decisions.md +9 -0
  42. package/shared-prompts/prd-update-progress.md +33 -0
  43. package/prompts/concept-extraction.md +0 -95
@@ -1 +1 @@
1
- {"version":3,"file":"recommend.d.ts","sourceRoot":"","sources":["../../src/tools/recommend.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAQhD,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAC/C,eAAO,MAAM,0BAA0B,+JAA+J,CAAC;AAGvM,eAAO,MAAM,2BAA2B;;CAEvC,CAAC;AAyHF;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EACxB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC,CAyOxD"}
1
+ {"version":3,"file":"recommend.d.ts","sourceRoot":"","sources":["../../src/tools/recommend.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAQhD,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAC/C,eAAO,MAAM,0BAA0B,+JAA+J,CAAC;AAGvM,eAAO,MAAM,2BAA2B;;CAEvC,CAAC;AAyHF;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EACxB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC,CAmOxD"}
@@ -65,7 +65,7 @@ async function validateIntentWithAI(intent, claudeIntegration) {
65
65
  // Replace template variables
66
66
  const validationPrompt = template.replace('{intent}', intent);
67
67
  // Send to Claude for validation
68
- const response = await claudeIntegration.sendMessage(validationPrompt);
68
+ const response = await claudeIntegration.sendMessage(validationPrompt, 'intent-validation');
69
69
  // Parse JSON response with robust error handling
70
70
  let jsonContent = response.content;
71
71
  // Try to find JSON object wrapped in code blocks
@@ -232,18 +232,14 @@ async function handleRecommendTool(args, dotAI, logger, requestId) {
232
232
  // Initialize AI-powered ResourceRecommender
233
233
  const rankingConfig = { claudeApiKey };
234
234
  const recommender = new schema_1.ResourceRecommender(rankingConfig);
235
- // Create discovery functions
236
- const discoverResourcesFn = async () => {
237
- logger.debug('Discovering cluster resources', { requestId });
238
- return await dotAI.discovery.discoverResources();
239
- };
235
+ // Create discovery function
240
236
  const explainResourceFn = async (resource) => {
241
237
  logger.debug(`Explaining resource: ${resource}`, { requestId });
242
238
  return await dotAI.discovery.explainResource(resource);
243
239
  };
244
240
  // Find best solutions for the user intent
245
241
  logger.debug('Generating recommendations with AI', { requestId });
246
- const solutions = await recommender.findBestSolutions(args.intent, discoverResourcesFn, explainResourceFn);
242
+ const solutions = await recommender.findBestSolutions(args.intent, explainResourceFn);
247
243
  logger.info('Recommendation process completed', {
248
244
  requestId,
249
245
  solutionCount: solutions.length,
@@ -40,6 +40,15 @@ export interface SystemStatus {
40
40
  keyConfigured: boolean;
41
41
  error?: string;
42
42
  };
43
+ capabilities: {
44
+ systemReady: boolean;
45
+ vectorDBHealthy: boolean;
46
+ collectionAccessible: boolean;
47
+ storedCount?: number;
48
+ error?: string;
49
+ rawError?: string;
50
+ lastDiagnosis: string;
51
+ };
43
52
  }
44
53
  /**
45
54
  * Get version information from package.json
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/tools/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,wBAAwB,gMAAgM,CAAC;AACtO,eAAO,MAAM,yBAAyB;;;;;CAKrC,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE;QACR,SAAS,EAAE,OAAO,CAAC;QACnB,GAAG,EAAE,MAAM,CAAC;QACZ,cAAc,EAAE,MAAM,CAAC;QACvB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,SAAS,EAAE;QACT,SAAS,EAAE,OAAO,CAAC;QACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,SAAS,EAAE;QACT,SAAS,EAAE,OAAO,CAAC;QACnB,aAAa,EAAE,OAAO,CAAC;QACvB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAmGD;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAqB5C;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CAiEd"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/tools/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,wBAAwB,gMAAgM,CAAC;AACtO,eAAO,MAAM,yBAAyB;;;;;CAKrC,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE;QACR,SAAS,EAAE,OAAO,CAAC;QACnB,GAAG,EAAE,MAAM,CAAC;QACZ,cAAc,EAAE,MAAM,CAAC;QACvB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,SAAS,EAAE;QACT,SAAS,EAAE,OAAO,CAAC;QACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,SAAS,EAAE;QACT,SAAS,EAAE,OAAO,CAAC;QACnB,aAAa,EAAE,OAAO,CAAC;QACvB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,YAAY,EAAE;QACZ,WAAW,EAAE,OAAO,CAAC;QACrB,eAAe,EAAE,OAAO,CAAC;QACzB,oBAAoB,EAAE,OAAO,CAAC;QAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AA4ND;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAqB5C;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CAsEd"}
@@ -110,6 +110,111 @@ async function getEmbeddingStatus() {
110
110
  reason: status.reason
111
111
  };
112
112
  }
113
+ /**
114
+ * Test capability system readiness
115
+ */
116
+ async function getCapabilityStatus() {
117
+ const timestamp = new Date().toISOString();
118
+ try {
119
+ const capabilityService = new index_1.CapabilityVectorService();
120
+ // Test Vector DB health for capabilities
121
+ let vectorDBHealthy = false;
122
+ let collectionAccessible = false;
123
+ let storedCount;
124
+ try {
125
+ vectorDBHealthy = await capabilityService.healthCheck();
126
+ }
127
+ catch (error) {
128
+ return {
129
+ systemReady: false,
130
+ vectorDBHealthy: false,
131
+ collectionAccessible: false,
132
+ error: `Vector DB health check failed: ${error instanceof Error ? error.message : String(error)}`,
133
+ lastDiagnosis: timestamp
134
+ };
135
+ }
136
+ if (vectorDBHealthy) {
137
+ // Test collection accessibility and storage operations
138
+ try {
139
+ await capabilityService.initialize();
140
+ storedCount = await capabilityService.getCapabilitiesCount();
141
+ collectionAccessible = true;
142
+ // Test actual storage operation to detect dimension mismatches and other storage issues
143
+ const testCapability = {
144
+ resourceName: 'test.version.diagnostic',
145
+ capabilities: ['version-test'],
146
+ providers: ['test'],
147
+ abstractions: ['diagnostic'],
148
+ complexity: 'low',
149
+ description: 'Version tool diagnostic test capability',
150
+ useCase: 'Testing capability storage pipeline',
151
+ confidence: 0.95, // Should be 0-1 range, not 0-100
152
+ analyzedAt: timestamp
153
+ };
154
+ // Test embedding generation directly first
155
+ const embeddingService = new index_1.EmbeddingService();
156
+ const testEmbedding = await embeddingService.generateEmbedding('test capability storage pipeline');
157
+ if (!testEmbedding || testEmbedding.length !== 1536) {
158
+ throw new Error(`Embedding dimension mismatch: expected 1536, got ${testEmbedding?.length || 'null'} dimensions`);
159
+ }
160
+ // Validate embedding values are numbers (not NaN, Infinity, etc.)
161
+ if (testEmbedding.some(val => !Number.isFinite(val))) {
162
+ throw new Error('Embedding contains invalid values (NaN or Infinity)');
163
+ }
164
+ // Attempt to store test capability
165
+ await capabilityService.storeCapability(testCapability);
166
+ // Attempt to retrieve test capability
167
+ const retrieved = await capabilityService.getCapability('test.version.diagnostic');
168
+ if (!retrieved) {
169
+ throw new Error('Test capability storage failed - could not retrieve stored test data');
170
+ }
171
+ // Clean up test capability
172
+ await capabilityService.deleteCapability('test.version.diagnostic');
173
+ }
174
+ catch (error) {
175
+ const errorMessage = error instanceof Error ? error.message : String(error);
176
+ // Check for common Vector DB issues
177
+ const isDimensionMismatch = errorMessage.toLowerCase().includes('dimension') ||
178
+ errorMessage.toLowerCase().includes('vector') ||
179
+ errorMessage.toLowerCase().includes('size') ||
180
+ errorMessage.toLowerCase().includes('bad request');
181
+ return {
182
+ systemReady: false,
183
+ vectorDBHealthy: true,
184
+ collectionAccessible: collectionAccessible,
185
+ storedCount: storedCount,
186
+ error: isDimensionMismatch ?
187
+ `Vector dimension mismatch detected: ${errorMessage}. The capabilities collection exists but has incompatible vector dimensions. Delete the collection to allow recreation with correct dimensions.` :
188
+ `Capability storage test failed: ${errorMessage}`,
189
+ lastDiagnosis: timestamp,
190
+ // Add raw error for debugging
191
+ rawError: errorMessage
192
+ };
193
+ }
194
+ }
195
+ // Check embedding service (required for semantic search)
196
+ const embeddingService = new index_1.EmbeddingService();
197
+ const embeddingAvailable = embeddingService.isAvailable();
198
+ // System is ready if Vector DB is healthy, collection is accessible, and embeddings available
199
+ const systemReady = vectorDBHealthy && collectionAccessible && embeddingAvailable;
200
+ return {
201
+ systemReady,
202
+ vectorDBHealthy,
203
+ collectionAccessible,
204
+ storedCount,
205
+ lastDiagnosis: timestamp
206
+ };
207
+ }
208
+ catch (error) {
209
+ return {
210
+ systemReady: false,
211
+ vectorDBHealthy: false,
212
+ collectionAccessible: false,
213
+ error: `Capability diagnostics failed: ${error instanceof Error ? error.message : String(error)}`,
214
+ lastDiagnosis: timestamp
215
+ };
216
+ }
217
+ }
113
218
  /**
114
219
  * Test Anthropic API connectivity
115
220
  */
@@ -175,16 +280,18 @@ async function handleVersionTool(args, logger, requestId) {
175
280
  const version = getVersionInfo();
176
281
  // Run all diagnostics in parallel for better performance
177
282
  logger.info('Running system diagnostics...', { requestId });
178
- const [vectorDBStatus, embeddingStatus, anthropicStatus] = await Promise.all([
283
+ const [vectorDBStatus, embeddingStatus, anthropicStatus, capabilityStatus] = await Promise.all([
179
284
  getVectorDBStatus(),
180
285
  getEmbeddingStatus(),
181
- getAnthropicStatus()
286
+ getAnthropicStatus(),
287
+ getCapabilityStatus()
182
288
  ]);
183
289
  const systemStatus = {
184
290
  version,
185
291
  vectorDB: vectorDBStatus,
186
292
  embedding: embeddingStatus,
187
- anthropic: anthropicStatus
293
+ anthropic: anthropicStatus,
294
+ capabilities: capabilityStatus
188
295
  };
189
296
  // Log summary of system health
190
297
  logger.info('System diagnostics completed', {
@@ -192,7 +299,8 @@ async function handleVersionTool(args, logger, requestId) {
192
299
  version: version.version,
193
300
  vectorDBConnected: vectorDBStatus.connected,
194
301
  embeddingAvailable: embeddingStatus.available,
195
- anthropicConnected: anthropicStatus.connected
302
+ anthropicConnected: anthropicStatus.connected,
303
+ capabilitySystemReady: capabilityStatus.systemReady
196
304
  });
197
305
  return {
198
306
  content: [{
@@ -201,10 +309,12 @@ async function handleVersionTool(args, logger, requestId) {
201
309
  status: 'success',
202
310
  system: systemStatus,
203
311
  summary: {
204
- overall: vectorDBStatus.connected && anthropicStatus.connected ? 'healthy' : 'degraded',
312
+ overall: vectorDBStatus.connected && anthropicStatus.connected && capabilityStatus.systemReady ? 'healthy' : 'degraded',
205
313
  patternSearch: embeddingStatus.available ? 'semantic+keyword' : 'keyword-only',
314
+ capabilityScanning: capabilityStatus.systemReady ? 'ready' : 'not-ready',
206
315
  capabilities: [
207
316
  vectorDBStatus.connected ? 'pattern-management' : null,
317
+ capabilityStatus.systemReady ? 'capability-scanning' : null,
208
318
  embeddingStatus.available ? 'semantic-search' : null,
209
319
  anthropicStatus.connected ? 'ai-recommendations' : null
210
320
  ].filter(Boolean)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vfarcic/dot-ai",
3
- "version": "0.49.0",
3
+ "version": "0.51.0",
4
4
  "description": "Universal Kubernetes application deployment agent with CLI and MCP interfaces",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,122 @@
1
+ # Generic Kubernetes Resource Capability Analysis
2
+
3
+ Analyze this Kubernetes resource and identify its capabilities for semantic matching and AI recommendations.
4
+
5
+ ## Resource Information
6
+ - **Resource**: {resourceName}
7
+
8
+ ## Resource Definition
9
+ ```yaml
10
+ {resourceDefinition}
11
+ ```
12
+
13
+ ## Analysis Instructions
14
+
15
+ Analyze the provided resource definition to understand what this resource does and extract its capabilities. Use only information present in the definition - do not guess or assume.
16
+
17
+ ### 1. Functional Capabilities
18
+ From the resource definition, identify what this resource enables users to do:
19
+ - Look at schema properties, descriptions, and field names
20
+ - Identify the core functionality (e.g., "database", "storage", "networking")
21
+ - Be specific about technologies (e.g., "postgresql" vs generic "database")
22
+ - Extract capabilities from field names, descriptions, and structure
23
+
24
+ ### 2. Provider/Platform Support
25
+ Identify what platforms or providers this resource works with:
26
+ - Look for provider-specific configuration sections or fields
27
+ - Check for multi-provider abstractions vs single-provider resources
28
+ - Identify on-premises vs cloud-only resources
29
+ - Only list providers explicitly mentioned or configured in the definition
30
+
31
+ ### 3. Abstraction Level
32
+ Determine what abstractions this resource provides:
33
+ - High-level managed services with minimal configuration
34
+ - Infrastructure abstractions (auto-scaling, high availability, etc.)
35
+ - Integration capabilities (backup, monitoring, security features)
36
+ - Look at required vs optional fields to gauge abstraction level
37
+
38
+ ### 4. User Experience Complexity
39
+ Assess complexity considering both configuration and assembly requirements:
40
+
41
+ **Configuration Complexity:**
42
+ - Number and difficulty of required fields
43
+ - Technical knowledge needed for the resource itself
44
+ - Clarity of purpose and abstractions provided
45
+
46
+ **Assembly Complexity:**
47
+ - **Standalone**: Resource works independently, creates/manages all dependencies
48
+ - **Coordinated**: Requires 2-3 other resources to be functional
49
+ - **Orchestrated**: Needs many resources and complex relationships to work
50
+
51
+ **Final Complexity Rating:**
52
+ - **Low**: Simple configuration AND works standalone or with minimal dependencies
53
+ - **Medium**: Moderate configuration OR needs some coordination with other resources
54
+ - **High**: Complex configuration OR requires orchestrating many resources OR both
55
+
56
+ ## Response Format
57
+
58
+ Respond **only** with valid JSON in this exact format:
59
+
60
+ ```json
61
+ {
62
+ "capabilities": ["capability1", "capability2", "capability3"],
63
+ "providers": ["provider1", "provider2"],
64
+ "abstractions": ["abstraction1", "abstraction2"],
65
+ "complexity": "low|medium|high",
66
+ "description": "Brief description of what this resource does (1-2 sentences)",
67
+ "useCase": "Primary use case for this resource (1 sentence)",
68
+ "confidence": 0.8
69
+ }
70
+ ```
71
+
72
+ ## Examples
73
+
74
+ ### Database Resource Example
75
+ ```json
76
+ {
77
+ "capabilities": ["postgresql", "mysql", "database", "managed database"],
78
+ "providers": ["azure", "gcp", "aws"],
79
+ "abstractions": ["managed service", "high availability", "backup"],
80
+ "complexity": "low",
81
+ "description": "High-level managed database solution supporting multiple engines and cloud providers",
82
+ "useCase": "Simple database deployment without infrastructure complexity",
83
+ "confidence": 0.9
84
+ }
85
+ ```
86
+
87
+ ### Storage Resource Example
88
+ ```json
89
+ {
90
+ "capabilities": ["object storage", "backup", "storage"],
91
+ "providers": ["aws"],
92
+ "abstractions": ["managed service", "auto scaling"],
93
+ "complexity": "medium",
94
+ "description": "AWS S3-compatible object storage with backup capabilities",
95
+ "useCase": "Object storage and backup for applications",
96
+ "confidence": 0.85
97
+ }
98
+ ```
99
+
100
+ ### Application Resource Example
101
+ ```json
102
+ {
103
+ "capabilities": ["web service", "api", "application"],
104
+ "providers": ["multi cloud"],
105
+ "abstractions": ["auto scaling", "monitoring"],
106
+ "complexity": "medium",
107
+ "description": "Web application deployment with auto scaling and monitoring",
108
+ "useCase": "Scalable web application hosting",
109
+ "confidence": 0.8
110
+ }
111
+ ```
112
+
113
+ ## Important Notes
114
+
115
+ - **Be specific**: Use precise capability terms that users would search for
116
+ - **Be comprehensive**: Include all relevant capabilities, not just the primary one
117
+ - **Be accurate**: Only include capabilities that are clearly supported
118
+ - **Focus on user intent**: Think about what users would search for to find this resource
119
+ - **Consider abstraction**: Higher abstraction = lower complexity for users
120
+ - **Confidence score**: 0.1-1.0 based on how certain you are about the analysis
121
+
122
+ Analyze the provided resource and respond with the JSON format above.
@@ -63,6 +63,42 @@ Check every claim in the documentation:
63
63
 
64
64
  ## Testing Approach
65
65
 
66
+ ### EXECUTION REQUIREMENTS FOR TESTABLE CONTENT
67
+ **When documentation contains executable examples, you MUST actually execute them:**
68
+
69
+ **Types of executable content that require actual testing:**
70
+ - **CLI Commands**: `kubectl get pods`, `npm install`, `docker run`
71
+ - **API Calls**: HTTP requests, REST endpoints, GraphQL queries
72
+ - **MCP Tool Calls**: `mcp__tool_name` with documented parameters
73
+ - **Configuration Examples**: Creating files, environment variables, config files
74
+ - **Web Navigation**: URLs, web interface interactions, form submissions
75
+ - **Database Queries**: SQL commands, database operations
76
+ - **Script Execution**: Shell scripts, Python scripts, automation workflows
77
+
78
+ **Testing Protocol for Executable Content:**
79
+ ✅ REQUIRED: Execute each example exactly as documented
80
+ ✅ REQUIRED: Test with the exact parameters/inputs shown
81
+ ✅ REQUIRED: Compare actual results with documented expected results
82
+ ❌ FORBIDDEN: Analyze implementation code instead of running examples
83
+ ❌ FORBIDDEN: Skip execution because "it looks similar to previous tests"
84
+ ❌ FORBIDDEN: Rely on testing from other sections of the documentation
85
+
86
+ ### NON-TESTABLE CONTENT (Testing Not Required)
87
+ **These types of content should be analyzed but not executed:**
88
+ - **Conceptual explanations**: Architecture descriptions, background theory
89
+ - **Screenshots**: Visual examples that can't be directly executed
90
+ - **Future roadmaps**: Planned features not yet implemented
91
+ - **External dependencies**: Third-party services you don't control
92
+ - **Destructive operations**: Commands that could damage systems
93
+ - **Hardware-specific instructions**: When you lack the specific hardware
94
+ - **Security credentials**: Examples containing sensitive information
95
+
96
+ ### CRITICAL: Section-Specific Testing Required (When Testable)
97
+ **Each documentation section with executable content requires independent validation:**
98
+ - Execute the specific testable examples shown in the current section
99
+ - Previous successful tests cannot substitute for current section validation
100
+ - Clearly distinguish between testable and non-testable content in your analysis
101
+
66
102
  ### Functional Testing (Execute Documentation)
67
103
  **Execute documented examples first** - Always prioritize running the actual commands/procedures shown in the documentation, adapting for safety when needed. Use help commands only as supplements for understanding, not as substitutes for real testing.
68
104
 
@@ -102,9 +138,11 @@ Return your results as JSON in this exact format:
102
138
 
103
139
  **whatWasDone** (string): Concise summary covering BOTH functional testing AND semantic analysis - what commands/procedures you executed and what claims you analyzed.
104
140
 
105
- **issues** (array): CRITICAL PROBLEMS that prevent users from succeeding (broken functionality, incorrect information, missing required steps). Include precise location and explain user impact.
141
+ **issues** (array): CRITICAL PROBLEMS that prevent users from succeeding (broken functionality, incorrect information, missing required steps). Include precise location and explain user impact. Each issue must be ACTIONABLE - describe what needs to be changed/fixed.
142
+
143
+ **recommendations** (array): OPTIONAL IMPROVEMENTS that would enhance user experience (NOT critical problems). Must be genuinely optional - user can succeed without these changes. Each recommendation must be ACTIONABLE - describe a specific change to make. Do NOT include statements that validate existing content is correct (e.g., "The format matches actual behavior - this is accurate"). Only include suggestions for actual changes or additions. Do NOT repeat anything from issues array.
106
144
 
107
- **recommendations** (array): OPTIONAL IMPROVEMENTS that would enhance user experience (NOT critical problems). Must be genuinely optional - user can succeed without these changes. Do NOT repeat anything from issues array.
145
+ **ACTIONABILITY REQUIREMENT**: Both issues and recommendations must suggest concrete changes. Avoid validation statements like "X is correct" or "Y matches expected behavior." If something is working correctly, don't mention it unless suggesting an enhancement.
108
146
 
109
147
  **ANTI-DUPLICATION RULES**: If something is broken/incorrect → issues only. If something could be enhanced but works fine → recommendations only. Never put the same concept in both arrays.
110
148
 
@@ -13,11 +13,18 @@ You are a Kubernetes expert. Given this user intent and available resources, sel
13
13
 
14
14
  ## Instructions
15
15
 
16
+ ## 🏆 PATTERN PRIORITIZATION (HIGHEST PRIORITY)
17
+
18
+ **If any organizational pattern above matches this intent (based on pattern triggers), prioritize those resources above all others:**
19
+ - **Golden Path Priority** - Pattern resources represent approved organizational standards and should rank higher than cloud-native alternatives
20
+ - **Pattern Recognition** - Match pattern triggers against user intent keywords. If triggers match, the pattern's "Suggested Resources" become high-priority candidates
21
+ - **Higher-Level Abstractions** - Pattern resources often provide better user experience than low-level cloud provider resources
22
+ - **Resource Name Matching** - Find exact "Suggested Resources" names in the "Resource Name" field of available resources
23
+
16
24
  Select all resources that could be relevant for this intent. Consider:
17
- - Direct relevance to the user's needs (applications, infrastructure, operators, networking, storage)
25
+ - **🥇 FIRST: Organizational pattern resources** - When patterns match the intent, their suggested resources should appear early in your selection
26
+ - Direct relevance to the user's needs (applications, infrastructure, operators, networking, storage)
18
27
  - Common Kubernetes patterns and best practices
19
- - **PRIORITY: Organizational pattern resources** - If organizational patterns are provided above, ALWAYS include ALL resources from patterns that match this intent, even if individual resources don't seem directly relevant
20
- - **Pattern resource completeness** - Organizational patterns represent complete, battle-tested solutions. Include entire pattern resource sets to avoid incomplete deployments
21
28
  - Resource relationships and combinations
22
29
  - Production deployment patterns
23
30
  - Complex multi-component solutions
@@ -54,6 +54,7 @@ For each identified decision, assess:
54
54
  - **Scope Impact**: Does this expand or contract the project scope?
55
55
  - **Timeline Impact**: Does this affect project phases or delivery dates?
56
56
  - **Architecture Impact**: Does this change technical constraints or approaches?
57
+ - **Code Example Impact**: Which examples, interfaces, or snippets become outdated?
57
58
  - **Risk Impact**: Does this introduce new risks or mitigate existing ones?
58
59
 
59
60
  ### Decision Documentation Format
@@ -62,6 +63,7 @@ For each decision, record:
62
63
  - **Date**: When the decision was made
63
64
  - **Rationale**: Why this approach was chosen
64
65
  - **Impact**: How this affects the PRD requirements, scope, or approach
66
+ - **Code Impact**: Which code examples, interfaces, or snippets need updating
65
67
  - **Owner**: Who made or approved the decision
66
68
 
67
69
  ## Step 4: PRD Updates
@@ -83,6 +85,13 @@ Update the appropriate PRD sections:
83
85
  - Modify architecture decisions if technical approach evolved
84
86
  - Adjust scope management if features were added, deferred, or removed
85
87
 
88
+ ### Code Example Validation and Updates
89
+ - **Identify Outdated Examples**: Scan PRD for code snippets that may be affected by design decisions
90
+ - **Interface Changes**: Update examples when function signatures, parameter types, or return values change
91
+ - **API Modifications**: Revise examples when method names, class structures, or data formats evolve
92
+ - **Workflow Updates**: Update process examples when user interaction patterns or step sequences change
93
+ - **Mark for Verification**: Flag code examples that need manual testing to ensure they still work
94
+
86
95
  ### Risk and Dependency Updates
87
96
  - Add new risks introduced by design decisions
88
97
  - Update mitigation strategies if approach changed
@@ -247,6 +247,39 @@ When applying updates:
247
247
  4. **Preserve unchecked items** that still need work
248
248
  5. **Update completion percentages** realistically
249
249
 
250
+ ## Step 7.5: Code Example Validation
251
+
252
+ When updating PRDs based on implementation progress:
253
+
254
+ **CRITICAL**: Always check if code examples in PRD match current implementation
255
+
256
+ ### Example Impact Detection
257
+ 1. **Interface Changes**: Function signatures, parameter types, return formats
258
+ 2. **API Evolution**: Method names, class structures, data models
259
+ 3. **Workflow Updates**: User interaction patterns, step sequences
260
+ 4. **Integration Changes**: How components connect and communicate
261
+
262
+ ### Code Example Update Process
263
+ 1. **Scan PRD**: Identify all code snippets and examples
264
+ 2. **Cross-reference Implementation**: Compare examples with actual code
265
+ 3. **Mark Outdated**: Flag examples that no longer match
266
+ 4. **Priority Assessment**: Determine which examples need immediate updates
267
+ 5. **Update Examples**: Revise code snippets to match current implementation
268
+ 6. **Validate Examples**: Test updated examples to ensure they work
269
+
270
+ ### Example Categories to Check
271
+ - **Function calls**: Parameter order, types, names
272
+ - **Interface definitions**: TypeScript interfaces, class structures
273
+ - **API responses**: Data formats, field names, response structures
274
+ - **Workflow steps**: User interaction sequences, tool usage patterns
275
+ - **Configuration**: Setup examples, environment variables, config files
276
+
277
+ ### When to Update Examples
278
+ - **Immediately**: When interface changes break existing examples
279
+ - **Before completion**: When marking implementation milestones complete
280
+ - **During reviews**: When validating PRD accuracy
281
+ - **User feedback**: When someone reports examples don't work
282
+
250
283
  ## Step 8: Commit Progress Updates
251
284
 
252
285
  After successfully updating the PRD, commit all changes to preserve the progress checkpoint:
@@ -1,95 +0,0 @@
1
- # Concept Extraction for Pattern Matching
2
-
3
- You are a Kubernetes deployment expert. Extract multiple deployment concepts from user intent to enable comprehensive pattern matching.
4
-
5
- ## User Intent
6
- {intent}
7
-
8
- ## Instructions
9
-
10
- Analyze the user intent and extract all relevant deployment concepts. Consider these categories:
11
-
12
- ### **Application Architecture**
13
- - Application types: web application, API service, microservice, monolith, frontend, backend
14
- - Architectural patterns: stateless, stateful, serverless, event-driven, batch processing
15
- - Service types: REST API, GraphQL API, gRPC service, websocket service, message consumer
16
-
17
- ### **Infrastructure & Integration**
18
- - Data storage: database, cache, persistent storage, file storage, object storage
19
- - Database services: PostgreSQL, MongoDB, MySQL, Redis, Elasticsearch clusters
20
- - Connectivity: external database, message queue, third-party API, service mesh
21
- - Networking: public access, internal service, load balancing, ingress, networking policies
22
- - Infrastructure operators: monitoring, logging, backup, security operators
23
-
24
- ### **Operational Requirements**
25
- - Scaling: auto-scaling, high availability, load balancing, horizontal scaling
26
- - Data management: schema management, database migrations, backup, monitoring
27
- - Security: authentication, authorization, network policies, secrets management
28
- - Deployment: CI/CD, blue-green deployment, canary deployment, rolling updates
29
-
30
- ### **Technology Stack**
31
- - Programming languages: golang, java, python, nodejs, react, angular
32
- - Frameworks: spring boot, express, flask, django, rails
33
- - Databases: postgresql, mysql, mongodb, redis, elasticsearch
34
- - Infrastructure tools: prometheus, grafana, ingress-nginx, istio, knative
35
- - Operators: database operators, monitoring operators, backup operators
36
-
37
- ## Response Format
38
-
39
- Extract 3-8 specific concepts that organizational patterns might address. Focus on concepts that would have dedicated deployment patterns.
40
-
41
- ```json
42
- {
43
- "concepts": [
44
- {
45
- "category": "application_architecture|infrastructure|operational|technology",
46
- "concept": "specific concept name",
47
- "importance": "high|medium|low",
48
- "keywords": ["keyword1", "keyword2", "keyword3"]
49
- }
50
- ]
51
- }
52
- ```
53
-
54
- ## Examples
55
-
56
- **Input**: "deploy a stateless golang API that connects to PostgreSQL with auto-scaling"
57
- **Output**:
58
- ```json
59
- {
60
- "concepts": [
61
- {
62
- "category": "application_architecture",
63
- "concept": "stateless application",
64
- "importance": "high",
65
- "keywords": ["stateless", "stateless app", "stateless service", "stateless workload"]
66
- },
67
- {
68
- "category": "application_architecture",
69
- "concept": "REST API service",
70
- "importance": "high",
71
- "keywords": ["api", "rest api", "api service", "web service", "http service"]
72
- },
73
- {
74
- "category": "technology",
75
- "concept": "golang application",
76
- "importance": "medium",
77
- "keywords": ["golang", "go", "golang app", "go application", "go service"]
78
- },
79
- {
80
- "category": "infrastructure",
81
- "concept": "database connection",
82
- "importance": "high",
83
- "keywords": ["database", "postgresql", "db connection", "external database"]
84
- },
85
- {
86
- "category": "operational",
87
- "concept": "auto-scaling",
88
- "importance": "medium",
89
- "keywords": ["auto-scaling", "horizontal scaling", "scaling", "hpa"]
90
- }
91
- ]
92
- }
93
- ```
94
-
95
- **IMPORTANT**: Return ONLY the JSON object, nothing else.