@vfarcic/dot-ai 0.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 +203 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +51 -0
- package/dist/core/claude.d.ts +42 -0
- package/dist/core/claude.d.ts.map +1 -0
- package/dist/core/claude.js +229 -0
- package/dist/core/deploy-operation.d.ts +38 -0
- package/dist/core/deploy-operation.d.ts.map +1 -0
- package/dist/core/deploy-operation.js +101 -0
- package/dist/core/discovery.d.ts +162 -0
- package/dist/core/discovery.d.ts.map +1 -0
- package/dist/core/discovery.js +758 -0
- package/dist/core/error-handling.d.ts +167 -0
- package/dist/core/error-handling.d.ts.map +1 -0
- package/dist/core/error-handling.js +399 -0
- package/dist/core/index.d.ts +42 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +123 -0
- package/dist/core/kubernetes-utils.d.ts +38 -0
- package/dist/core/kubernetes-utils.d.ts.map +1 -0
- package/dist/core/kubernetes-utils.js +177 -0
- package/dist/core/memory.d.ts +45 -0
- package/dist/core/memory.d.ts.map +1 -0
- package/dist/core/memory.js +113 -0
- package/dist/core/schema.d.ts +187 -0
- package/dist/core/schema.d.ts.map +1 -0
- package/dist/core/schema.js +655 -0
- package/dist/core/session-utils.d.ts +29 -0
- package/dist/core/session-utils.d.ts.map +1 -0
- package/dist/core/session-utils.js +121 -0
- package/dist/core/workflow.d.ts +70 -0
- package/dist/core/workflow.d.ts.map +1 -0
- package/dist/core/workflow.js +161 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/interfaces/cli.d.ts +74 -0
- package/dist/interfaces/cli.d.ts.map +1 -0
- package/dist/interfaces/cli.js +769 -0
- package/dist/interfaces/mcp.d.ts +30 -0
- package/dist/interfaces/mcp.d.ts.map +1 -0
- package/dist/interfaces/mcp.js +105 -0
- package/dist/mcp/server.d.ts +9 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +151 -0
- package/dist/tools/answer-question.d.ts +27 -0
- package/dist/tools/answer-question.d.ts.map +1 -0
- package/dist/tools/answer-question.js +696 -0
- package/dist/tools/choose-solution.d.ts +23 -0
- package/dist/tools/choose-solution.d.ts.map +1 -0
- package/dist/tools/choose-solution.js +171 -0
- package/dist/tools/deploy-manifests.d.ts +25 -0
- package/dist/tools/deploy-manifests.d.ts.map +1 -0
- package/dist/tools/deploy-manifests.js +74 -0
- package/dist/tools/generate-manifests.d.ts +23 -0
- package/dist/tools/generate-manifests.d.ts.map +1 -0
- package/dist/tools/generate-manifests.js +424 -0
- package/dist/tools/index.d.ts +11 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +34 -0
- package/dist/tools/recommend.d.ts +23 -0
- package/dist/tools/recommend.d.ts.map +1 -0
- package/dist/tools/recommend.js +332 -0
- package/package.json +124 -0
- package/prompts/intent-validation.md +65 -0
- package/prompts/manifest-generation.md +79 -0
- package/prompts/question-generation.md +128 -0
- package/prompts/resource-analysis.md +127 -0
- package/prompts/resource-selection.md +55 -0
- package/prompts/resource-solution-ranking.md +77 -0
- package/prompts/solution-enhancement.md +129 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Question Generation for Kubernetes Resource Configuration
|
|
2
|
+
|
|
3
|
+
## User Intent
|
|
4
|
+
{intent}
|
|
5
|
+
|
|
6
|
+
## Recommended Solution
|
|
7
|
+
{solution_description}
|
|
8
|
+
|
|
9
|
+
## Resources in Solution
|
|
10
|
+
{resource_details}
|
|
11
|
+
|
|
12
|
+
## Available Cluster Options
|
|
13
|
+
{cluster_options}
|
|
14
|
+
|
|
15
|
+
## Instructions
|
|
16
|
+
|
|
17
|
+
Based on the user's intent and the Kubernetes resources in this solution, generate appropriate questions to gather the information needed to create working manifests.
|
|
18
|
+
|
|
19
|
+
**IMPORTANT**: Only ask questions about properties that are explicitly listed in the "Resources in Solution" section below. Do not ask about common Kubernetes properties unless they appear in the actual resource schema.
|
|
20
|
+
|
|
21
|
+
Use the provided cluster options to populate dynamic select questions with real values from the user's cluster.
|
|
22
|
+
|
|
23
|
+
Organize questions into three categories based on their importance and impact:
|
|
24
|
+
|
|
25
|
+
### REQUIRED Questions
|
|
26
|
+
Essential information needed for basic functionality. These are mandatory fields or critical configuration that makes the difference between working and non-working deployments. Without answers to these questions, the manifests cannot be generated or will fail to deploy.
|
|
27
|
+
|
|
28
|
+
**MANDATORY QUESTIONS**: You MUST always include these questions in the REQUIRED section:
|
|
29
|
+
- `name`: Resource name (applies to metadata.name across all resources)
|
|
30
|
+
- `namespace`: Target namespace (ONLY if any resource in the solution is namespace-scoped - check resource scope information)
|
|
31
|
+
|
|
32
|
+
### BASIC Questions
|
|
33
|
+
Common configuration options most users will want to set. These improve the deployment but aren't strictly required for basic functionality. They represent sensible customizations that enhance the deployment.
|
|
34
|
+
|
|
35
|
+
### ADVANCED Questions
|
|
36
|
+
Optional advanced configuration for power users. These are for optimization, security hardening, complex networking, resource management, or specialized scenarios that most users won't need initially.
|
|
37
|
+
|
|
38
|
+
## Guidelines
|
|
39
|
+
|
|
40
|
+
**CRITICAL CONSTRAINT**: Only ask questions about properties that actually exist in the provided resource schemas. Do not invent or assume properties that are not explicitly listed in the resource details.
|
|
41
|
+
|
|
42
|
+
For each question, consider:
|
|
43
|
+
- **ONLY the resource schema properties and their actual constraints** - never ask about properties not in the schema
|
|
44
|
+
- What information is truly needed to generate a working manifest from the actual schema fields
|
|
45
|
+
- **Resource capabilities and configuration richness** - expose meaningful configuration options available in the schema
|
|
46
|
+
- User-friendly question wording (avoid Kubernetes jargon where possible)
|
|
47
|
+
- Practical defaults that work in most environments
|
|
48
|
+
- **Comprehensive coverage** - generate questions for all significant configurable properties, not just the minimum required
|
|
49
|
+
- Use cluster-discovered options when available for select questions
|
|
50
|
+
|
|
51
|
+
**VALIDATION RULE**: Before creating any question, verify that the property exists in the provided resource schema. If a property like "storageClass" is not listed in the schema, do not ask about it.
|
|
52
|
+
|
|
53
|
+
Question types available:
|
|
54
|
+
- `text`: Free text input
|
|
55
|
+
- `select`: Single choice from options (use cluster-discovered options when possible)
|
|
56
|
+
- `multiselect`: Multiple choices from options
|
|
57
|
+
- `boolean`: Yes/no question
|
|
58
|
+
- `number`: Numeric input
|
|
59
|
+
|
|
60
|
+
## Question Design for Manifest Generation
|
|
61
|
+
|
|
62
|
+
**IMPORTANT**: Questions should be designed to collect semantic answers that the manifest generator can intelligently apply to the appropriate resource fields. Focus on user-friendly question IDs and clear descriptions.
|
|
63
|
+
|
|
64
|
+
### Question ID Guidelines
|
|
65
|
+
- Use semantic IDs that describe what the answer represents: `name`, `port`, `namespace`, `replicas`
|
|
66
|
+
- Avoid resource-specific IDs like `deployment-name` or `service-port`
|
|
67
|
+
- Use consolidation-friendly IDs when the same answer applies to multiple resources
|
|
68
|
+
- Examples:
|
|
69
|
+
- `name` (applies to metadata.name across all resources)
|
|
70
|
+
- `port` (applies to containerPort, service port, ingress port)
|
|
71
|
+
- `namespace` (applies to metadata.namespace across all resources)
|
|
72
|
+
- `replicas` (applies to spec.replicas in Deployment)
|
|
73
|
+
|
|
74
|
+
### Semantic Consolidation
|
|
75
|
+
When multiple resources need the same information, create a single question with a consolidated ID:
|
|
76
|
+
- **Instead of**: `deployment-port`, `service-port`, `ingress-port`
|
|
77
|
+
- **Use**: `port` (manifest generator will apply to all relevant port fields)
|
|
78
|
+
|
|
79
|
+
- **Instead of**: `deployment-name`, `service-name`
|
|
80
|
+
- **Use**: `name` (manifest generator will apply to all resource names)
|
|
81
|
+
|
|
82
|
+
## Response Format
|
|
83
|
+
|
|
84
|
+
Return your response as JSON in this exact format:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"required": [
|
|
89
|
+
{
|
|
90
|
+
"id": "unique-kebab-case-id",
|
|
91
|
+
"question": "User-friendly question text?",
|
|
92
|
+
"type": "text|select|multiselect|boolean|number",
|
|
93
|
+
"options": ["option1", "option2"],
|
|
94
|
+
"placeholder": "example value or helpful hint",
|
|
95
|
+
"validation": {
|
|
96
|
+
"required": true,
|
|
97
|
+
"min": 1,
|
|
98
|
+
"max": 100,
|
|
99
|
+
"pattern": "^[a-z0-9-]+$"
|
|
100
|
+
},
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"basic": [
|
|
104
|
+
// same format as required
|
|
105
|
+
],
|
|
106
|
+
"advanced": [
|
|
107
|
+
// same format as required
|
|
108
|
+
],
|
|
109
|
+
"open": {
|
|
110
|
+
"question": "Is there anything else about your requirements or constraints that would help us provide better recommendations?",
|
|
111
|
+
"placeholder": "e.g., specific security requirements, performance needs, existing infrastructure constraints..."
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Important Notes
|
|
117
|
+
|
|
118
|
+
- **CRITICAL**: Only ask questions about properties explicitly defined in the provided resource schemas
|
|
119
|
+
- **Generate comprehensive questions** covering all meaningful configuration options available in the resource schemas
|
|
120
|
+
- Focus on questions that actually affect the generated manifests based on the actual schema
|
|
121
|
+
- **Prefer explicit configuration over defaults** - give users control over important settings even if reasonable defaults exist
|
|
122
|
+
- **DO NOT** ask about storage classes, node selectors, or other properties unless they appear in the resource schema
|
|
123
|
+
- **DO NOT** make assumptions about what properties are configurable - stick strictly to the provided schema
|
|
124
|
+
- Use the provided cluster options to populate select questions with real values
|
|
125
|
+
- Consider real-world usage patterns and common configurations
|
|
126
|
+
- Ensure question IDs are unique and descriptive
|
|
127
|
+
- Use semantic question IDs that consolidate related fields (e.g., `port` instead of separate port questions)
|
|
128
|
+
- Validation rules should match Kubernetes constraints where applicable
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Resource Analysis for Enhancement
|
|
2
|
+
|
|
3
|
+
## Current Solution
|
|
4
|
+
{current_solution}
|
|
5
|
+
|
|
6
|
+
## User Request
|
|
7
|
+
{user_request}
|
|
8
|
+
|
|
9
|
+
## Available Resource Types
|
|
10
|
+
{available_resource_types}
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
Analyze the user's request and determine if the current solution can fulfill it or if additional resources are needed.
|
|
15
|
+
|
|
16
|
+
### STEP 0: Handle No-Requirements Cases
|
|
17
|
+
If the user request is any of: "N/A", "no requirements", "none", "nothing", "no", or similar variations:
|
|
18
|
+
- This indicates the user has no additional requirements beyond current configuration
|
|
19
|
+
- ALWAYS respond with: `{"canHandle": true, "approach": "complete_existing_questions", "reasoning": "User specified no additional requirements beyond current configuration"}`
|
|
20
|
+
- Do NOT proceed to capability gap analysis in these cases
|
|
21
|
+
- Skip all other steps and return the success response immediately
|
|
22
|
+
|
|
23
|
+
### STEP 1: Analyze Current Solution Capabilities
|
|
24
|
+
- Review the current solution's resources and their capabilities
|
|
25
|
+
- Check if missing question answers can fulfill the user's request
|
|
26
|
+
- Determine if the current resources support the requested functionality
|
|
27
|
+
- **IMPORTANT**: Note which resources control deployment/pod creation and management
|
|
28
|
+
|
|
29
|
+
### STEP 2: Determine Resource Needs
|
|
30
|
+
If the current solution CANNOT fulfill the request:
|
|
31
|
+
- Identify what type of capability is needed (storage, networking, database, etc.)
|
|
32
|
+
- **CRITICAL**: Check if suggested resources can actually integrate with current solution
|
|
33
|
+
- Consider resource control relationships and dependencies
|
|
34
|
+
- Verify that new resources can be meaningfully connected to existing resources
|
|
35
|
+
- Only suggest resources if they can functionally integrate with the current solution
|
|
36
|
+
- If no meaningful integration is possible, classify as capability gap
|
|
37
|
+
|
|
38
|
+
### STEP 3: Integration Analysis
|
|
39
|
+
Before suggesting additional resources, perform these specific checks:
|
|
40
|
+
|
|
41
|
+
#### A. Controller Resource Detection
|
|
42
|
+
- **Check if current resources are high-level controllers** (Custom Resources, Operators, Helm Charts, etc.)
|
|
43
|
+
- **Identify what they control**: Do they manage Deployment, Pod, Service, or Ingress creation?
|
|
44
|
+
- **Determine autonomy level**: Do they fully control the application lifecycle?
|
|
45
|
+
|
|
46
|
+
#### B. Integration Feasibility
|
|
47
|
+
- **Volume Mounting**: If user needs storage, can volumes be mounted to pods controlled by existing resources?
|
|
48
|
+
- **Networking**: If user needs networking, can traffic be routed to pods managed by existing resources?
|
|
49
|
+
- **Environment Variables**: Can configuration be injected into pods controlled by existing resources?
|
|
50
|
+
- **Resource Limits**: Can compute/memory limits be set on pods managed by existing resources?
|
|
51
|
+
|
|
52
|
+
#### C. Capability Gap Detection
|
|
53
|
+
If existing resources are high-level controllers that fully manage pod/deployment lifecycle:
|
|
54
|
+
- **No volume mount points**: Cannot attach external storage volumes
|
|
55
|
+
- **No network customization**: Cannot modify networking beyond controller's scope
|
|
56
|
+
- **No direct pod access**: Cannot inject custom configuration
|
|
57
|
+
- **Classify as CAPABILITY_GAP**: Adding standalone resources won't actually provide functionality
|
|
58
|
+
|
|
59
|
+
### STEP 4: Provide Analysis Result
|
|
60
|
+
|
|
61
|
+
## Response Format (JSON ONLY)
|
|
62
|
+
|
|
63
|
+
### If current solution CAN handle the request:
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"canHandle": true,
|
|
67
|
+
"approach": "complete_existing_questions",
|
|
68
|
+
"reasoning": "AppClaim supports scaling via spec.scaling.enabled/min/max fields"
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### If user has no additional requirements ("N/A", "none", etc.):
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"canHandle": true,
|
|
76
|
+
"approach": "complete_existing_questions",
|
|
77
|
+
"reasoning": "User specified no additional requirements beyond current configuration"
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### If additional resources are needed:
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"canHandle": false,
|
|
85
|
+
"approach": "add_resources",
|
|
86
|
+
"reasoning": "AppClaim does not support persistent storage",
|
|
87
|
+
"requiredCapability": "persistent storage",
|
|
88
|
+
"suggestedResources": ["PersistentVolumeClaim", "StorageClass"],
|
|
89
|
+
"resourceJustification": "PersistentVolumeClaim provides pod-independent storage, StorageClass defines storage parameters"
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### If request cannot be fulfilled:
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"canHandle": false,
|
|
97
|
+
"approach": "capability_gap",
|
|
98
|
+
"reasoning": "Current solution uses high-level controller that fully manages application lifecycle",
|
|
99
|
+
"integrationIssue": "Controller resource manages pod/deployment creation, preventing integration with external resources that require pod-level access",
|
|
100
|
+
"controllerType": "Custom Resource/Operator/High-level abstraction",
|
|
101
|
+
"requestedCapability": "User's requested functionality",
|
|
102
|
+
"suggestedAction": "Start over with intent that includes these requirements from the beginning"
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Integration Analysis Examples:
|
|
107
|
+
|
|
108
|
+
**Example 1 - Database with High-Level Controller:**
|
|
109
|
+
- Current: High-level resource that manages application lifecycle
|
|
110
|
+
- Request: External database connectivity
|
|
111
|
+
- Analysis: High-level resource controls networking/service creation, cannot connect to external databases
|
|
112
|
+
- Result: capability_gap
|
|
113
|
+
|
|
114
|
+
**Example 2 - Compatible Resources:**
|
|
115
|
+
- Current: Standard Deployment
|
|
116
|
+
- Request: Load balancing
|
|
117
|
+
- Analysis: Service can route traffic to Deployment pods via label selectors
|
|
118
|
+
- Result: add_resources (Service)
|
|
119
|
+
|
|
120
|
+
## Critical Requirements:
|
|
121
|
+
1. **RESPOND ONLY WITH JSON** - No explanations, no text, only the JSON object
|
|
122
|
+
2. **Only suggest resources from Available Resource Types list**
|
|
123
|
+
3. **Be specific about capability gaps**
|
|
124
|
+
4. **Provide clear reasoning for decisions**
|
|
125
|
+
5. **Always check resource integration feasibility**
|
|
126
|
+
|
|
127
|
+
**YOU MUST RESPOND WITH ONLY THE JSON OBJECT - NO OTHER TEXT**
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Resource Selection Prompt
|
|
2
|
+
|
|
3
|
+
You are a Kubernetes expert. Given this user intent and available resources, select the resources that could be relevant for detailed analysis.
|
|
4
|
+
|
|
5
|
+
## User Intent
|
|
6
|
+
{intent}
|
|
7
|
+
|
|
8
|
+
## Available Resources
|
|
9
|
+
{resources}
|
|
10
|
+
|
|
11
|
+
## Instructions
|
|
12
|
+
|
|
13
|
+
Select all resources that could be relevant for this intent. Consider:
|
|
14
|
+
- Direct relevance to the user's needs
|
|
15
|
+
- Common Kubernetes patterns and best practices
|
|
16
|
+
- Resource relationships and combinations
|
|
17
|
+
- Production deployment patterns
|
|
18
|
+
- Complex multi-component solutions
|
|
19
|
+
- **Custom Resource Definitions (CRDs)** that might provide higher-level abstractions or simpler alternatives
|
|
20
|
+
- Platform-specific resources (e.g., Crossplane, Knative, Istio, ArgoCD) that could simplify the deployment
|
|
21
|
+
- **CRD Selection Priority**: If you see multiple CRDs from the same group with similar purposes (like "App" and "AppClaim"), include the namespace-scoped ones (marked as "Namespaced: true") rather than cluster-scoped ones, as they're more appropriate for application deployments
|
|
22
|
+
|
|
23
|
+
Don't limit yourself - if the intent is complex, select as many resources as needed.
|
|
24
|
+
|
|
25
|
+
## Response Format
|
|
26
|
+
|
|
27
|
+
Respond with ONLY a JSON array of resource objects with full identifiers. Do NOT wrap in an object - just return the array:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
[
|
|
31
|
+
{
|
|
32
|
+
"kind": "Deployment",
|
|
33
|
+
"apiVersion": "apps/v1",
|
|
34
|
+
"group": "apps"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"kind": "Service",
|
|
38
|
+
"apiVersion": "v1",
|
|
39
|
+
"group": ""
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
IMPORTANT: Your response must be ONLY the JSON array, nothing else.
|
|
45
|
+
|
|
46
|
+
## Selection Philosophy
|
|
47
|
+
|
|
48
|
+
- **Be inclusive** - It's better to analyze too many than miss important ones
|
|
49
|
+
- **Think holistically** - Consider complete solutions, not just individual components
|
|
50
|
+
- **Consider dependencies** - If you select one resource, include its typical dependencies
|
|
51
|
+
- **Include supporting resources** - ConfigMaps, Secrets, ServiceAccounts often needed
|
|
52
|
+
- **Evaluate custom resources** - CRDs often provide simpler, higher-level interfaces than raw Kubernetes resources
|
|
53
|
+
- **Prefer namespace-scoped CRDs** - When multiple similar CRDs exist from the same group (e.g., "App" vs "AppClaim"), prefer namespace-scoped ones as they're more user-friendly and require fewer permissions
|
|
54
|
+
- **Don't assume user knowledge** - Users may not know about available platforms/operators in their cluster
|
|
55
|
+
- **Use exact identifiers** - Include full apiVersion and group to avoid ambiguity
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Resource Solution Ranking Prompt
|
|
2
|
+
|
|
3
|
+
You are a Kubernetes expert helping to determine which resource(s) best meet a user's needs.
|
|
4
|
+
|
|
5
|
+
## User Intent
|
|
6
|
+
{intent}
|
|
7
|
+
|
|
8
|
+
## Available Resources
|
|
9
|
+
{resources}
|
|
10
|
+
|
|
11
|
+
## Instructions
|
|
12
|
+
|
|
13
|
+
Analyze the user's intent and determine the best solution(s). This could be:
|
|
14
|
+
- A single resource that fully addresses the need
|
|
15
|
+
- A combination of resources that work together to create a complete solution
|
|
16
|
+
- Multiple alternative approaches ranked by effectiveness
|
|
17
|
+
|
|
18
|
+
For each solution, provide:
|
|
19
|
+
1. A score from 0-100 for how well it meets the user's needs
|
|
20
|
+
2. Specific reasons why this solution addresses the intent
|
|
21
|
+
3. Whether it's a single resource or combination, and why
|
|
22
|
+
4. Production readiness and best practices
|
|
23
|
+
|
|
24
|
+
Consider:
|
|
25
|
+
- Semantic meaning and typical use cases
|
|
26
|
+
- Resource relationships and orchestration patterns
|
|
27
|
+
- Complete end-to-end solutions vs partial solutions
|
|
28
|
+
- Production patterns and best practices
|
|
29
|
+
- **Custom Resource Definitions (CRDs)** that may provide simpler, higher-level abstractions
|
|
30
|
+
- Platform operators (Crossplane, Knative, etc.) that might offer better user experience
|
|
31
|
+
- User experience - simpler declarative approaches often score higher than complex multi-resource solutions
|
|
32
|
+
|
|
33
|
+
## CRD Preference Guidelines
|
|
34
|
+
|
|
35
|
+
When evaluating CRDs vs standard Kubernetes resources:
|
|
36
|
+
- **Prefer CRDs with matching capabilities**: If a CRD's listed capabilities directly address the user's specific needs, it should score higher than manually combining multiple standard resources
|
|
37
|
+
- **Favor purpose-built solutions**: CRDs designed for specific use cases should score higher than generic resource combinations when the use case aligns
|
|
38
|
+
- **Value comprehensive functionality**: A single CRD that handles multiple related concerns (deployment + networking + scaling) should score higher than manually orchestrating separate resources for the same outcome
|
|
39
|
+
- **Consider operational simplicity**: CRDs that provide intuitive, domain-specific interfaces should be preferred over complex multi-resource configurations
|
|
40
|
+
- **Give preference to platform abstractions**: For application deployment scenarios, purpose-built CRDs with comprehensive application platform features should be weighted more favorably than basic resources requiring manual orchestration
|
|
41
|
+
- **Match scope to intent**: Only prefer CRDs when their documented capabilities genuinely align with what the user is trying to achieve
|
|
42
|
+
|
|
43
|
+
## Response Format
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"solutions": [
|
|
48
|
+
{
|
|
49
|
+
"type": "single|combination",
|
|
50
|
+
"resources": [
|
|
51
|
+
{
|
|
52
|
+
"kind": "Deployment",
|
|
53
|
+
"apiVersion": "apps/v1",
|
|
54
|
+
"group": "apps"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"score": 85,
|
|
58
|
+
"description": "Brief description of this solution",
|
|
59
|
+
"reasons": ["reason1", "reason2"],
|
|
60
|
+
"analysis": "Detailed explanation of why this solution meets the user's needs"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
For each resource in the `resources` array, provide:
|
|
67
|
+
- `kind`: The resource type (e.g., "Deployment", "Service", "AppClaim")
|
|
68
|
+
- `apiVersion`: The API version (e.g., "apps/v1", "v1")
|
|
69
|
+
- `group`: The API group (empty string for core resources, e.g., "apps", "devopstoolkit.live")
|
|
70
|
+
|
|
71
|
+
## Scoring Guidelines
|
|
72
|
+
|
|
73
|
+
- **90-100**: Complete solution, fully addresses user needs
|
|
74
|
+
- **70-89**: Good solution, addresses most needs with minor gaps
|
|
75
|
+
- **50-69**: Partial solution, addresses some needs but requires additional work
|
|
76
|
+
- **30-49**: Incomplete solution, only peripherally addresses needs
|
|
77
|
+
- **0-29**: Poor fit, doesn't meaningfully address the user's intent
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Single-Pass Solution Enhancement
|
|
2
|
+
|
|
3
|
+
## Current Solution
|
|
4
|
+
{current_solution}
|
|
5
|
+
|
|
6
|
+
## Detailed Resource Schemas
|
|
7
|
+
{detailed_schemas}
|
|
8
|
+
|
|
9
|
+
## Analysis Result
|
|
10
|
+
{analysis_result}
|
|
11
|
+
|
|
12
|
+
## User Response
|
|
13
|
+
{open_response}
|
|
14
|
+
|
|
15
|
+
## Instructions
|
|
16
|
+
|
|
17
|
+
You are enhancing a solution in a **single-pass architecture**. Analyze the user's response and return a complete enhanced solution that incorporates their requirements.
|
|
18
|
+
|
|
19
|
+
**SINGLE-PASS APPROACH**: Enhance the solution description, analysis, potentially add new resources, and populate missing question answers based on the user's requirements from their open response.
|
|
20
|
+
|
|
21
|
+
### Enhancement Strategy:
|
|
22
|
+
|
|
23
|
+
1. **Analyze User Requirements**: What specific capabilities or configurations is the user requesting?
|
|
24
|
+
|
|
25
|
+
2. **Enhance Solution Content**:
|
|
26
|
+
- Update the solution description to reflect the enhanced capabilities
|
|
27
|
+
- Enhance the analysis to explain how the solution addresses the user's specific needs
|
|
28
|
+
- Adjust the solution score if the enhancement significantly improves the solution
|
|
29
|
+
|
|
30
|
+
3. **Populate Question Answers**:
|
|
31
|
+
- Analyze the user's open response for specific configuration values
|
|
32
|
+
- Fill in answers for questions that can be determined from the user's requirements
|
|
33
|
+
- Only populate answers where the user provided clear information in their open response
|
|
34
|
+
- Leave questions unanswered if the user didn't provide relevant information
|
|
35
|
+
|
|
36
|
+
4. **Add Resources if Needed**:
|
|
37
|
+
- Only if the Analysis Result indicates new resources are required (approach: "add_resources")
|
|
38
|
+
- Use ONLY the schemas provided in "Detailed Resource Schemas" section
|
|
39
|
+
- Add resources that are actually needed and supported by the available schemas
|
|
40
|
+
|
|
41
|
+
5. **Preserve Solution Structure**:
|
|
42
|
+
- Keep all existing questions intact
|
|
43
|
+
- The user's open response should remain as-is
|
|
44
|
+
- Do not add new questions - this is a single-pass system
|
|
45
|
+
|
|
46
|
+
### Resource Enhancement Guidelines:
|
|
47
|
+
- **SCHEMA VALIDATION**: Only add resources that exist in the "Detailed Resource Schemas" section
|
|
48
|
+
- **CAPABILITY FOCUS**: Add resources only when the current solution cannot handle the user's requirements
|
|
49
|
+
- **NO REDUNDANCY**: Don't add resources if existing ones already provide the needed capabilities
|
|
50
|
+
|
|
51
|
+
## Response Format
|
|
52
|
+
|
|
53
|
+
### For Successful Enhancement:
|
|
54
|
+
Return the complete enhanced solution. Copy the entire current solution and enhance it with:
|
|
55
|
+
- Updated description and analysis
|
|
56
|
+
- Populated question answers based on the user's open response
|
|
57
|
+
- Additional resources if needed
|
|
58
|
+
- Updated score
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"enhancedSolution": {
|
|
63
|
+
"type": "single",
|
|
64
|
+
"score": 85,
|
|
65
|
+
"description": "[ENHANCED_DESCRIPTION_INCORPORATING_USER_REQUIREMENTS]",
|
|
66
|
+
"reasons": ["copy from current solution"],
|
|
67
|
+
"analysis": "[ENHANCED_ANALYSIS_EXPLAINING_HOW_SOLUTION_MEETS_REQUIREMENTS]",
|
|
68
|
+
"resources": [
|
|
69
|
+
"copy all resources from current solution, plus any additionalResources if needed"
|
|
70
|
+
],
|
|
71
|
+
"questions": {
|
|
72
|
+
"required": [
|
|
73
|
+
"copy all required questions from current solution, preserving existing answers"
|
|
74
|
+
],
|
|
75
|
+
"basic": [
|
|
76
|
+
"copy all basic questions from current solution, adding answers where user provided info"
|
|
77
|
+
],
|
|
78
|
+
"advanced": [
|
|
79
|
+
"copy all advanced questions from current solution, adding answers where user provided info"
|
|
80
|
+
],
|
|
81
|
+
"open": {
|
|
82
|
+
"question": "copy from current solution",
|
|
83
|
+
"placeholder": "copy from current solution",
|
|
84
|
+
"answer": "copy from current solution - DO NOT MODIFY"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### For Capability Gap:
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"error": "CAPABILITY_GAP",
|
|
95
|
+
"message": "[EXPLANATION_OF_WHY_CURRENT_SOLUTION_CANNOT_HANDLE_REQUEST]",
|
|
96
|
+
"missingCapability": "[WHAT_USER_REQUESTED_THAT_CANNOT_BE_DONE]",
|
|
97
|
+
"currentSolution": "[BRIEF_DESCRIPTION_OF_CURRENT_RESOURCES]",
|
|
98
|
+
"suggestedAction": "[ADVICE_TO_START_OVER_WITH_DIFFERENT_INTENT]"
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Enhancement Examples:
|
|
103
|
+
|
|
104
|
+
### Example 1: Enhanced Description and Analysis
|
|
105
|
+
**User**: "I need it to handle 10x traffic with high availability"
|
|
106
|
+
**Current**: Basic Pod deployment solution
|
|
107
|
+
**Enhanced**: Description mentions auto-scaling and HA capabilities, analysis explains how the solution scales and maintains availability
|
|
108
|
+
|
|
109
|
+
### Example 2: Adding Resources
|
|
110
|
+
**User**: "I need persistent storage for user uploads"
|
|
111
|
+
**Current**: Basic application deployment
|
|
112
|
+
**Analysis Result**: "add_resources" with PersistentVolumeClaim recommended
|
|
113
|
+
**Enhanced**: Add PVC resource and update description to mention persistent storage capabilities
|
|
114
|
+
|
|
115
|
+
### Example 3: Capability Gap
|
|
116
|
+
**User**: "I need a managed database service"
|
|
117
|
+
**Current**: Application deployment solution
|
|
118
|
+
**Problem**: Kubernetes doesn't provide managed database services natively
|
|
119
|
+
**Response**: Return capability gap error, suggest starting over with database-specific intent
|
|
120
|
+
|
|
121
|
+
## Critical Requirements:
|
|
122
|
+
1. **RESPOND ONLY WITH JSON** - No explanations, no text, only the JSON object
|
|
123
|
+
2. **SINGLE-PASS MINDSET** - Return a complete enhanced solution, don't modify existing structure
|
|
124
|
+
3. **PRESERVE QUESTIONS** - Never alter the existing questions or their answers
|
|
125
|
+
4. **VALIDATE RESOURCES** - Only add resources that exist in the provided schemas
|
|
126
|
+
5. **ENHANCE CONTENT** - Focus on improving description and analysis to reflect user requirements
|
|
127
|
+
6. **LOGICAL ENHANCEMENTS** - Only enhance aspects that are actually improved by the user's requirements
|
|
128
|
+
|
|
129
|
+
**YOU MUST RESPOND WITH ONLY THE JSON OBJECT - NO OTHER TEXT**
|