@vfarcic/dot-ai 0.72.0 → 0.74.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 (74) hide show
  1. package/README.md +36 -1
  2. package/dist/core/capabilities.d.ts.map +1 -1
  3. package/dist/core/capabilities.js +6 -51
  4. package/dist/core/claude.d.ts +2 -0
  5. package/dist/core/claude.d.ts.map +1 -1
  6. package/dist/core/claude.js +24 -15
  7. package/dist/core/doc-testing-session.d.ts.map +1 -1
  8. package/dist/core/doc-testing-session.js +42 -60
  9. package/dist/core/index.d.ts +2 -2
  10. package/dist/core/index.d.ts.map +1 -1
  11. package/dist/core/index.js +4 -3
  12. package/dist/core/organizational-types.d.ts +43 -0
  13. package/dist/core/organizational-types.d.ts.map +1 -0
  14. package/dist/core/organizational-types.js +8 -0
  15. package/dist/core/pattern-types.d.ts +1 -10
  16. package/dist/core/pattern-types.d.ts.map +1 -1
  17. package/dist/core/policy-vector-service.d.ts +28 -0
  18. package/dist/core/policy-vector-service.d.ts.map +1 -0
  19. package/dist/core/policy-vector-service.js +64 -0
  20. package/dist/core/schema.d.ts +3 -5
  21. package/dist/core/schema.d.ts.map +1 -1
  22. package/dist/core/schema.js +85 -24
  23. package/dist/core/shared-prompt-loader.d.ts +13 -0
  24. package/dist/core/shared-prompt-loader.d.ts.map +1 -0
  25. package/dist/core/shared-prompt-loader.js +64 -0
  26. package/dist/core/unified-creation-session.d.ts +83 -0
  27. package/dist/core/unified-creation-session.d.ts.map +1 -0
  28. package/dist/core/unified-creation-session.js +943 -0
  29. package/dist/core/unified-creation-types.d.ts +58 -0
  30. package/dist/core/unified-creation-types.d.ts.map +1 -0
  31. package/dist/core/unified-creation-types.js +61 -0
  32. package/dist/core/vector-db-service.d.ts.map +1 -1
  33. package/dist/core/vector-db-service.js +10 -1
  34. package/dist/tools/answer-question.d.ts.map +1 -1
  35. package/dist/tools/answer-question.js +3 -4
  36. package/dist/tools/generate-manifests.d.ts.map +1 -1
  37. package/dist/tools/generate-manifests.js +25 -70
  38. package/dist/tools/organizational-data.d.ts +2 -2
  39. package/dist/tools/organizational-data.d.ts.map +1 -1
  40. package/dist/tools/organizational-data.js +650 -62
  41. package/dist/tools/version.d.ts +30 -3
  42. package/dist/tools/version.d.ts.map +1 -1
  43. package/dist/tools/version.js +200 -27
  44. package/package.json +3 -3
  45. package/prompts/infrastructure-trigger-expansion.md +26 -0
  46. package/prompts/infrastructure-triggers.md +11 -0
  47. package/prompts/kyverno-generation.md +317 -0
  48. package/prompts/pattern-complete-error.md +1 -0
  49. package/prompts/pattern-complete-success.md +8 -0
  50. package/prompts/pattern-created-by.md +1 -0
  51. package/prompts/pattern-description.md +7 -0
  52. package/prompts/pattern-rationale.md +1 -0
  53. package/prompts/pattern-resources.md +1 -0
  54. package/prompts/pattern-review.md +9 -0
  55. package/prompts/policy-complete-apply.md +12 -0
  56. package/prompts/policy-complete-discard.md +5 -0
  57. package/prompts/policy-complete-error.md +1 -0
  58. package/prompts/policy-complete-save.md +12 -0
  59. package/prompts/policy-complete-success.md +7 -0
  60. package/prompts/policy-created-by.md +1 -0
  61. package/prompts/policy-description.md +9 -0
  62. package/prompts/policy-namespace-scope.md +43 -0
  63. package/prompts/policy-rationale.md +1 -0
  64. package/prompts/question-generation.md +27 -0
  65. package/prompts/resource-selection.md +6 -2
  66. package/shared-prompts/manage-org-data.md +20 -9
  67. package/dist/core/pattern-creation-session.d.ts +0 -43
  68. package/dist/core/pattern-creation-session.d.ts.map +0 -1
  69. package/dist/core/pattern-creation-session.js +0 -312
  70. package/dist/core/pattern-creation-types.d.ts +0 -30
  71. package/dist/core/pattern-creation-types.d.ts.map +0 -1
  72. package/dist/core/pattern-creation-types.js +0 -8
  73. package/shared-prompts/context-load.md +0 -19
  74. package/shared-prompts/context-save.md +0 -24
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { Logger } from '../core/error-handling';
8
8
  export declare const VERSION_TOOL_NAME = "version";
