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,432 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Research integration utilities using prompt-driven AI analysis
|
|
3
|
+
* Implements intelligent research findings incorporation into ADRs
|
|
4
|
+
*/
|
|
5
|
+
import { McpAdrError } from '../types/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Monitor research directory for files
|
|
8
|
+
*/
|
|
9
|
+
export async function monitorResearchDirectory(researchPath = 'docs/research') {
|
|
10
|
+
try {
|
|
11
|
+
const { findFiles } = await import('./file-system.js');
|
|
12
|
+
// Find all research files
|
|
13
|
+
const researchFiles = await findFiles(process.cwd(), [
|
|
14
|
+
`${researchPath}/**/*.md`,
|
|
15
|
+
`${researchPath}/**/*.txt`,
|
|
16
|
+
`${researchPath}/**/*.pdf`,
|
|
17
|
+
`${researchPath}/**/*.doc`,
|
|
18
|
+
`${researchPath}/**/*.docx`,
|
|
19
|
+
], { includeContent: true });
|
|
20
|
+
const instructions = `
|
|
21
|
+
# Research Directory Monitoring
|
|
22
|
+
|
|
23
|
+
Monitoring research directory for architectural insights and findings.
|
|
24
|
+
|
|
25
|
+
## Directory Status
|
|
26
|
+
- **Research Path**: ${researchPath}
|
|
27
|
+
- **Files Found**: ${researchFiles.length} files
|
|
28
|
+
- **Total Size**: ${researchFiles.reduce((sum, f) => sum + (f.size || 0), 0)} bytes
|
|
29
|
+
|
|
30
|
+
## Discovered Files
|
|
31
|
+
${researchFiles.length === 0
|
|
32
|
+
? 'No research files found in the specified directory.'
|
|
33
|
+
: researchFiles
|
|
34
|
+
.map((file, index) => `
|
|
35
|
+
### ${index + 1}. ${file.name}
|
|
36
|
+
- **Path**: ${file.path}
|
|
37
|
+
- **Size**: ${file.size} bytes
|
|
38
|
+
- **Last Modified**: ${file.lastModified || 'Unknown'}
|
|
39
|
+
`)
|
|
40
|
+
.join('')}
|
|
41
|
+
|
|
42
|
+
## Next Steps
|
|
43
|
+
1. **Extract research topics** using the topic extraction tool
|
|
44
|
+
2. **Analyze impact on existing ADRs** using the impact evaluation tool
|
|
45
|
+
3. **Generate update suggestions** for affected ADRs
|
|
46
|
+
4. **Monitor for new research** files and changes
|
|
47
|
+
|
|
48
|
+
## Monitoring Recommendations
|
|
49
|
+
- Set up file system watchers for automatic detection
|
|
50
|
+
- Establish research file naming conventions
|
|
51
|
+
- Create research templates for consistent structure
|
|
52
|
+
- Schedule regular research integration reviews
|
|
53
|
+
|
|
54
|
+
${researchFiles.length === 0
|
|
55
|
+
? `
|
|
56
|
+
## Getting Started
|
|
57
|
+
To begin using research integration:
|
|
58
|
+
1. Create the research directory: \`mkdir -p ${researchPath}\`
|
|
59
|
+
2. Add research files (markdown, text, or documents)
|
|
60
|
+
3. Use the \`incorporate_research\` tool to analyze findings
|
|
61
|
+
4. Review suggested ADR updates and implementations
|
|
62
|
+
`
|
|
63
|
+
: ''}
|
|
64
|
+
`;
|
|
65
|
+
return {
|
|
66
|
+
monitoringPrompt: `Research directory monitoring complete. Found ${researchFiles.length} files in ${researchPath}.`,
|
|
67
|
+
instructions,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
throw new McpAdrError(`Failed to monitor research directory: ${error instanceof Error ? error.message : String(error)}`, 'MONITORING_ERROR');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Extract research topics from files
|
|
76
|
+
*/
|
|
77
|
+
export async function extractResearchTopics(researchPath = 'docs/research', existingTopics) {
|
|
78
|
+
try {
|
|
79
|
+
const { findFiles } = await import('./file-system.js');
|
|
80
|
+
const { generateResearchTopicExtractionPrompt } = await import('../prompts/research-integration-prompts.js');
|
|
81
|
+
// Find and read research files
|
|
82
|
+
const researchFiles = await findFiles(process.cwd(), [`${researchPath}/**/*.md`, `${researchPath}/**/*.txt`], { includeContent: true });
|
|
83
|
+
if (researchFiles.length === 0) {
|
|
84
|
+
throw new McpAdrError(`No research files found in ${researchPath}`, 'NO_RESEARCH_FILES');
|
|
85
|
+
}
|
|
86
|
+
// Prepare research file data
|
|
87
|
+
const fileData = researchFiles.map(file => ({
|
|
88
|
+
filename: file.name,
|
|
89
|
+
content: file.content || '',
|
|
90
|
+
lastModified: file.lastModified || new Date().toISOString(),
|
|
91
|
+
size: file.size || 0,
|
|
92
|
+
}));
|
|
93
|
+
const extractionPrompt = generateResearchTopicExtractionPrompt(fileData, existingTopics);
|
|
94
|
+
const instructions = `
|
|
95
|
+
# Research Topic Extraction Instructions
|
|
96
|
+
|
|
97
|
+
This analysis will extract key topics and findings from research files that could impact architectural decisions.
|
|
98
|
+
|
|
99
|
+
## Research Analysis
|
|
100
|
+
- **Research Path**: ${researchPath}
|
|
101
|
+
- **Files Analyzed**: ${researchFiles.length} files
|
|
102
|
+
- **Existing Topics**: ${existingTopics?.length || 0} topics
|
|
103
|
+
- **Total Content**: ${fileData.reduce((sum, f) => sum + f.content.length, 0)} characters
|
|
104
|
+
|
|
105
|
+
## Next Steps
|
|
106
|
+
1. **Submit the extraction prompt** to an AI agent for topic analysis
|
|
107
|
+
2. **Parse the JSON response** to get extracted topics and insights
|
|
108
|
+
3. **Review the research findings** for architectural relevance
|
|
109
|
+
4. **Use the impact evaluation tool** to assess ADR implications
|
|
110
|
+
|
|
111
|
+
## Expected AI Response Format
|
|
112
|
+
The AI will return a JSON object with:
|
|
113
|
+
- \`extractedTopics\`: Array of research topics with findings and evidence
|
|
114
|
+
- \`researchSummary\`: Overall assessment of research quality and completeness
|
|
115
|
+
- \`keyInsights\`: Major insights that require action
|
|
116
|
+
- \`recommendations\`: Specific recommendations for incorporating findings
|
|
117
|
+
- \`gaps\`: Areas where additional research is needed
|
|
118
|
+
|
|
119
|
+
## Usage Example
|
|
120
|
+
\`\`\`typescript
|
|
121
|
+
const result = await extractResearchTopics(researchPath, existingTopics);
|
|
122
|
+
// Submit result.extractionPrompt to AI agent
|
|
123
|
+
// Parse AI response for research topics and insights
|
|
124
|
+
\`\`\`
|
|
125
|
+
`;
|
|
126
|
+
return {
|
|
127
|
+
extractionPrompt,
|
|
128
|
+
instructions,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
throw new McpAdrError(`Failed to extract research topics: ${error instanceof Error ? error.message : String(error)}`, 'EXTRACTION_ERROR');
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Evaluate research impact on existing ADRs
|
|
137
|
+
*/
|
|
138
|
+
export async function evaluateResearchImpact(researchTopics, adrDirectory = 'docs/adrs') {
|
|
139
|
+
try {
|
|
140
|
+
const { findFiles } = await import('./file-system.js');
|
|
141
|
+
const { generateResearchImpactEvaluationPrompt } = await import('../prompts/research-integration-prompts.js');
|
|
142
|
+
// Find existing ADRs
|
|
143
|
+
const adrFiles = await findFiles(process.cwd(), [`${adrDirectory}/**/*.md`], {
|
|
144
|
+
includeContent: true,
|
|
145
|
+
});
|
|
146
|
+
if (adrFiles.length === 0) {
|
|
147
|
+
throw new McpAdrError(`No ADR files found in ${adrDirectory}`, 'NO_ADRS_FOUND');
|
|
148
|
+
}
|
|
149
|
+
// Prepare ADR data
|
|
150
|
+
const adrData = adrFiles.map(file => {
|
|
151
|
+
const titleMatch = file.content?.match(/^#\s+(.+)$/m);
|
|
152
|
+
const statusMatch = file.content?.match(/##\s+Status\s*\n\s*(.+)/i);
|
|
153
|
+
return {
|
|
154
|
+
id: file.name.replace(/\.md$/, ''),
|
|
155
|
+
title: titleMatch?.[1] || file.name.replace(/\.md$/, ''),
|
|
156
|
+
status: statusMatch?.[1] || 'Unknown',
|
|
157
|
+
content: file.content || '',
|
|
158
|
+
category: extractAdrCategory(file.content || ''),
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
const evaluationPrompt = generateResearchImpactEvaluationPrompt(researchTopics, adrData);
|
|
162
|
+
const instructions = `
|
|
163
|
+
# Research Impact Evaluation Instructions
|
|
164
|
+
|
|
165
|
+
This analysis will evaluate how research findings impact existing ADRs and suggest necessary updates.
|
|
166
|
+
|
|
167
|
+
## Impact Analysis
|
|
168
|
+
- **Research Topics**: ${researchTopics.length} topics
|
|
169
|
+
- **Existing ADRs**: ${adrFiles.length} ADRs
|
|
170
|
+
- **ADR Directory**: ${adrDirectory}
|
|
171
|
+
- **High Relevance Topics**: ${researchTopics.filter(t => t.relevanceScore > 0.7).length} topics
|
|
172
|
+
|
|
173
|
+
## Next Steps
|
|
174
|
+
1. **Submit the evaluation prompt** to an AI agent for impact analysis
|
|
175
|
+
2. **Parse the JSON response** to get impact assessments and recommendations
|
|
176
|
+
3. **Review suggested updates** and prioritize based on impact level
|
|
177
|
+
4. **Use the update suggestion tool** for specific ADR modifications
|
|
178
|
+
|
|
179
|
+
## Expected AI Response Format
|
|
180
|
+
The AI will return a JSON object with:
|
|
181
|
+
- \`impactAnalysis\`: Detailed impact assessment for each ADR
|
|
182
|
+
- \`updateRecommendations\`: Specific update suggestions with justifications
|
|
183
|
+
- \`newAdrSuggestions\`: Recommendations for new ADRs based on research
|
|
184
|
+
- \`deprecationSuggestions\`: ADRs that should be deprecated
|
|
185
|
+
- \`overallAssessment\`: Summary of findings and action priorities
|
|
186
|
+
|
|
187
|
+
## Usage Example
|
|
188
|
+
\`\`\`typescript
|
|
189
|
+
const result = await evaluateResearchImpact(researchTopics, adrDirectory);
|
|
190
|
+
// Submit result.evaluationPrompt to AI agent
|
|
191
|
+
// Parse AI response for impact analysis and recommendations
|
|
192
|
+
\`\`\`
|
|
193
|
+
`;
|
|
194
|
+
return {
|
|
195
|
+
evaluationPrompt,
|
|
196
|
+
instructions,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
throw new McpAdrError(`Failed to evaluate research impact: ${error instanceof Error ? error.message : String(error)}`, 'EVALUATION_ERROR');
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Generate ADR update suggestions
|
|
205
|
+
*/
|
|
206
|
+
export async function generateAdrUpdateSuggestions(adrId, researchFindings, updateType, adrDirectory = 'docs/adrs') {
|
|
207
|
+
try {
|
|
208
|
+
const { findFiles } = await import('./file-system.js');
|
|
209
|
+
const { generateAdrUpdateSuggestionPrompt } = await import('../prompts/research-integration-prompts.js');
|
|
210
|
+
// Find the specific ADR
|
|
211
|
+
const adrFiles = await findFiles(process.cwd(), [`${adrDirectory}/**/*.md`], {
|
|
212
|
+
includeContent: true,
|
|
213
|
+
});
|
|
214
|
+
const targetAdr = adrFiles.find(file => file.name.includes(adrId) || file.content?.includes(adrId) || file.path.includes(adrId));
|
|
215
|
+
if (!targetAdr) {
|
|
216
|
+
throw new McpAdrError(`ADR not found: ${adrId}`, 'ADR_NOT_FOUND');
|
|
217
|
+
}
|
|
218
|
+
// Extract ADR metadata
|
|
219
|
+
const titleMatch = targetAdr.content?.match(/^#\s+(.+)$/m);
|
|
220
|
+
const statusMatch = targetAdr.content?.match(/##\s+Status\s*\n\s*(.+)/i);
|
|
221
|
+
const adrData = {
|
|
222
|
+
id: adrId,
|
|
223
|
+
title: titleMatch?.[1] || targetAdr.name.replace(/\.md$/, ''),
|
|
224
|
+
content: targetAdr.content || '',
|
|
225
|
+
status: statusMatch?.[1] || 'Unknown',
|
|
226
|
+
};
|
|
227
|
+
const updatePrompt = generateAdrUpdateSuggestionPrompt(adrData, researchFindings, updateType);
|
|
228
|
+
const instructions = `
|
|
229
|
+
# ADR Update Suggestion Instructions
|
|
230
|
+
|
|
231
|
+
This will generate specific update suggestions for an ADR based on research findings.
|
|
232
|
+
|
|
233
|
+
## Update Details
|
|
234
|
+
- **ADR ID**: ${adrId}
|
|
235
|
+
- **ADR Title**: ${adrData.title}
|
|
236
|
+
- **Current Status**: ${adrData.status}
|
|
237
|
+
- **Update Type**: ${updateType}
|
|
238
|
+
- **Research Findings**: ${researchFindings.length} findings
|
|
239
|
+
|
|
240
|
+
## Next Steps
|
|
241
|
+
1. **Submit the update prompt** to an AI agent for suggestion generation
|
|
242
|
+
2. **Parse the JSON response** to get detailed update recommendations
|
|
243
|
+
3. **Review the proposed changes** for accuracy and completeness
|
|
244
|
+
4. **Apply the updates** to the ADR file with proper version control
|
|
245
|
+
5. **Notify stakeholders** of the changes and rationale
|
|
246
|
+
|
|
247
|
+
## Expected AI Response Format
|
|
248
|
+
The AI will return a JSON object with:
|
|
249
|
+
- \`updateSuggestion\`: Overall update metadata and assessment
|
|
250
|
+
- \`proposedChanges\`: Specific changes to make to the ADR
|
|
251
|
+
- \`newContent\`: Complete updated ADR content
|
|
252
|
+
- \`migrationGuidance\`: Implementation and rollback guidance
|
|
253
|
+
- \`qualityChecks\`: Quality assessment of the proposed updates
|
|
254
|
+
- \`reviewRecommendations\`: Suggested review and approval process
|
|
255
|
+
|
|
256
|
+
## Usage Example
|
|
257
|
+
\`\`\`typescript
|
|
258
|
+
const result = await generateAdrUpdateSuggestions(adrId, findings, updateType);
|
|
259
|
+
// Submit result.updatePrompt to AI agent
|
|
260
|
+
// Parse AI response for update suggestions and implementation guidance
|
|
261
|
+
\`\`\`
|
|
262
|
+
`;
|
|
263
|
+
return {
|
|
264
|
+
updatePrompt,
|
|
265
|
+
instructions,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
catch (error) {
|
|
269
|
+
throw new McpAdrError(`Failed to generate ADR update suggestions: ${error instanceof Error ? error.message : String(error)}`, 'UPDATE_GENERATION_ERROR');
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Extract category from ADR content
|
|
274
|
+
*/
|
|
275
|
+
function extractAdrCategory(content) {
|
|
276
|
+
const categoryPatterns = [
|
|
277
|
+
{ pattern: /framework|library|dependency/i, category: 'technology' },
|
|
278
|
+
{ pattern: /database|storage|persistence/i, category: 'database' },
|
|
279
|
+
{ pattern: /api|rest|graphql|endpoint/i, category: 'api' },
|
|
280
|
+
{ pattern: /security|authentication|authorization/i, category: 'security' },
|
|
281
|
+
{ pattern: /deployment|infrastructure|cloud/i, category: 'deployment' },
|
|
282
|
+
{ pattern: /test|testing|quality/i, category: 'testing' },
|
|
283
|
+
{ pattern: /architecture|pattern|design/i, category: 'architecture' },
|
|
284
|
+
{ pattern: /process|workflow|methodology/i, category: 'process' },
|
|
285
|
+
];
|
|
286
|
+
for (const { pattern, category } of categoryPatterns) {
|
|
287
|
+
if (pattern.test(content)) {
|
|
288
|
+
return category;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return 'general';
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Create research file template
|
|
295
|
+
*/
|
|
296
|
+
export function createResearchTemplate(title, category = 'general') {
|
|
297
|
+
const date = new Date().toISOString().split('T')[0];
|
|
298
|
+
return `# ${title}
|
|
299
|
+
|
|
300
|
+
**Date**: ${date}
|
|
301
|
+
**Category**: ${category}
|
|
302
|
+
**Status**: In Progress
|
|
303
|
+
|
|
304
|
+
## Research Question
|
|
305
|
+
|
|
306
|
+
[What specific question or problem is this research addressing?]
|
|
307
|
+
|
|
308
|
+
## Background
|
|
309
|
+
|
|
310
|
+
[Provide context and background information]
|
|
311
|
+
|
|
312
|
+
## Methodology
|
|
313
|
+
|
|
314
|
+
[Describe how the research was conducted]
|
|
315
|
+
|
|
316
|
+
## Key Findings
|
|
317
|
+
|
|
318
|
+
### Finding 1
|
|
319
|
+
- **Description**: [Detailed description]
|
|
320
|
+
- **Evidence**: [Supporting evidence or data]
|
|
321
|
+
- **Confidence**: [High/Medium/Low]
|
|
322
|
+
- **Source**: [Source of information]
|
|
323
|
+
|
|
324
|
+
### Finding 2
|
|
325
|
+
- **Description**: [Detailed description]
|
|
326
|
+
- **Evidence**: [Supporting evidence or data]
|
|
327
|
+
- **Confidence**: [High/Medium/Low]
|
|
328
|
+
- **Source**: [Source of information]
|
|
329
|
+
|
|
330
|
+
## Implications
|
|
331
|
+
|
|
332
|
+
### Architectural Impact
|
|
333
|
+
[How do these findings impact architectural decisions?]
|
|
334
|
+
|
|
335
|
+
### Technology Choices
|
|
336
|
+
[What technology choices are affected?]
|
|
337
|
+
|
|
338
|
+
### Risk Assessment
|
|
339
|
+
[What risks are identified or mitigated?]
|
|
340
|
+
|
|
341
|
+
## Recommendations
|
|
342
|
+
|
|
343
|
+
1. [Specific recommendation 1]
|
|
344
|
+
2. [Specific recommendation 2]
|
|
345
|
+
3. [Specific recommendation 3]
|
|
346
|
+
|
|
347
|
+
## Related ADRs
|
|
348
|
+
|
|
349
|
+
- [List any ADRs that might be affected by this research]
|
|
350
|
+
|
|
351
|
+
## Next Steps
|
|
352
|
+
|
|
353
|
+
- [ ] [Action item 1]
|
|
354
|
+
- [ ] [Action item 2]
|
|
355
|
+
- [ ] [Action item 3]
|
|
356
|
+
|
|
357
|
+
## References
|
|
358
|
+
|
|
359
|
+
- [Reference 1]
|
|
360
|
+
- [Reference 2]
|
|
361
|
+
- [Reference 3]
|
|
362
|
+
`;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Prompt for action confirmation before generating drafts
|
|
366
|
+
*/
|
|
367
|
+
export function promptForActionConfirmation(action, details, impact) {
|
|
368
|
+
const confirmationPrompt = `
|
|
369
|
+
# Action Confirmation Required
|
|
370
|
+
|
|
371
|
+
**Action**: ${action}
|
|
372
|
+
**Impact Level**: ${impact.toUpperCase()}
|
|
373
|
+
|
|
374
|
+
## Details
|
|
375
|
+
${details}
|
|
376
|
+
|
|
377
|
+
## Confirmation Required
|
|
378
|
+
Before proceeding with this action, please confirm:
|
|
379
|
+
|
|
380
|
+
1. **Understanding**: Do you understand the proposed action and its implications?
|
|
381
|
+
2. **Authorization**: Are you authorized to approve this type of change?
|
|
382
|
+
3. **Impact Assessment**: Have you reviewed the potential impact on existing systems?
|
|
383
|
+
4. **Timing**: Is this an appropriate time to implement this change?
|
|
384
|
+
5. **Resources**: Are the necessary resources available for implementation?
|
|
385
|
+
|
|
386
|
+
## Risk Assessment
|
|
387
|
+
${impact === 'critical'
|
|
388
|
+
? '🔴 **CRITICAL**: This action may have significant system-wide impact'
|
|
389
|
+
: impact === 'high'
|
|
390
|
+
? '🟠 **HIGH**: This action may affect multiple components or stakeholders'
|
|
391
|
+
: impact === 'medium'
|
|
392
|
+
? '🟡 **MEDIUM**: This action has moderate impact and should be reviewed'
|
|
393
|
+
: '🟢 **LOW**: This action has minimal impact but still requires confirmation'}
|
|
394
|
+
|
|
395
|
+
Please respond with:
|
|
396
|
+
- **APPROVED**: To proceed with the action
|
|
397
|
+
- **REJECTED**: To cancel the action
|
|
398
|
+
- **MODIFIED**: To request modifications to the proposed action
|
|
399
|
+
- **DEFERRED**: To postpone the action to a later time
|
|
400
|
+
|
|
401
|
+
Include any additional comments or requirements for the action.
|
|
402
|
+
`;
|
|
403
|
+
const instructions = `
|
|
404
|
+
# Action Confirmation Instructions
|
|
405
|
+
|
|
406
|
+
This confirmation step ensures that significant changes are properly reviewed before implementation.
|
|
407
|
+
|
|
408
|
+
## Confirmation Process
|
|
409
|
+
1. **Review the proposed action** and its details carefully
|
|
410
|
+
2. **Assess the impact level** and potential consequences
|
|
411
|
+
3. **Consider timing and resources** required for implementation
|
|
412
|
+
4. **Provide clear approval or rejection** with reasoning
|
|
413
|
+
5. **Specify any modifications** needed if not approving as-is
|
|
414
|
+
|
|
415
|
+
## Response Options
|
|
416
|
+
- **APPROVED**: Action can proceed as proposed
|
|
417
|
+
- **REJECTED**: Action should not be implemented
|
|
418
|
+
- **MODIFIED**: Action needs changes before approval
|
|
419
|
+
- **DEFERRED**: Action should be postponed
|
|
420
|
+
|
|
421
|
+
## Best Practices
|
|
422
|
+
- Always review high and critical impact actions carefully
|
|
423
|
+
- Consider stakeholder impact and communication needs
|
|
424
|
+
- Ensure proper backup and rollback plans are in place
|
|
425
|
+
- Document the approval decision and reasoning
|
|
426
|
+
`;
|
|
427
|
+
return {
|
|
428
|
+
confirmationPrompt,
|
|
429
|
+
instructions,
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
//# sourceMappingURL=research-integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"research-integration.js","sourceRoot":"","sources":["../../../src/utils/research-integration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA+ChD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,eAAuB,eAAe;IAEtC,IAAI,CAAC;QACH,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAEvD,0BAA0B;QAC1B,MAAM,aAAa,GAAG,MAAM,SAAS,CACnC,OAAO,CAAC,GAAG,EAAE,EACb;YACE,GAAG,YAAY,UAAU;YACzB,GAAG,YAAY,WAAW;YAC1B,GAAG,YAAY,WAAW;YAC1B,GAAG,YAAY,WAAW;YAC1B,GAAG,YAAY,YAAY;SAC5B,EACD,EAAE,cAAc,EAAE,IAAI,EAAE,CACzB,CAAC;QAEF,MAAM,YAA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AkB,GAAG;;;cAGf,MAAM;oBACA,MAAM,CAAC,WAAW,EAAE;;;EAGtC,OAAO;;;;;;;;;;;;EAaP,MAAM,KAAK,UAAU;QACnB,CAAC,CAAC,sEAAsE;QACxE,CAAC,CAAC,MAAM,KAAK,MAAM;YACjB,CAAC,CAAC,yEAAyE;YAC3E,CAAC,CAAC,MAAM,KAAK,QAAQ;gBACnB,CAAC,CAAC,uEAAuE;gBACzE,CAAC,CAAC,4EACV;;;;;;;;;CASC,CAAC;IAEA,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBtB,CAAC;IAEA,OAAO;QACL,kBAAkB;QAClB,YAAY;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Research question generation utilities using prompt-driven AI analysis
|
|
3
|
+
* Implements intelligent research question generation and task tracking
|
|
4
|
+
*/
|
|
5
|
+
export interface ResearchProblem {
|
|
6
|
+
id: string;
|
|
7
|
+
description: string;
|
|
8
|
+
category: string;
|
|
9
|
+
severity: string;
|
|
10
|
+
context: string;
|
|
11
|
+
}
|
|
12
|
+
export interface KnowledgeGraph {
|
|
13
|
+
technologies: Array<{
|
|
14
|
+
name: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
category?: string;
|
|
17
|
+
}>;
|
|
18
|
+
patterns: Array<{
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
category?: string;
|
|
22
|
+
}>;
|
|
23
|
+
adrs: Array<{
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
status: string;
|
|
27
|
+
content?: string;
|
|
28
|
+
}>;
|
|
29
|
+
relationships: Array<{
|
|
30
|
+
source: string;
|
|
31
|
+
target: string;
|
|
32
|
+
type: string;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
export interface ResearchContext {
|
|
36
|
+
topic: string;
|
|
37
|
+
category: string;
|
|
38
|
+
scope: string;
|
|
39
|
+
objectives: string[];
|
|
40
|
+
constraints?: string[];
|
|
41
|
+
timeline?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface ResearchQuestion {
|
|
44
|
+
id: string;
|
|
45
|
+
question: string;
|
|
46
|
+
type: string;
|
|
47
|
+
priority: string;
|
|
48
|
+
complexity: string;
|
|
49
|
+
timeline: string;
|
|
50
|
+
methodology: string;
|
|
51
|
+
expectedOutcome: string;
|
|
52
|
+
successCriteria: string[];
|
|
53
|
+
relatedKnowledge: string[];
|
|
54
|
+
resources: string[];
|
|
55
|
+
risks: string[];
|
|
56
|
+
dependencies: string[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Correlate problems with knowledge graph
|
|
60
|
+
*/
|
|
61
|
+
export declare function correlateProblemKnowledge(problems: ResearchProblem[], knowledgeGraph: KnowledgeGraph): Promise<{
|
|
62
|
+
correlationPrompt: string;
|
|
63
|
+
instructions: string;
|
|
64
|
+
}>;
|
|
65
|
+
/**
|
|
66
|
+
* Find relevant ADRs and patterns for research context
|
|
67
|
+
*/
|
|
68
|
+
export declare function findRelevantAdrPatterns(researchContext: ResearchContext, adrDirectory?: string): Promise<{
|
|
69
|
+
relevancePrompt: string;
|
|
70
|
+
instructions: string;
|
|
71
|
+
}>;
|
|
72
|
+
/**
|
|
73
|
+
* Generate context-aware research questions
|
|
74
|
+
*/
|
|
75
|
+
export declare function generateContextAwareQuestions(researchContext: ResearchContext, relevantKnowledge: {
|
|
76
|
+
adrs: any[];
|
|
77
|
+
patterns: any[];
|
|
78
|
+
gaps: any[];
|
|
79
|
+
opportunities: any[];
|
|
80
|
+
}, projectPath?: string): Promise<{
|
|
81
|
+
questionPrompt: string;
|
|
82
|
+
instructions: string;
|
|
83
|
+
}>;
|
|
84
|
+
/**
|
|
85
|
+
* Create research task tracking system
|
|
86
|
+
*/
|
|
87
|
+
export declare function createResearchTaskTracking(researchQuestions: ResearchQuestion[], currentProgress?: Array<{
|
|
88
|
+
questionId: string;
|
|
89
|
+
status: string;
|
|
90
|
+
progress: number;
|
|
91
|
+
findings: string[];
|
|
92
|
+
blockers: string[];
|
|
93
|
+
}>): Promise<{
|
|
94
|
+
trackingPrompt: string;
|
|
95
|
+
instructions: string;
|
|
96
|
+
}>;
|
|
97
|
+
//# sourceMappingURL=research-questions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"research-questions.d.ts","sourceRoot":"","sources":["../../../src/utils/research-questions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,KAAK,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,QAAQ,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,IAAI,EAAE,KAAK,CAAC;QACV,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,aAAa,EAAE,KAAK,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAA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