mcp-adr-analysis-server 1.1.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/LICENSE +21 -0
- package/README.md +608 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +1722 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/prompts/adr-suggestion-prompts.d.ts +24 -0
- package/dist/src/prompts/adr-suggestion-prompts.d.ts.map +1 -0
- package/dist/src/prompts/adr-suggestion-prompts.js +383 -0
- package/dist/src/prompts/adr-suggestion-prompts.js.map +1 -0
- package/dist/src/prompts/analysis-prompts.d.ts +24 -0
- package/dist/src/prompts/analysis-prompts.d.ts.map +1 -0
- package/dist/src/prompts/analysis-prompts.js +489 -0
- package/dist/src/prompts/analysis-prompts.js.map +1 -0
- package/dist/src/prompts/deployment-analysis-prompts.d.ts +54 -0
- package/dist/src/prompts/deployment-analysis-prompts.d.ts.map +1 -0
- package/dist/src/prompts/deployment-analysis-prompts.js +712 -0
- package/dist/src/prompts/deployment-analysis-prompts.js.map +1 -0
- package/dist/src/prompts/environment-analysis-prompts.d.ts +34 -0
- package/dist/src/prompts/environment-analysis-prompts.d.ts.map +1 -0
- package/dist/src/prompts/environment-analysis-prompts.js +724 -0
- package/dist/src/prompts/environment-analysis-prompts.js.map +1 -0
- package/dist/src/prompts/index.d.ts +43 -0
- package/dist/src/prompts/index.d.ts.map +1 -0
- package/dist/src/prompts/index.js +384 -0
- package/dist/src/prompts/index.js.map +1 -0
- package/dist/src/prompts/research-integration-prompts.d.ts +43 -0
- package/dist/src/prompts/research-integration-prompts.d.ts.map +1 -0
- package/dist/src/prompts/research-integration-prompts.js +398 -0
- package/dist/src/prompts/research-integration-prompts.js.map +1 -0
- package/dist/src/prompts/research-question-prompts.d.ts +75 -0
- package/dist/src/prompts/research-question-prompts.d.ts.map +1 -0
- package/dist/src/prompts/research-question-prompts.js +695 -0
- package/dist/src/prompts/research-question-prompts.js.map +1 -0
- package/dist/src/prompts/rule-generation-prompts.d.ts +63 -0
- package/dist/src/prompts/rule-generation-prompts.d.ts.map +1 -0
- package/dist/src/prompts/rule-generation-prompts.js +630 -0
- package/dist/src/prompts/rule-generation-prompts.js.map +1 -0
- package/dist/src/prompts/security-prompts.d.ts +23 -0
- package/dist/src/prompts/security-prompts.d.ts.map +1 -0
- package/dist/src/prompts/security-prompts.js +287 -0
- package/dist/src/prompts/security-prompts.js.map +1 -0
- package/dist/src/resources/index.d.ts +24 -0
- package/dist/src/resources/index.d.ts.map +1 -0
- package/dist/src/resources/index.js +458 -0
- package/dist/src/resources/index.js.map +1 -0
- package/dist/src/tools/adr-suggestion-tool.d.ts +40 -0
- package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -0
- package/dist/src/tools/adr-suggestion-tool.js +338 -0
- package/dist/src/tools/adr-suggestion-tool.js.map +1 -0
- package/dist/src/tools/content-masking-tool.d.ts +52 -0
- package/dist/src/tools/content-masking-tool.d.ts.map +1 -0
- package/dist/src/tools/content-masking-tool.js +206 -0
- package/dist/src/tools/content-masking-tool.js.map +1 -0
- package/dist/src/tools/deployment-analysis-tool.d.ts +39 -0
- package/dist/src/tools/deployment-analysis-tool.d.ts.map +1 -0
- package/dist/src/tools/deployment-analysis-tool.js +310 -0
- package/dist/src/tools/deployment-analysis-tool.js.map +1 -0
- package/dist/src/tools/environment-analysis-tool.d.ts +16 -0
- package/dist/src/tools/environment-analysis-tool.d.ts.map +1 -0
- package/dist/src/tools/environment-analysis-tool.js +298 -0
- package/dist/src/tools/environment-analysis-tool.js.map +1 -0
- package/dist/src/tools/research-integration-tool.d.ts +44 -0
- package/dist/src/tools/research-integration-tool.d.ts.map +1 -0
- package/dist/src/tools/research-integration-tool.js +429 -0
- package/dist/src/tools/research-integration-tool.js.map +1 -0
- package/dist/src/tools/research-question-tool.d.ts +55 -0
- package/dist/src/tools/research-question-tool.d.ts.map +1 -0
- package/dist/src/tools/research-question-tool.js +333 -0
- package/dist/src/tools/research-question-tool.js.map +1 -0
- package/dist/src/tools/rule-generation-tool.d.ts +49 -0
- package/dist/src/tools/rule-generation-tool.d.ts.map +1 -0
- package/dist/src/tools/rule-generation-tool.js +432 -0
- package/dist/src/tools/rule-generation-tool.js.map +1 -0
- package/dist/src/types/index.d.ts +531 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +129 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/utils/adr-suggestions.d.ts +104 -0
- package/dist/src/utils/adr-suggestions.d.ts.map +1 -0
- package/dist/src/utils/adr-suggestions.js +228 -0
- package/dist/src/utils/adr-suggestions.js.map +1 -0
- package/dist/src/utils/cache.d.ts +51 -0
- package/dist/src/utils/cache.d.ts.map +1 -0
- package/dist/src/utils/cache.js +243 -0
- package/dist/src/utils/cache.js.map +1 -0
- package/dist/src/utils/config.d.ts +65 -0
- package/dist/src/utils/config.d.ts.map +1 -0
- package/dist/src/utils/config.js +118 -0
- package/dist/src/utils/config.js.map +1 -0
- package/dist/src/utils/content-masking.d.ts +79 -0
- package/dist/src/utils/content-masking.d.ts.map +1 -0
- package/dist/src/utils/content-masking.js +203 -0
- package/dist/src/utils/content-masking.js.map +1 -0
- package/dist/src/utils/deployment-analysis.d.ts +67 -0
- package/dist/src/utils/deployment-analysis.d.ts.map +1 -0
- package/dist/src/utils/deployment-analysis.js +263 -0
- package/dist/src/utils/deployment-analysis.js.map +1 -0
- package/dist/src/utils/environment-analysis.d.ts +76 -0
- package/dist/src/utils/environment-analysis.d.ts.map +1 -0
- package/dist/src/utils/environment-analysis.js +329 -0
- package/dist/src/utils/environment-analysis.js.map +1 -0
- package/dist/src/utils/file-system.d.ts +63 -0
- package/dist/src/utils/file-system.d.ts.map +1 -0
- package/dist/src/utils/file-system.js +189 -0
- package/dist/src/utils/file-system.js.map +1 -0
- package/dist/src/utils/output-masking.d.ts +45 -0
- package/dist/src/utils/output-masking.d.ts.map +1 -0
- package/dist/src/utils/output-masking.js +200 -0
- package/dist/src/utils/output-masking.js.map +1 -0
- package/dist/src/utils/research-documentation.d.ts +58 -0
- package/dist/src/utils/research-documentation.d.ts.map +1 -0
- package/dist/src/utils/research-documentation.js +438 -0
- package/dist/src/utils/research-documentation.js.map +1 -0
- package/dist/src/utils/research-integration.d.ts +89 -0
- package/dist/src/utils/research-integration.d.ts.map +1 -0
- package/dist/src/utils/research-integration.js +432 -0
- package/dist/src/utils/research-integration.js.map +1 -0
- package/dist/src/utils/research-questions.d.ts +97 -0
- package/dist/src/utils/research-questions.d.ts.map +1 -0
- package/dist/src/utils/research-questions.js +319 -0
- package/dist/src/utils/research-questions.js.map +1 -0
- package/dist/src/utils/rule-format.d.ts +76 -0
- package/dist/src/utils/rule-format.d.ts.map +1 -0
- package/dist/src/utils/rule-format.js +257 -0
- package/dist/src/utils/rule-format.js.map +1 -0
- package/dist/src/utils/rule-generation.d.ts +86 -0
- package/dist/src/utils/rule-generation.d.ts.map +1 -0
- package/dist/src/utils/rule-generation.js +330 -0
- package/dist/src/utils/rule-generation.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,724 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI prompts for environment context analysis
|
|
3
|
+
* Following prompt-driven development approach
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* AI prompt for analyzing system environment specifications
|
|
7
|
+
*/
|
|
8
|
+
export function generateEnvironmentSpecAnalysisPrompt(environmentFiles, projectStructure) {
|
|
9
|
+
return `
|
|
10
|
+
# System Environment Specification Analysis
|
|
11
|
+
|
|
12
|
+
Please analyze the following environment specifications and project structure to understand the deployment environment and infrastructure requirements.
|
|
13
|
+
|
|
14
|
+
## Environment Files
|
|
15
|
+
${environmentFiles
|
|
16
|
+
.map((file, index) => `
|
|
17
|
+
### ${index + 1}. ${file.filename} (${file.type})
|
|
18
|
+
\`\`\`
|
|
19
|
+
${file.content.slice(0, 1500)}${file.content.length > 1500 ? '\n... (truncated for analysis)' : ''}
|
|
20
|
+
\`\`\`
|
|
21
|
+
`)
|
|
22
|
+
.join('')}
|
|
23
|
+
|
|
24
|
+
## Project Structure
|
|
25
|
+
\`\`\`
|
|
26
|
+
${projectStructure}
|
|
27
|
+
\`\`\`
|
|
28
|
+
|
|
29
|
+
## Analysis Requirements
|
|
30
|
+
|
|
31
|
+
Please analyze the environment specifications for:
|
|
32
|
+
|
|
33
|
+
### 🏗️ **Infrastructure Components**
|
|
34
|
+
- **Compute Resources**: CPU, memory, storage requirements
|
|
35
|
+
- **Network Configuration**: Ports, protocols, load balancing
|
|
36
|
+
- **Storage Systems**: Databases, file systems, caching layers
|
|
37
|
+
- **Security Components**: Authentication, authorization, encryption
|
|
38
|
+
- **Monitoring & Logging**: Observability infrastructure
|
|
39
|
+
- **Backup & Recovery**: Data protection mechanisms
|
|
40
|
+
|
|
41
|
+
### 🐳 **Containerization Analysis**
|
|
42
|
+
- **Container Technology**: Docker, Podman, containerd
|
|
43
|
+
- **Orchestration Platform**: Kubernetes, Docker Swarm, ECS
|
|
44
|
+
- **Image Management**: Base images, multi-stage builds, registries
|
|
45
|
+
- **Resource Limits**: CPU, memory, storage constraints
|
|
46
|
+
- **Health Checks**: Liveness, readiness, startup probes
|
|
47
|
+
- **Networking**: Service mesh, ingress, load balancing
|
|
48
|
+
|
|
49
|
+
### ☁️ **Cloud & Platform Services**
|
|
50
|
+
- **Cloud Provider**: AWS, Azure, GCP, hybrid, on-premises
|
|
51
|
+
- **Platform Services**: Managed databases, message queues, caches
|
|
52
|
+
- **Serverless Components**: Functions, event-driven architecture
|
|
53
|
+
- **CDN & Edge**: Content delivery, edge computing
|
|
54
|
+
- **Identity & Access**: IAM, service accounts, RBAC
|
|
55
|
+
- **Compliance**: Security standards, regulatory requirements
|
|
56
|
+
|
|
57
|
+
### 🔧 **Configuration Management**
|
|
58
|
+
- **Environment Variables**: Configuration patterns and security
|
|
59
|
+
- **Secrets Management**: Credential storage and rotation
|
|
60
|
+
- **Feature Flags**: Dynamic configuration capabilities
|
|
61
|
+
- **Service Discovery**: How services find and communicate
|
|
62
|
+
- **Configuration Sources**: Files, databases, external services
|
|
63
|
+
- **Environment Promotion**: Dev, staging, production workflows
|
|
64
|
+
|
|
65
|
+
## Output Format
|
|
66
|
+
|
|
67
|
+
Please provide your analysis in the following JSON format:
|
|
68
|
+
|
|
69
|
+
\`\`\`json
|
|
70
|
+
{
|
|
71
|
+
"environmentAnalysis": {
|
|
72
|
+
"environmentType": "containerized|serverless|traditional|hybrid",
|
|
73
|
+
"complexity": "simple|moderate|complex|enterprise",
|
|
74
|
+
"maturity": "prototype|development|production|enterprise",
|
|
75
|
+
"cloudNative": true/false,
|
|
76
|
+
"scalabilityPattern": "vertical|horizontal|auto|manual"
|
|
77
|
+
},
|
|
78
|
+
"infrastructure": {
|
|
79
|
+
"compute": {
|
|
80
|
+
"type": "containers|vms|bare_metal|serverless",
|
|
81
|
+
"orchestration": "kubernetes|docker_swarm|ecs|none",
|
|
82
|
+
"resourceRequirements": {
|
|
83
|
+
"cpu": "detected CPU requirements",
|
|
84
|
+
"memory": "detected memory requirements",
|
|
85
|
+
"storage": "detected storage requirements"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"networking": {
|
|
89
|
+
"loadBalancer": "detected load balancer type",
|
|
90
|
+
"serviceMesh": "detected service mesh",
|
|
91
|
+
"ingress": "detected ingress configuration",
|
|
92
|
+
"ports": ["exposed ports"]
|
|
93
|
+
},
|
|
94
|
+
"storage": {
|
|
95
|
+
"databases": ["detected database systems"],
|
|
96
|
+
"caching": ["detected caching systems"],
|
|
97
|
+
"fileStorage": ["detected file storage systems"],
|
|
98
|
+
"persistence": "persistent|ephemeral|mixed"
|
|
99
|
+
},
|
|
100
|
+
"security": {
|
|
101
|
+
"authentication": ["detected auth mechanisms"],
|
|
102
|
+
"authorization": ["detected authz systems"],
|
|
103
|
+
"encryption": ["detected encryption methods"],
|
|
104
|
+
"secrets": ["detected secret management"]
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"containerization": {
|
|
108
|
+
"technology": "docker|podman|containerd|none",
|
|
109
|
+
"baseImages": ["detected base images"],
|
|
110
|
+
"buildStrategy": "single_stage|multi_stage|distroless",
|
|
111
|
+
"registries": ["detected container registries"],
|
|
112
|
+
"healthChecks": true/false,
|
|
113
|
+
"resourceLimits": true/false,
|
|
114
|
+
"securityScanning": true/false
|
|
115
|
+
},
|
|
116
|
+
"cloudServices": {
|
|
117
|
+
"provider": "aws|azure|gcp|multi_cloud|on_premises|hybrid",
|
|
118
|
+
"managedServices": ["detected managed services"],
|
|
119
|
+
"serverlessComponents": ["detected serverless functions"],
|
|
120
|
+
"platformServices": ["detected platform services"],
|
|
121
|
+
"complianceFrameworks": ["detected compliance requirements"]
|
|
122
|
+
},
|
|
123
|
+
"configuration": {
|
|
124
|
+
"environmentVariables": true/false,
|
|
125
|
+
"secretsManagement": "kubernetes|vault|cloud_native|files",
|
|
126
|
+
"configMaps": true/false,
|
|
127
|
+
"featureFlags": true/false,
|
|
128
|
+
"serviceDiscovery": "dns|service_mesh|registry|manual"
|
|
129
|
+
},
|
|
130
|
+
"qualityAttributes": {
|
|
131
|
+
"availability": "high|medium|low|unknown",
|
|
132
|
+
"scalability": "high|medium|low|unknown",
|
|
133
|
+
"performance": "high|medium|low|unknown",
|
|
134
|
+
"security": "high|medium|low|unknown",
|
|
135
|
+
"maintainability": "high|medium|low|unknown",
|
|
136
|
+
"observability": "high|medium|low|unknown"
|
|
137
|
+
},
|
|
138
|
+
"recommendations": [
|
|
139
|
+
{
|
|
140
|
+
"category": "infrastructure|security|performance|scalability|maintainability",
|
|
141
|
+
"priority": "critical|high|medium|low",
|
|
142
|
+
"description": "specific recommendation",
|
|
143
|
+
"rationale": "why this recommendation is important",
|
|
144
|
+
"implementation": "how to implement this recommendation",
|
|
145
|
+
"effort": "low|medium|high",
|
|
146
|
+
"impact": "low|medium|high|critical"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"gaps": [
|
|
150
|
+
{
|
|
151
|
+
"area": "missing or inadequate area",
|
|
152
|
+
"description": "what's missing or inadequate",
|
|
153
|
+
"risk": "potential risk if not addressed",
|
|
154
|
+
"suggestion": "suggested improvement"
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
\`\`\`
|
|
159
|
+
|
|
160
|
+
## Analysis Guidelines
|
|
161
|
+
|
|
162
|
+
1. **Comprehensive Coverage**: Analyze all aspects of the environment
|
|
163
|
+
2. **Evidence-Based**: Base conclusions on actual configuration files
|
|
164
|
+
3. **Best Practices**: Compare against industry best practices
|
|
165
|
+
4. **Security Focus**: Pay special attention to security configurations
|
|
166
|
+
5. **Scalability Assessment**: Evaluate scalability patterns and limitations
|
|
167
|
+
6. **Practical Recommendations**: Provide actionable improvement suggestions
|
|
168
|
+
|
|
169
|
+
Please provide a thorough analysis of the environment specifications and infrastructure.
|
|
170
|
+
`;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* AI prompt for detecting containerization technologies
|
|
174
|
+
*/
|
|
175
|
+
export function generateContainerizationDetectionPrompt(projectFiles) {
|
|
176
|
+
return `
|
|
177
|
+
# Containerization Technology Detection
|
|
178
|
+
|
|
179
|
+
Please analyze the following project files to detect containerization technologies, patterns, and configurations.
|
|
180
|
+
|
|
181
|
+
## Project Files
|
|
182
|
+
${projectFiles
|
|
183
|
+
.map((file, index) => `
|
|
184
|
+
### ${index + 1}. ${file.filename}
|
|
185
|
+
**Path**: ${file.path}
|
|
186
|
+
\`\`\`
|
|
187
|
+
${file.content.slice(0, 1000)}${file.content.length > 1000 ? '\n... (truncated)' : ''}
|
|
188
|
+
\`\`\`
|
|
189
|
+
`)
|
|
190
|
+
.join('')}
|
|
191
|
+
|
|
192
|
+
## Detection Requirements
|
|
193
|
+
|
|
194
|
+
Please identify:
|
|
195
|
+
|
|
196
|
+
### 🐳 **Container Technologies**
|
|
197
|
+
- **Docker**: Dockerfile, docker-compose.yml, .dockerignore
|
|
198
|
+
- **Podman**: Containerfile, podman-compose
|
|
199
|
+
- **Buildah**: Build scripts and configurations
|
|
200
|
+
- **Container Registries**: Registry configurations and references
|
|
201
|
+
- **Base Images**: Detected base images and versions
|
|
202
|
+
|
|
203
|
+
### 🎛️ **Orchestration Platforms**
|
|
204
|
+
- **Kubernetes**: Manifests, Helm charts, operators
|
|
205
|
+
- **Docker Swarm**: Stack files and swarm configurations
|
|
206
|
+
- **Amazon ECS**: Task definitions and service configurations
|
|
207
|
+
- **Azure Container Instances**: Container group definitions
|
|
208
|
+
- **Google Cloud Run**: Service configurations
|
|
209
|
+
|
|
210
|
+
### 🔧 **Build & Deployment**
|
|
211
|
+
- **Multi-stage Builds**: Optimization patterns
|
|
212
|
+
- **Build Tools**: BuildKit, Kaniko, Jib
|
|
213
|
+
- **CI/CD Integration**: Pipeline configurations
|
|
214
|
+
- **Image Scanning**: Security scanning tools
|
|
215
|
+
- **Registry Management**: Push/pull configurations
|
|
216
|
+
|
|
217
|
+
### 📊 **Resource Management**
|
|
218
|
+
- **Resource Limits**: CPU, memory constraints
|
|
219
|
+
- **Health Checks**: Liveness, readiness probes
|
|
220
|
+
- **Scaling Policies**: Horizontal/vertical scaling
|
|
221
|
+
- **Storage Mounts**: Volume and storage configurations
|
|
222
|
+
- **Network Policies**: Container networking rules
|
|
223
|
+
|
|
224
|
+
## Output Format
|
|
225
|
+
|
|
226
|
+
Please provide your analysis in the following JSON format:
|
|
227
|
+
|
|
228
|
+
\`\`\`json
|
|
229
|
+
{
|
|
230
|
+
"containerization": {
|
|
231
|
+
"detected": true/false,
|
|
232
|
+
"technology": "docker|podman|buildah|multiple|none",
|
|
233
|
+
"maturity": "basic|intermediate|advanced|enterprise",
|
|
234
|
+
"orchestration": "kubernetes|docker_swarm|ecs|cloud_run|none"
|
|
235
|
+
},
|
|
236
|
+
"dockerfiles": [
|
|
237
|
+
{
|
|
238
|
+
"path": "path to dockerfile",
|
|
239
|
+
"baseImage": "detected base image",
|
|
240
|
+
"stages": "single|multi",
|
|
241
|
+
"optimization": "basic|optimized|distroless",
|
|
242
|
+
"securityPractices": ["detected security practices"],
|
|
243
|
+
"issues": ["identified issues or improvements"]
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
"composeFiles": [
|
|
247
|
+
{
|
|
248
|
+
"path": "path to compose file",
|
|
249
|
+
"version": "compose file version",
|
|
250
|
+
"services": ["service names"],
|
|
251
|
+
"networks": ["network configurations"],
|
|
252
|
+
"volumes": ["volume configurations"],
|
|
253
|
+
"secrets": ["secret configurations"]
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
"kubernetesManifests": [
|
|
257
|
+
{
|
|
258
|
+
"path": "path to manifest",
|
|
259
|
+
"kind": "Deployment|Service|ConfigMap|Secret|etc",
|
|
260
|
+
"apiVersion": "kubernetes api version",
|
|
261
|
+
"resourceLimits": true/false,
|
|
262
|
+
"healthChecks": true/false,
|
|
263
|
+
"securityContext": true/false
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
"buildConfiguration": {
|
|
267
|
+
"multistage": true/false,
|
|
268
|
+
"optimization": "none|basic|advanced",
|
|
269
|
+
"securityScanning": true/false,
|
|
270
|
+
"registryIntegration": true/false,
|
|
271
|
+
"cicdIntegration": true/false
|
|
272
|
+
},
|
|
273
|
+
"resourceManagement": {
|
|
274
|
+
"cpuLimits": true/false,
|
|
275
|
+
"memoryLimits": true/false,
|
|
276
|
+
"storageConfiguration": true/false,
|
|
277
|
+
"networkPolicies": true/false,
|
|
278
|
+
"scalingPolicies": true/false
|
|
279
|
+
},
|
|
280
|
+
"bestPractices": {
|
|
281
|
+
"nonRootUser": true/false,
|
|
282
|
+
"minimalBaseImage": true/false,
|
|
283
|
+
"layerOptimization": true/false,
|
|
284
|
+
"secretsManagement": true/false,
|
|
285
|
+
"healthChecks": true/false,
|
|
286
|
+
"resourceLimits": true/false
|
|
287
|
+
},
|
|
288
|
+
"recommendations": [
|
|
289
|
+
{
|
|
290
|
+
"category": "security|performance|optimization|best_practices",
|
|
291
|
+
"priority": "critical|high|medium|low",
|
|
292
|
+
"description": "specific recommendation",
|
|
293
|
+
"currentState": "what was detected",
|
|
294
|
+
"improvedState": "what should be implemented",
|
|
295
|
+
"implementation": "how to implement"
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
"securityFindings": [
|
|
299
|
+
{
|
|
300
|
+
"severity": "critical|high|medium|low|info",
|
|
301
|
+
"finding": "security issue description",
|
|
302
|
+
"location": "file and line if applicable",
|
|
303
|
+
"remediation": "how to fix this issue"
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
\`\`\`
|
|
308
|
+
|
|
309
|
+
## Detection Guidelines
|
|
310
|
+
|
|
311
|
+
1. **Thorough Scanning**: Check all relevant file types and patterns
|
|
312
|
+
2. **Version Detection**: Identify specific versions where possible
|
|
313
|
+
3. **Security Assessment**: Evaluate security configurations and practices
|
|
314
|
+
4. **Best Practice Comparison**: Compare against industry standards
|
|
315
|
+
5. **Practical Recommendations**: Provide actionable improvement suggestions
|
|
316
|
+
6. **Risk Assessment**: Identify security and operational risks
|
|
317
|
+
|
|
318
|
+
Please provide comprehensive containerization technology detection and analysis.
|
|
319
|
+
`;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* AI prompt for determining environment requirements from ADRs
|
|
323
|
+
*/
|
|
324
|
+
export function generateAdrEnvironmentRequirementsPrompt(adrFiles) {
|
|
325
|
+
return `
|
|
326
|
+
# Environment Requirements Analysis from ADRs
|
|
327
|
+
|
|
328
|
+
Please analyze the following Architectural Decision Records to extract environment and infrastructure requirements.
|
|
329
|
+
|
|
330
|
+
## ADR Files
|
|
331
|
+
${adrFiles
|
|
332
|
+
.map((adr, index) => `
|
|
333
|
+
### ${index + 1}. ${adr.title}
|
|
334
|
+
**ID**: ${adr.id}
|
|
335
|
+
**Status**: ${adr.status}
|
|
336
|
+
|
|
337
|
+
**Content**:
|
|
338
|
+
\`\`\`markdown
|
|
339
|
+
${adr.content.slice(0, 1200)}${adr.content.length > 1200 ? '\n... (truncated)' : ''}
|
|
340
|
+
\`\`\`
|
|
341
|
+
`)
|
|
342
|
+
.join('')}
|
|
343
|
+
|
|
344
|
+
## Requirements Extraction
|
|
345
|
+
|
|
346
|
+
Please identify environment requirements in these categories:
|
|
347
|
+
|
|
348
|
+
### 🏗️ **Infrastructure Requirements**
|
|
349
|
+
- **Compute**: CPU, memory, processing requirements
|
|
350
|
+
- **Storage**: Database, file storage, backup needs
|
|
351
|
+
- **Network**: Bandwidth, latency, connectivity requirements
|
|
352
|
+
- **Security**: Compliance, encryption, access control
|
|
353
|
+
- **Availability**: Uptime, disaster recovery, redundancy
|
|
354
|
+
- **Scalability**: Growth patterns, load handling
|
|
355
|
+
|
|
356
|
+
### 🐳 **Platform Requirements**
|
|
357
|
+
- **Container Orchestration**: Kubernetes, Docker Swarm needs
|
|
358
|
+
- **Cloud Services**: Managed services, serverless requirements
|
|
359
|
+
- **Runtime Environment**: Language runtimes, frameworks
|
|
360
|
+
- **Database Systems**: SQL, NoSQL, caching requirements
|
|
361
|
+
- **Message Queues**: Async communication needs
|
|
362
|
+
- **Monitoring**: Observability and alerting requirements
|
|
363
|
+
|
|
364
|
+
### 🔒 **Security & Compliance**
|
|
365
|
+
- **Data Protection**: Encryption, privacy requirements
|
|
366
|
+
- **Access Control**: Authentication, authorization needs
|
|
367
|
+
- **Compliance Standards**: GDPR, HIPAA, SOC2, etc.
|
|
368
|
+
- **Network Security**: Firewalls, VPNs, segmentation
|
|
369
|
+
- **Audit & Logging**: Compliance logging requirements
|
|
370
|
+
- **Vulnerability Management**: Security scanning needs
|
|
371
|
+
|
|
372
|
+
### 📊 **Performance & Scalability**
|
|
373
|
+
- **Response Time**: Latency requirements
|
|
374
|
+
- **Throughput**: Transaction volume handling
|
|
375
|
+
- **Concurrent Users**: User load requirements
|
|
376
|
+
- **Data Volume**: Storage and processing capacity
|
|
377
|
+
- **Geographic Distribution**: Multi-region needs
|
|
378
|
+
- **Caching Strategy**: Performance optimization
|
|
379
|
+
|
|
380
|
+
## Output Format
|
|
381
|
+
|
|
382
|
+
Please provide your analysis in the following JSON format:
|
|
383
|
+
|
|
384
|
+
\`\`\`json
|
|
385
|
+
{
|
|
386
|
+
"environmentRequirements": {
|
|
387
|
+
"extractedFrom": ${adrFiles.length},
|
|
388
|
+
"confidence": 0.0-1.0,
|
|
389
|
+
"completeness": 0.0-1.0,
|
|
390
|
+
"lastAnalyzed": "ISO-8601-timestamp"
|
|
391
|
+
},
|
|
392
|
+
"infrastructure": {
|
|
393
|
+
"compute": {
|
|
394
|
+
"cpuRequirements": "detected CPU needs",
|
|
395
|
+
"memoryRequirements": "detected memory needs",
|
|
396
|
+
"storageRequirements": "detected storage needs",
|
|
397
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
398
|
+
},
|
|
399
|
+
"networking": {
|
|
400
|
+
"bandwidthRequirements": "detected bandwidth needs",
|
|
401
|
+
"latencyRequirements": "detected latency needs",
|
|
402
|
+
"connectivityRequirements": "detected connectivity needs",
|
|
403
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
404
|
+
},
|
|
405
|
+
"availability": {
|
|
406
|
+
"uptimeRequirements": "detected uptime needs",
|
|
407
|
+
"redundancyRequirements": "detected redundancy needs",
|
|
408
|
+
"disasterRecoveryRequirements": "detected DR needs",
|
|
409
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
"platform": {
|
|
413
|
+
"containerization": {
|
|
414
|
+
"required": true/false,
|
|
415
|
+
"orchestrationNeeds": "kubernetes|docker_swarm|ecs|none",
|
|
416
|
+
"scalingRequirements": "horizontal|vertical|auto|manual",
|
|
417
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
418
|
+
},
|
|
419
|
+
"cloudServices": {
|
|
420
|
+
"required": true/false,
|
|
421
|
+
"preferredProvider": "aws|azure|gcp|multi_cloud|agnostic",
|
|
422
|
+
"managedServices": ["required managed services"],
|
|
423
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
424
|
+
},
|
|
425
|
+
"databases": {
|
|
426
|
+
"types": ["sql|nosql|cache|search|timeseries"],
|
|
427
|
+
"specificSystems": ["postgresql|mongodb|redis|elasticsearch"],
|
|
428
|
+
"consistencyRequirements": "strong|eventual|weak",
|
|
429
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
"security": {
|
|
433
|
+
"compliance": {
|
|
434
|
+
"standards": ["gdpr|hipaa|soc2|pci_dss|iso27001"],
|
|
435
|
+
"dataClassification": ["public|internal|confidential|restricted"],
|
|
436
|
+
"auditRequirements": "basic|detailed|comprehensive",
|
|
437
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
438
|
+
},
|
|
439
|
+
"accessControl": {
|
|
440
|
+
"authenticationMethods": ["oauth|saml|ldap|mfa"],
|
|
441
|
+
"authorizationModel": "rbac|abac|acl|custom",
|
|
442
|
+
"identityProvider": "internal|external|federated",
|
|
443
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
444
|
+
},
|
|
445
|
+
"dataProtection": {
|
|
446
|
+
"encryptionRequirements": "at_rest|in_transit|end_to_end",
|
|
447
|
+
"keyManagement": "cloud_kms|hsm|software",
|
|
448
|
+
"privacyRequirements": "anonymization|pseudonymization|retention",
|
|
449
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
"performance": {
|
|
453
|
+
"responseTime": {
|
|
454
|
+
"requirements": "detected response time needs",
|
|
455
|
+
"slaTargets": "detected SLA targets",
|
|
456
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
457
|
+
},
|
|
458
|
+
"throughput": {
|
|
459
|
+
"requirements": "detected throughput needs",
|
|
460
|
+
"peakLoad": "detected peak load handling",
|
|
461
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
462
|
+
},
|
|
463
|
+
"scalability": {
|
|
464
|
+
"userLoad": "detected concurrent user requirements",
|
|
465
|
+
"dataVolume": "detected data volume requirements",
|
|
466
|
+
"growthProjections": "detected growth expectations",
|
|
467
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
"operationalRequirements": {
|
|
471
|
+
"monitoring": {
|
|
472
|
+
"metricsRequired": ["application|infrastructure|business"],
|
|
473
|
+
"alertingNeeds": "basic|advanced|intelligent",
|
|
474
|
+
"observabilityLevel": "basic|detailed|comprehensive",
|
|
475
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
476
|
+
},
|
|
477
|
+
"deployment": {
|
|
478
|
+
"strategy": "blue_green|canary|rolling|recreate",
|
|
479
|
+
"frequency": "continuous|daily|weekly|monthly",
|
|
480
|
+
"automationLevel": "manual|semi_automated|fully_automated",
|
|
481
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
482
|
+
},
|
|
483
|
+
"maintenance": {
|
|
484
|
+
"backupRequirements": "detected backup needs",
|
|
485
|
+
"updateStrategy": "detected update approach",
|
|
486
|
+
"maintenanceWindows": "detected maintenance requirements",
|
|
487
|
+
"sourceAdrs": ["adr-ids that specify these requirements"]
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
"gaps": [
|
|
491
|
+
{
|
|
492
|
+
"category": "infrastructure|platform|security|performance|operational",
|
|
493
|
+
"description": "missing or unclear requirement",
|
|
494
|
+
"impact": "potential impact of this gap",
|
|
495
|
+
"recommendation": "suggested action to address gap"
|
|
496
|
+
}
|
|
497
|
+
],
|
|
498
|
+
"recommendations": [
|
|
499
|
+
{
|
|
500
|
+
"category": "infrastructure|platform|security|performance|operational",
|
|
501
|
+
"priority": "critical|high|medium|low",
|
|
502
|
+
"description": "specific recommendation",
|
|
503
|
+
"rationale": "why this is recommended based on ADRs",
|
|
504
|
+
"implementation": "how to implement this recommendation"
|
|
505
|
+
}
|
|
506
|
+
]
|
|
507
|
+
}
|
|
508
|
+
\`\`\`
|
|
509
|
+
|
|
510
|
+
## Analysis Guidelines
|
|
511
|
+
|
|
512
|
+
1. **Explicit Requirements**: Extract clearly stated requirements from ADRs
|
|
513
|
+
2. **Implicit Requirements**: Infer requirements from architectural decisions
|
|
514
|
+
3. **Traceability**: Link requirements back to specific ADRs
|
|
515
|
+
4. **Completeness**: Identify gaps in requirement coverage
|
|
516
|
+
5. **Consistency**: Check for conflicting requirements across ADRs
|
|
517
|
+
6. **Practicality**: Ensure requirements are implementable
|
|
518
|
+
|
|
519
|
+
Please provide comprehensive environment requirements analysis based on the ADRs.
|
|
520
|
+
`;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* AI prompt for environment compliance assessment
|
|
524
|
+
*/
|
|
525
|
+
export function generateEnvironmentCompliancePrompt(currentEnvironment, requirements, industryStandards) {
|
|
526
|
+
return `
|
|
527
|
+
# Environment Compliance Assessment
|
|
528
|
+
|
|
529
|
+
Please assess the compliance of the current environment against requirements and industry standards.
|
|
530
|
+
|
|
531
|
+
## Current Environment
|
|
532
|
+
\`\`\`json
|
|
533
|
+
${JSON.stringify(currentEnvironment, null, 2)}
|
|
534
|
+
\`\`\`
|
|
535
|
+
|
|
536
|
+
## Requirements
|
|
537
|
+
\`\`\`json
|
|
538
|
+
${JSON.stringify(requirements, null, 2)}
|
|
539
|
+
\`\`\`
|
|
540
|
+
|
|
541
|
+
${industryStandards
|
|
542
|
+
? `## Industry Standards
|
|
543
|
+
${industryStandards.map(standard => `- ${standard}`).join('\n')}
|
|
544
|
+
`
|
|
545
|
+
: ''}
|
|
546
|
+
|
|
547
|
+
## Compliance Assessment
|
|
548
|
+
|
|
549
|
+
Please evaluate compliance in these areas:
|
|
550
|
+
|
|
551
|
+
### 🏗️ **Infrastructure Compliance**
|
|
552
|
+
- **Resource Adequacy**: CPU, memory, storage sufficiency
|
|
553
|
+
- **Availability**: Uptime and redundancy compliance
|
|
554
|
+
- **Scalability**: Growth and load handling capability
|
|
555
|
+
- **Network**: Bandwidth, latency, connectivity compliance
|
|
556
|
+
- **Security**: Infrastructure security posture
|
|
557
|
+
- **Monitoring**: Observability and alerting coverage
|
|
558
|
+
|
|
559
|
+
### 🔒 **Security Compliance**
|
|
560
|
+
- **Access Control**: Authentication and authorization compliance
|
|
561
|
+
- **Data Protection**: Encryption and privacy compliance
|
|
562
|
+
- **Network Security**: Firewall, VPN, segmentation compliance
|
|
563
|
+
- **Compliance Standards**: GDPR, HIPAA, SOC2, etc.
|
|
564
|
+
- **Vulnerability Management**: Security scanning and patching
|
|
565
|
+
- **Audit & Logging**: Compliance logging and monitoring
|
|
566
|
+
|
|
567
|
+
### 📊 **Performance Compliance**
|
|
568
|
+
- **Response Time**: Latency requirement compliance
|
|
569
|
+
- **Throughput**: Transaction volume handling compliance
|
|
570
|
+
- **Scalability**: User load and data volume compliance
|
|
571
|
+
- **Availability**: SLA and uptime compliance
|
|
572
|
+
- **Resource Utilization**: Efficiency and optimization
|
|
573
|
+
- **Caching**: Performance optimization compliance
|
|
574
|
+
|
|
575
|
+
### 🛠️ **Operational Compliance**
|
|
576
|
+
- **Deployment**: CI/CD and deployment process compliance
|
|
577
|
+
- **Monitoring**: Observability and alerting compliance
|
|
578
|
+
- **Backup & Recovery**: Data protection compliance
|
|
579
|
+
- **Maintenance**: Update and maintenance process compliance
|
|
580
|
+
- **Documentation**: Operational documentation compliance
|
|
581
|
+
- **Training**: Team knowledge and skill compliance
|
|
582
|
+
|
|
583
|
+
## Output Format
|
|
584
|
+
|
|
585
|
+
Please provide your assessment in the following JSON format:
|
|
586
|
+
|
|
587
|
+
\`\`\`json
|
|
588
|
+
{
|
|
589
|
+
"complianceAssessment": {
|
|
590
|
+
"overallScore": 0.0-1.0,
|
|
591
|
+
"assessmentDate": "ISO-8601-timestamp",
|
|
592
|
+
"assessmentScope": "full|partial|targeted",
|
|
593
|
+
"riskLevel": "low|medium|high|critical",
|
|
594
|
+
"complianceStatus": "compliant|non_compliant|partially_compliant"
|
|
595
|
+
},
|
|
596
|
+
"categoryScores": {
|
|
597
|
+
"infrastructure": 0.0-1.0,
|
|
598
|
+
"security": 0.0-1.0,
|
|
599
|
+
"performance": 0.0-1.0,
|
|
600
|
+
"operational": 0.0-1.0
|
|
601
|
+
},
|
|
602
|
+
"complianceDetails": [
|
|
603
|
+
{
|
|
604
|
+
"category": "infrastructure|security|performance|operational",
|
|
605
|
+
"requirement": "specific requirement being assessed",
|
|
606
|
+
"currentState": "what is currently implemented",
|
|
607
|
+
"requiredState": "what is required",
|
|
608
|
+
"complianceStatus": "compliant|non_compliant|partially_compliant|not_applicable",
|
|
609
|
+
"gap": "description of any compliance gap",
|
|
610
|
+
"riskLevel": "low|medium|high|critical",
|
|
611
|
+
"effort": "low|medium|high",
|
|
612
|
+
"priority": "low|medium|high|critical"
|
|
613
|
+
}
|
|
614
|
+
],
|
|
615
|
+
"violations": [
|
|
616
|
+
{
|
|
617
|
+
"severity": "critical|high|medium|low|info",
|
|
618
|
+
"category": "infrastructure|security|performance|operational",
|
|
619
|
+
"violation": "description of compliance violation",
|
|
620
|
+
"requirement": "requirement that is violated",
|
|
621
|
+
"currentState": "current non-compliant state",
|
|
622
|
+
"requiredState": "required compliant state",
|
|
623
|
+
"remediation": "how to fix this violation",
|
|
624
|
+
"timeline": "suggested timeline for remediation",
|
|
625
|
+
"impact": "business/technical impact of violation"
|
|
626
|
+
}
|
|
627
|
+
],
|
|
628
|
+
"strengths": [
|
|
629
|
+
{
|
|
630
|
+
"category": "infrastructure|security|performance|operational",
|
|
631
|
+
"strength": "area where compliance exceeds requirements",
|
|
632
|
+
"description": "detailed description of the strength",
|
|
633
|
+
"value": "business/technical value provided"
|
|
634
|
+
}
|
|
635
|
+
],
|
|
636
|
+
"recommendations": [
|
|
637
|
+
{
|
|
638
|
+
"priority": "critical|high|medium|low",
|
|
639
|
+
"category": "infrastructure|security|performance|operational",
|
|
640
|
+
"recommendation": "specific recommendation",
|
|
641
|
+
"rationale": "why this recommendation is important",
|
|
642
|
+
"implementation": "how to implement this recommendation",
|
|
643
|
+
"effort": "low|medium|high",
|
|
644
|
+
"impact": "low|medium|high|critical",
|
|
645
|
+
"timeline": "suggested implementation timeline",
|
|
646
|
+
"dependencies": ["any dependencies for implementation"]
|
|
647
|
+
}
|
|
648
|
+
],
|
|
649
|
+
"improvementPlan": {
|
|
650
|
+
"immediate": [
|
|
651
|
+
{
|
|
652
|
+
"action": "immediate action required",
|
|
653
|
+
"timeline": "within days",
|
|
654
|
+
"owner": "suggested responsible party",
|
|
655
|
+
"success_criteria": "how to measure success"
|
|
656
|
+
}
|
|
657
|
+
],
|
|
658
|
+
"shortTerm": [
|
|
659
|
+
{
|
|
660
|
+
"action": "short-term improvement",
|
|
661
|
+
"timeline": "1-4 weeks",
|
|
662
|
+
"dependencies": ["what this depends on"],
|
|
663
|
+
"resources": ["required resources"]
|
|
664
|
+
}
|
|
665
|
+
],
|
|
666
|
+
"mediumTerm": [
|
|
667
|
+
{
|
|
668
|
+
"action": "medium-term improvement",
|
|
669
|
+
"timeline": "1-3 months",
|
|
670
|
+
"strategic_value": "strategic importance",
|
|
671
|
+
"investment": "required investment"
|
|
672
|
+
}
|
|
673
|
+
],
|
|
674
|
+
"longTerm": [
|
|
675
|
+
{
|
|
676
|
+
"action": "long-term improvement",
|
|
677
|
+
"timeline": "3+ months",
|
|
678
|
+
"vision": "long-term vision",
|
|
679
|
+
"transformation": "expected transformation"
|
|
680
|
+
}
|
|
681
|
+
]
|
|
682
|
+
},
|
|
683
|
+
"riskAssessment": {
|
|
684
|
+
"criticalRisks": [
|
|
685
|
+
{
|
|
686
|
+
"risk": "description of critical risk",
|
|
687
|
+
"probability": "low|medium|high",
|
|
688
|
+
"impact": "low|medium|high|critical",
|
|
689
|
+
"mitigation": "risk mitigation strategy"
|
|
690
|
+
}
|
|
691
|
+
],
|
|
692
|
+
"operationalRisks": [
|
|
693
|
+
{
|
|
694
|
+
"risk": "description of operational risk",
|
|
695
|
+
"probability": "low|medium|high",
|
|
696
|
+
"impact": "low|medium|high|critical",
|
|
697
|
+
"mitigation": "risk mitigation strategy"
|
|
698
|
+
}
|
|
699
|
+
]
|
|
700
|
+
},
|
|
701
|
+
"complianceMetrics": {
|
|
702
|
+
"requirementsCovered": 0,
|
|
703
|
+
"requirementsTotal": 0,
|
|
704
|
+
"violationsCount": 0,
|
|
705
|
+
"criticalViolations": 0,
|
|
706
|
+
"compliancePercentage": 0.0-1.0,
|
|
707
|
+
"improvementOpportunities": 0
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
\`\`\`
|
|
711
|
+
|
|
712
|
+
## Assessment Guidelines
|
|
713
|
+
|
|
714
|
+
1. **Objective Evaluation**: Base assessment on factual analysis
|
|
715
|
+
2. **Risk-Based Prioritization**: Focus on high-risk compliance gaps
|
|
716
|
+
3. **Actionable Recommendations**: Provide specific, implementable suggestions
|
|
717
|
+
4. **Timeline Awareness**: Consider realistic implementation timelines
|
|
718
|
+
5. **Business Impact**: Assess business implications of compliance gaps
|
|
719
|
+
6. **Continuous Improvement**: Suggest ongoing compliance monitoring
|
|
720
|
+
|
|
721
|
+
Please provide a comprehensive, actionable compliance assessment.
|
|
722
|
+
`;
|
|
723
|
+
}
|
|
724
|
+
//# sourceMappingURL=environment-analysis-prompts.js.map
|