9
- export declare const VERSION_TOOL_DESCRIPTION = "Get comprehensive system status including version information, Vector DB connection status, embedding service capabilities, Anthropic API connectivity, Kubernetes cluster connectivity, and pattern management health check";
9
+ export declare const VERSION_TOOL_DESCRIPTION = "Get comprehensive system status including version information, Vector DB connection status, embedding service capabilities, Anthropic API connectivity, Kubernetes cluster connectivity, Kyverno policy engine status, and pattern management health check";
10
10
  export declare const VERSION_TOOL_INPUT_SCHEMA: {};
11
11
  export interface VersionInfo {
12
12
  version: string;
@@ -19,9 +19,24 @@ export interface SystemStatus {
19
19
  vectorDB: {
20
20
  connected: boolean;
21
21
  url: string;
22
- collectionName: string;
23
22
  error?: string;
24
- patternsCount?: number;
23
+ collections: {
24
+ patterns: {
25
+ exists: boolean;
26
+ documentsCount?: number;
27
+ error?: string;
28
+ };
29
+ policies: {
30
+ exists: boolean;
31
+ documentsCount?: number;
32
+ error?: string;
33
+ };
34
+ capabilities: {
35
+ exists: boolean;
36
+ documentsCount?: number;
37
+ error?: string;
38
+ };
39
+ };
25
40
  };
26
41
  embedding: {
27
42
  available: boolean;
@@ -55,7 +70,19 @@ export interface SystemStatus {
55
70
  rawError?: string;
56
71
  lastDiagnosis: string;
57
72
  };
73
+ kyverno: {
74
+ installed: boolean;
75
+ version?: string;
76
+ webhookReady?: boolean;
77
+ policyGenerationReady: boolean;
78
+ error?: string;
79
+ reason?: string;
80
+ };
58
81
  }
82
+ /**
83
+ * Test Kyverno installation and readiness for policy generation
84
+ */
85
+ export declare function getKyvernoStatus(): Promise<SystemStatus['kyverno']>;
59
86
  /**
60
87
  * Get version information from package.json
61
88
  */
@@ -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;AAIhD,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,wBAAwB,iOAAiO,CAAC;AACvQ,eAAO,MAAM,yBA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sB,gBAAgB,IAAI,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAwIzE;AAiGD;;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,CAiFd"}
@@ -40,6 +40,7 @@ var __importStar = (this && this.__importStar) || (function () {
40
40
  })();
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  exports.VERSION_TOOL_INPUT_SCHEMA = exports.VERSION_TOOL_DESCRIPTION = exports.VERSION_TOOL_NAME = void 0;
43
+ exports.getKyvernoStatus = getKyvernoStatus;
43
44
  exports.getVersionInfo = getVersionInfo;
44
45
  exports.handleVersionTool = handleVersionTool;
45
46
  const fs_1 = require("fs");
@@ -47,48 +48,92 @@ const path_1 = require("path");
47
48
  const index_1 = require("../core/index");
48
49
  const kubernetes_utils_1 = require("../core/kubernetes-utils");
49
50
  exports.VERSION_TOOL_NAME = 'version';
50
- exports.VERSION_TOOL_DESCRIPTION = 'Get comprehensive system status including version information, Vector DB connection status, embedding service capabilities, Anthropic API connectivity, Kubernetes cluster connectivity, and pattern management health check';
51
+ exports.VERSION_TOOL_DESCRIPTION = 'Get comprehensive system status including version information, Vector DB connection status, embedding service capabilities, Anthropic API connectivity, Kubernetes cluster connectivity, Kyverno policy engine status, and pattern management health check';
51
52
  exports.VERSION_TOOL_INPUT_SCHEMA = {};
52
53
  /**
53
- * Test Vector DB connectivity and get status
54
+ * Test Vector DB connectivity and get status for all collections
54
55
  */
55
56
  async function getVectorDBStatus() {
56
- const vectorDB = new index_1.VectorDBService();
57
- const config = vectorDB.getConfig();
57
+ // Create a test service just to get connection config
58
+ const testVectorDB = new index_1.VectorDBService({ collectionName: 'test' });
59
+ const config = testVectorDB.getConfig();
58
60
  try {
59
- const isHealthy = await vectorDB.healthCheck();
61
+ // Test basic Vector DB connectivity (independent of collections)
62
+ const isHealthy = await testVectorDB.healthCheck();
60
63
  if (!isHealthy) {
61
64
  return {
62
65
  connected: false,
63
66
  url: config.url || 'unknown',
64
- collectionName: config.collectionName || 'patterns',
65
- error: 'Health check failed - Vector DB not responding'
67
+ error: 'Health check failed - Vector DB not responding',
68
+ collections: {
69
+ patterns: { exists: false, error: 'Vector DB not accessible' },
70
+ policies: { exists: false, error: 'Vector DB not accessible' },
71
+ capabilities: { exists: false, error: 'Vector DB not accessible' }
72
+ }
66
73
  };
67
74
  }
68
- // Try to get patterns count to verify collection access
75
+ // Test each collection separately
69
76
  const embeddingService = new index_1.EmbeddingService();
70
- const patternService = new index_1.PatternVectorService(vectorDB, embeddingService);
71
- let patternsCount;
72
- try {
73
- patternsCount = await patternService.getPatternsCount();
74
- }
75
- catch (error) {
76
- // Collection might not exist yet - that's okay
77
- patternsCount = 0;
78
- }
77
+ // Test patterns collection
78
+ const patternsStatus = await testCollectionStatus('patterns', () => {
79
+ const patternVectorDB = new index_1.VectorDBService({ collectionName: 'patterns' });
80
+ const patternService = new index_1.PatternVectorService(patternVectorDB, embeddingService);
81
+ return patternService.getPatternsCount();
82
+ });
83
+ // Test policies collection
84
+ const policiesStatus = await testCollectionStatus('policies', () => {
85
+ const policyVectorDB = new index_1.VectorDBService({ collectionName: 'policies' });
86
+ const policyService = new index_1.PolicyVectorService(policyVectorDB, embeddingService);
87
+ return policyService.getDataCount();
88
+ });
89
+ // Test capabilities collection
90
+ const capabilitiesStatus = await testCollectionStatus('capabilities', () => {
91
+ const capabilityService = new index_1.CapabilityVectorService();
92
+ return capabilityService.getCapabilitiesCount();
93
+ });
79
94
  return {
80
95
  connected: true,
81
96
  url: config.url || 'unknown',
82
- collectionName: config.collectionName || 'patterns',
83
- patternsCount
97
+ collections: {
98
+ patterns: patternsStatus,
99
+ policies: policiesStatus,
100
+ capabilities: capabilitiesStatus
101
+ }
84
102
  };
85
103
  }
86
104
  catch (error) {
87
105
  return {
88
106
  connected: false,
89
107
  url: config.url || 'unknown',
90
- collectionName: config.collectionName || 'patterns',
91
- error: error instanceof Error ? error.message : String(error)
108
+ error: error instanceof Error ? error.message : String(error),
109
+ collections: {
110
+ patterns: { exists: false, error: 'Vector DB connection failed' },
111
+ policies: { exists: false, error: 'Vector DB connection failed' },
112
+ capabilities: { exists: false, error: 'Vector DB connection failed' }
113
+ }
114
+ };
115
+ }
116
+ }
117
+ /**
118
+ * Helper function to test individual collection status
119
+ */
120
+ async function testCollectionStatus(collectionName, getCountFn) {
121
+ try {
122
+ const documentsCount = await getCountFn();
123
+ return {
124
+ exists: true,
125
+ documentsCount
126
+ };
127
+ }
128
+ catch (error) {
129
+ const errorMessage = error instanceof Error ? error.message : String(error);
130
+ // Check if error indicates collection doesn't exist (vs other errors)
131
+ const collectionNotExists = errorMessage.toLowerCase().includes('collection') &&
132
+ (errorMessage.toLowerCase().includes('not exist') ||
133
+ errorMessage.toLowerCase().includes('does not exist'));
134
+ return {
135
+ exists: false,
136
+ error: collectionNotExists ? `${collectionName} collection does not exist` : errorMessage
92
137
  };
93
138
  }
94
139
  }
@@ -196,6 +241,128 @@ async function getCapabilityStatus() {
196
241
  };
197
242
  }
198
243
  }
