mcp-adr-analysis-server 2.0.21 → 2.0.24
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/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1380 -781
- package/dist/src/index.js.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.js +32 -30
- package/dist/src/tools/adr-suggestion-tool.js.map +1 -1
- package/dist/src/tools/content-masking-tool.d.ts +4 -0
- package/dist/src/tools/content-masking-tool.d.ts.map +1 -1
- package/dist/src/tools/content-masking-tool.js +531 -28
- package/dist/src/tools/content-masking-tool.js.map +1 -1
- package/dist/src/tools/deployment-readiness-tool.d.ts +8 -5
- package/dist/src/tools/deployment-readiness-tool.d.ts.map +1 -1
- package/dist/src/tools/deployment-readiness-tool.js +741 -79
- package/dist/src/tools/deployment-readiness-tool.js.map +1 -1
- 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 +568 -24
- package/dist/src/tools/environment-analysis-tool.js.map +1 -1
- package/dist/src/tools/mcp-planning-tool.d.ts.map +1 -1
- package/dist/src/tools/mcp-planning-tool.js +298 -173
- package/dist/src/tools/mcp-planning-tool.js.map +1 -1
- package/dist/src/tools/memory-loading-tool.d.ts +60 -0
- package/dist/src/tools/memory-loading-tool.d.ts.map +1 -0
- package/dist/src/tools/memory-loading-tool.js +457 -0
- package/dist/src/tools/memory-loading-tool.js.map +1 -0
- package/dist/src/tools/smart-git-push-tool.d.ts +3 -0
- package/dist/src/tools/smart-git-push-tool.d.ts.map +1 -1
- package/dist/src/tools/smart-git-push-tool.js +177 -223
- package/dist/src/tools/smart-git-push-tool.js.map +1 -1
- package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts +20 -11
- package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts.map +1 -1
- package/dist/src/tools/troubleshoot-guided-workflow-tool.js +506 -22
- package/dist/src/tools/troubleshoot-guided-workflow-tool.js.map +1 -1
- package/dist/src/types/enhanced-errors.d.ts +173 -0
- package/dist/src/types/enhanced-errors.d.ts.map +1 -0
- package/dist/src/types/enhanced-errors.js +668 -0
- package/dist/src/types/enhanced-errors.js.map +1 -0
- package/dist/src/types/knowledge-graph-schemas.d.ts +92 -0
- package/dist/src/types/knowledge-graph-schemas.d.ts.map +1 -1
- package/dist/src/types/knowledge-graph-schemas.js +45 -17
- package/dist/src/types/knowledge-graph-schemas.js.map +1 -1
- package/dist/src/types/memory-entities.d.ts +7209 -0
- package/dist/src/types/memory-entities.d.ts.map +1 -0
- package/dist/src/types/memory-entities.js +395 -0
- package/dist/src/types/memory-entities.js.map +1 -0
- package/dist/src/types/todo-json-schemas.d.ts +7 -653
- package/dist/src/types/todo-json-schemas.d.ts.map +1 -1
- package/dist/src/types/todo-json-schemas.js +6 -110
- package/dist/src/types/todo-json-schemas.js.map +1 -1
- package/dist/src/utils/enhanced-logging.d.ts +195 -0
- package/dist/src/utils/enhanced-logging.d.ts.map +1 -0
- package/dist/src/utils/enhanced-logging.js +449 -0
- package/dist/src/utils/enhanced-logging.js.map +1 -0
- package/dist/src/utils/interactive-approval.d.ts +1 -1
- package/dist/src/utils/interactive-approval.d.ts.map +1 -1
- package/dist/src/utils/interactive-approval.js +20 -16
- package/dist/src/utils/interactive-approval.js.map +1 -1
- package/dist/src/utils/knowledge-graph-manager.d.ts +23 -1
- package/dist/src/utils/knowledge-graph-manager.d.ts.map +1 -1
- package/dist/src/utils/knowledge-graph-manager.js +297 -69
- package/dist/src/utils/knowledge-graph-manager.js.map +1 -1
- package/dist/src/utils/memory-entity-manager.d.ts +134 -0
- package/dist/src/utils/memory-entity-manager.d.ts.map +1 -0
- package/dist/src/utils/memory-entity-manager.js +848 -0
- package/dist/src/utils/memory-entity-manager.js.map +1 -0
- package/dist/src/utils/memory-health-scoring.d.ts +125 -0
- package/dist/src/utils/memory-health-scoring.d.ts.map +1 -0
- package/dist/src/utils/memory-health-scoring.js +277 -0
- package/dist/src/utils/memory-health-scoring.js.map +1 -0
- package/dist/src/utils/memory-migration-manager.d.ts +93 -0
- package/dist/src/utils/memory-migration-manager.d.ts.map +1 -0
- package/dist/src/utils/memory-migration-manager.js +834 -0
- package/dist/src/utils/memory-migration-manager.js.map +1 -0
- package/dist/src/utils/memory-relationship-mapper.d.ts +87 -0
- package/dist/src/utils/memory-relationship-mapper.d.ts.map +1 -0
- package/dist/src/utils/memory-relationship-mapper.js +481 -0
- package/dist/src/utils/memory-relationship-mapper.js.map +1 -0
- package/dist/src/utils/memory-rollback-manager.d.ts +93 -0
- package/dist/src/utils/memory-rollback-manager.d.ts.map +1 -0
- package/dist/src/utils/memory-rollback-manager.js +542 -0
- package/dist/src/utils/memory-rollback-manager.js.map +1 -0
- package/dist/src/utils/memory-transformation.d.ts +59 -0
- package/dist/src/utils/memory-transformation.d.ts.map +1 -0
- package/dist/src/utils/memory-transformation.js +742 -0
- package/dist/src/utils/memory-transformation.js.map +1 -0
- package/dist/src/utils/prompt-execution.d.ts.map +1 -1
- package/dist/src/utils/prompt-execution.js +72 -51
- package/dist/src/utils/prompt-execution.js.map +1 -1
- package/dist/src/utils/todo-file-watcher.d.ts +11 -23
- package/dist/src/utils/todo-file-watcher.d.ts.map +1 -1
- package/dist/src/utils/todo-file-watcher.js +18 -156
- package/dist/src/utils/todo-file-watcher.js.map +1 -1
- package/package.json +22 -6
- package/dist/src/tools/smart-score-tool.d.ts +0 -173
- package/dist/src/tools/smart-score-tool.d.ts.map +0 -1
- package/dist/src/tools/smart-score-tool.js +0 -681
- package/dist/src/tools/smart-score-tool.js.map +0 -1
- package/dist/src/tools/todo-management-tool-v2.d.ts +0 -368
- package/dist/src/tools/todo-management-tool-v2.d.ts.map +0 -1
- package/dist/src/tools/todo-management-tool-v2.js +0 -922
- package/dist/src/tools/todo-management-tool-v2.js.map +0 -1
- package/dist/src/utils/project-health-scoring.d.ts +0 -177
- package/dist/src/utils/project-health-scoring.d.ts.map +0 -1
- package/dist/src/utils/project-health-scoring.js +0 -370
- package/dist/src/utils/project-health-scoring.js.map +0 -1
- package/dist/src/utils/todo-json-manager.d.ts +0 -71
- package/dist/src/utils/todo-json-manager.d.ts.map +0 -1
- package/dist/src/utils/todo-json-manager.js +0 -396
- package/dist/src/utils/todo-json-manager.js.map +0 -1
- package/dist/src/utils/todo-markdown-converter.d.ts +0 -16
- package/dist/src/utils/todo-markdown-converter.d.ts.map +0 -1
- package/dist/src/utils/todo-markdown-converter.js +0 -362
- package/dist/src/utils/todo-markdown-converter.js.map +0 -1
- package/dist/src/utils/todo-migration.d.ts +0 -47
- package/dist/src/utils/todo-migration.d.ts.map +0 -1
- package/dist/src/utils/todo-migration.js +0 -261
- package/dist/src/utils/todo-migration.js.map +0 -1
|
@@ -23,7 +23,7 @@ import { z } from 'zod';
|
|
|
23
23
|
import { promises as fs } from 'fs';
|
|
24
24
|
import { join } from 'path';
|
|
25
25
|
import { McpAdrError } from '../types/index.js';
|
|
26
|
-
|
|
26
|
+
// TodoJsonManager removed - use mcp-shrimp-task-manager for task management
|
|
27
27
|
// Project phase schema
|
|
28
28
|
const ProjectPhaseSchema = z.object({
|
|
29
29
|
id: z.string(),
|
|
@@ -42,13 +42,15 @@ const ProjectPhaseSchema = z.object({
|
|
|
42
42
|
completion: z.number().min(0).max(100).default(0),
|
|
43
43
|
riskLevel: z.enum(['low', 'medium', 'high', 'critical']).default('medium'),
|
|
44
44
|
riskFactors: z.array(z.string()).default([]),
|
|
45
|
-
resources: z
|
|
45
|
+
resources: z
|
|
46
|
+
.array(z.object({
|
|
46
47
|
role: z.string(),
|
|
47
48
|
capacity: z.string(), // e.g., "40h/week"
|
|
48
|
-
allocation: z.number().min(0).max(100) // percentage allocated to this phase
|
|
49
|
-
}))
|
|
49
|
+
allocation: z.number().min(0).max(100), // percentage allocated to this phase
|
|
50
|
+
}))
|
|
51
|
+
.default([]),
|
|
50
52
|
createdAt: z.string(),
|
|
51
|
-
updatedAt: z.string()
|
|
53
|
+
updatedAt: z.string(),
|
|
52
54
|
});
|
|
53
55
|
// Team member schema
|
|
54
56
|
const TeamMemberSchema = z.object({
|
|
@@ -58,11 +60,13 @@ const TeamMemberSchema = z.object({
|
|
|
58
60
|
skills: z.array(z.string()).default([]),
|
|
59
61
|
capacity: z.string(), // e.g., "40h/week"
|
|
60
62
|
currentWorkload: z.number().min(0).max(100).default(0), // percentage utilization
|
|
61
|
-
availability: z
|
|
63
|
+
availability: z
|
|
64
|
+
.object({
|
|
62
65
|
startDate: z.string().optional(),
|
|
63
66
|
endDate: z.string().optional(),
|
|
64
|
-
unavailableDates: z.array(z.string()).default([])
|
|
65
|
-
})
|
|
67
|
+
unavailableDates: z.array(z.string()).default([]),
|
|
68
|
+
})
|
|
69
|
+
.optional(),
|
|
66
70
|
});
|
|
67
71
|
// Project schema
|
|
68
72
|
const ProjectPlanSchema = z.object({
|
|
@@ -72,37 +76,43 @@ const ProjectPlanSchema = z.object({
|
|
|
72
76
|
status: z.enum(['planning', 'active', 'completed', 'on_hold', 'cancelled']),
|
|
73
77
|
phases: z.array(ProjectPhaseSchema).default([]),
|
|
74
78
|
team: z.array(TeamMemberSchema).default([]),
|
|
75
|
-
milestones: z
|
|
79
|
+
milestones: z
|
|
80
|
+
.array(z.object({
|
|
76
81
|
id: z.string(),
|
|
77
82
|
name: z.string(),
|
|
78
83
|
description: z.string().optional(),
|
|
79
84
|
dueDate: z.string(),
|
|
80
85
|
status: z.enum(['pending', 'achieved', 'delayed', 'cancelled']),
|
|
81
86
|
criteria: z.array(z.string()).default([]),
|
|
82
|
-
linkedPhases: z.array(z.string()).default([])
|
|
83
|
-
}))
|
|
84
|
-
|
|
87
|
+
linkedPhases: z.array(z.string()).default([]),
|
|
88
|
+
}))
|
|
89
|
+
.default([]),
|
|
90
|
+
risks: z
|
|
91
|
+
.array(z.object({
|
|
85
92
|
id: z.string(),
|
|
86
93
|
description: z.string(),
|
|
87
94
|
impact: z.enum(['low', 'medium', 'high', 'critical']),
|
|
88
95
|
probability: z.enum(['low', 'medium', 'high']),
|
|
89
96
|
mitigation: z.string().optional(),
|
|
90
97
|
owner: z.string().optional(),
|
|
91
|
-
status: z.enum(['open', 'mitigated', 'closed'])
|
|
92
|
-
}))
|
|
98
|
+
status: z.enum(['open', 'mitigated', 'closed']),
|
|
99
|
+
}))
|
|
100
|
+
.default([]),
|
|
93
101
|
metadata: z.object({
|
|
94
102
|
createdAt: z.string(),
|
|
95
103
|
updatedAt: z.string(),
|
|
96
104
|
createdBy: z.string(),
|
|
97
105
|
projectPath: z.string(),
|
|
98
106
|
adrDirectory: z.string().default('docs/adrs'),
|
|
99
|
-
linkedAdrs: z.array(z.string()).default([])
|
|
107
|
+
linkedAdrs: z.array(z.string()).default([]),
|
|
100
108
|
}),
|
|
101
|
-
settings: z
|
|
109
|
+
settings: z
|
|
110
|
+
.object({
|
|
102
111
|
autoPhaseTransition: z.boolean().default(false),
|
|
103
112
|
riskAssessmentInterval: z.string().default('weekly'),
|
|
104
|
-
progressUpdateFrequency: z.string().default('daily')
|
|
105
|
-
})
|
|
113
|
+
progressUpdateFrequency: z.string().default('daily'),
|
|
114
|
+
})
|
|
115
|
+
.default({}),
|
|
106
116
|
});
|
|
107
117
|
// Operation schemas
|
|
108
118
|
const CreateProjectSchema = z.object({
|
|
@@ -110,76 +120,111 @@ const CreateProjectSchema = z.object({
|
|
|
110
120
|
projectPath: z.string().describe('Project root path'),
|
|
111
121
|
projectName: z.string().describe('Project name'),
|
|
112
122
|
description: z.string().optional().describe('Project description'),
|
|
113
|
-
phases: z
|
|
123
|
+
phases: z
|
|
124
|
+
.array(z.object({
|
|
114
125
|
name: z.string(),
|
|
115
126
|
duration: z.string(),
|
|
116
127
|
dependencies: z.array(z.string()).default([]),
|
|
117
|
-
milestones: z.array(z.string()).default([])
|
|
118
|
-
}))
|
|
119
|
-
|
|
128
|
+
milestones: z.array(z.string()).default([]),
|
|
129
|
+
}))
|
|
130
|
+
.describe('Initial project phases'),
|
|
131
|
+
team: z
|
|
132
|
+
.array(z.object({
|
|
120
133
|
name: z.string(),
|
|
121
134
|
role: z.string(),
|
|
122
135
|
skills: z.array(z.string()).default([]),
|
|
123
|
-
capacity: z.string()
|
|
124
|
-
}))
|
|
136
|
+
capacity: z.string(),
|
|
137
|
+
}))
|
|
138
|
+
.default([])
|
|
139
|
+
.describe('Team structure'),
|
|
125
140
|
importFromAdrs: z.boolean().default(true).describe('Import phases from existing ADRs'),
|
|
126
|
-
importFromTodos: z.boolean().default(true).describe('Import tasks from TODO system')
|
|
141
|
+
importFromTodos: z.boolean().default(true).describe('Import tasks from TODO system'),
|
|
127
142
|
});
|
|
128
143
|
const ManagePhasesSchema = z.object({
|
|
129
144
|
operation: z.literal('manage_phases'),
|
|
130
145
|
projectPath: z.string().describe('Project root path'),
|
|
131
|
-
action: z
|
|
146
|
+
action: z
|
|
147
|
+
.enum(['list', 'create', 'update', 'delete', 'transition'])
|
|
148
|
+
.describe('Phase management action'),
|
|
132
149
|
phaseId: z.string().optional().describe('Phase ID for update/delete/transition'),
|
|
133
|
-
phaseData: z
|
|
150
|
+
phaseData: z
|
|
151
|
+
.object({
|
|
134
152
|
name: z.string().optional(),
|
|
135
153
|
description: z.string().optional(),
|
|
136
154
|
estimatedDuration: z.string().optional(),
|
|
137
155
|
dependencies: z.array(z.string()).optional(),
|
|
138
156
|
milestones: z.array(z.string()).optional(),
|
|
139
|
-
linkedAdrs: z.array(z.string()).optional()
|
|
140
|
-
})
|
|
141
|
-
|
|
157
|
+
linkedAdrs: z.array(z.string()).optional(),
|
|
158
|
+
})
|
|
159
|
+
.optional()
|
|
160
|
+
.describe('Phase data for create/update'),
|
|
161
|
+
targetStatus: z
|
|
162
|
+
.enum(['planning', 'active', 'completed', 'blocked', 'cancelled'])
|
|
163
|
+
.optional()
|
|
164
|
+
.describe('Target status for transition'),
|
|
142
165
|
});
|
|
143
166
|
const TrackProgressSchema = z.object({
|
|
144
167
|
operation: z.literal('track_progress'),
|
|
145
168
|
projectPath: z.string().describe('Project root path'),
|
|
146
|
-
reportType: z
|
|
147
|
-
|
|
169
|
+
reportType: z
|
|
170
|
+
.enum(['summary', 'detailed', 'gantt', 'milestones', 'risks'])
|
|
171
|
+
.default('summary')
|
|
172
|
+
.describe('Type of progress report'),
|
|
173
|
+
timeframe: z
|
|
174
|
+
.enum(['current', 'weekly', 'monthly', 'quarterly'])
|
|
175
|
+
.default('current')
|
|
176
|
+
.describe('Time frame for progress tracking'),
|
|
148
177
|
includeVisuals: z.boolean().default(true).describe('Include visual progress indicators'),
|
|
149
|
-
updateTaskProgress: z.boolean().default(true).describe('Sync progress from TODO system')
|
|
178
|
+
updateTaskProgress: z.boolean().default(true).describe('Sync progress from TODO system'),
|
|
150
179
|
});
|
|
151
180
|
const ManageResourcesSchema = z.object({
|
|
152
181
|
operation: z.literal('manage_resources'),
|
|
153
182
|
projectPath: z.string().describe('Project root path'),
|
|
154
|
-
action: z
|
|
183
|
+
action: z
|
|
184
|
+
.enum(['list', 'add', 'update', 'remove', 'allocate', 'optimize'])
|
|
185
|
+
.describe('Resource management action'),
|
|
155
186
|
memberId: z.string().optional().describe('Team member ID for individual actions'),
|
|
156
|
-
memberData: z
|
|
187
|
+
memberData: z
|
|
188
|
+
.object({
|
|
157
189
|
name: z.string().optional(),
|
|
158
190
|
role: z.string().optional(),
|
|
159
191
|
skills: z.array(z.string()).optional(),
|
|
160
|
-
capacity: z.string().optional()
|
|
161
|
-
})
|
|
162
|
-
|
|
192
|
+
capacity: z.string().optional(),
|
|
193
|
+
})
|
|
194
|
+
.optional()
|
|
195
|
+
.describe('Team member data'),
|
|
196
|
+
allocationData: z
|
|
197
|
+
.object({
|
|
163
198
|
phaseId: z.string(),
|
|
164
|
-
allocation: z.number().min(0).max(100)
|
|
165
|
-
})
|
|
199
|
+
allocation: z.number().min(0).max(100),
|
|
200
|
+
})
|
|
201
|
+
.optional()
|
|
202
|
+
.describe('Resource allocation data'),
|
|
166
203
|
});
|
|
167
204
|
const RiskAnalysisSchema = z.object({
|
|
168
205
|
operation: z.literal('risk_analysis'),
|
|
169
206
|
projectPath: z.string().describe('Project root path'),
|
|
170
|
-
analysisType: z
|
|
207
|
+
analysisType: z
|
|
208
|
+
.enum(['automated', 'manual', 'comprehensive'])
|
|
209
|
+
.default('comprehensive')
|
|
210
|
+
.describe('Type of risk analysis'),
|
|
171
211
|
includeAdrRisks: z.boolean().default(true).describe('Analyze risks from ADR complexity'),
|
|
172
212
|
includeDependencyRisks: z.boolean().default(true).describe('Analyze dependency chain risks'),
|
|
173
213
|
includeResourceRisks: z.boolean().default(true).describe('Analyze resource allocation risks'),
|
|
174
|
-
generateMitigation: z.boolean().default(true).describe('Generate mitigation strategies')
|
|
214
|
+
generateMitigation: z.boolean().default(true).describe('Generate mitigation strategies'),
|
|
175
215
|
});
|
|
176
216
|
const GenerateReportsSchema = z.object({
|
|
177
217
|
operation: z.literal('generate_reports'),
|
|
178
218
|
projectPath: z.string().describe('Project root path'),
|
|
179
|
-
reportType: z
|
|
219
|
+
reportType: z
|
|
220
|
+
.enum(['executive', 'status', 'health', 'team_performance', 'milestone_tracking'])
|
|
221
|
+
.describe('Type of report to generate'),
|
|
180
222
|
format: z.enum(['markdown', 'json', 'html']).default('markdown').describe('Report output format'),
|
|
181
223
|
includeCharts: z.boolean().default(true).describe('Include progress charts and graphs'),
|
|
182
|
-
timeframe: z
|
|
224
|
+
timeframe: z
|
|
225
|
+
.enum(['week', 'month', 'quarter', 'project'])
|
|
226
|
+
.default('month')
|
|
227
|
+
.describe('Report time frame'),
|
|
183
228
|
});
|
|
184
229
|
// Main operation schema
|
|
185
230
|
const McpPlanningSchema = z.union([
|
|
@@ -188,7 +233,7 @@ const McpPlanningSchema = z.union([
|
|
|
188
233
|
TrackProgressSchema,
|
|
189
234
|
ManageResourcesSchema,
|
|
190
235
|
RiskAnalysisSchema,
|
|
191
|
-
GenerateReportsSchema
|
|
236
|
+
GenerateReportsSchema,
|
|
192
237
|
]);
|
|
193
238
|
/**
|
|
194
239
|
* Get planning cache directory
|
|
@@ -272,7 +317,7 @@ async function createProject(args) {
|
|
|
272
317
|
riskFactors: [],
|
|
273
318
|
resources: [],
|
|
274
319
|
createdAt: now,
|
|
275
|
-
updatedAt: now
|
|
320
|
+
updatedAt: now,
|
|
276
321
|
}));
|
|
277
322
|
// Create team members
|
|
278
323
|
const teamMembers = team.map(member => ({
|
|
@@ -281,7 +326,7 @@ async function createProject(args) {
|
|
|
281
326
|
role: member.role,
|
|
282
327
|
skills: member.skills,
|
|
283
328
|
capacity: member.capacity,
|
|
284
|
-
currentWorkload: 0
|
|
329
|
+
currentWorkload: 0,
|
|
285
330
|
}));
|
|
286
331
|
// Import from ADRs if requested
|
|
287
332
|
if (importFromAdrs) {
|
|
@@ -302,8 +347,10 @@ async function createProject(args) {
|
|
|
302
347
|
// Import from TODO system if requested
|
|
303
348
|
if (importFromTodos) {
|
|
304
349
|
try {
|
|
305
|
-
|
|
306
|
-
|
|
350
|
+
// TodoJsonManager removed - use mcp-shrimp-task-manager for task management
|
|
351
|
+
console.warn('⚠️ TodoJsonManager is deprecated and was removed in memory-centric transformation');
|
|
352
|
+
// todoManager removed - skip loading todo data
|
|
353
|
+
const todoData = null;
|
|
307
354
|
if (todoData && todoData.tasks && Object.values(todoData.tasks).length > 0) {
|
|
308
355
|
// Distribute tasks across phases based on categories or ADR links
|
|
309
356
|
const tasksArray = Object.values(todoData.tasks);
|
|
@@ -334,17 +381,18 @@ async function createProject(args) {
|
|
|
334
381
|
createdBy: 'mcp-planning-tool',
|
|
335
382
|
projectPath,
|
|
336
383
|
adrDirectory: 'docs/adrs',
|
|
337
|
-
linkedAdrs: projectPhases.flatMap(p => p.linkedAdrs)
|
|
384
|
+
linkedAdrs: projectPhases.flatMap(p => p.linkedAdrs),
|
|
338
385
|
},
|
|
339
386
|
settings: {
|
|
340
387
|
autoPhaseTransition: false,
|
|
341
388
|
riskAssessmentInterval: 'weekly',
|
|
342
|
-
progressUpdateFrequency: 'daily'
|
|
343
|
-
}
|
|
389
|
+
progressUpdateFrequency: 'daily',
|
|
390
|
+
},
|
|
344
391
|
};
|
|
345
392
|
await savePlanningData(projectPath, projectPlan);
|
|
346
393
|
return {
|
|
347
|
-
content: [
|
|
394
|
+
content: [
|
|
395
|
+
{
|
|
348
396
|
type: 'text',
|
|
349
397
|
text: `# Project Created Successfully
|
|
350
398
|
|
|
@@ -356,22 +404,26 @@ async function createProject(args) {
|
|
|
356
404
|
- **Team Members**: ${teamMembers.length}
|
|
357
405
|
|
|
358
406
|
## Project Phases
|
|
359
|
-
${projectPhases
|
|
407
|
+
${projectPhases
|
|
408
|
+
.map((phase, index) => `
|
|
360
409
|
### Phase ${index + 1}: ${phase.name}
|
|
361
410
|
- **Duration**: ${phase.estimatedDuration}
|
|
362
411
|
- **Dependencies**: ${phase.dependencies.length > 0 ? phase.dependencies.join(', ') : 'None'}
|
|
363
412
|
- **Milestones**: ${phase.milestones.length > 0 ? phase.milestones.join(', ') : 'None'}
|
|
364
413
|
- **Linked ADRs**: ${phase.linkedAdrs.length}
|
|
365
414
|
- **Tasks**: ${phase.tasks.length}
|
|
366
|
-
`)
|
|
415
|
+
`)
|
|
416
|
+
.join('')}
|
|
367
417
|
|
|
368
418
|
## Team Structure
|
|
369
|
-
${teamMembers
|
|
419
|
+
${teamMembers
|
|
420
|
+
.map(member => `
|
|
370
421
|
### ${member.name} - ${member.role}
|
|
371
422
|
- **Capacity**: ${member.capacity}
|
|
372
423
|
- **Skills**: ${member.skills.join(', ')}
|
|
373
424
|
- **Current Workload**: ${member.currentWorkload}%
|
|
374
|
-
`)
|
|
425
|
+
`)
|
|
426
|
+
.join('')}
|
|
375
427
|
|
|
376
428
|
## Next Steps
|
|
377
429
|
1. Use \`manage_phases\` to refine phase details
|
|
@@ -384,8 +436,9 @@ ${teamMembers.map(member => `
|
|
|
384
436
|
- **TODO Import**: ${importFromTodos ? `✅ Imported tasks from TODO system` : '❌ Skipped'}
|
|
385
437
|
|
|
386
438
|
Project planning data saved to: \`.mcp-adr-cache/project-planning.json\`
|
|
387
|
-
|
|
388
|
-
}
|
|
439
|
+
`,
|
|
440
|
+
},
|
|
441
|
+
],
|
|
389
442
|
};
|
|
390
443
|
}
|
|
391
444
|
/**
|
|
@@ -401,13 +454,15 @@ async function managePhases(args) {
|
|
|
401
454
|
switch (action) {
|
|
402
455
|
case 'list':
|
|
403
456
|
return {
|
|
404
|
-
content: [
|
|
457
|
+
content: [
|
|
458
|
+
{
|
|
405
459
|
type: 'text',
|
|
406
460
|
text: `# Project Phases
|
|
407
461
|
|
|
408
462
|
## ${projectPlan.name}
|
|
409
463
|
|
|
410
|
-
${projectPlan.phases
|
|
464
|
+
${projectPlan.phases
|
|
465
|
+
.map((phase, index) => `
|
|
411
466
|
### Phase ${index + 1}: ${phase.name}
|
|
412
467
|
- **Status**: ${phase.status}
|
|
413
468
|
- **Progress**: ${phase.completion}%
|
|
@@ -417,11 +472,13 @@ ${projectPlan.phases.map((phase, index) => `
|
|
|
417
472
|
- **Risk Level**: ${phase.riskLevel}
|
|
418
473
|
- **Tasks**: ${phase.tasks.length}
|
|
419
474
|
- **Linked ADRs**: ${phase.linkedAdrs.length}
|
|
420
|
-
`)
|
|
475
|
+
`)
|
|
476
|
+
.join('')}
|
|
421
477
|
|
|
422
478
|
Total phases: ${projectPlan.phases.length}
|
|
423
|
-
|
|
424
|
-
}
|
|
479
|
+
`,
|
|
480
|
+
},
|
|
481
|
+
],
|
|
425
482
|
};
|
|
426
483
|
case 'create':
|
|
427
484
|
if (!phaseData?.name) {
|
|
@@ -443,12 +500,13 @@ Total phases: ${projectPlan.phases.length}
|
|
|
443
500
|
riskFactors: [],
|
|
444
501
|
resources: [],
|
|
445
502
|
createdAt: now,
|
|
446
|
-
updatedAt: now
|
|
503
|
+
updatedAt: now,
|
|
447
504
|
};
|
|
448
505
|
projectPlan.phases.push(newPhase);
|
|
449
506
|
await savePlanningData(projectPath, projectPlan);
|
|
450
507
|
return {
|
|
451
|
-
content: [
|
|
508
|
+
content: [
|
|
509
|
+
{
|
|
452
510
|
type: 'text',
|
|
453
511
|
text: `# Phase Created
|
|
454
512
|
|
|
@@ -460,8 +518,9 @@ Total phases: ${projectPlan.phases.length}
|
|
|
460
518
|
- **Dependencies**: ${newPhase.dependencies.join(', ') || 'None'}
|
|
461
519
|
|
|
462
520
|
Use \`manage_resources\` to allocate team members to this phase.
|
|
463
|
-
|
|
464
|
-
}
|
|
521
|
+
`,
|
|
522
|
+
},
|
|
523
|
+
],
|
|
465
524
|
};
|
|
466
525
|
case 'update':
|
|
467
526
|
if (!phaseId) {
|
|
@@ -478,20 +537,22 @@ Use \`manage_resources\` to allocate team members to this phase.
|
|
|
478
537
|
if (phaseData) {
|
|
479
538
|
Object.assign(phase, {
|
|
480
539
|
...phaseData,
|
|
481
|
-
updatedAt: now
|
|
540
|
+
updatedAt: now,
|
|
482
541
|
});
|
|
483
542
|
}
|
|
484
543
|
await savePlanningData(projectPath, projectPlan);
|
|
485
544
|
return {
|
|
486
|
-
content: [
|
|
545
|
+
content: [
|
|
546
|
+
{
|
|
487
547
|
type: 'text',
|
|
488
548
|
text: `# Phase Updated
|
|
489
549
|
|
|
490
550
|
**${phase.name}** has been updated successfully.
|
|
491
551
|
|
|
492
552
|
Updated fields: ${Object.keys(phaseData || {}).join(', ')}
|
|
493
|
-
|
|
494
|
-
}
|
|
553
|
+
`,
|
|
554
|
+
},
|
|
555
|
+
],
|
|
495
556
|
};
|
|
496
557
|
case 'transition':
|
|
497
558
|
if (!phaseId || !targetStatus) {
|
|
@@ -517,15 +578,17 @@ Updated fields: ${Object.keys(phaseData || {}).join(', ')}
|
|
|
517
578
|
}
|
|
518
579
|
await savePlanningData(projectPath, projectPlan);
|
|
519
580
|
return {
|
|
520
|
-
content: [
|
|
581
|
+
content: [
|
|
582
|
+
{
|
|
521
583
|
type: 'text',
|
|
522
584
|
text: `# Phase Transition Complete
|
|
523
585
|
|
|
524
586
|
**${transitionPhase.name}** status changed from **${oldStatus}** to **${targetStatus}**.
|
|
525
587
|
|
|
526
588
|
Current completion: ${transitionPhase.completion}%
|
|
527
|
-
|
|
528
|
-
}
|
|
589
|
+
`,
|
|
590
|
+
},
|
|
591
|
+
],
|
|
529
592
|
};
|
|
530
593
|
case 'delete':
|
|
531
594
|
if (!phaseId) {
|
|
@@ -541,15 +604,17 @@ Current completion: ${transitionPhase.completion}%
|
|
|
541
604
|
}
|
|
542
605
|
await savePlanningData(projectPath, projectPlan);
|
|
543
606
|
return {
|
|
544
|
-
content: [
|
|
607
|
+
content: [
|
|
608
|
+
{
|
|
545
609
|
type: 'text',
|
|
546
610
|
text: `# Phase Deleted
|
|
547
611
|
|
|
548
612
|
**${deletedPhase.name}** has been removed from the project.
|
|
549
613
|
|
|
550
614
|
Remaining phases: ${projectPlan.phases.length}
|
|
551
|
-
|
|
552
|
-
}
|
|
615
|
+
`,
|
|
616
|
+
},
|
|
617
|
+
],
|
|
553
618
|
};
|
|
554
619
|
default:
|
|
555
620
|
throw new McpAdrError(`Unknown phase action: ${action}`, 'INVALID_INPUT');
|
|
@@ -567,8 +632,10 @@ async function trackProgress(args) {
|
|
|
567
632
|
// Update task progress from TODO system if requested
|
|
568
633
|
if (updateTaskProgress) {
|
|
569
634
|
try {
|
|
570
|
-
|
|
571
|
-
|
|
635
|
+
// TodoJsonManager removed - use mcp-shrimp-task-manager for task management
|
|
636
|
+
console.warn('⚠️ TodoJsonManager is deprecated and was removed in memory-centric transformation');
|
|
637
|
+
// todoManager removed - skip loading todo data
|
|
638
|
+
const todoData = null;
|
|
572
639
|
if (todoData && todoData.tasks) {
|
|
573
640
|
const tasksArray = Object.values(todoData.tasks);
|
|
574
641
|
for (const phase of projectPlan.phases) {
|
|
@@ -590,11 +657,14 @@ async function trackProgress(args) {
|
|
|
590
657
|
const completedPhases = projectPlan.phases.filter(p => p.status === 'completed').length;
|
|
591
658
|
const activePhases = projectPlan.phases.filter(p => p.status === 'active').length;
|
|
592
659
|
const blockedPhases = projectPlan.phases.filter(p => p.status === 'blocked').length;
|
|
593
|
-
const overallProgress = totalPhases > 0
|
|
660
|
+
const overallProgress = totalPhases > 0
|
|
661
|
+
? Math.round(projectPlan.phases.reduce((sum, phase) => sum + phase.completion, 0) / totalPhases)
|
|
662
|
+
: 0;
|
|
594
663
|
switch (reportType) {
|
|
595
664
|
case 'summary':
|
|
596
665
|
return {
|
|
597
|
-
content: [
|
|
666
|
+
content: [
|
|
667
|
+
{
|
|
598
668
|
type: 'text',
|
|
599
669
|
text: `# Project Progress Summary
|
|
600
670
|
|
|
@@ -609,28 +679,38 @@ async function trackProgress(args) {
|
|
|
609
679
|
- **Blocked**: ${blockedPhases}
|
|
610
680
|
|
|
611
681
|
### Phase Progress
|
|
612
|
-
${projectPlan.phases
|
|
682
|
+
${projectPlan.phases
|
|
683
|
+
.map(phase => `
|
|
613
684
|
#### ${phase.name}
|
|
614
685
|
- **Status**: ${phase.status}
|
|
615
686
|
- **Progress**: ${phase.completion}% ${includeVisuals ? getProgressBar(phase.completion) : ''}
|
|
616
687
|
- **Tasks**: ${phase.tasks.length}
|
|
617
688
|
- **Blockers**: ${phase.blockers.length}
|
|
618
|
-
`)
|
|
689
|
+
`)
|
|
690
|
+
.join('')}
|
|
619
691
|
|
|
620
692
|
### Current Focus
|
|
621
|
-
${activePhases > 0
|
|
622
|
-
`Currently working on ${activePhases} phase(s):\n${projectPlan.phases
|
|
623
|
-
|
|
693
|
+
${activePhases > 0
|
|
694
|
+
? `Currently working on ${activePhases} phase(s):\n${projectPlan.phases
|
|
695
|
+
.filter(p => p.status === 'active')
|
|
696
|
+
.map(p => `- ${p.name}`)
|
|
697
|
+
.join('\n')}`
|
|
698
|
+
: 'No active phases'}
|
|
624
699
|
|
|
625
|
-
${blockedPhases > 0
|
|
626
|
-
`\n⚠️ **Blocked Phases**: ${projectPlan.phases
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
700
|
+
${blockedPhases > 0
|
|
701
|
+
? `\n⚠️ **Blocked Phases**: ${projectPlan.phases
|
|
702
|
+
.filter(p => p.status === 'blocked')
|
|
703
|
+
.map(p => p.name)
|
|
704
|
+
.join(', ')}`
|
|
705
|
+
: ''}
|
|
706
|
+
`,
|
|
707
|
+
},
|
|
708
|
+
],
|
|
630
709
|
};
|
|
631
710
|
case 'detailed':
|
|
632
711
|
return {
|
|
633
|
-
content: [
|
|
712
|
+
content: [
|
|
713
|
+
{
|
|
634
714
|
type: 'text',
|
|
635
715
|
text: `# Detailed Progress Report
|
|
636
716
|
|
|
@@ -642,7 +722,8 @@ ${blockedPhases > 0 ?
|
|
|
642
722
|
- **Risk Level**: ${calculateProjectRisk(projectPlan)}
|
|
643
723
|
- **Timeline Status**: ${calculateTimelineStatus(projectPlan)}
|
|
644
724
|
|
|
645
|
-
${projectPlan.phases
|
|
725
|
+
${projectPlan.phases
|
|
726
|
+
.map(phase => `
|
|
646
727
|
### ${phase.name}
|
|
647
728
|
- **Status**: ${phase.status}
|
|
648
729
|
- **Progress**: ${phase.completion}% ${includeVisuals ? getProgressBar(phase.completion) : ''}
|
|
@@ -655,45 +736,55 @@ ${projectPlan.phases.map(phase => `
|
|
|
655
736
|
- **Resources**: ${phase.resources.length} team members allocated
|
|
656
737
|
|
|
657
738
|
${phase.riskFactors.length > 0 ? `**Risk Factors**:\n${phase.riskFactors.map(r => `- ${r}`).join('\n')}` : ''}
|
|
658
|
-
`)
|
|
659
|
-
|
|
660
|
-
|
|
739
|
+
`)
|
|
740
|
+
.join('')}
|
|
741
|
+
`,
|
|
742
|
+
},
|
|
743
|
+
],
|
|
661
744
|
};
|
|
662
745
|
case 'milestones':
|
|
663
746
|
return {
|
|
664
|
-
content: [
|
|
747
|
+
content: [
|
|
748
|
+
{
|
|
665
749
|
type: 'text',
|
|
666
750
|
text: `# Milestone Tracking
|
|
667
751
|
|
|
668
752
|
## ${projectPlan.name}
|
|
669
753
|
|
|
670
754
|
### Project Milestones
|
|
671
|
-
${projectPlan.milestones.length > 0
|
|
672
|
-
projectPlan.milestones
|
|
755
|
+
${projectPlan.milestones.length > 0
|
|
756
|
+
? projectPlan.milestones
|
|
757
|
+
.map(milestone => `
|
|
673
758
|
#### ${milestone.name}
|
|
674
759
|
- **Status**: ${milestone.status}
|
|
675
760
|
- **Due Date**: ${milestone.dueDate}
|
|
676
761
|
- **Linked Phases**: ${milestone.linkedPhases.join(', ') || 'None'}
|
|
677
762
|
- **Criteria**: ${milestone.criteria.join(', ') || 'None'}
|
|
678
|
-
`)
|
|
679
|
-
|
|
763
|
+
`)
|
|
764
|
+
.join('')
|
|
765
|
+
: 'No project milestones defined'}
|
|
680
766
|
|
|
681
767
|
### Phase Milestones
|
|
682
|
-
${projectPlan.phases
|
|
768
|
+
${projectPlan.phases
|
|
769
|
+
.map(phase => `
|
|
683
770
|
#### ${phase.name}
|
|
684
|
-
${phase.milestones.length > 0
|
|
685
|
-
phase.milestones.map(m => `- ${m}`).join('\n')
|
|
686
|
-
'- No milestones defined'}
|
|
687
|
-
`)
|
|
688
|
-
|
|
689
|
-
|
|
771
|
+
${phase.milestones.length > 0
|
|
772
|
+
? phase.milestones.map(m => `- ${m}`).join('\n')
|
|
773
|
+
: '- No milestones defined'}
|
|
774
|
+
`)
|
|
775
|
+
.join('')}
|
|
776
|
+
`,
|
|
777
|
+
},
|
|
778
|
+
],
|
|
690
779
|
};
|
|
691
780
|
default:
|
|
692
781
|
return {
|
|
693
|
-
content: [
|
|
782
|
+
content: [
|
|
783
|
+
{
|
|
694
784
|
type: 'text',
|
|
695
|
-
text: `Progress tracking for report type "${reportType}" is not yet implemented
|
|
696
|
-
}
|
|
785
|
+
text: `Progress tracking for report type "${reportType}" is not yet implemented.`,
|
|
786
|
+
},
|
|
787
|
+
],
|
|
697
788
|
};
|
|
698
789
|
}
|
|
699
790
|
}
|
|
@@ -709,32 +800,40 @@ async function manageResources(args) {
|
|
|
709
800
|
switch (action) {
|
|
710
801
|
case 'list':
|
|
711
802
|
return {
|
|
712
|
-
content: [
|
|
803
|
+
content: [
|
|
804
|
+
{
|
|
713
805
|
type: 'text',
|
|
714
806
|
text: `# Team Resources
|
|
715
807
|
|
|
716
808
|
## ${projectPlan.name}
|
|
717
809
|
|
|
718
810
|
### Team Members
|
|
719
|
-
${projectPlan.team
|
|
811
|
+
${projectPlan.team
|
|
812
|
+
.map(member => `
|
|
720
813
|
#### ${member.name} - ${member.role}
|
|
721
814
|
- **Capacity**: ${member.capacity}
|
|
722
815
|
- **Current Workload**: ${member.currentWorkload}%
|
|
723
816
|
- **Skills**: ${member.skills.join(', ') || 'None specified'}
|
|
724
817
|
- **Availability**: ${member.availability ? 'Configured' : 'Not set'}
|
|
725
|
-
`)
|
|
818
|
+
`)
|
|
819
|
+
.join('')}
|
|
726
820
|
|
|
727
821
|
### Resource Allocation
|
|
728
|
-
${projectPlan.phases
|
|
822
|
+
${projectPlan.phases
|
|
823
|
+
.map(phase => `
|
|
729
824
|
#### ${phase.name}
|
|
730
|
-
${phase.resources.length > 0
|
|
731
|
-
phase.resources
|
|
732
|
-
|
|
733
|
-
|
|
825
|
+
${phase.resources.length > 0
|
|
826
|
+
? phase.resources
|
|
827
|
+
.map(resource => `- ${resource.role}: ${resource.allocation}% (${resource.capacity})`)
|
|
828
|
+
.join('\n')
|
|
829
|
+
: '- No resources allocated'}
|
|
830
|
+
`)
|
|
831
|
+
.join('')}
|
|
734
832
|
|
|
735
833
|
Total team members: ${projectPlan.team.length}
|
|
736
|
-
|
|
737
|
-
}
|
|
834
|
+
`,
|
|
835
|
+
},
|
|
836
|
+
],
|
|
738
837
|
};
|
|
739
838
|
case 'add':
|
|
740
839
|
if (!memberData?.name || !memberData?.role) {
|
|
@@ -746,12 +845,13 @@ Total team members: ${projectPlan.team.length}
|
|
|
746
845
|
role: memberData.role,
|
|
747
846
|
skills: memberData.skills || [],
|
|
748
847
|
capacity: memberData.capacity || '40h/week',
|
|
749
|
-
currentWorkload: 0
|
|
848
|
+
currentWorkload: 0,
|
|
750
849
|
};
|
|
751
850
|
projectPlan.team.push(newMember);
|
|
752
851
|
await savePlanningData(projectPath, projectPlan);
|
|
753
852
|
return {
|
|
754
|
-
content: [
|
|
853
|
+
content: [
|
|
854
|
+
{
|
|
755
855
|
type: 'text',
|
|
756
856
|
text: `# Team Member Added
|
|
757
857
|
|
|
@@ -762,15 +862,18 @@ Total team members: ${projectPlan.team.length}
|
|
|
762
862
|
- **Skills**: ${newMember.skills.join(', ') || 'None specified'}
|
|
763
863
|
|
|
764
864
|
Use \`allocate\` action to assign them to project phases.
|
|
765
|
-
|
|
766
|
-
}
|
|
865
|
+
`,
|
|
866
|
+
},
|
|
867
|
+
],
|
|
767
868
|
};
|
|
768
869
|
default:
|
|
769
870
|
return {
|
|
770
|
-
content: [
|
|
871
|
+
content: [
|
|
872
|
+
{
|
|
771
873
|
type: 'text',
|
|
772
|
-
text: `Resource management for action "${action}" is not yet implemented
|
|
773
|
-
}
|
|
874
|
+
text: `Resource management for action "${action}" is not yet implemented.`,
|
|
875
|
+
},
|
|
876
|
+
],
|
|
774
877
|
};
|
|
775
878
|
}
|
|
776
879
|
}
|
|
@@ -778,7 +881,7 @@ Use \`allocate\` action to assign them to project phases.
|
|
|
778
881
|
* Risk analysis operation
|
|
779
882
|
*/
|
|
780
883
|
async function riskAnalysis(args) {
|
|
781
|
-
const { projectPath, includeAdrRisks, includeDependencyRisks, includeResourceRisks, generateMitigation } = args;
|
|
884
|
+
const { projectPath, includeAdrRisks, includeDependencyRisks, includeResourceRisks, generateMitigation, } = args;
|
|
782
885
|
const projectPlan = await loadPlanningData(projectPath);
|
|
783
886
|
if (!projectPlan) {
|
|
784
887
|
throw new McpAdrError(`No project found at ${projectPath}. Use create_project first.`, 'PROJECT_NOT_FOUND');
|
|
@@ -792,7 +895,7 @@ async function riskAnalysis(args) {
|
|
|
792
895
|
category: 'Architecture',
|
|
793
896
|
description: `Phase "${phase.name}" has no linked ADRs - architectural decisions may be unclear`,
|
|
794
897
|
impact: 'medium',
|
|
795
|
-
probability: 'high'
|
|
898
|
+
probability: 'high',
|
|
796
899
|
};
|
|
797
900
|
if (generateMitigation) {
|
|
798
901
|
riskObj.mitigation = 'Review and create ADRs for architectural decisions in this phase';
|
|
@@ -804,10 +907,11 @@ async function riskAnalysis(args) {
|
|
|
804
907
|
category: 'Complexity',
|
|
805
908
|
description: `Phase "${phase.name}" has many ADRs (${phase.linkedAdrs.length}) - high complexity risk`,
|
|
806
909
|
impact: 'high',
|
|
807
|
-
probability: 'medium'
|
|
910
|
+
probability: 'medium',
|
|
808
911
|
};
|
|
809
912
|
if (generateMitigation) {
|
|
810
|
-
riskObj.mitigation =
|
|
913
|
+
riskObj.mitigation =
|
|
914
|
+
'Consider breaking this phase into smaller, more manageable sub-phases';
|
|
811
915
|
}
|
|
812
916
|
risks.push(riskObj);
|
|
813
917
|
}
|
|
@@ -821,10 +925,11 @@ async function riskAnalysis(args) {
|
|
|
821
925
|
category: 'Dependencies',
|
|
822
926
|
description: `Phase "${phase.name}" has multiple dependencies (${phase.dependencies.length}) - high coordination risk`,
|
|
823
927
|
impact: 'high',
|
|
824
|
-
probability: 'medium'
|
|
928
|
+
probability: 'medium',
|
|
825
929
|
};
|
|
826
930
|
if (generateMitigation) {
|
|
827
|
-
riskObj.mitigation =
|
|
931
|
+
riskObj.mitigation =
|
|
932
|
+
'Review and simplify dependencies, create detailed coordination plan';
|
|
828
933
|
}
|
|
829
934
|
risks.push(riskObj);
|
|
830
935
|
}
|
|
@@ -835,10 +940,11 @@ async function riskAnalysis(args) {
|
|
|
835
940
|
category: 'Dependencies',
|
|
836
941
|
description: `Potential circular dependency detected between "${phase.name}" and other phases`,
|
|
837
942
|
impact: 'critical',
|
|
838
|
-
probability: 'high'
|
|
943
|
+
probability: 'high',
|
|
839
944
|
};
|
|
840
945
|
if (generateMitigation) {
|
|
841
|
-
riskObj.mitigation =
|
|
946
|
+
riskObj.mitigation =
|
|
947
|
+
'Review and restructure phase dependencies to eliminate circular references';
|
|
842
948
|
}
|
|
843
949
|
risks.push(riskObj);
|
|
844
950
|
}
|
|
@@ -853,7 +959,7 @@ async function riskAnalysis(args) {
|
|
|
853
959
|
category: 'Resources',
|
|
854
960
|
description: `Team is overallocated (${avgWorkload.toFixed(1)}% average workload)`,
|
|
855
961
|
impact: 'high',
|
|
856
|
-
probability: 'high'
|
|
962
|
+
probability: 'high',
|
|
857
963
|
};
|
|
858
964
|
if (generateMitigation) {
|
|
859
965
|
riskObj.mitigation = 'Rebalance workload or consider adding team members';
|
|
@@ -865,7 +971,7 @@ async function riskAnalysis(args) {
|
|
|
865
971
|
category: 'Resources',
|
|
866
972
|
description: `Limited team size (${projectPlan.team.length} members) for ${projectPlan.phases.length} phases`,
|
|
867
973
|
impact: 'medium',
|
|
868
|
-
probability: 'medium'
|
|
974
|
+
probability: 'medium',
|
|
869
975
|
};
|
|
870
976
|
if (generateMitigation) {
|
|
871
977
|
riskObj.mitigation = 'Consider increasing team size or extending timeline';
|
|
@@ -877,7 +983,7 @@ async function riskAnalysis(args) {
|
|
|
877
983
|
const criticalRisks = risks.filter(r => r.impact === 'critical').length;
|
|
878
984
|
const highRisks = risks.filter(r => r.impact === 'high').length;
|
|
879
985
|
const mediumRisks = risks.filter(r => r.impact === 'medium').length;
|
|
880
|
-
const riskScore =
|
|
986
|
+
const riskScore = criticalRisks * 10 + highRisks * 5 + mediumRisks * 2;
|
|
881
987
|
let riskLevel = 'low';
|
|
882
988
|
if (riskScore > 20)
|
|
883
989
|
riskLevel = 'critical';
|
|
@@ -886,7 +992,8 @@ async function riskAnalysis(args) {
|
|
|
886
992
|
else if (riskScore > 5)
|
|
887
993
|
riskLevel = 'medium';
|
|
888
994
|
return {
|
|
889
|
-
content: [
|
|
995
|
+
content: [
|
|
996
|
+
{
|
|
890
997
|
type: 'text',
|
|
891
998
|
text: `# Risk Analysis Report
|
|
892
999
|
|
|
@@ -902,29 +1009,32 @@ async function riskAnalysis(args) {
|
|
|
902
1009
|
|
|
903
1010
|
### Identified Risks
|
|
904
1011
|
|
|
905
|
-
${risks
|
|
1012
|
+
${risks
|
|
1013
|
+
.map((risk, index) => `
|
|
906
1014
|
#### Risk ${index + 1}: ${risk.category}
|
|
907
1015
|
- **Description**: ${risk.description}
|
|
908
1016
|
- **Impact**: ${risk.impact}
|
|
909
1017
|
- **Probability**: ${risk.probability}
|
|
910
1018
|
${risk.mitigation ? `- **Mitigation**: ${risk.mitigation}` : ''}
|
|
911
|
-
`)
|
|
1019
|
+
`)
|
|
1020
|
+
.join('')}
|
|
912
1021
|
|
|
913
1022
|
### Recommendations
|
|
914
1023
|
|
|
915
|
-
${riskLevel === 'critical'
|
|
916
|
-
'🚨 **Critical risks detected** - Immediate action required before proceeding'
|
|
917
|
-
riskLevel === 'high'
|
|
918
|
-
'⚠️ **High risks present** - Review and mitigate before major milestones'
|
|
919
|
-
'✅ **Manageable risk level** - Continue with normal monitoring'}
|
|
1024
|
+
${riskLevel === 'critical'
|
|
1025
|
+
? '🚨 **Critical risks detected** - Immediate action required before proceeding'
|
|
1026
|
+
: riskLevel === 'high'
|
|
1027
|
+
? '⚠️ **High risks present** - Review and mitigate before major milestones'
|
|
1028
|
+
: '✅ **Manageable risk level** - Continue with normal monitoring'}
|
|
920
1029
|
|
|
921
1030
|
### Next Steps
|
|
922
1031
|
1. Review and prioritize risk mitigation strategies
|
|
923
1032
|
2. Assign risk owners for high-impact items
|
|
924
1033
|
3. Schedule regular risk assessment reviews
|
|
925
1034
|
4. Update project timeline if necessary
|
|
926
|
-
|
|
927
|
-
}
|
|
1035
|
+
`,
|
|
1036
|
+
},
|
|
1037
|
+
],
|
|
928
1038
|
};
|
|
929
1039
|
}
|
|
930
1040
|
/**
|
|
@@ -942,7 +1052,8 @@ async function generateReports(args) {
|
|
|
942
1052
|
const teamUtilization = calculateTeamUtilization(projectPlan);
|
|
943
1053
|
const riskLevel = calculateProjectRisk(projectPlan);
|
|
944
1054
|
return {
|
|
945
|
-
content: [
|
|
1055
|
+
content: [
|
|
1056
|
+
{
|
|
946
1057
|
type: 'text',
|
|
947
1058
|
text: `# Executive Summary
|
|
948
1059
|
|
|
@@ -956,11 +1067,11 @@ async function generateReports(args) {
|
|
|
956
1067
|
- **Completed Phases**: ${projectPlan.phases.filter(p => p.status === 'completed').length}
|
|
957
1068
|
|
|
958
1069
|
### Current Status
|
|
959
|
-
${projectPlan.status === 'active'
|
|
960
|
-
'🟢 Project is actively progressing'
|
|
961
|
-
projectPlan.status === 'completed'
|
|
962
|
-
'✅ Project completed successfully'
|
|
963
|
-
'🟡 Project in planning phase'}
|
|
1070
|
+
${projectPlan.status === 'active'
|
|
1071
|
+
? '🟢 Project is actively progressing'
|
|
1072
|
+
: projectPlan.status === 'completed'
|
|
1073
|
+
? '✅ Project completed successfully'
|
|
1074
|
+
: '🟡 Project in planning phase'}
|
|
964
1075
|
|
|
965
1076
|
### Key Highlights
|
|
966
1077
|
- Total phases: ${projectPlan.phases.length}
|
|
@@ -969,56 +1080,69 @@ ${projectPlan.status === 'active' ?
|
|
|
969
1080
|
- Risk level: ${riskLevel}
|
|
970
1081
|
|
|
971
1082
|
### Next Milestones
|
|
972
|
-
${projectPlan.milestones
|
|
1083
|
+
${projectPlan.milestones
|
|
1084
|
+
.filter(m => m.status === 'pending')
|
|
1085
|
+
.slice(0, 3)
|
|
1086
|
+
.map(milestone => `- ${milestone.name} (Due: ${milestone.dueDate})`)
|
|
1087
|
+
.join('\n') || 'No upcoming milestones'}
|
|
973
1088
|
|
|
974
1089
|
### Blockers & Risks
|
|
975
|
-
${projectPlan.phases.filter(p => p.blockers.length > 0).length > 0
|
|
976
|
-
`⚠️ ${projectPlan.phases.filter(p => p.blockers.length > 0).length} phases have blockers`
|
|
977
|
-
'✅ No major blockers reported'}
|
|
1090
|
+
${projectPlan.phases.filter(p => p.blockers.length > 0).length > 0
|
|
1091
|
+
? `⚠️ ${projectPlan.phases.filter(p => p.blockers.length > 0).length} phases have blockers`
|
|
1092
|
+
: '✅ No major blockers reported'}
|
|
978
1093
|
|
|
979
1094
|
*Report generated: ${new Date().toISOString()}*
|
|
980
|
-
|
|
981
|
-
}
|
|
1095
|
+
`,
|
|
1096
|
+
},
|
|
1097
|
+
],
|
|
982
1098
|
};
|
|
983
1099
|
case 'status':
|
|
984
1100
|
return {
|
|
985
|
-
content: [
|
|
1101
|
+
content: [
|
|
1102
|
+
{
|
|
986
1103
|
type: 'text',
|
|
987
1104
|
text: `# Status Report - ${timeframe}
|
|
988
1105
|
|
|
989
1106
|
## ${projectPlan.name}
|
|
990
1107
|
|
|
991
1108
|
### Phase Status
|
|
992
|
-
${projectPlan.phases
|
|
1109
|
+
${projectPlan.phases
|
|
1110
|
+
.map(phase => `
|
|
993
1111
|
#### ${phase.name}
|
|
994
1112
|
- **Status**: ${phase.status}
|
|
995
1113
|
- **Progress**: ${phase.completion}%
|
|
996
1114
|
- **Timeline**: ${phase.estimatedDuration}
|
|
997
1115
|
- **Team**: ${phase.resources.length} members
|
|
998
1116
|
- **Blockers**: ${phase.blockers.length}
|
|
999
|
-
`)
|
|
1117
|
+
`)
|
|
1118
|
+
.join('')}
|
|
1000
1119
|
|
|
1001
1120
|
### Team Status
|
|
1002
|
-
${projectPlan.team
|
|
1121
|
+
${projectPlan.team
|
|
1122
|
+
.map(member => `
|
|
1003
1123
|
#### ${member.name}
|
|
1004
1124
|
- **Role**: ${member.role}
|
|
1005
1125
|
- **Workload**: ${member.currentWorkload}%
|
|
1006
1126
|
- **Capacity**: ${member.capacity}
|
|
1007
|
-
`)
|
|
1127
|
+
`)
|
|
1128
|
+
.join('')}
|
|
1008
1129
|
|
|
1009
1130
|
### Recent Updates
|
|
1010
1131
|
- Last updated: ${projectPlan.metadata.updatedAt}
|
|
1011
1132
|
- Total phases: ${projectPlan.phases.length}
|
|
1012
1133
|
- Active work streams: ${projectPlan.phases.filter(p => p.status === 'active').length}
|
|
1013
|
-
|
|
1014
|
-
}
|
|
1134
|
+
`,
|
|
1135
|
+
},
|
|
1136
|
+
],
|
|
1015
1137
|
};
|
|
1016
1138
|
default:
|
|
1017
1139
|
return {
|
|
1018
|
-
content: [
|
|
1140
|
+
content: [
|
|
1141
|
+
{
|
|
1019
1142
|
type: 'text',
|
|
1020
|
-
text: `Report generation for type "${reportType}" is not yet implemented
|
|
1021
|
-
}
|
|
1143
|
+
text: `Report generation for type "${reportType}" is not yet implemented.`,
|
|
1144
|
+
},
|
|
1145
|
+
],
|
|
1022
1146
|
};
|
|
1023
1147
|
}
|
|
1024
1148
|
}
|
|
@@ -1038,7 +1162,8 @@ function calculateOverallProgress(projectPlan) {
|
|
|
1038
1162
|
function calculateTeamUtilization(projectPlan) {
|
|
1039
1163
|
if (projectPlan.team.length === 0)
|
|
1040
1164
|
return 0;
|
|
1041
|
-
return Math.round(projectPlan.team.reduce((sum, member) => sum + member.currentWorkload, 0) /
|
|
1165
|
+
return Math.round(projectPlan.team.reduce((sum, member) => sum + member.currentWorkload, 0) /
|
|
1166
|
+
projectPlan.team.length);
|
|
1042
1167
|
}
|
|
1043
1168
|
function calculateProjectRisk(projectPlan) {
|
|
1044
1169
|
const blockedPhases = projectPlan.phases.filter(p => p.status === 'blocked').length;
|