mcp-adr-analysis-server 2.12.0 → 2.13.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/.tsbuildinfo +1 -1
- package/dist/src/mcp-adr-analysis-server.d.ts.map +1 -1
- package/dist/src/mcp-adr-analysis-server.js +74 -447
- package/dist/src/mcp-adr-analysis-server.js.map +1 -1
- package/dist/src/tools/ce-mcp-tools.d.ts +46 -0
- package/dist/src/tools/ce-mcp-tools.d.ts.map +1 -1
- package/dist/src/tools/ce-mcp-tools.js +173 -1
- package/dist/src/tools/ce-mcp-tools.js.map +1 -1
- package/dist/src/tools/tool-catalog.js +3 -3
- package/dist/src/tools/tool-catalog.js.map +1 -1
- package/dist/src/utils/file-system.d.ts.map +1 -1
- package/dist/src/utils/file-system.js +25 -35
- package/dist/src/utils/file-system.js.map +1 -1
- package/dist/src/utils/tiered-response-manager.d.ts +2 -1
- package/dist/src/utils/tiered-response-manager.d.ts.map +1 -1
- package/dist/src/utils/tiered-response-manager.js +4 -29
- package/dist/src/utils/tiered-response-manager.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-adr-analysis-server.d.ts","sourceRoot":"","sources":["../../src/mcp-adr-analysis-server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAOL,KAAK,cAAc,EACpB,MAAM,oCAAoC,CAAC;AA4B5C,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAEhC,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,2B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;CAoH5B"}
|
|
@@ -592,8 +592,26 @@ export class McpAdrAnalysisServer {
|
|
|
592
592
|
*/
|
|
593
593
|
async checkAIExecutionStatus(_args) {
|
|
594
594
|
try {
|
|
595
|
-
const {
|
|
596
|
-
const
|
|
595
|
+
const { loadAIConfig, isAIExecutionEnabled } = await import('./config/ai-config.js');
|
|
596
|
+
const config = loadAIConfig();
|
|
597
|
+
const hasApiKey = !!config.apiKey;
|
|
598
|
+
const isEnabled = isAIExecutionEnabled(config);
|
|
599
|
+
let reason = undefined;
|
|
600
|
+
if (config.executionMode !== 'ce-mcp') {
|
|
601
|
+
if (!hasApiKey) {
|
|
602
|
+
reason = 'Missing OPENROUTER_API_KEY environment variable';
|
|
603
|
+
}
|
|
604
|
+
else if (config.executionMode !== 'full') {
|
|
605
|
+
reason = `EXECUTION_MODE is '${config.executionMode}', should be 'full'`;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
const status = {
|
|
609
|
+
isEnabled,
|
|
610
|
+
hasApiKey,
|
|
611
|
+
executionMode: config.executionMode,
|
|
612
|
+
model: config.defaultModel,
|
|
613
|
+
reason,
|
|
614
|
+
};
|
|
597
615
|
return {
|
|
598
616
|
content: [
|
|
599
617
|
{
|
|
@@ -840,65 +858,15 @@ Provide a comprehensive workflow guide that includes:
|
|
|
840
858
|
|
|
841
859
|
Make the guidance **actionable, specific, and outcome-focused** so the user can immediately start executing the recommended workflow.
|
|
842
860
|
`;
|
|
843
|
-
//
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
});
|
|
853
|
-
if (executionResult.isAIGenerated) {
|
|
854
|
-
// AI execution successful - return actual workflow guidance
|
|
855
|
-
return formatMCPResponse({
|
|
856
|
-
...executionResult,
|
|
857
|
-
content: `# Workflow Guidance & Tool Recommendations
|
|
858
|
-
|
|
859
|
-
## Your Context
|
|
860
|
-
- **Goal**: ${goal}
|
|
861
|
-
- **Project Context**: ${projectContext}
|
|
862
|
-
- **Available Assets**: ${availableAssets.length > 0 ? availableAssets.join(', ') : 'None specified'}
|
|
863
|
-
- **Timeframe**: ${timeframe}
|
|
864
|
-
- **Primary Concerns**: ${primaryConcerns.length > 0 ? primaryConcerns.join(', ') : 'General analysis'}
|
|
865
|
-
|
|
866
|
-
## AI-Generated Workflow Guidance
|
|
867
|
-
|
|
868
|
-
${executionResult.content}
|
|
869
|
-
|
|
870
|
-
## Quick Reference: Available Tools
|
|
871
|
-
|
|
872
|
-
**Core Analysis**: analyze_project_ecosystem, get_architectural_context, generate_adrs_from_prd, analyze_content_security
|
|
873
|
-
**ADR Management**: suggest_adrs, generate_adr_from_decision, discover_existing_adrs
|
|
874
|
-
**Security**: generate_content_masking, configure_custom_patterns, validate_content_masking
|
|
875
|
-
**Governance**: generate_rules, validate_rules, create_rule_set
|
|
876
|
-
**Environment**: analyze_environment, analyze_deployment_progress
|
|
877
|
-
**Utilities**: manage_cache, configure_output_masking, check_ai_execution_status
|
|
878
|
-
|
|
879
|
-
## Next Steps
|
|
880
|
-
|
|
881
|
-
1. **Start with the recommended primary workflow** above
|
|
882
|
-
2. **Call the first tool** with the suggested parameters
|
|
883
|
-
3. **Review the results** and proceed to the next step
|
|
884
|
-
4. **Track progress** using the success metrics provided
|
|
885
|
-
5. **Adjust as needed** based on your specific findings
|
|
886
|
-
|
|
887
|
-
This guidance is tailored to your specific context and goals for maximum effectiveness!
|
|
888
|
-
`,
|
|
889
|
-
});
|
|
890
|
-
}
|
|
891
|
-
else {
|
|
892
|
-
// Fallback to prompt-only mode
|
|
893
|
-
return {
|
|
894
|
-
content: [
|
|
895
|
-
{
|
|
896
|
-
type: 'text',
|
|
897
|
-
text: workflowPrompt,
|
|
898
|
-
},
|
|
899
|
-
],
|
|
900
|
-
};
|
|
901
|
-
}
|
|
861
|
+
// CE-MCP: return prompt text directly; directive intercepts in CE-MCP mode.
|
|
862
|
+
return {
|
|
863
|
+
content: [
|
|
864
|
+
{
|
|
865
|
+
type: 'text',
|
|
866
|
+
text: workflowPrompt,
|
|
867
|
+
},
|
|
868
|
+
],
|
|
869
|
+
};
|
|
902
870
|
}
|
|
903
871
|
catch (error) {
|
|
904
872
|
throw new McpAdrError(`Failed to generate workflow guidance: ${error instanceof Error ? error.message : String(error)}`, 'WORKFLOW_ERROR');
|
|
@@ -1065,77 +1033,15 @@ Ensure all development guidance:
|
|
|
1065
1033
|
|
|
1066
1034
|
Make the guidance **actionable, specific, and immediately implementable** so developers can start coding with confidence and architectural alignment.
|
|
1067
1035
|
`;
|
|
1068
|
-
//
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
Consider team context, technology stack, and development phase to provide tailored recommendations.`,
|
|
1078
|
-
});
|
|
1079
|
-
if (executionResult.isAIGenerated) {
|
|
1080
|
-
// AI execution successful - return actual development guidance
|
|
1081
|
-
return formatMCPResponse({
|
|
1082
|
-
...executionResult,
|
|
1083
|
-
content: `# Development Guidance & Implementation Roadmap
|
|
1084
|
-
|
|
1085
|
-
## Your Development Context
|
|
1086
|
-
- **Development Phase**: ${developmentPhase}
|
|
1087
|
-
- **Technology Stack**: ${technologyStack.length > 0 ? technologyStack.join(', ') : 'Not specified'}
|
|
1088
|
-
- **Current Progress**: ${currentProgress || 'Starting fresh'}
|
|
1089
|
-
- **Team Context**: ${teamContext.size} team with ${teamContext.experienceLevel} experience
|
|
1090
|
-
- **Timeline**: ${timeline || 'Not specified'}
|
|
1091
|
-
- **Focus Areas**: ${focusAreas.length > 0 ? focusAreas.join(', ') : 'General development'}
|
|
1092
|
-
- **ADRs to Implement**: ${adrsToImplement.length > 0 ? adrsToImplement.join(', ') : 'None specified'}
|
|
1093
|
-
|
|
1094
|
-
## AI-Generated Development Guidance
|
|
1095
|
-
|
|
1096
|
-
${executionResult.content}
|
|
1097
|
-
|
|
1098
|
-
## Integration with Workflow Tools
|
|
1099
|
-
|
|
1100
|
-
This development guidance works seamlessly with other MCP tools:
|
|
1101
|
-
|
|
1102
|
-
### **Workflow Integration**
|
|
1103
|
-
1. **get_workflow_guidance** → Recommends architectural process
|
|
1104
|
-
2. **get_development_guidance** → Guides implementation (this tool)
|
|
1105
|
-
3. **validate_rules** → Ensures code follows architectural decisions
|
|
1106
|
-
4. **analyze_deployment_progress** → Tracks implementation progress
|
|
1107
|
-
|
|
1108
|
-
### **Quality Assurance Tools**
|
|
1109
|
-
- **generate_rules** → Extract coding standards from ADRs
|
|
1110
|
-
- **validate_rules** → Validate code against architectural rules
|
|
1111
|
-
- **analyze_content_security** → Security validation during development
|
|
1112
|
-
|
|
1113
|
-
### **Documentation Tools**
|
|
1114
|
-
- **discover_existing_adrs** → Reference existing architectural decisions
|
|
1115
|
-
|
|
1116
|
-
## Next Steps: From Architecture to Code
|
|
1117
|
-
|
|
1118
|
-
1. **📋 Review the Development Roadmap** above
|
|
1119
|
-
2. **🏗️ Set Up Project Structure** as recommended
|
|
1120
|
-
3. **🧪 Implement Testing Strategy** early in development
|
|
1121
|
-
4. **📊 Track Progress** using the success metrics provided
|
|
1122
|
-
5. **🔄 Iterate and Refine** based on implementation learnings
|
|
1123
|
-
|
|
1124
|
-
This guidance ensures your development work is **architecturally aligned**, **quality-focused**, and **efficiently executed**!
|
|
1125
|
-
`,
|
|
1126
|
-
});
|
|
1127
|
-
}
|
|
1128
|
-
else {
|
|
1129
|
-
// Fallback to prompt-only mode
|
|
1130
|
-
return {
|
|
1131
|
-
content: [
|
|
1132
|
-
{
|
|
1133
|
-
type: 'text',
|
|
1134
|
-
text: developmentPrompt,
|
|
1135
|
-
},
|
|
1136
|
-
],
|
|
1137
|
-
};
|
|
1138
|
-
}
|
|
1036
|
+
// CE-MCP: return prompt text directly; directive intercepts in CE-MCP mode.
|
|
1037
|
+
return {
|
|
1038
|
+
content: [
|
|
1039
|
+
{
|
|
1040
|
+
type: 'text',
|
|
1041
|
+
text: developmentPrompt,
|
|
1042
|
+
},
|
|
1043
|
+
],
|
|
1044
|
+
};
|
|
1139
1045
|
}
|
|
1140
1046
|
catch (error) {
|
|
1141
1047
|
throw new McpAdrError(`Failed to generate development guidance: ${error instanceof Error ? error.message : String(error)}`, 'DEVELOPMENT_ERROR');
|
|
@@ -1335,15 +1241,9 @@ ${environmentResult.content[0].text}
|
|
|
1335
1241
|
enhancedAnalysisPrompt =
|
|
1336
1242
|
baseProjectAnalysisPrompt.prompt + knowledgeContext + environmentAnalysisContext;
|
|
1337
1243
|
}
|
|
1338
|
-
// Execute the analysis with AI if enabled, otherwise return prompt
|
|
1339
|
-
ctx.info('🤖 Phase 6: Executing AI-powered ecosystem analysis');
|
|
1340
|
-
ctx.report_progress(85, 100);
|
|
1341
|
-
const { executeEcosystemAnalysisPrompt, formatMCPResponse } = await import('./utils/prompt-execution.js');
|
|
1342
|
-
const executionResult = await executeEcosystemAnalysisPrompt(enhancedAnalysisPrompt, baseProjectAnalysisPrompt.instructions, {
|
|
1343
|
-
temperature: 0.1,
|
|
1344
|
-
maxTokens: 6000,
|
|
1345
|
-
});
|
|
1346
1244
|
// Step 6: Record project structure to knowledge graph
|
|
1245
|
+
ctx.info('📊 Phase 6: Recording project structure');
|
|
1246
|
+
ctx.report_progress(85, 100);
|
|
1347
1247
|
try {
|
|
1348
1248
|
this.logger.info('Recording project structure to knowledge graph');
|
|
1349
1249
|
const projectStructureSnapshot = {
|
|
@@ -1361,84 +1261,15 @@ ${environmentResult.content[0].text}
|
|
|
1361
1261
|
}
|
|
1362
1262
|
catch (kgError) {
|
|
1363
1263
|
this.logger.warn('Failed to record project structure to knowledge graph:', kgError);
|
|
1364
|
-
// Don't fail the entire analysis if KG recording fails
|
|
1365
1264
|
}
|
|
1366
1265
|
ctx.info('✅ Ecosystem analysis completed successfully');
|
|
1367
1266
|
ctx.report_progress(100, 100);
|
|
1368
|
-
//
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
## Analysis Configuration
|
|
1376
|
-
- **Project Path**: ${projectPath}
|
|
1377
|
-
- **Analysis Depth**: ${analysisDepth}
|
|
1378
|
-
- **Recursive Depth**: ${recursiveDepth}
|
|
1379
|
-
- **Environment Analysis**: ${includeEnvironment ? '✅ Included' : '❌ Excluded'}
|
|
1380
|
-
- **Analysis Scope**: ${analysisScope.length > 0 ? analysisScope.join(', ') : 'Full ecosystem analysis'}
|
|
1381
|
-
|
|
1382
|
-
## Enhancement Features
|
|
1383
|
-
- **Knowledge Generation**: ${enhancedMode && knowledgeEnhancement ? '✅ Enabled' : '❌ Disabled'}
|
|
1384
|
-
- **Reflexion Learning**: ${enhancedMode && learningEnabled ? '✅ Enabled' : '❌ Disabled'}
|
|
1385
|
-
- **Enhanced Mode**: ${enhancedMode ? '✅ Enabled' : '❌ Disabled'}
|
|
1386
|
-
- **Technology Focus**: ${technologyFocus.length > 0 ? technologyFocus.join(', ') : 'Auto-detect'}
|
|
1387
|
-
- **Knowledge Graph**: ✅ Project structure recorded
|
|
1388
|
-
|
|
1389
|
-
${knowledgeContext}
|
|
1390
|
-
|
|
1391
|
-
${reflexionContext}
|
|
1392
|
-
|
|
1393
|
-
## Comprehensive Ecosystem Analysis Results
|
|
1394
|
-
|
|
1395
|
-
${executionResult.content}
|
|
1396
|
-
|
|
1397
|
-
${includeEnvironment
|
|
1398
|
-
? `
|
|
1399
|
-
|
|
1400
|
-
## Environment Integration Summary
|
|
1401
|
-
|
|
1402
|
-
The analysis above includes comprehensive environment analysis covering:
|
|
1403
|
-
- **Infrastructure Specifications**: Deployment and runtime environment details
|
|
1404
|
-
- **Containerization**: Docker, Kubernetes, and container orchestration analysis
|
|
1405
|
-
- **Environment Requirements**: Configuration and dependency requirements
|
|
1406
|
-
- **Compliance Assessment**: Security and regulatory compliance evaluation
|
|
1407
|
-
|
|
1408
|
-
This integrated approach provides complete understanding of both codebase patterns AND operational environment.
|
|
1409
|
-
`
|
|
1410
|
-
: ''}
|
|
1411
|
-
|
|
1412
|
-
## Next Steps: Complete Ecosystem Understanding
|
|
1413
|
-
|
|
1414
|
-
Based on the comprehensive analysis above:
|
|
1415
|
-
|
|
1416
|
-
### **Immediate Actions**
|
|
1417
|
-
1. **Review Ecosystem Overview**: Examine the complete technology stack and environment context
|
|
1418
|
-
2. **Assess Integration Points**: Understand how code patterns relate to operational environment
|
|
1419
|
-
3. **Identify Critical Dependencies**: Focus on key dependencies between code and infrastructure
|
|
1420
|
-
|
|
1421
|
-
### **Strategic Planning**
|
|
1422
|
-
4. **Address Architectural Issues**: Prioritize improvements based on both code and environment analysis
|
|
1423
|
-
5. **Plan Environment Optimization**: Optimize deployment and operational configurations
|
|
1424
|
-
6. **Update Documentation**: Document both architectural decisions and environment specifications
|
|
1425
|
-
|
|
1426
|
-
### **Implementation Roadmap**
|
|
1427
|
-
7. **Implement Code Improvements**: Execute code-level architectural enhancements
|
|
1428
|
-
8. **Optimize Environment**: Improve infrastructure and deployment configurations
|
|
1429
|
-
9. **Monitor Integration**: Ensure code and environment changes work together effectively
|
|
1430
|
-
|
|
1431
|
-
This comprehensive ecosystem analysis provides the foundation for informed architectural and operational decisions.
|
|
1432
|
-
`,
|
|
1433
|
-
});
|
|
1434
|
-
}
|
|
1435
|
-
else {
|
|
1436
|
-
// Fallback to prompt-only mode
|
|
1437
|
-
return {
|
|
1438
|
-
content: [
|
|
1439
|
-
{
|
|
1440
|
-
type: 'text',
|
|
1441
|
-
text: `# Comprehensive Project Ecosystem Analysis
|
|
1267
|
+
// CE-MCP: return prompt text directly; directive intercepts in CE-MCP mode.
|
|
1268
|
+
return {
|
|
1269
|
+
content: [
|
|
1270
|
+
{
|
|
1271
|
+
type: 'text',
|
|
1272
|
+
text: `# Comprehensive Project Ecosystem Analysis
|
|
1442
1273
|
|
|
1443
1274
|
This comprehensive analysis provides deep recursive project understanding with integrated environment analysis.
|
|
1444
1275
|
|
|
@@ -1467,47 +1298,10 @@ ${enhancedAnalysisPrompt}
|
|
|
1467
1298
|
|
|
1468
1299
|
## Enhanced Implementation Instructions
|
|
1469
1300
|
|
|
1470
|
-
${baseProjectAnalysisPrompt.instructions}
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
${enhancedMode && knowledgeEnhancement
|
|
1475
|
-
? `
|
|
1476
|
-
#### Knowledge Enhancement
|
|
1477
|
-
- Apply technology-specific knowledge to ecosystem analysis
|
|
1478
|
-
- Use domain expertise to identify patterns and anti-patterns
|
|
1479
|
-
- Leverage architectural best practices for technology stack evaluation
|
|
1480
|
-
`
|
|
1481
|
-
: ''}
|
|
1482
|
-
|
|
1483
|
-
${enhancedMode && learningEnabled
|
|
1484
|
-
? `
|
|
1485
|
-
#### Learning Integration
|
|
1486
|
-
- Apply lessons learned from past ecosystem analyses
|
|
1487
|
-
- Use memory insights to improve pattern recognition accuracy
|
|
1488
|
-
- Incorporate feedback from previous analysis outcomes
|
|
1489
|
-
`
|
|
1490
|
-
: ''}
|
|
1491
|
-
|
|
1492
|
-
## Expected Enhanced Output
|
|
1493
|
-
|
|
1494
|
-
The enhanced analysis should provide:
|
|
1495
|
-
1. **Technology Stack Analysis** with domain knowledge context
|
|
1496
|
-
2. **Architectural Pattern Detection** informed by past experiences
|
|
1497
|
-
3. **Ecosystem Health Assessment** using learned evaluation criteria
|
|
1498
|
-
4. **Improvement Recommendations** based on domain best practices
|
|
1499
|
-
5. **Learning Insights** for future analysis improvement
|
|
1500
|
-
|
|
1501
|
-
## Quality Assurance
|
|
1502
|
-
|
|
1503
|
-
- Ensure analysis leverages all available enhancement features
|
|
1504
|
-
- Verify technology-specific knowledge is properly applied
|
|
1505
|
-
- Confirm learning insights improve analysis accuracy
|
|
1506
|
-
- Validate recommendations align with domain best practices`,
|
|
1507
|
-
},
|
|
1508
|
-
],
|
|
1509
|
-
};
|
|
1510
|
-
}
|
|
1301
|
+
${baseProjectAnalysisPrompt.instructions}`,
|
|
1302
|
+
},
|
|
1303
|
+
],
|
|
1304
|
+
};
|
|
1511
1305
|
}
|
|
1512
1306
|
catch (error) {
|
|
1513
1307
|
throw new McpAdrError(`Failed to analyze project ecosystem: ${error instanceof Error ? error.message : String(error)}`, 'ANALYSIS_ERROR');
|
|
@@ -1681,74 +1475,15 @@ After this analysis, follow this **outcome-focused workflow**:
|
|
|
1681
1475
|
|
|
1682
1476
|
This approach ensures that architectural work is **grounded in measurable outcomes** and **aligned with project success**.
|
|
1683
1477
|
`;
|
|
1684
|
-
//
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
}
|
|
1693
|
-
if (executionResult.isAIGenerated) {
|
|
1694
|
-
// AI execution successful - return actual analysis results
|
|
1695
|
-
return formatMCPResponse({
|
|
1696
|
-
...executionResult,
|
|
1697
|
-
content: `# Architectural Context Analysis Results
|
|
1698
|
-
|
|
1699
|
-
${filePath ? `## Target File: ${filePath}` : '## Project-wide Analysis'}
|
|
1700
|
-
|
|
1701
|
-
## Project Information
|
|
1702
|
-
- **Project Path**: ${projectPath}
|
|
1703
|
-
- **Analysis Scope**: ${filePath ? 'File-specific' : 'Project-wide'}
|
|
1704
|
-
- **ADR Directory**: ${this.config.adrDirectory}
|
|
1705
|
-
|
|
1706
|
-
## ADR Infrastructure Setup
|
|
1707
|
-
|
|
1708
|
-
The analysis includes automatic ADR infrastructure setup:
|
|
1709
|
-
|
|
1710
|
-
${adrDirectoryCheckPrompt.instructions}
|
|
1711
|
-
|
|
1712
|
-
${adrDirectorySetupPrompt.instructions}
|
|
1713
|
-
|
|
1714
|
-
## AI Analysis Results
|
|
1715
|
-
|
|
1716
|
-
${executionResult.content}
|
|
1717
|
-
|
|
1718
|
-
## Outcome-Focused Next Steps
|
|
1719
|
-
|
|
1720
|
-
Based on the architectural analysis, follow this **grounded workflow**:
|
|
1721
|
-
|
|
1722
|
-
### **Immediate Actions (This Week)**
|
|
1723
|
-
1. **Review Analysis**: Examine the architectural context and recommendations above
|
|
1724
|
-
2. **Set Up ADRs**: Ensure ADR directory structure is created and ready
|
|
1725
|
-
3. **Identify Quick Wins**: Focus on low-effort, high-impact improvements
|
|
1726
|
-
|
|
1727
|
-
### **Short-term Goals (Next Month)**
|
|
1728
|
-
4. **Document Key Decisions**: Create ADRs for the most significant architectural choices
|
|
1729
|
-
5. **Address Critical Issues**: Tackle the highest-priority architectural concerns
|
|
1730
|
-
6. **Establish Metrics**: Set up measurement for the success metrics identified
|
|
1731
|
-
|
|
1732
|
-
### **Long-term Vision (Next Quarter)**
|
|
1733
|
-
7. **Implement Roadmap**: Execute the architectural improvement plan
|
|
1734
|
-
8. **Monitor Progress**: Track success metrics and adjust approach as needed
|
|
1735
|
-
9. **Continuous Improvement**: Establish regular architectural reviews
|
|
1736
|
-
|
|
1737
|
-
This **outcome-focused approach** ensures architectural work delivers **measurable value** and keeps the project **grounded in clear objectives**.
|
|
1738
|
-
`,
|
|
1739
|
-
});
|
|
1740
|
-
}
|
|
1741
|
-
else {
|
|
1742
|
-
// Fallback to prompt-only mode
|
|
1743
|
-
return {
|
|
1744
|
-
content: [
|
|
1745
|
-
{
|
|
1746
|
-
type: 'text',
|
|
1747
|
-
text: architecturalPrompt,
|
|
1748
|
-
},
|
|
1749
|
-
],
|
|
1750
|
-
};
|
|
1751
|
-
}
|
|
1478
|
+
// CE-MCP: return prompt text directly; directive intercepts in CE-MCP mode.
|
|
1479
|
+
return {
|
|
1480
|
+
content: [
|
|
1481
|
+
{
|
|
1482
|
+
type: 'text',
|
|
1483
|
+
text: architecturalPrompt,
|
|
1484
|
+
},
|
|
1485
|
+
],
|
|
1486
|
+
};
|
|
1752
1487
|
}
|
|
1753
1488
|
catch (error) {
|
|
1754
1489
|
throw new McpAdrError(`Failed to get architectural context: ${error instanceof Error ? error.message : String(error)}`, 'ANALYSIS_ERROR');
|
|
@@ -1909,88 +1644,14 @@ For each generated ADR, create a file creation prompt using the following patter
|
|
|
1909
1644
|
- Confirm all decisions are traceable back to PRD requirements with domain context
|
|
1910
1645
|
`;
|
|
1911
1646
|
// Execute the ADR generation with AI if enabled, otherwise return prompt
|
|
1912
|
-
ctx.info('🤖 Phase 6: Executing AI-powered ADR generation');
|
|
1913
|
-
ctx.report_progress(90, 100);
|
|
1914
|
-
const { executeADRGenerationPrompt, formatMCPResponse } = await import('./utils/prompt-execution.js');
|
|
1915
|
-
const executionResult = await executeADRGenerationPrompt(adrPrompt, 'Generate comprehensive ADRs from PRD analysis with enhanced domain knowledge and optimization', {
|
|
1916
|
-
temperature: 0.1,
|
|
1917
|
-
maxTokens: 8000,
|
|
1918
|
-
systemPrompt: `You are an expert software architect who creates comprehensive Architectural Decision Records (ADRs) from Product Requirements Documents (PRDs).
|
|
1919
|
-
Generate well-structured ADRs that follow best practices and include all necessary sections.
|
|
1920
|
-
Focus on extracting architectural decisions from the PRD and creating actionable ADRs with clear reasoning.`,
|
|
1921
|
-
});
|
|
1922
1647
|
ctx.info('✅ ADR generation completed successfully');
|
|
1923
1648
|
ctx.report_progress(100, 100);
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
## Enhancement Features
|
|
1931
|
-
- **APE Optimization**: ${enhancedMode && promptOptimization ? '✅ Enabled' : '❌ Disabled'}
|
|
1932
|
-
- **Knowledge Generation**: ${enhancedMode && knowledgeEnhancement ? '✅ Enabled' : '❌ Disabled'}
|
|
1933
|
-
- **PRD Type Optimization**: ${prdType}
|
|
1934
|
-
- **Enhanced Mode**: ${enhancedMode ? '✅ Enabled' : '❌ Disabled'}
|
|
1935
|
-
|
|
1936
|
-
## Source Information
|
|
1937
|
-
- **PRD Path**: ${prdPath}
|
|
1938
|
-
- **Output Directory**: ${outputDirectory}
|
|
1939
|
-
|
|
1940
|
-
## Generated ADRs
|
|
1941
|
-
|
|
1942
|
-
${executionResult.content}
|
|
1943
|
-
|
|
1944
|
-
## Next Steps
|
|
1945
|
-
|
|
1946
|
-
1. **Review Generated ADRs**: Examine each ADR for completeness and accuracy
|
|
1947
|
-
2. **Save ADR Files**: Create individual .md files for each ADR in ${outputDirectory}
|
|
1948
|
-
3. **Update ADR Index**: Add new ADRs to your project's ADR catalog
|
|
1949
|
-
4. **Stakeholder Review**: Share ADRs with team for feedback and approval
|
|
1950
|
-
5. **Implementation Planning**: Create tasks for implementing the architectural decisions
|
|
1951
|
-
|
|
1952
|
-
## File Creation Commands
|
|
1953
|
-
|
|
1954
|
-
To save the generated ADRs, create individual files in ${outputDirectory}:
|
|
1955
|
-
|
|
1956
|
-
\`\`\`bash
|
|
1957
|
-
# Create ADR directory if it doesn't exist
|
|
1958
|
-
mkdir -p ${outputDirectory}
|
|
1959
|
-
|
|
1960
|
-
# Save each ADR as a separate file (example)
|
|
1961
|
-
# Replace [NUMBER] and [TITLE] with actual values from generated ADRs
|
|
1962
|
-
# cat > "${outputDirectory}/001-example-decision.md" << 'EOF'
|
|
1963
|
-
# [ADR content here]
|
|
1964
|
-
# EOF
|
|
1965
|
-
\`\`\`
|
|
1966
|
-
`,
|
|
1967
|
-
});
|
|
1968
|
-
}
|
|
1969
|
-
else {
|
|
1970
|
-
// Fallback to prompt-only mode
|
|
1971
|
-
return {
|
|
1972
|
-
content: [
|
|
1973
|
-
{
|
|
1974
|
-
type: 'text',
|
|
1975
|
-
text: `# Enhanced ADR Generation from PRD: ${prdPath}
|
|
1976
|
-
|
|
1977
|
-
## Advanced Prompt-Driven ADR Generation Process
|
|
1978
|
-
|
|
1979
|
-
This tool uses a 100% prompt-driven architecture enhanced with advanced prompting techniques:
|
|
1980
|
-
|
|
1981
|
-
### Enhancement Features
|
|
1982
|
-
- **APE Optimization**: ${enhancedMode && promptOptimization ? '✅ Enabled - Prompts optimized for superior quality' : '❌ Disabled'}
|
|
1983
|
-
- **Knowledge Generation**: ${enhancedMode && knowledgeEnhancement ? '✅ Enabled - Domain knowledge enhanced analysis' : '❌ Disabled'}
|
|
1984
|
-
- **PRD Type Optimization**: ${prdType} - Tailored for specific domain requirements
|
|
1985
|
-
- **Enhanced Mode**: ${enhancedMode ? '✅ Enabled - All advanced features active' : '❌ Disabled - Basic mode'}
|
|
1986
|
-
|
|
1987
|
-
### Enhanced AI Agent Workflow
|
|
1988
|
-
|
|
1989
|
-
1. **Validate PRD file existence** using secure file system operations
|
|
1990
|
-
2. **Read PRD content** safely with proper security validation
|
|
1991
|
-
3. **Apply domain knowledge** to enhance understanding (if enabled)
|
|
1992
|
-
4. **Generate optimized ADRs** using APE-enhanced prompts (if enabled)
|
|
1993
|
-
5. **Create enhanced ADR files** in the specified output directory: ${outputDirectory}
|
|
1649
|
+
// CE-MCP: return prompt text directly; directive intercepts in CE-MCP mode.
|
|
1650
|
+
return {
|
|
1651
|
+
content: [
|
|
1652
|
+
{
|
|
1653
|
+
type: 'text',
|
|
1654
|
+
text: `# Enhanced ADR Generation from PRD: ${prdPath}
|
|
1994
1655
|
|
|
1995
1656
|
## Execution Instructions
|
|
1996
1657
|
|
|
@@ -1998,49 +1659,15 @@ Please execute the following enhanced comprehensive prompt:
|
|
|
1998
1659
|
|
|
1999
1660
|
${adrPrompt}
|
|
2000
1661
|
|
|
2001
|
-
##
|
|
2002
|
-
|
|
2003
|
-
${enhancedMode && knowledgeEnhancement
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
: ''}
|
|
2011
|
-
|
|
2012
|
-
${enhancedMode && promptOptimization
|
|
2013
|
-
? `
|
|
2014
|
-
### APE Optimization
|
|
2015
|
-
- Prompts have been automatically optimized for quality
|
|
2016
|
-
- Enhanced evaluation criteria ensure superior ADR generation
|
|
2017
|
-
- Optimization focused on task completion, clarity, and specificity
|
|
2018
|
-
`
|
|
2019
|
-
: ''}
|
|
2020
|
-
|
|
2021
|
-
## Security and Validation
|
|
2022
|
-
|
|
2023
|
-
- All file operations include security validation
|
|
2024
|
-
- Path traversal protection is enabled
|
|
2025
|
-
- System directory access is prevented
|
|
2026
|
-
- User confirmation is required for file creation
|
|
2027
|
-
- Content validation ensures safe enhanced ADR generation
|
|
2028
|
-
|
|
2029
|
-
## Expected Enhanced Workflow
|
|
2030
|
-
|
|
2031
|
-
1. Execute file existence check for: ${prdPath}
|
|
2032
|
-
2. If file exists, read PRD content securely
|
|
2033
|
-
3. Apply domain knowledge to enhance PRD understanding
|
|
2034
|
-
4. Analyze PRD content using optimized prompts
|
|
2035
|
-
5. Generate domain-enhanced individual ADRs for each decision
|
|
2036
|
-
6. Create file creation prompts for each enhanced ADR
|
|
2037
|
-
7. Confirm with user before writing files to: ${outputDirectory}
|
|
2038
|
-
|
|
2039
|
-
The enhanced process maintains full traceability from PRD requirements to generated ADRs while providing superior quality through advanced prompting techniques and ensuring security and user control over file operations.`,
|
|
2040
|
-
},
|
|
2041
|
-
],
|
|
2042
|
-
};
|
|
2043
|
-
}
|
|
1662
|
+
## Enhancement Features
|
|
1663
|
+
- **APE Optimization**: ${enhancedMode && promptOptimization ? '✅ Enabled' : '❌ Disabled'}
|
|
1664
|
+
- **Knowledge Generation**: ${enhancedMode && knowledgeEnhancement ? '✅ Enabled' : '❌ Disabled'}
|
|
1665
|
+
- **PRD Type Optimization**: ${prdType}
|
|
1666
|
+
- **Enhanced Mode**: ${enhancedMode ? '✅ Enabled' : '❌ Disabled'}
|
|
1667
|
+
- **Output Directory**: ${outputDirectory}`,
|
|
1668
|
+
},
|
|
1669
|
+
],
|
|
1670
|
+
};
|
|
2044
1671
|
}
|
|
2045
1672
|
catch (error) {
|
|
2046
1673
|
throw new McpAdrError(`Failed to generate ADR prompts from PRD: ${error instanceof Error ? error.message : String(error)}`, 'PROMPT_GENERATION_ERROR');
|