244
+ /**
245
+ * Test Kyverno installation and readiness for policy generation
246
+ */
247
+ async function getKyvernoStatus() {
248
+ const kubeconfig = process.env.KUBECONFIG || '~/.kube/config';
249
+ try {
250
+ // Check if Kyverno CRDs are installed
251
+ const crdOutput = await (0, kubernetes_utils_1.executeKubectl)(['get', 'crd', '--no-headers'], {
252
+ kubeconfig: kubeconfig,
253
+ timeout: 10000
254
+ });
255
+ const kyvernoCRDs = crdOutput.split('\n').filter(line => line.includes('kyverno.io') && (line.includes('clusterpolicies') ||
256
+ line.includes('policies') ||
257
+ line.includes('policyreports')));
258
+ if (kyvernoCRDs.length === 0) {
259
+ return {
260
+ installed: false,
261
+ policyGenerationReady: false,
262
+ reason: 'Kyverno CRDs not found in cluster - Kyverno is not installed'
263
+ };
264
+ }
265
+ // Check if Kyverno deployment is ready
266
+ let deploymentReady = false;
267
+ let webhookReady = false;
268
+ let version;
269
+ try {
270
+ const deploymentOutput = await (0, kubernetes_utils_1.executeKubectl)([
271
+ 'get', 'deployment', '-n', 'kyverno', '--no-headers'
272
+ ], { kubeconfig, timeout: 5000 });
273
+ // Check if kyverno deployment exists and is ready
274
+ const kyvernoDeployment = deploymentOutput.split('\n').find(line => line.trim().startsWith('kyverno'));
275
+ if (kyvernoDeployment) {
276
+ // Parse deployment status (format: NAME READY UP-TO-DATE AVAILABLE AGE)
277
+ const parts = kyvernoDeployment.trim().split(/\s+/);
278
+ const ready = parts[1]; // e.g., "1/1", "0/1"
279
+ if (ready && ready.includes('/')) {
280
+ const [current, desired] = ready.split('/');
281
+ deploymentReady = current === desired && current !== '0';
282
+ }
283
+ }
284
+ }
285
+ catch (error) {
286
+ // Kyverno might be in a different namespace or not exist
287
+ deploymentReady = false;
288
+ }
289
+ // Check admission controller webhook
290
+ try {
291
+ const webhookOutput = await (0, kubernetes_utils_1.executeKubectl)([
292
+ 'get', 'validatingwebhookconfigurations', '--no-headers'
293
+ ], { kubeconfig, timeout: 5000 });
294
+ webhookReady = webhookOutput.includes('kyverno-');
295
+ }
296
+ catch (error) {
297
+ webhookReady = false;
298
+ }
299
+ // Try to get version from deployment labels or image
300
+ try {
301
+ const deploymentDetails = await (0, kubernetes_utils_1.executeKubectl)([
302
+ 'get', 'deployment', 'kyverno', '-n', 'kyverno', '-o', 'jsonpath={.metadata.labels.version}'
303
+ ], { kubeconfig, timeout: 5000 });
304
+ if (deploymentDetails && deploymentDetails.trim()) {
305
+ version = deploymentDetails.trim();
306
+ }
307
+ else {
308
+ // Fallback: try to get version from image tag
309
+ const imageOutput = await (0, kubernetes_utils_1.executeKubectl)([
310
+ 'get', 'deployment', 'kyverno', '-n', 'kyverno', '-o', 'jsonpath={.spec.template.spec.containers[0].image}'
311
+ ], { kubeconfig, timeout: 5000 });
312
+ const imageMatch = imageOutput.match(/:v?([0-9]+\.[0-9]+\.[0-9]+)/);
313
+ if (imageMatch) {
314
+ version = imageMatch[1];
315
+ }
316
+ }
317
+ }
318
+ catch (error) {
319
+ // Version detection is optional
320
+ }
321
+ // Determine if policy generation is ready
322
+ const policyGenerationReady = deploymentReady && webhookReady;
323
+ if (!policyGenerationReady) {
324
+ let reason = 'Kyverno is partially installed but not fully operational';
325
+ if (!deploymentReady && !webhookReady) {
326
+ reason = 'Kyverno deployment and admission webhook are not ready';
327
+ }
328
+ else if (!deploymentReady) {
329
+ reason = 'Kyverno deployment is not ready';
330
+ }
331
+ else if (!webhookReady) {
332
+ reason = 'Kyverno admission webhook is not ready';
333
+ }
334
+ return {
335
+ installed: true,
336
+ version,
337
+ webhookReady,
338
+ policyGenerationReady,
339
+ reason
340
+ };
341
+ }
342
+ return {
343
+ installed: true,
344
+ version,
345
+ webhookReady: true,
346
+ policyGenerationReady: true
347
+ };
348
+ }
349
+ catch (error) {
350
+ const errorMessage = error instanceof Error ? error.message : String(error);
351
+ // If Kubernetes is not available, we can't detect Kyverno
352
+ if (errorMessage.includes('ECONNREFUSED') || errorMessage.includes('connection refused')) {
353
+ return {
354
+ installed: false,
355
+ policyGenerationReady: false,
356
+ error: 'Cannot detect Kyverno - Kubernetes cluster is not accessible'
357
+ };
358
+ }
359
+ return {
360
+ installed: false,
361
+ policyGenerationReady: false,
362
+ error: `Kyverno detection failed: ${errorMessage}`
363
+ };
364
+ }
365
+ }
199
366
  /**
200
367
  * Test Kubernetes cluster connectivity
201
368
  */
