mcp-adr-analysis-server 2.0.3 → 2.0.6
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/src/index.d.ts +28 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +703 -325
- package/dist/src/index.js.map +1 -1
- package/dist/src/prompts/adr-suggestion-prompts.d.ts +1 -0
- package/dist/src/prompts/adr-suggestion-prompts.d.ts.map +1 -1
- package/dist/src/prompts/adr-suggestion-prompts.js +14 -6
- package/dist/src/prompts/adr-suggestion-prompts.js.map +1 -1
- package/dist/src/resources/index.d.ts.map +1 -1
- package/dist/src/resources/index.js +31 -15
- package/dist/src/resources/index.js.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.d.ts +4 -1
- package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.js +72 -114
- package/dist/src/tools/adr-suggestion-tool.js.map +1 -1
- package/dist/src/tools/content-masking-tool.d.ts +7 -0
- package/dist/src/tools/content-masking-tool.d.ts.map +1 -1
- package/dist/src/tools/content-masking-tool.js +134 -17
- package/dist/src/tools/content-masking-tool.js.map +1 -1
- package/dist/src/tools/deployment-guidance-tool.d.ts +21 -0
- package/dist/src/tools/deployment-guidance-tool.d.ts.map +1 -0
- package/dist/src/tools/deployment-guidance-tool.js +289 -0
- package/dist/src/tools/deployment-guidance-tool.js.map +1 -0
- package/dist/src/tools/environment-analysis-tool.d.ts +4 -0
- package/dist/src/tools/environment-analysis-tool.d.ts.map +1 -1
- package/dist/src/tools/environment-analysis-tool.js +209 -25
- package/dist/src/tools/environment-analysis-tool.js.map +1 -1
- package/dist/src/tools/research-question-tool.d.ts +4 -0
- package/dist/src/tools/research-question-tool.d.ts.map +1 -1
- package/dist/src/tools/research-question-tool.js +42 -4
- package/dist/src/tools/research-question-tool.js.map +1 -1
- package/dist/src/tools/rule-generation-tool.d.ts +4 -0
- package/dist/src/tools/rule-generation-tool.d.ts.map +1 -1
- package/dist/src/tools/rule-generation-tool.js +136 -16
- package/dist/src/tools/rule-generation-tool.js.map +1 -1
- package/dist/src/tools/todo-management-tool.d.ts +166 -0
- package/dist/src/tools/todo-management-tool.d.ts.map +1 -0
- package/dist/src/tools/todo-management-tool.js +472 -0
- package/dist/src/tools/todo-management-tool.js.map +1 -0
- package/dist/src/types/conversation-context.d.ts +93 -0
- package/dist/src/types/conversation-context.d.ts.map +1 -0
- package/dist/src/types/conversation-context.js +101 -0
- package/dist/src/types/conversation-context.js.map +1 -0
- package/dist/src/utils/actual-file-operations.d.ts +40 -0
- package/dist/src/utils/actual-file-operations.d.ts.map +1 -0
- package/dist/src/utils/actual-file-operations.js +309 -0
- package/dist/src/utils/actual-file-operations.js.map +1 -0
- package/dist/src/utils/adr-discovery.d.ts +36 -0
- package/dist/src/utils/adr-discovery.d.ts.map +1 -0
- package/dist/src/utils/adr-discovery.js +237 -0
- package/dist/src/utils/adr-discovery.js.map +1 -0
- package/dist/src/utils/adr-suggestions.d.ts +2 -1
- package/dist/src/utils/adr-suggestions.d.ts.map +1 -1
- package/dist/src/utils/adr-suggestions.js +8 -2
- package/dist/src/utils/adr-suggestions.js.map +1 -1
- package/dist/src/utils/apply-cot-enhancement.d.ts +46 -0
- package/dist/src/utils/apply-cot-enhancement.d.ts.map +1 -0
- package/dist/src/utils/apply-cot-enhancement.js +165 -0
- package/dist/src/utils/apply-cot-enhancement.js.map +1 -0
- package/dist/src/utils/chain-of-thought-template.d.ts +48 -0
- package/dist/src/utils/chain-of-thought-template.d.ts.map +1 -0
- package/dist/src/utils/chain-of-thought-template.js +191 -0
- package/dist/src/utils/chain-of-thought-template.js.map +1 -0
- package/dist/src/utils/deployment-analysis.d.ts +1 -0
- package/dist/src/utils/deployment-analysis.d.ts.map +1 -1
- package/dist/src/utils/deployment-analysis.js +82 -39
- package/dist/src/utils/deployment-analysis.js.map +1 -1
- package/dist/src/utils/environment-analysis.d.ts +6 -1
- package/dist/src/utils/environment-analysis.d.ts.map +1 -1
- package/dist/src/utils/environment-analysis.js +176 -87
- package/dist/src/utils/environment-analysis.js.map +1 -1
- package/dist/src/utils/file-system.d.ts +1 -0
- package/dist/src/utils/file-system.d.ts.map +1 -1
- package/dist/src/utils/file-system.js +24 -47
- package/dist/src/utils/file-system.js.map +1 -1
- package/dist/src/utils/prompt-execution.d.ts.map +1 -1
- package/dist/src/utils/prompt-execution.js +67 -3
- package/dist/src/utils/prompt-execution.js.map +1 -1
- package/dist/src/utils/research-integration.d.ts +4 -0
- package/dist/src/utils/research-integration.d.ts.map +1 -1
- package/dist/src/utils/research-integration.js +275 -84
- package/dist/src/utils/research-integration.js.map +1 -1
- package/dist/src/utils/research-questions.d.ts.map +1 -1
- package/dist/src/utils/research-questions.js +134 -38
- package/dist/src/utils/research-questions.js.map +1 -1
- package/dist/src/utils/rule-generation.d.ts +2 -1
- package/dist/src/utils/rule-generation.d.ts.map +1 -1
- package/dist/src/utils/rule-generation.js +65 -36
- package/dist/src/utils/rule-generation.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-execution.js","sourceRoot":"","sources":["../../../src/utils/prompt-execution.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAqB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAgC5E;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,MAAc,EACd,YAAoB,EACpB,UAAkC,EAAE;IAEpC,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,eAAe,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAE7E,IAAI,WAAW,EAAE,CAAC;QAChB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,aAAa,EAAE,CAAC;YAEjC,IAAI,OAA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aAAa,MAAM,CAAC,KAAK,CAAC,gBAAgB,cAAc,CAAC,CAAC;QAClJ,CAAC;QAED,YAAY,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;KAChD,CAAC;AACJ,CAAC"}
|
|
@@ -49,6 +49,7 @@ export interface AdrImpactAnalysis {
|
|
|
49
49
|
export declare function monitorResearchDirectory(researchPath?: string): Promise<{
|
|
50
50
|
monitoringPrompt: string;
|
|
51
51
|
instructions: string;
|
|
52
|
+
actualData?: any;
|
|
52
53
|
}>;
|
|
53
54
|
/**
|
|
54
55
|
* Extract research topics from files
|
|
@@ -56,6 +57,7 @@ export declare function monitorResearchDirectory(researchPath?: string): Promise
|
|
|
56
57
|
export declare function extractResearchTopics(researchPath?: string, existingTopics?: string[]): Promise<{
|
|
57
58
|
extractionPrompt: string;
|
|
58
59
|
instructions: string;
|
|
60
|
+
actualData?: any;
|
|
59
61
|
}>;
|
|
60
62
|
/**
|
|
61
63
|
* Evaluate research impact on existing ADRs
|
|
@@ -63,6 +65,7 @@ export declare function extractResearchTopics(researchPath?: string, existingTop
|
|
|
63
65
|
export declare function evaluateResearchImpact(researchTopics: ResearchTopic[], adrDirectory?: string): Promise<{
|
|
64
66
|
evaluationPrompt: string;
|
|
65
67
|
instructions: string;
|
|
68
|
+
actualData?: any;
|
|
66
69
|
}>;
|
|
67
70
|
/**
|
|
68
71
|
* Generate ADR update suggestions
|
|
@@ -74,6 +77,7 @@ export declare function generateAdrUpdateSuggestions(adrId: string, researchFind
|
|
|
74
77
|
}>, updateType: 'content' | 'status' | 'consequences' | 'alternatives' | 'deprecation', adrDirectory?: string): Promise<{
|
|
75
78
|
updatePrompt: string;
|
|
76
79
|
instructions: string;
|
|
80
|
+
actualData?: any;
|
|
77
81
|
}>;
|
|
78
82
|
/**
|
|
79
83
|
* Create research file template
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"research-integration.d.ts","sourceRoot":"","sources":["../../../src/utils/research-integration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;CACjD;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,iBAAiB,EAAE,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC;IACjF,OAAO,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,YAAY,GAAE,MAAwB,GACrC,OAAO,CAAC;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"research-integration.d.ts","sourceRoot":"","sources":["../../../src/utils/research-integration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IA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CAAC;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC,CAqH/E;AAED;;GAEG;AACH,wBAAsB,4BAA4B,CAChD,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,KAAK,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,EACF,UAAU,EAAE,SAAS,GAAG,QAAQ,GAAG,cAAc,GAAG,cAAc,GAAG,aAAa,EAClF,YAAY,GAAE,MAAoB,GACjC,OAAO,CAAC;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC,CAwJ3E;AAID;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAkB,GAAG,MAAM,CAoE1F;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAC7C;IAAE,kBAAkB,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAoEtD"}
|
|
@@ -8,32 +8,89 @@ import { McpAdrError } from '../types/index.js';
|
|
|
8
8
|
*/
|
|
9
9
|
export async function monitorResearchDirectory(researchPath = 'docs/research') {
|
|
10
10
|
try {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
// Use actual file operations to scan research directory
|
|
12
|
+
const fs = await import('fs/promises');
|
|
13
|
+
const path = await import('path');
|
|
14
|
+
const projectPath = process.cwd();
|
|
15
|
+
const fullResearchPath = path.resolve(projectPath, researchPath);
|
|
16
|
+
let researchFiles = [];
|
|
17
|
+
try {
|
|
18
|
+
// Check if research directory exists
|
|
19
|
+
await fs.access(fullResearchPath);
|
|
20
|
+
// Scan for research files
|
|
21
|
+
const scanDirectory = async (dirPath) => {
|
|
22
|
+
const entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
23
|
+
for (const entry of entries) {
|
|
24
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
25
|
+
if (entry.isDirectory()) {
|
|
26
|
+
await scanDirectory(fullPath);
|
|
27
|
+
}
|
|
28
|
+
else if (entry.isFile()) {
|
|
29
|
+
const ext = path.extname(entry.name).toLowerCase();
|
|
30
|
+
const supportedExts = ['.md', '.txt', '.pdf', '.doc', '.docx'];
|
|
31
|
+
if (supportedExts.includes(ext)) {
|
|
32
|
+
try {
|
|
33
|
+
const stats = await fs.stat(fullPath);
|
|
34
|
+
let content = '';
|
|
35
|
+
// Only read text-based files
|
|
36
|
+
if (['.md', '.txt'].includes(ext)) {
|
|
37
|
+
content = await fs.readFile(fullPath, 'utf-8');
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
content = `[${ext.toUpperCase()} file - content not readable]`;
|
|
41
|
+
}
|
|
42
|
+
researchFiles.push({
|
|
43
|
+
filename: entry.name,
|
|
44
|
+
content,
|
|
45
|
+
lastModified: stats.mtime.toISOString(),
|
|
46
|
+
size: stats.size,
|
|
47
|
+
path: path.relative(projectPath, fullPath)
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
// Skip files that can't be read
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
await scanDirectory(fullResearchPath);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
// Research directory doesn't exist or is not accessible
|
|
61
|
+
}
|
|
20
62
|
const monitoringPrompt = `
|
|
21
63
|
# Research Directory Monitoring
|
|
22
64
|
|
|
23
|
-
|
|
65
|
+
Based on actual file system analysis, here are the research files found:
|
|
24
66
|
|
|
25
|
-
##
|
|
67
|
+
## Research Directory Status
|
|
68
|
+
- **Research Path**: ${researchPath}
|
|
69
|
+
- **Full Path**: ${fullResearchPath}
|
|
70
|
+
- **Files Found**: ${researchFiles.length} research files
|
|
71
|
+
- **Directory Exists**: ${researchFiles.length > 0 ? 'Yes' : 'No (may need to be created)'}
|
|
72
|
+
|
|
73
|
+
## Discovered Research Files
|
|
26
74
|
|
|
27
|
-
${
|
|
75
|
+
${researchFiles.length > 0 ?
|
|
76
|
+
researchFiles.map((file, index) => `
|
|
77
|
+
### ${index + 1}. ${file.filename}
|
|
78
|
+
- **Path**: ${file.path}
|
|
79
|
+
- **Size**: ${file.size} bytes
|
|
80
|
+
- **Last Modified**: ${file.lastModified}
|
|
28
81
|
|
|
29
|
-
|
|
82
|
+
#### Content:
|
|
83
|
+
\`\`\`
|
|
84
|
+
${file.content.slice(0, 1000)}${file.content.length > 1000 ? '\n... (truncated)' : ''}
|
|
85
|
+
\`\`\`
|
|
30
86
|
|
|
31
|
-
|
|
87
|
+
---
|
|
88
|
+
`).join('\n') : '**No research files found.** You may need to:\n- Create the research directory: `mkdir -p docs/research`\n- Add research files in supported formats (.md, .txt, .pdf, .doc, .docx)\n- Use the research template tool to create structured research documents'}
|
|
32
89
|
|
|
33
90
|
## Analysis Requirements
|
|
34
91
|
|
|
35
92
|
For each research file discovered:
|
|
36
|
-
1. Extract key architectural insights and findings
|
|
93
|
+
1. Extract key architectural insights and findings from **actual file content**
|
|
37
94
|
2. Identify potential impacts on existing ADRs
|
|
38
95
|
3. Assess relevance to current project decisions
|
|
39
96
|
4. Categorize research by topic and priority
|
|
@@ -51,18 +108,24 @@ Please provide research monitoring analysis in JSON format with:
|
|
|
51
108
|
const instructions = `
|
|
52
109
|
# Research Directory Monitoring Instructions
|
|
53
110
|
|
|
54
|
-
This analysis
|
|
111
|
+
This analysis provides **actual research file contents** for comprehensive architectural insights and findings.
|
|
55
112
|
|
|
56
113
|
## Monitoring Scope
|
|
57
114
|
- **Research Path**: ${researchPath}
|
|
115
|
+
- **Files Found**: ${researchFiles.length} research files
|
|
116
|
+
- **Readable Files**: ${researchFiles.filter(f => f.content && !f.content.includes('content not readable')).length} files
|
|
58
117
|
- **File Types**: Markdown, Text, PDF, Word documents
|
|
59
118
|
- **Analysis Focus**: Architectural insights, ADR impacts, integration opportunities
|
|
60
119
|
|
|
120
|
+
## Discovered Files Summary
|
|
121
|
+
${researchFiles.map(f => `- **${f.filename}** (${f.size} bytes, modified: ${f.lastModified.split('T')[0]})`).join('\n')}
|
|
122
|
+
|
|
61
123
|
## Next Steps
|
|
62
|
-
1. **
|
|
63
|
-
2. **
|
|
64
|
-
3. **
|
|
65
|
-
4. **
|
|
124
|
+
1. **Submit the monitoring prompt** to an AI agent for analysis of **actual file content**
|
|
125
|
+
2. **Extract research topics** using the topic extraction tool
|
|
126
|
+
3. **Analyze impact on existing ADRs** using the impact evaluation tool
|
|
127
|
+
4. **Generate update suggestions** for affected ADRs
|
|
128
|
+
5. **Monitor for new research** files and changes
|
|
66
129
|
|
|
67
130
|
## Monitoring Recommendations
|
|
68
131
|
- Set up file system watchers for automatic detection
|
|
@@ -71,15 +134,39 @@ This analysis will monitor research directory for architectural insights and fin
|
|
|
71
134
|
- Schedule regular research integration reviews
|
|
72
135
|
|
|
73
136
|
## Getting Started
|
|
74
|
-
To begin using research integration:
|
|
137
|
+
${researchFiles.length === 0 ? `To begin using research integration:
|
|
75
138
|
1. Create the research directory: \`mkdir -p ${researchPath}\`
|
|
76
139
|
2. Add research files (markdown, text, or documents)
|
|
77
140
|
3. Use the \`incorporate_research\` tool to analyze findings
|
|
78
|
-
4. Review suggested ADR updates and implementations
|
|
141
|
+
4. Review suggested ADR updates and implementations` :
|
|
142
|
+
`Research files are already available for analysis. Proceed with topic extraction and impact evaluation.`}
|
|
143
|
+
|
|
144
|
+
## Expected AI Response Format
|
|
145
|
+
The AI will return a JSON object with:
|
|
146
|
+
- \`researchInventory\`: File inventory with metadata and analysis
|
|
147
|
+
- \`keyInsights\`: Major architectural insights from actual content
|
|
148
|
+
- \`impactAssessment\`: Potential impacts on existing ADRs
|
|
149
|
+
- \`integrationRecommendations\`: Specific recommendations for incorporating findings
|
|
150
|
+
|
|
151
|
+
## Usage Example
|
|
152
|
+
\`\`\`typescript
|
|
153
|
+
const result = await monitorResearchDirectory(researchPath);
|
|
154
|
+
// Submit result.monitoringPrompt to AI agent
|
|
155
|
+
// Parse AI response for research insights and recommendations
|
|
156
|
+
\`\`\`
|
|
79
157
|
`;
|
|
80
158
|
return {
|
|
81
159
|
monitoringPrompt,
|
|
82
160
|
instructions,
|
|
161
|
+
actualData: {
|
|
162
|
+
researchFiles,
|
|
163
|
+
summary: {
|
|
164
|
+
totalFiles: researchFiles.length,
|
|
165
|
+
readableFiles: researchFiles.filter(f => f.content && !f.content.includes('content not readable')).length,
|
|
166
|
+
directoryExists: researchFiles.length > 0,
|
|
167
|
+
lastModified: researchFiles.length > 0 ? Math.max(...researchFiles.map(f => new Date(f.lastModified).getTime())) : null
|
|
168
|
+
}
|
|
169
|
+
}
|
|
83
170
|
};
|
|
84
171
|
}
|
|
85
172
|
catch (error) {
|
|
@@ -91,21 +178,32 @@ To begin using research integration:
|
|
|
91
178
|
*/
|
|
92
179
|
export async function extractResearchTopics(researchPath = 'docs/research', existingTopics) {
|
|
93
180
|
try {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const
|
|
181
|
+
// Reuse the actual file monitoring to get research files
|
|
182
|
+
const monitoringResult = await monitorResearchDirectory(researchPath);
|
|
183
|
+
const researchFiles = monitoringResult.actualData?.researchFiles || [];
|
|
184
|
+
// Filter to only text-based files for topic extraction
|
|
185
|
+
const textFiles = researchFiles.filter((f) => f.content && !f.content.includes('content not readable'));
|
|
97
186
|
const extractionPrompt = `
|
|
98
187
|
# Research Topic Extraction
|
|
99
188
|
|
|
100
|
-
|
|
189
|
+
Based on actual research file analysis, here are the files with extractable content:
|
|
101
190
|
|
|
102
|
-
##
|
|
191
|
+
## Research Files for Topic Extraction
|
|
103
192
|
|
|
104
|
-
${
|
|
193
|
+
${textFiles.length > 0 ?
|
|
194
|
+
textFiles.map((file, index) => `
|
|
195
|
+
### ${index + 1}. ${file.filename}
|
|
196
|
+
- **Path**: ${file.path}
|
|
197
|
+
- **Size**: ${file.size} bytes
|
|
198
|
+
- **Last Modified**: ${file.lastModified.split('T')[0]}
|
|
105
199
|
|
|
106
|
-
|
|
200
|
+
#### Full Content:
|
|
201
|
+
\`\`\`markdown
|
|
202
|
+
${file.content}
|
|
203
|
+
\`\`\`
|
|
107
204
|
|
|
108
|
-
|
|
205
|
+
---
|
|
206
|
+
`).join('\n') : '**No text-based research files found for topic extraction.**\n\nTo extract topics, you need:\n- Research files in .md or .txt format\n- Files with readable content\n- Research content that contains architectural insights'}
|
|
109
207
|
|
|
110
208
|
## Existing Topics Context
|
|
111
209
|
|
|
@@ -116,8 +214,8 @@ ${existingTopics.map((topic, index) => `${index + 1}. ${topic}`).join('\n')}
|
|
|
116
214
|
|
|
117
215
|
## Topic Extraction Requirements
|
|
118
216
|
|
|
119
|
-
For each research file
|
|
120
|
-
1. Extract key architectural insights and findings
|
|
217
|
+
For each research file with **actual content** shown above:
|
|
218
|
+
1. Extract key architectural insights and findings from the **actual file content**
|
|
121
219
|
2. Identify potential impacts on existing decisions
|
|
122
220
|
3. Categorize topics by relevance and priority
|
|
123
221
|
4. Generate actionable recommendations
|
|
@@ -126,24 +224,29 @@ For each research file discovered:
|
|
|
126
224
|
const instructions = `
|
|
127
225
|
# Research Topic Extraction Instructions
|
|
128
226
|
|
|
129
|
-
This analysis
|
|
227
|
+
This analysis provides **actual research file contents** to extract key topics and findings that could impact architectural decisions.
|
|
130
228
|
|
|
131
229
|
## Research Analysis
|
|
132
230
|
- **Research Path**: ${researchPath}
|
|
231
|
+
- **Total Research Files**: ${researchFiles.length} files
|
|
232
|
+
- **Text-Based Files**: ${textFiles.length} files with extractable content
|
|
133
233
|
- **Existing Topics**: ${existingTopics?.length || 0} topics
|
|
134
|
-
- **Analysis Focus**: Topic extraction, impact assessment, integration opportunities
|
|
234
|
+
- **Analysis Focus**: Topic extraction from actual content, impact assessment, integration opportunities
|
|
235
|
+
|
|
236
|
+
## Discovered Text Files
|
|
237
|
+
${textFiles.map((f) => `- **${f.filename}** (${f.size} bytes)`).join('\n')}
|
|
135
238
|
|
|
136
239
|
## Next Steps
|
|
137
|
-
1. **Submit the extraction prompt** to an AI agent for topic analysis
|
|
240
|
+
1. **Submit the extraction prompt** to an AI agent for topic analysis based on **actual file content**
|
|
138
241
|
2. **Parse the JSON response** to get extracted topics and insights
|
|
139
242
|
3. **Review the research findings** for architectural relevance
|
|
140
243
|
4. **Use the impact evaluation tool** to assess ADR implications
|
|
141
244
|
|
|
142
245
|
## Expected AI Response Format
|
|
143
246
|
The AI will return a JSON object with:
|
|
144
|
-
- \`extractedTopics\`: Array of research topics with findings and evidence
|
|
247
|
+
- \`extractedTopics\`: Array of research topics with findings and evidence based on actual content
|
|
145
248
|
- \`researchSummary\`: Overall assessment of research quality and completeness
|
|
146
|
-
- \`keyInsights\`: Major insights that require action
|
|
249
|
+
- \`keyInsights\`: Major insights that require action derived from actual files
|
|
147
250
|
- \`recommendations\`: Specific recommendations for incorporating findings
|
|
148
251
|
- \`gaps\`: Areas where additional research is needed
|
|
149
252
|
|
|
@@ -151,12 +254,21 @@ The AI will return a JSON object with:
|
|
|
151
254
|
\`\`\`typescript
|
|
152
255
|
const result = await extractResearchTopics(researchPath, existingTopics);
|
|
153
256
|
// Submit result.extractionPrompt to AI agent
|
|
154
|
-
// Parse AI response for research topics and insights
|
|
257
|
+
// Parse AI response for research topics and insights based on actual content
|
|
155
258
|
\`\`\`
|
|
156
259
|
`;
|
|
157
260
|
return {
|
|
158
261
|
extractionPrompt,
|
|
159
262
|
instructions,
|
|
263
|
+
actualData: {
|
|
264
|
+
researchFiles,
|
|
265
|
+
textFiles,
|
|
266
|
+
summary: {
|
|
267
|
+
totalFiles: researchFiles.length,
|
|
268
|
+
textFiles: textFiles.length,
|
|
269
|
+
existingTopics: existingTopics?.length || 0
|
|
270
|
+
}
|
|
271
|
+
}
|
|
160
272
|
};
|
|
161
273
|
}
|
|
162
274
|
catch (error) {
|
|
@@ -168,79 +280,110 @@ const result = await extractResearchTopics(researchPath, existingTopics);
|
|
|
168
280
|
*/
|
|
169
281
|
export async function evaluateResearchImpact(researchTopics, adrDirectory = 'docs/adrs') {
|
|
170
282
|
try {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
});
|
|
283
|
+
// Use actual ADR discovery instead of prompts
|
|
284
|
+
const { discoverAdrsInDirectory } = await import('./adr-discovery.js');
|
|
285
|
+
// Actually read ADR files
|
|
286
|
+
const discoveryResult = await discoverAdrsInDirectory(adrDirectory, true, process.cwd());
|
|
176
287
|
const evaluationPrompt = `
|
|
177
288
|
# Research Impact Evaluation
|
|
178
289
|
|
|
179
|
-
|
|
290
|
+
Based on actual ADR file analysis and research topics, analyze how research findings impact existing ADRs:
|
|
180
291
|
|
|
181
|
-
##
|
|
292
|
+
## Discovered ADRs (${discoveryResult.totalAdrs} total)
|
|
182
293
|
|
|
183
|
-
${
|
|
294
|
+
${discoveryResult.adrs.length > 0 ?
|
|
295
|
+
discoveryResult.adrs.map((adr, index) => `
|
|
296
|
+
### ${index + 1}. ${adr.title}
|
|
297
|
+
- **File**: ${adr.filename}
|
|
298
|
+
- **Status**: ${adr.status}
|
|
299
|
+
- **Path**: ${adr.path}
|
|
300
|
+
${adr.metadata?.number ? `- **Number**: ${adr.metadata.number}` : ''}
|
|
184
301
|
|
|
185
|
-
|
|
302
|
+
#### ADR Content:
|
|
303
|
+
\`\`\`markdown
|
|
304
|
+
${adr.content || 'Content not available'}
|
|
305
|
+
\`\`\`
|
|
186
306
|
|
|
187
|
-
|
|
307
|
+
---
|
|
308
|
+
`).join('\n') : 'No ADRs found in the specified directory.'}
|
|
188
309
|
|
|
189
310
|
## Research Topics Analysis
|
|
190
311
|
|
|
191
|
-
Please evaluate the following research topics for their impact on
|
|
312
|
+
Please evaluate the following research topics for their impact on the **actual ADR content** above:
|
|
192
313
|
|
|
193
314
|
${researchTopics.map((topic, index) => `
|
|
194
315
|
### ${index + 1}. ${topic.title}
|
|
316
|
+
- **Category**: ${topic.category}
|
|
195
317
|
- **Relevance Score**: ${topic.relevanceScore}
|
|
318
|
+
- **Confidence**: ${topic.confidence}
|
|
196
319
|
- **Key Findings**: ${topic.keyFindings.join(', ')}
|
|
197
320
|
- **Evidence**: ${topic.evidence.join(', ')}
|
|
198
|
-
- **
|
|
321
|
+
- **Source Files**: ${topic.sourceFiles.join(', ')}
|
|
322
|
+
- **Description**: ${topic.description}
|
|
323
|
+
- **Tags**: ${topic.tags.join(', ')}
|
|
199
324
|
`).join('')}
|
|
200
325
|
|
|
201
326
|
## Impact Assessment Requirements
|
|
202
327
|
|
|
203
|
-
For each research topic
|
|
204
|
-
1. Identify affected ADRs based on content analysis
|
|
205
|
-
2. Assess the severity of impact (low, medium, high)
|
|
328
|
+
For each research topic and each ADR with **actual content**:
|
|
329
|
+
1. Identify affected ADRs based on actual content analysis
|
|
330
|
+
2. Assess the severity of impact (low, medium, high, critical)
|
|
206
331
|
3. Determine required updates or new decisions
|
|
207
|
-
4. Prioritize changes based on business impact
|
|
208
|
-
5. Generate specific update recommendations
|
|
332
|
+
4. Prioritize changes based on business impact and evidence strength
|
|
333
|
+
5. Generate specific update recommendations with references to actual ADR sections
|
|
209
334
|
`;
|
|
210
335
|
const instructions = `
|
|
211
336
|
# Research Impact Evaluation Instructions
|
|
212
337
|
|
|
213
|
-
This analysis
|
|
338
|
+
This analysis provides **actual ADR content and research topics** to evaluate how research findings impact existing ADRs.
|
|
214
339
|
|
|
215
340
|
## Impact Analysis
|
|
216
341
|
- **Research Topics**: ${researchTopics.length} topics
|
|
217
342
|
- **ADR Directory**: ${adrDirectory}
|
|
343
|
+
- **ADRs Found**: ${discoveryResult.totalAdrs} files
|
|
344
|
+
- **ADRs with Content**: ${discoveryResult.adrs.filter(adr => adr.content).length} ADRs
|
|
218
345
|
- **High Relevance Topics**: ${researchTopics.filter(t => t.relevanceScore > 0.7).length} topics
|
|
219
346
|
|
|
347
|
+
## Discovered ADR Summary
|
|
348
|
+
${discoveryResult.adrs.map(adr => `- **${adr.title}** (${adr.status})`).join('\n')}
|
|
349
|
+
|
|
350
|
+
## Research Topic Summary
|
|
351
|
+
${researchTopics.map(topic => `- **${topic.title}** (Relevance: ${topic.relevanceScore}, Confidence: ${topic.confidence})`).join('\n')}
|
|
352
|
+
|
|
220
353
|
## Next Steps
|
|
221
|
-
1. **Submit the evaluation prompt** to an AI agent for impact analysis
|
|
354
|
+
1. **Submit the evaluation prompt** to an AI agent for impact analysis based on **actual ADR content**
|
|
222
355
|
2. **Parse the JSON response** to get impact assessments and recommendations
|
|
223
356
|
3. **Review suggested updates** and prioritize based on impact level
|
|
224
357
|
4. **Use the update suggestion tool** for specific ADR modifications
|
|
225
358
|
|
|
226
359
|
## Expected AI Response Format
|
|
227
360
|
The AI will return a JSON object with:
|
|
228
|
-
- \`impactAnalysis\`: Detailed impact assessment for each ADR
|
|
229
|
-
- \`updateRecommendations\`: Specific update suggestions with justifications
|
|
230
|
-
- \`newAdrSuggestions\`: Recommendations for new ADRs based on research
|
|
231
|
-
- \`deprecationSuggestions\`: ADRs that should be deprecated
|
|
361
|
+
- \`impactAnalysis\`: Detailed impact assessment for each ADR based on actual content
|
|
362
|
+
- \`updateRecommendations\`: Specific update suggestions with justifications and content references
|
|
363
|
+
- \`newAdrSuggestions\`: Recommendations for new ADRs based on research findings
|
|
364
|
+
- \`deprecationSuggestions\`: ADRs that should be deprecated based on research evidence
|
|
232
365
|
- \`overallAssessment\`: Summary of findings and action priorities
|
|
233
366
|
|
|
234
367
|
## Usage Example
|
|
235
368
|
\`\`\`typescript
|
|
236
369
|
const result = await evaluateResearchImpact(researchTopics, adrDirectory);
|
|
237
370
|
// Submit result.evaluationPrompt to AI agent
|
|
238
|
-
// Parse AI response for impact analysis
|
|
371
|
+
// Parse AI response for impact analysis based on actual ADR content
|
|
239
372
|
\`\`\`
|
|
240
373
|
`;
|
|
241
374
|
return {
|
|
242
375
|
evaluationPrompt,
|
|
243
376
|
instructions,
|
|
377
|
+
actualData: {
|
|
378
|
+
discoveryResult,
|
|
379
|
+
researchTopics,
|
|
380
|
+
summary: {
|
|
381
|
+
totalAdrs: discoveryResult.totalAdrs,
|
|
382
|
+
adrsWithContent: discoveryResult.adrs.filter(adr => adr.content).length,
|
|
383
|
+
totalTopics: researchTopics.length,
|
|
384
|
+
highRelevanceTopics: researchTopics.filter(t => t.relevanceScore > 0.7).length
|
|
385
|
+
}
|
|
386
|
+
}
|
|
244
387
|
};
|
|
245
388
|
}
|
|
246
389
|
catch (error) {
|
|
@@ -252,30 +395,55 @@ const result = await evaluateResearchImpact(researchTopics, adrDirectory);
|
|
|
252
395
|
*/
|
|
253
396
|
export async function generateAdrUpdateSuggestions(adrId, researchFindings, updateType, adrDirectory = 'docs/adrs') {
|
|
254
397
|
try {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
398
|
+
// Use actual ADR discovery instead of prompts
|
|
399
|
+
const { discoverAdrsInDirectory } = await import('./adr-discovery.js');
|
|
400
|
+
// Actually read ADR files
|
|
401
|
+
const discoveryResult = await discoverAdrsInDirectory(adrDirectory, true, process.cwd());
|
|
402
|
+
// Try to find the target ADR by ID
|
|
403
|
+
const targetAdr = discoveryResult.adrs.find(adr => adr.filename.includes(adrId) ||
|
|
404
|
+
adr.content?.includes(adrId) ||
|
|
405
|
+
adr.path.includes(adrId) ||
|
|
406
|
+
adr.metadata?.number?.toString() === adrId);
|
|
260
407
|
const updatePrompt = `
|
|
261
408
|
# ADR Update Suggestion
|
|
262
409
|
|
|
263
|
-
|
|
410
|
+
Based on actual ADR file analysis, generate updates for the specified ADR based on research findings.
|
|
264
411
|
|
|
265
|
-
##
|
|
412
|
+
## All Discovered ADRs (${discoveryResult.totalAdrs} total)
|
|
266
413
|
|
|
267
|
-
${
|
|
414
|
+
${discoveryResult.adrs.length > 0 ?
|
|
415
|
+
discoveryResult.adrs.map((adr, index) => `
|
|
416
|
+
### ${index + 1}. ${adr.title}
|
|
417
|
+
- **File**: ${adr.filename}
|
|
418
|
+
- **Status**: ${adr.status}
|
|
419
|
+
- **Path**: ${adr.path}
|
|
420
|
+
${adr.metadata?.number ? `- **Number**: ${adr.metadata.number}` : ''}
|
|
421
|
+
${adr === targetAdr ? '**⭐ TARGET ADR ⭐**' : ''}
|
|
268
422
|
|
|
269
|
-
|
|
423
|
+
#### ADR Content:
|
|
424
|
+
\`\`\`markdown
|
|
425
|
+
${adr.content || 'Content not available'}
|
|
426
|
+
\`\`\`
|
|
270
427
|
|
|
271
|
-
|
|
428
|
+
---
|
|
429
|
+
`).join('\n') : 'No ADRs found in the specified directory.'}
|
|
272
430
|
|
|
273
431
|
## Target ADR Identification
|
|
274
432
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
-
|
|
433
|
+
**Target ADR ID**: ${adrId}
|
|
434
|
+
${targetAdr ? `
|
|
435
|
+
**✅ FOUND TARGET ADR**: ${targetAdr.title}
|
|
436
|
+
- **File**: ${targetAdr.filename}
|
|
437
|
+
- **Status**: ${targetAdr.status}
|
|
438
|
+
- **Path**: ${targetAdr.path}
|
|
439
|
+
` : `
|
|
440
|
+
**❌ TARGET ADR NOT FOUND**
|
|
441
|
+
Please locate the ADR with ID: **${adrId}** by:
|
|
442
|
+
- Searching by filename containing the ID
|
|
443
|
+
- Searching by content containing the ID
|
|
444
|
+
- Searching by path containing the ID
|
|
445
|
+
- Searching by ADR number matching the ID
|
|
446
|
+
`}
|
|
279
447
|
|
|
280
448
|
## Research Findings to Incorporate
|
|
281
449
|
|
|
@@ -298,24 +466,36 @@ ${researchFindings.map((finding, index) => `
|
|
|
298
466
|
|
|
299
467
|
Please provide the updated ADR content with:
|
|
300
468
|
1. Clear indication of what was changed
|
|
301
|
-
2. Integration of research findings
|
|
469
|
+
2. Integration of research findings into the **actual ADR content** shown above
|
|
302
470
|
3. Updated metadata and timestamps
|
|
303
471
|
4. Preservation of ADR structure and format
|
|
304
472
|
`;
|
|
305
473
|
const instructions = `
|
|
306
474
|
# ADR Update Suggestion Instructions
|
|
307
475
|
|
|
308
|
-
This
|
|
476
|
+
This analysis provides **actual ADR content** to generate specific update suggestions based on research findings.
|
|
309
477
|
|
|
310
478
|
## Update Details
|
|
311
479
|
- **ADR ID**: ${adrId}
|
|
312
|
-
- **Target ADR**:
|
|
480
|
+
- **Target ADR**: ${targetAdr ? `✅ Found - ${targetAdr.title}` : '❌ Not found - will need identification'}
|
|
481
|
+
- **ADRs Available**: ${discoveryResult.totalAdrs} total ADRs
|
|
313
482
|
- **Update Focus**: ${updateType}
|
|
314
|
-
- **Update Type**: ${updateType}
|
|
315
483
|
- **Research Findings**: ${researchFindings.length} findings
|
|
316
484
|
|
|
485
|
+
## Target ADR Status
|
|
486
|
+
${targetAdr ? `
|
|
487
|
+
**Target Found**: ${targetAdr.title}
|
|
488
|
+
- **File**: ${targetAdr.filename}
|
|
489
|
+
- **Status**: ${targetAdr.status}
|
|
490
|
+
- **Path**: ${targetAdr.path}
|
|
491
|
+
- **Content Length**: ${targetAdr.content?.length || 0} characters
|
|
492
|
+
` : `
|
|
493
|
+
**Target Not Found**: ADR with ID "${adrId}" could not be automatically identified.
|
|
494
|
+
The AI agent will need to search through the ${discoveryResult.totalAdrs} available ADRs using the provided content.
|
|
495
|
+
`}
|
|
496
|
+
|
|
317
497
|
## Next Steps
|
|
318
|
-
1. **Submit the update prompt** to an AI agent for suggestion generation
|
|
498
|
+
1. **Submit the update prompt** to an AI agent for suggestion generation based on **actual ADR content**
|
|
319
499
|
2. **Parse the JSON response** to get detailed update recommendations
|
|
320
500
|
3. **Review the proposed changes** for accuracy and completeness
|
|
321
501
|
4. **Apply the updates** to the ADR file with proper version control
|
|
@@ -324,8 +504,8 @@ This will generate specific update suggestions for an ADR based on research find
|
|
|
324
504
|
## Expected AI Response Format
|
|
325
505
|
The AI will return a JSON object with:
|
|
326
506
|
- \`updateSuggestion\`: Overall update metadata and assessment
|
|
327
|
-
- \`proposedChanges\`: Specific changes to make to the ADR
|
|
328
|
-
- \`newContent\`: Complete updated ADR content
|
|
507
|
+
- \`proposedChanges\`: Specific changes to make to the actual ADR content
|
|
508
|
+
- \`newContent\`: Complete updated ADR content based on actual current content
|
|
329
509
|
- \`migrationGuidance\`: Implementation and rollback guidance
|
|
330
510
|
- \`qualityChecks\`: Quality assessment of the proposed updates
|
|
331
511
|
- \`reviewRecommendations\`: Suggested review and approval process
|
|
@@ -334,12 +514,23 @@ The AI will return a JSON object with:
|
|
|
334
514
|
\`\`\`typescript
|
|
335
515
|
const result = await generateAdrUpdateSuggestions(adrId, findings, updateType);
|
|
336
516
|
// Submit result.updatePrompt to AI agent
|
|
337
|
-
// Parse AI response for update suggestions
|
|
517
|
+
// Parse AI response for update suggestions based on actual ADR content
|
|
338
518
|
\`\`\`
|
|
339
519
|
`;
|
|
340
520
|
return {
|
|
341
521
|
updatePrompt,
|
|
342
522
|
instructions,
|
|
523
|
+
actualData: {
|
|
524
|
+
discoveryResult,
|
|
525
|
+
targetAdr,
|
|
526
|
+
researchFindings,
|
|
527
|
+
summary: {
|
|
528
|
+
totalAdrs: discoveryResult.totalAdrs,
|
|
529
|
+
targetFound: !!targetAdr,
|
|
530
|
+
updateType,
|
|
531
|
+
findingsCount: researchFindings.length
|
|
532
|
+
}
|
|
533
|
+
}
|
|
343
534
|
};
|
|
344
535
|
}
|
|
345
536
|
catch (error) {
|