@vfarcic/dot-ai 0.157.0 → 0.158.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/dist/core/ai-provider.interface.d.ts +0 -35
- package/dist/core/ai-provider.interface.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/tools/recommend.d.ts.map +1 -1
- package/dist/tools/recommend.js +46 -95
- package/package.json +1 -1
- package/prompts/intent-refinement-guidance.md +53 -0
- package/shared-prompts/prd-done.md +5 -4
- package/prompts/intent-analysis.md +0 -106
|
@@ -22,41 +22,6 @@ export interface AIResponse {
|
|
|
22
22
|
cache_read_input_tokens?: number;
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Impact level for clarification opportunities
|
|
27
|
-
*/
|
|
28
|
-
export type ImpactLevel = 'HIGH' | 'MEDIUM' | 'LOW';
|
|
29
|
-
/**
|
|
30
|
-
* Clarification category types
|
|
31
|
-
*/
|
|
32
|
-
export type ClarificationCategory = 'TECHNICAL_SPECIFICATIONS' | 'ARCHITECTURAL_CONTEXT' | 'OPERATIONAL_REQUIREMENTS' | 'SECURITY_COMPLIANCE' | 'ORGANIZATIONAL_ALIGNMENT';
|
|
33
|
-
/**
|
|
34
|
-
* Clarification opportunity structure
|
|
35
|
-
*/
|
|
36
|
-
export interface ClarificationOpportunity {
|
|
37
|
-
category: ClarificationCategory;
|
|
38
|
-
missingContext: string;
|
|
39
|
-
impactLevel: ImpactLevel;
|
|
40
|
-
reasoning: string;
|
|
41
|
-
suggestedQuestions?: string[];
|
|
42
|
-
patternAlignment?: string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Intent analysis result structure
|
|
46
|
-
*/
|
|
47
|
-
export interface IntentAnalysisResult {
|
|
48
|
-
clarificationOpportunities: ClarificationOpportunity[];
|
|
49
|
-
overallAssessment: {
|
|
50
|
-
enhancementPotential: ImpactLevel;
|
|
51
|
-
primaryGaps: string[];
|
|
52
|
-
recommendedFocus: string;
|
|
53
|
-
};
|
|
54
|
-
intentQuality: {
|
|
55
|
-
currentSpecificity: string;
|
|
56
|
-
strengthAreas: string[];
|
|
57
|
-
improvementAreas: string[];
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
25
|
/**
|
|
61
26
|
* AI Provider configuration
|
|
62
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-provider.interface.d.ts","sourceRoot":"","sources":["../../src/core/ai-provider.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE;QACL,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;QACtB,2BAA2B,CAAC,EAAE,MAAM,CAAC;QACrC,uBAAuB,CAAC,EAAE,MAAM,CAAC;KAClC,CAAC;CACH;AAED;;GAEG;AACH,MAAM,
|
|
1
|
+
{"version":3,"file":"ai-provider.interface.d.ts","sourceRoot":"","sources":["../../src/core/ai-provider.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE;QACL,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;QACtB,2BAA2B,CAAC,EAAE,MAAM,CAAC;QACrC,uBAAuB,CAAC,EAAE,MAAM,CAAC;KAClC,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IAEf,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IAEjB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,oDAAoD;IACpD,SAAS,CAAC,EAAE,OAAO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AC,CAAC;CAE1D"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare class DotAI {
|
|
|
40
40
|
export { KubernetesDiscovery } from './discovery';
|
|
41
41
|
export { MemorySystem } from './memory';
|
|
42
42
|
export { WorkflowEngine } from './workflow';
|
|
43
|
-
export { AIProvider, AIResponse,
|
|
43
|
+
export { AIProvider, AIResponse, AIProviderConfig } from './ai-provider.interface';
|
|
44
44
|
export { createAIProvider, AIProviderFactory } from './ai-provider-factory';
|
|
45
45
|
export { SchemaParser, ManifestValidator, ResourceRecommender } from './schema';
|
|
46
46
|
export { OrganizationalPattern, CreatePatternRequest } from './pattern-types';
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,WAAW,UAAU;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qBAAa,KAAK;IAChB,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,WAAW,CAAkB;IAErC,SAAgB,SAAS,EAAE,mBAAmB,CAAC;IAC/C,SAAgB,MAAM,EAAE,YAAY,CAAC;IACrC,SAAgB,QAAQ,EAAE,cAAc,CAAC;IACzC,SAAgB,EAAE,EAAE,UAAU,CAAC;IAC/B,SAAgB,MAAM,EAAE;QACtB,MAA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e,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommend.d.ts","sourceRoot":"","sources":["../../src/tools/recommend.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"recommend.d.ts","sourceRoot":"","sources":["../../src/tools/recommend.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAUhD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAMnD,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAC/C,eAAO,MAAM,0BAA0B,yXAAyX,CAAC;AAGja,eAAO,MAAM,2BAA2B;;;;;;;;CAWvC,CAAC;AAIF,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB,SAAS,CAAC,EAAE,KAAK,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;IAEH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE;QACT,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;QACd,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,CAAC;QACX,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC7B,CAAC;IACF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAiCD;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC,CAkVxD"}
|
package/dist/tools/recommend.js
CHANGED
|
@@ -17,6 +17,8 @@ const deploy_manifests_1 = require("./deploy-manifests");
|
|
|
17
17
|
const shared_prompt_loader_1 = require("../core/shared-prompt-loader");
|
|
18
18
|
const platform_utils_1 = require("../core/platform-utils");
|
|
19
19
|
const artifacthub_1 = require("../core/artifacthub");
|
|
20
|
+
// Intent refinement heuristic constants
|
|
21
|
+
const VAGUE_INTENT_THRESHOLD = 100; // Characters - intents below this trigger guidance
|
|
20
22
|
// Tool metadata for direct MCP registration
|
|
21
23
|
exports.RECOMMEND_TOOL_NAME = 'recommend';
|
|
22
24
|
exports.RECOMMEND_TOOL_DESCRIPTION = 'Deploy applications, infrastructure, and services using Kubernetes resources with AI recommendations. Supports cloud resources via operators like Crossplane, cluster management via CAPI, and traditional Kubernetes workloads. Describe what you want to deploy. Does NOT handle policy creation, organizational patterns, or resource capabilities - use manageOrgData for those.';
|
|
@@ -34,53 +36,29 @@ exports.RECOMMEND_TOOL_INPUT_SCHEMA = {
|
|
|
34
36
|
interaction_id: zod_1.z.string().optional().describe('INTERNAL ONLY - Do not populate. Used for evaluation dataset generation.')
|
|
35
37
|
};
|
|
36
38
|
/**
|
|
37
|
-
*
|
|
39
|
+
* Check if intent is vague using simple heuristic (character count)
|
|
38
40
|
*
|
|
39
|
-
* @param intent User's
|
|
40
|
-
* @
|
|
41
|
-
* @param logger Logger for error reporting
|
|
42
|
-
* @param organizationalPatterns Optional organizational patterns context
|
|
43
|
-
* @returns Analysis result with clarification opportunities
|
|
41
|
+
* @param intent User's intent string
|
|
42
|
+
* @returns true if intent is considered vague and needs refinement
|
|
44
43
|
*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return analysisResult;
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
// If parsing fails or API call fails, return a fallback minimal analysis
|
|
67
|
-
logger.warn?.('Intent analysis failed, returning minimal analysis', {
|
|
68
|
-
error: error instanceof Error ? error.message : String(error)
|
|
69
|
-
});
|
|
70
|
-
return {
|
|
71
|
-
clarificationOpportunities: [],
|
|
72
|
-
overallAssessment: {
|
|
73
|
-
enhancementPotential: 'LOW',
|
|
74
|
-
primaryGaps: [],
|
|
75
|
-
recommendedFocus: 'Proceed with original intent - analysis unavailable'
|
|
76
|
-
},
|
|
77
|
-
intentQuality: {
|
|
78
|
-
currentSpecificity: 'Unable to analyze - using original intent',
|
|
79
|
-
strengthAreas: ['User provided clear deployment intent'],
|
|
80
|
-
improvementAreas: []
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
}
|
|
44
|
+
function isVagueIntent(intent) {
|
|
45
|
+
return intent.length < VAGUE_INTENT_THRESHOLD;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Generate guidance response for vague intents by loading the prompt template
|
|
49
|
+
*
|
|
50
|
+
* @param intent The vague intent that was provided
|
|
51
|
+
* @returns Structured response with guidance for the client agent
|
|
52
|
+
*/
|
|
53
|
+
function generateIntentRefinementGuidance(intent) {
|
|
54
|
+
// Load the guidance prompt from file
|
|
55
|
+
const guidance = (0, shared_prompt_loader_1.loadPrompt)('intent-refinement-guidance', {});
|
|
56
|
+
return {
|
|
57
|
+
success: true,
|
|
58
|
+
needsRefinement: true,
|
|
59
|
+
intent,
|
|
60
|
+
guidance
|
|
61
|
+
};
|
|
84
62
|
}
|
|
85
63
|
// Session management now handled by GenericSessionManager
|
|
86
64
|
/**
|
|
@@ -123,59 +101,32 @@ async function handleRecommendTool(args, dotAI, logger, requestId) {
|
|
|
123
101
|
intent: args.intent,
|
|
124
102
|
hasApiProvider: dotAI.ai.isInitialized()
|
|
125
103
|
});
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
user_intent: args.intent,
|
|
134
|
-
interaction_id: args.interaction_id
|
|
104
|
+
// Check if intent needs refinement using simple heuristic (unless final=true)
|
|
105
|
+
if (!args.final && isVagueIntent(args.intent)) {
|
|
106
|
+
logger.debug('Vague intent detected, returning refinement guidance', {
|
|
107
|
+
requestId,
|
|
108
|
+
intent: args.intent,
|
|
109
|
+
intentLength: args.intent.length,
|
|
110
|
+
threshold: VAGUE_INTENT_THRESHOLD
|
|
135
111
|
});
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const clarificationResponse = {
|
|
149
|
-
status: 'clarification_available',
|
|
150
|
-
intent: args.intent,
|
|
151
|
-
analysis: {
|
|
152
|
-
enhancementPotential: analysisResult.overallAssessment.enhancementPotential,
|
|
153
|
-
recommendedFocus: analysisResult.overallAssessment.recommendedFocus,
|
|
154
|
-
currentSpecificity: analysisResult.intentQuality.currentSpecificity,
|
|
155
|
-
strengthAreas: analysisResult.intentQuality.strengthAreas,
|
|
156
|
-
improvementAreas: analysisResult.intentQuality.improvementAreas
|
|
157
|
-
},
|
|
158
|
-
questions,
|
|
159
|
-
agentInstructions: 'Present these clarification questions to help the user provide a more specific intent. When the user provides a refined intent (or confirms the current intent is sufficient), call the recommend tool again with final: true to proceed with recommendations.'
|
|
160
|
-
};
|
|
161
|
-
logger.debug('Returning clarification questions', {
|
|
162
|
-
requestId,
|
|
163
|
-
questionsCount: questions.length,
|
|
164
|
-
enhancementPotential: analysisResult.overallAssessment.enhancementPotential
|
|
165
|
-
});
|
|
166
|
-
return {
|
|
167
|
-
content: [
|
|
168
|
-
{
|
|
169
|
-
type: 'text',
|
|
170
|
-
text: JSON.stringify(clarificationResponse, null, 2)
|
|
171
|
-
}
|
|
172
|
-
]
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
logger.debug('No significant clarification opportunities found, proceeding with recommendations', { requestId });
|
|
112
|
+
const guidanceResponse = generateIntentRefinementGuidance(args.intent);
|
|
113
|
+
return {
|
|
114
|
+
content: [
|
|
115
|
+
{
|
|
116
|
+
type: 'text',
|
|
117
|
+
text: JSON.stringify(guidanceResponse, null, 2)
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
if (args.final) {
|
|
123
|
+
logger.debug('Skipping intent refinement check (final=true), proceeding directly', { requestId });
|
|
176
124
|
}
|
|
177
125
|
else {
|
|
178
|
-
logger.debug('
|
|
126
|
+
logger.debug('Intent is detailed enough, proceeding with recommendations', {
|
|
127
|
+
requestId,
|
|
128
|
+
intentLength: args.intent.length
|
|
129
|
+
});
|
|
179
130
|
}
|
|
180
131
|
// Ensure cluster connectivity before proceeding with recommendations
|
|
181
132
|
await (0, cluster_utils_1.ensureClusterConnection)(dotAI, logger, requestId, 'RecommendTool');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vfarcic/dot-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.158.0",
|
|
4
4
|
"description": "AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance",
|
|
5
5
|
"mcpName": "io.github.vfarcic/dot-ai",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Intent Refinement Guidance
|
|
2
|
+
|
|
3
|
+
The provided intent lacks sufficient detail to proceed.
|
|
4
|
+
|
|
5
|
+
## Your Task
|
|
6
|
+
|
|
7
|
+
Figure out what the user wants to do. It could be anything - deploying applications, provisioning cloud resources (AWS, Azure, GCP), setting up infrastructure, configuring services, or something else entirely. Use your available context to gather details, then call the recommend tool again with a refined intent and `final: true`.
|
|
8
|
+
|
|
9
|
+
## Suggested Approach
|
|
10
|
+
|
|
11
|
+
### Step 1: Analyze Available Context
|
|
12
|
+
|
|
13
|
+
Check what context you have access to:
|
|
14
|
+
|
|
15
|
+
- **Project directory**: Are there files to analyze? Is the directory empty?
|
|
16
|
+
- **Conversation history**: Has the user mentioned relevant details earlier?
|
|
17
|
+
- **User preferences**: Do you know anything about their typical patterns or preferences?
|
|
18
|
+
|
|
19
|
+
### Step 2: If Project Has Files, Perform Deep Analysis
|
|
20
|
+
|
|
21
|
+
**Thoroughness over speed.** The more time you spend analyzing the project, the better your refined intent will be. Shallow analysis leads to vague intents. Investigate thoroughly before proceeding.
|
|
22
|
+
|
|
23
|
+
**Discover What Exists**
|
|
24
|
+
|
|
25
|
+
Explore the full directory structure. Read files to understand what they do, not just note their existence. The project could be anything - application source code, infrastructure definitions, Helm charts, Terraform configs, policy definitions, documentation, or something else entirely. Don't assume it's an application.
|
|
26
|
+
|
|
27
|
+
**Identify What the User Might Want**
|
|
28
|
+
|
|
29
|
+
A project may relate to multiple things - components, resources, services, infrastructure. Scan thoroughly to identify what exists and how things relate to each other.
|
|
30
|
+
|
|
31
|
+
**Gather Relevant Details**
|
|
32
|
+
|
|
33
|
+
For each thing you identify, dig into the specifics that would be relevant. What details matter depends entirely on what it is. Find evidence in the codebase rather than guessing. Note anything unclear as a question for the user.
|
|
34
|
+
|
|
35
|
+
### Step 3: Discuss With User
|
|
36
|
+
|
|
37
|
+
This is a conversation, not a one-shot analysis.
|
|
38
|
+
|
|
39
|
+
**Present your findings** - explain what you discovered and what you think the user might want to do. **Ask questions** - clarify what to include, confirm the details you found are correct, and ask about anything you couldn't determine from analysis.
|
|
40
|
+
|
|
41
|
+
Iterate as needed. You may need to go back and analyze further based on user responses.
|
|
42
|
+
|
|
43
|
+
If there are no files to scan or the purpose is unclear, ask the user to describe what they want to do.
|
|
44
|
+
|
|
45
|
+
### Step 4: Call Recommend Again
|
|
46
|
+
|
|
47
|
+
Once you and the user have agreed on what they want to do and the relevant details, call the recommend tool with:
|
|
48
|
+
- A comprehensive intent describing what they want and relevant specifics
|
|
49
|
+
- `final: true` to proceed
|
|
50
|
+
|
|
51
|
+
## What Makes a Good Intent
|
|
52
|
+
|
|
53
|
+
A detailed intent describes what the user wants to do with relevant specifics. What details matter depends entirely on what they're trying to accomplish. The more relevant detail you provide, the better.
|
|
@@ -293,11 +293,12 @@ Closes #[issue-id]
|
|
|
293
293
|
- CLI commands: `gh pr view [pr-number]`, `gh pr checks [pr-number]`, `gh api repos/owner/repo/pulls/[pr-number]/comments`
|
|
294
294
|
- **Web interface inspection**: Fetch the PR URL directly to capture all comments, including inline code suggestions that CLI tools may miss
|
|
295
295
|
- Look for comments from automated tools (usernames ending in 'ai', 'bot', or known review tools)
|
|
296
|
-
- [ ] **Present code review findings**: ALWAYS
|
|
297
|
-
- **
|
|
296
|
+
- [ ] **Present ALL code review findings**: ALWAYS present every review comment to the user, regardless of severity
|
|
297
|
+
- **Show ALL comments**: Present every suggestion, nitpick, and recommendation - do not filter or omit any
|
|
298
|
+
- **Categorize findings**: Critical, Important, Optional/Nitpick based on impact
|
|
298
299
|
- **Provide specific examples**: Quote actual suggestions and their locations
|
|
299
|
-
- **Explain assessment**: Why each category was assigned
|
|
300
|
-
- **User decision**: Let user decide which
|
|
300
|
+
- **Explain assessment**: Why each category was assigned
|
|
301
|
+
- **User decision**: Let user decide which improvements to implement before merge (critical items must be addressed, others are user's choice)
|
|
301
302
|
- [ ] **Assess feedback priority**: Categorize review feedback
|
|
302
303
|
- **Critical**: Security issues, breaking changes, test failures - MUST address before merge
|
|
303
304
|
- **Important**: Code quality, maintainability, performance - SHOULD address for production readiness
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
# Intent Analysis for Comprehensive Clarification
|
|
2
|
-
|
|
3
|
-
You are an expert Kubernetes deployment consultant analyzing user intents to identify ALL opportunities for clarification that would lead to better deployment recommendations.
|
|
4
|
-
|
|
5
|
-
## User Intent
|
|
6
|
-
{{intent}}
|
|
7
|
-
|
|
8
|
-
## Organizational Patterns Context
|
|
9
|
-
{{organizational_patterns}}
|
|
10
|
-
|
|
11
|
-
## Third-Party Tool Installation Detection
|
|
12
|
-
|
|
13
|
-
**IMPORTANT**: First, determine if this intent is for installing a well-known third-party tool (Argo CD, Prometheus, Grafana, Crossplane, Cert-Manager, Jaeger, Vault, etc.).
|
|
14
|
-
|
|
15
|
-
**If YES (third-party tool installation)**:
|
|
16
|
-
- **Installation method is Helm** - DO NOT ask about Helm vs Kustomize vs manual
|
|
17
|
-
- **Detailed configuration will come later** - DO NOT ask about HA mode, authentication, storage, resource limits, monitoring integration, secrets management, backup strategies, etc. These questions will be asked in the Helm configuration phase
|
|
18
|
-
- **Keep clarification minimal** - only ask 1-3 questions that affect CHART SELECTION:
|
|
19
|
-
- "Do you want the full stack (e.g., kube-prometheus-stack) or just the base tool?"
|
|
20
|
-
- "Single cluster or multi-cluster setup?" (only if it affects which chart to use)
|
|
21
|
-
- Open-ended: "Any specific requirements that would affect the installation?"
|
|
22
|
-
- **Set enhancementPotential to LOW** for clear tool installation intents
|
|
23
|
-
- **Return minimal clarificationOpportunities** (1-3 max)
|
|
24
|
-
|
|
25
|
-
**If NO (custom application deployment)**:
|
|
26
|
-
- Proceed with comprehensive analysis below
|
|
27
|
-
|
|
28
|
-
## Analysis Framework
|
|
29
|
-
|
|
30
|
-
Analyze the user's intent comprehensively to identify **every piece of missing context** that could improve the quality and relevance of deployment recommendations. Be thorough - explore all aspects that could influence the deployment, regardless of traditional categories.
|
|
31
|
-
|
|
32
|
-
### Exploration Principles
|
|
33
|
-
|
|
34
|
-
**Comprehensive Context Discovery**: Identify ALL information that would help create the perfect solution for this specific intent. Consider:
|
|
35
|
-
- What would you need to know to build the ideal deployment?
|
|
36
|
-
- What domain-specific requirements might apply?
|
|
37
|
-
- What user-specific context is missing?
|
|
38
|
-
- What technical decisions haven't been made?
|
|
39
|
-
- What operational considerations are unexplored?
|
|
40
|
-
|
|
41
|
-
**Adaptive Questioning**: Let the intent guide your analysis:
|
|
42
|
-
- **Vague intents** require extensive exploration of possibilities
|
|
43
|
-
- **Specific intents** need targeted questions about remaining gaps
|
|
44
|
-
- **Technical intents** may need domain expertise questions
|
|
45
|
-
- **Business intents** may need operational and compliance questions
|
|
46
|
-
|
|
47
|
-
**No Self-Censoring**: Don't limit yourself to "high-impact" questions. Generate questions for every aspect that could be relevant. Users can decide what matters to them.
|
|
48
|
-
|
|
49
|
-
## Organizational Pattern Integration
|
|
50
|
-
|
|
51
|
-
Use the provided organizational patterns to inform your analysis:
|
|
52
|
-
- Identify alignment opportunities with existing patterns
|
|
53
|
-
- Recognize potential governance requirements
|
|
54
|
-
- Consider standard approaches within the organization
|
|
55
|
-
- Highlight areas where clarification could ensure compliance
|
|
56
|
-
|
|
57
|
-
## Analysis Guidelines
|
|
58
|
-
|
|
59
|
-
**DO NOT suggest clarification for:**
|
|
60
|
-
- Information that is clearly and explicitly stated in the intent
|
|
61
|
-
- Standard configurations that have sensible defaults AND the user hasn't indicated special requirements
|
|
62
|
-
|
|
63
|
-
**DO suggest clarification for:**
|
|
64
|
-
- Any missing context that could influence the solution approach
|
|
65
|
-
- Ambiguous requirements that could lead to multiple valid interpretations
|
|
66
|
-
- Missing information that only the user would know
|
|
67
|
-
- Organizational-specific requirements that align with provided patterns
|
|
68
|
-
|
|
69
|
-
## Response Format
|
|
70
|
-
|
|
71
|
-
Respond with ONLY a JSON object in this exact format:
|
|
72
|
-
|
|
73
|
-
```json
|
|
74
|
-
{
|
|
75
|
-
"clarificationOpportunities": [
|
|
76
|
-
{
|
|
77
|
-
"missingContext": "Specific description of what context is missing",
|
|
78
|
-
"reasoning": "Why this clarification would improve recommendations",
|
|
79
|
-
"suggestedQuestions": [
|
|
80
|
-
"Specific question that could gather this information",
|
|
81
|
-
"Alternative question approach for the same context"
|
|
82
|
-
],
|
|
83
|
-
"patternAlignment": "How this relates to organizational patterns (if applicable)"
|
|
84
|
-
}
|
|
85
|
-
],
|
|
86
|
-
"overallAssessment": {
|
|
87
|
-
"enhancementPotential": "<ENUM: HIGH | MEDIUM | LOW>",
|
|
88
|
-
"primaryGaps": ["Most important missing context area 1", "Most important missing context area 2"],
|
|
89
|
-
"recommendedFocus": "The single most valuable clarification opportunity"
|
|
90
|
-
},
|
|
91
|
-
"intentQuality": {
|
|
92
|
-
"currentSpecificity": "Assessment of how specific the intent currently is",
|
|
93
|
-
"strengthAreas": ["What aspects of the intent are already clear"],
|
|
94
|
-
"improvementAreas": ["What aspects would benefit most from clarification"]
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## Important Notes
|
|
100
|
-
|
|
101
|
-
- Generate questions for **every piece of missing context** that could improve recommendations
|
|
102
|
-
- Consider the **user's perspective** - suggest questions they can actually answer
|
|
103
|
-
- **Be comprehensive** - explore all aspects that could influence the deployment
|
|
104
|
-
- **Leverage organizational patterns** to identify governance and compliance opportunities
|
|
105
|
-
- **Be practical** - ensure suggested questions are actionable and specific
|
|
106
|
-
- **Always include an open-ended question** as the final clarification opportunity to capture anything else the user might want to share
|