@@ -316,12 +483,13 @@ async function handleVersionTool(args, logger, requestId) {
316
483
  const version = getVersionInfo();
317
484
  // Run all diagnostics in parallel for better performance
318
485
  logger.info('Running system diagnostics...', { requestId });
319
- const [vectorDBStatus, embeddingStatus, anthropicStatus, kubernetesStatus, capabilityStatus] = await Promise.all([
486
+ const [vectorDBStatus, embeddingStatus, anthropicStatus, kubernetesStatus, capabilityStatus, kyvernoStatus] = await Promise.all([
320
487
  getVectorDBStatus(),
321
488
  getEmbeddingStatus(),
322
489
  getAnthropicStatus(),
323
490
  getKubernetesStatus(),
324
- getCapabilityStatus()
491
+ getCapabilityStatus(),
492
+ getKyvernoStatus()
325
493
  ]);
326
494
  const systemStatus = {
327
495
  version,
@@ -329,7 +497,8 @@ async function handleVersionTool(args, logger, requestId) {
329
497
  embedding: embeddingStatus,
330
498
  anthropic: anthropicStatus,
331
499
  kubernetes: kubernetesStatus,
332
- capabilities: capabilityStatus
500
+ capabilities: capabilityStatus,
501
+ kyverno: kyvernoStatus
333
502
  };
334
503
  // Log summary of system health
335
504
  logger.info('System diagnostics completed', {
@@ -339,7 +508,8 @@ async function handleVersionTool(args, logger, requestId) {
339
508
  embeddingAvailable: embeddingStatus.available,
340
509
  anthropicConnected: anthropicStatus.connected,
341
510
  kubernetesConnected: kubernetesStatus.connected,
342
- capabilitySystemReady: capabilityStatus.systemReady
511
+ capabilitySystemReady: capabilityStatus.systemReady,
512
+ kyvernoReady: kyvernoStatus.policyGenerationReady
343
513
  });
344
514
  return {
345
515
  content: [{
@@ -352,12 +522,15 @@ async function handleVersionTool(args, logger, requestId) {
352
522
  patternSearch: embeddingStatus.available ? 'semantic+keyword' : 'keyword-only',
353
523
  capabilityScanning: capabilityStatus.systemReady && kubernetesStatus.connected ? 'ready' : 'not-ready',
354
524
  kubernetesAccess: kubernetesStatus.connected ? 'connected' : 'disconnected',
525
+ policyGeneration: kyvernoStatus.policyGenerationReady ? 'ready' : 'not-ready',
355
526
  capabilities: [
356
- vectorDBStatus.connected ? 'pattern-management' : null,
527
+ vectorDBStatus.connected && vectorDBStatus.collections.patterns.exists ? 'pattern-management' : null,
528
+ vectorDBStatus.connected && vectorDBStatus.collections.policies.exists ? 'policy-management' : null,
357
529
  capabilityStatus.systemReady && kubernetesStatus.connected ? 'capability-scanning' : null,
358
530
  embeddingStatus.available ? 'semantic-search' : null,
359
531
  anthropicStatus.connected ? 'ai-recommendations' : null,
360
- kubernetesStatus.connected ? 'kubernetes-integration' : null
532
+ kubernetesStatus.connected ? 'kubernetes-integration' : null,
533
+ kyvernoStatus.policyGenerationReady ? 'policy-generation' : null
361
534
  ].filter(Boolean)
362
535
  },
363
536
  timestamp: new Date().toISOString()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vfarcic/dot-ai",
3
- "version": "0.72.0",
3
+ "version": "0.74.0",
4
4
  "description": "AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -83,11 +83,11 @@
83
83
  "typescript": "^5.0.0"
84
84
  },
85
85
  "dependencies": {
86
- "@anthropic-ai/sdk": "^0.27.0",
86
+ "@anthropic-ai/sdk": "^0.60.0",
87
87
  "@kubernetes/client-node": "^1.3.0",
88
88
  "@modelcontextprotocol/sdk": "^1.13.2",
89
89
  "@qdrant/js-client-rest": "^1.15.0",
90
- "@vfarcic/dot-ai": "^0.34.0",
90
+ "@vfarcic/dot-ai": "^0.73.0",
91
91
  "glob": "^11.0.3",
92
92
  "openai": "^5.11.0",
93
93
  "yaml": "^2.8.0"
@@ -0,0 +1,26 @@
1
+ Expand these infrastructure type triggers: {initialTriggers}
2
+
3
+ Context: {description}
4
+
5
+ Generate additional infrastructure type keywords that are:
6
+ 1. **Alternative names** for the same infrastructure types (e.g., "storage" → "volumes", "persistent storage")
7
+ 2. **Related infrastructure categories** that would need the same governance approach
8
+ 3. **Infrastructure synonyms** (e.g., "load balancers" → "ingresses", "networking" → "services")
9
+
10
+ Rules:
11
+ - Return only ADDITIONAL triggers (not the original ones)
12
+ - Focus on infrastructure/resource types, not technical field names or implementation details
13
+ - Return as comma-separated list
14
+ - If no relevant additions exist, return empty response
15
+
16
+ Examples:
17
+ Input: "database"
18
+ Output: "databases, data store, SQL database, NoSQL, persistent storage"
19
+
20
+ Input: "networking"
21
+ Output: "network policies, services, ingresses, load balancers, DNS"
22
+
23
+ Input: "storage"
24
+ Output: "persistent volumes, volumes, backup systems, storage classes"
25
+
26
+ Return only the comma-separated list of additional triggers:
@@ -0,0 +1,11 @@
1
+ Ask the user: "What types of infrastructure should this apply to? Think about the categories of resources and systems this covers, not technical implementation details.
2
+
3
+ Examples by domain:
4
+ - **Applications**: web applications, microservices, APIs, frontends, backends
5
+ - **Databases**: databases, SQL databases, NoSQL, data stores, persistent storage
6
+ - **Networking**: load balancers, ingresses, services, network policies, DNS
7
+ - **Storage**: persistent volumes, storage classes, backup systems
8
+ - **Security**: secrets, certificates, authentication, authorization, RBAC
9
+ - **Infrastructure**: clusters, nodes, compute resources, cloud resources
10
+
11
+ Please provide infrastructure type keywords separated by commas (avoid field names like 'image', 'tag', or specific values like 'latest')."