mcp-adr-analysis-server 2.0.10 → 2.0.12
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/README.md +1 -1
- package/dist/src/index.d.ts +1 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +340 -492
- package/dist/src/index.js.map +1 -1
- package/dist/src/prompts/adr-suggestion-prompts.d.ts.map +1 -1
- package/dist/src/prompts/adr-suggestion-prompts.js +2 -0
- package/dist/src/prompts/adr-suggestion-prompts.js.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.d.ts +16 -0
- package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.js +55 -2
- package/dist/src/tools/adr-suggestion-tool.js.map +1 -1
- package/dist/src/tools/smart-git-push-tool-v2.d.ts +55 -0
- package/dist/src/tools/smart-git-push-tool-v2.d.ts.map +1 -0
- package/dist/src/tools/smart-git-push-tool-v2.js +527 -0
- package/dist/src/tools/smart-git-push-tool-v2.js.map +1 -0
- package/dist/src/tools/smart-git-push-tool.d.ts +27 -3
- package/dist/src/tools/smart-git-push-tool.d.ts.map +1 -1
- package/dist/src/tools/smart-git-push-tool.js +490 -10
- package/dist/src/tools/smart-git-push-tool.js.map +1 -1
- package/dist/src/tools/smart-score-tool.d.ts +39 -4
- package/dist/src/tools/smart-score-tool.d.ts.map +1 -1
- package/dist/src/tools/smart-score-tool.js +94 -15
- package/dist/src/tools/smart-score-tool.js.map +1 -1
- package/dist/src/tools/todo-management-tool-v2.d.ts +329 -0
- package/dist/src/tools/todo-management-tool-v2.d.ts.map +1 -0
- package/dist/src/tools/todo-management-tool-v2.js +644 -0
- package/dist/src/tools/todo-management-tool-v2.js.map +1 -0
- package/dist/src/tools/tool-chain-orchestrator.d.ts +3 -41
- package/dist/src/tools/tool-chain-orchestrator.d.ts.map +1 -1
- package/dist/src/tools/tool-chain-orchestrator.js +10 -198
- package/dist/src/tools/tool-chain-orchestrator.js.map +1 -1
- package/dist/src/types/conversation-context.d.ts +6 -0
- package/dist/src/types/conversation-context.d.ts.map +1 -1
- package/dist/src/types/conversation-context.js +9 -1
- package/dist/src/types/conversation-context.js.map +1 -1
- package/dist/src/types/knowledge-graph-schemas.d.ts +298 -6
- package/dist/src/types/knowledge-graph-schemas.d.ts.map +1 -1
- package/dist/src/types/knowledge-graph-schemas.js +31 -3
- package/dist/src/types/knowledge-graph-schemas.js.map +1 -1
- package/dist/src/types/todo-json-schemas.d.ts +663 -0
- package/dist/src/types/todo-json-schemas.d.ts.map +1 -0
- package/dist/src/types/todo-json-schemas.js +113 -0
- package/dist/src/types/todo-json-schemas.js.map +1 -0
- package/dist/src/utils/chain-of-thought-template.d.ts.map +1 -1
- package/dist/src/utils/chain-of-thought-template.js.map +1 -1
- package/dist/src/utils/knowledge-graph-manager.d.ts +50 -0
- package/dist/src/utils/knowledge-graph-manager.d.ts.map +1 -1
- package/dist/src/utils/knowledge-graph-manager.js +209 -3
- package/dist/src/utils/knowledge-graph-manager.js.map +1 -1
- package/dist/src/utils/project-health-scoring.js +5 -5
- package/dist/src/utils/project-health-scoring.js.map +1 -1
- package/dist/src/utils/todo-json-manager.d.ts +71 -0
- package/dist/src/utils/todo-json-manager.d.ts.map +1 -0
- package/dist/src/utils/todo-json-manager.js +394 -0
- package/dist/src/utils/todo-json-manager.js.map +1 -0
- package/dist/src/utils/todo-markdown-converter.d.ts +16 -0
- package/dist/src/utils/todo-markdown-converter.d.ts.map +1 -0
- package/dist/src/utils/todo-markdown-converter.js +362 -0
- package/dist/src/utils/todo-markdown-converter.js.map +1 -0
- package/dist/src/utils/todo-migration.d.ts +47 -0
- package/dist/src/utils/todo-migration.d.ts.map +1 -0
- package/dist/src/utils/todo-migration.js +261 -0
- package/dist/src/utils/todo-migration.js.map +1 -0
- package/package.json +1 -1
- package/dist/src/tools/human-override-tool.d.ts +0 -42
- package/dist/src/tools/human-override-tool.d.ts.map +0 -1
- package/dist/src/tools/human-override-tool.js +0 -431
- package/dist/src/tools/human-override-tool.js.map +0 -1
- package/dist/src/tools/todo-management-tool.d.ts +0 -344
- package/dist/src/tools/todo-management-tool.d.ts.map +0 -1
- package/dist/src/tools/todo-management-tool.js +0 -1249
- package/dist/src/tools/todo-management-tool.js.map +0 -1
package/dist/src/index.js
CHANGED
|
@@ -198,7 +198,8 @@ export class McpAdrAnalysisServer {
|
|
|
198
198
|
type: 'boolean',
|
|
199
199
|
description: 'Include compliance checks in the analysis',
|
|
200
200
|
default: true
|
|
201
|
-
}
|
|
201
|
+
},
|
|
202
|
+
conversationContext: CONVERSATION_CONTEXT_SCHEMA
|
|
202
203
|
}
|
|
203
204
|
}
|
|
204
205
|
},
|
|
@@ -236,14 +237,15 @@ export class McpAdrAnalysisServer {
|
|
|
236
237
|
enum: ['web-application', 'mobile-app', 'microservices', 'data-platform', 'api-service', 'general'],
|
|
237
238
|
description: 'Type of PRD for optimized knowledge generation',
|
|
238
239
|
default: 'general'
|
|
239
|
-
}
|
|
240
|
+
},
|
|
241
|
+
conversationContext: CONVERSATION_CONTEXT_SCHEMA
|
|
240
242
|
},
|
|
241
243
|
required: ['prdPath']
|
|
242
244
|
}
|
|
243
245
|
},
|
|
244
246
|
{
|
|
245
247
|
name: 'generate_adr_todo',
|
|
246
|
-
description: 'Generate TDD-focused todo.md from existing ADRs with
|
|
248
|
+
description: 'Generate TDD-focused todo.md from existing ADRs with JSON-first approach: creates structured JSON TODO and syncs to markdown',
|
|
247
249
|
inputSchema: {
|
|
248
250
|
type: 'object',
|
|
249
251
|
properties: {
|
|
@@ -265,7 +267,7 @@ export class McpAdrAnalysisServer {
|
|
|
265
267
|
},
|
|
266
268
|
linkAdrs: {
|
|
267
269
|
type: 'boolean',
|
|
268
|
-
description: '
|
|
270
|
+
description: 'Auto-detect and link ADR dependencies in task creation',
|
|
269
271
|
default: true
|
|
270
272
|
},
|
|
271
273
|
includeRules: {
|
|
@@ -288,7 +290,22 @@ export class McpAdrAnalysisServer {
|
|
|
288
290
|
type: 'boolean',
|
|
289
291
|
description: 'Preserve existing TODO.md content by merging instead of overwriting',
|
|
290
292
|
default: true
|
|
291
|
-
}
|
|
293
|
+
},
|
|
294
|
+
forceSyncToMarkdown: {
|
|
295
|
+
type: 'boolean',
|
|
296
|
+
description: 'Force sync JSON to markdown even if markdown is newer',
|
|
297
|
+
default: false
|
|
298
|
+
},
|
|
299
|
+
intentId: {
|
|
300
|
+
type: 'string',
|
|
301
|
+
description: 'Link generated tasks to specific knowledge graph intent'
|
|
302
|
+
},
|
|
303
|
+
createJsonBackup: {
|
|
304
|
+
type: 'boolean',
|
|
305
|
+
description: 'Create backup of existing JSON TODO data before import',
|
|
306
|
+
default: true
|
|
307
|
+
},
|
|
308
|
+
conversationContext: CONVERSATION_CONTEXT_SCHEMA
|
|
292
309
|
}
|
|
293
310
|
}
|
|
294
311
|
},
|
|
@@ -1248,86 +1265,178 @@ export class McpAdrAnalysisServer {
|
|
|
1248
1265
|
}
|
|
1249
1266
|
},
|
|
1250
1267
|
{
|
|
1251
|
-
name: '
|
|
1252
|
-
description: '
|
|
1268
|
+
name: 'manage_todo_json',
|
|
1269
|
+
description: 'JSON-first TODO management with consistent LLM interactions, automatic scoring sync, and knowledge graph integration',
|
|
1253
1270
|
inputSchema: {
|
|
1254
1271
|
type: 'object',
|
|
1255
1272
|
properties: {
|
|
1256
1273
|
operation: {
|
|
1257
1274
|
type: 'string',
|
|
1258
|
-
enum: ['
|
|
1259
|
-
description: 'Operation to perform on TODO
|
|
1275
|
+
enum: ['create_task', 'update_task', 'bulk_update', 'get_tasks', 'get_analytics', 'import_adr_tasks', 'sync_knowledge_graph', 'sync_to_markdown', 'import_from_markdown'],
|
|
1276
|
+
description: 'Operation to perform on TODO JSON backend'
|
|
1260
1277
|
},
|
|
1261
|
-
|
|
1278
|
+
projectPath: {
|
|
1262
1279
|
type: 'string',
|
|
1263
|
-
|
|
1264
|
-
description: 'Path to TODO.md file'
|
|
1280
|
+
description: 'Project root path (uses configured PROJECT_PATH if not provided)'
|
|
1265
1281
|
},
|
|
1266
|
-
|
|
1282
|
+
taskId: {
|
|
1283
|
+
type: 'string',
|
|
1284
|
+
description: 'Task ID for update operations'
|
|
1285
|
+
},
|
|
1286
|
+
title: {
|
|
1287
|
+
type: 'string',
|
|
1288
|
+
description: 'Task title for create operations'
|
|
1289
|
+
},
|
|
1290
|
+
description: {
|
|
1291
|
+
type: 'string',
|
|
1292
|
+
description: 'Task description'
|
|
1293
|
+
},
|
|
1294
|
+
priority: {
|
|
1295
|
+
type: 'string',
|
|
1296
|
+
enum: ['low', 'medium', 'high', 'critical'],
|
|
1297
|
+
default: 'medium',
|
|
1298
|
+
description: 'Task priority level'
|
|
1299
|
+
},
|
|
1300
|
+
assignee: {
|
|
1301
|
+
type: 'string',
|
|
1302
|
+
description: 'Task assignee'
|
|
1303
|
+
},
|
|
1304
|
+
dueDate: {
|
|
1305
|
+
type: 'string',
|
|
1306
|
+
description: 'Due date (ISO string format)'
|
|
1307
|
+
},
|
|
1308
|
+
category: {
|
|
1309
|
+
type: 'string',
|
|
1310
|
+
description: 'Task category'
|
|
1311
|
+
},
|
|
1312
|
+
tags: {
|
|
1267
1313
|
type: 'array',
|
|
1268
|
-
items: {
|
|
1269
|
-
|
|
1270
|
-
properties: {
|
|
1271
|
-
taskId: { type: 'string' },
|
|
1272
|
-
status: { type: 'string', enum: ['pending', 'in_progress', 'completed', 'blocked', 'cancelled'] },
|
|
1273
|
-
notes: { type: 'string' },
|
|
1274
|
-
assignee: { type: 'string' }
|
|
1275
|
-
},
|
|
1276
|
-
required: ['taskId', 'status']
|
|
1277
|
-
},
|
|
1278
|
-
description: 'Status updates to apply (for update_status operation)'
|
|
1314
|
+
items: { type: 'string' },
|
|
1315
|
+
description: 'Task tags'
|
|
1279
1316
|
},
|
|
1280
|
-
|
|
1317
|
+
dependencies: {
|
|
1281
1318
|
type: 'array',
|
|
1282
|
-
items: {
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1319
|
+
items: { type: 'string' },
|
|
1320
|
+
description: 'Task dependencies (task IDs)'
|
|
1321
|
+
},
|
|
1322
|
+
intentId: {
|
|
1323
|
+
type: 'string',
|
|
1324
|
+
description: 'Link to knowledge graph intent'
|
|
1325
|
+
},
|
|
1326
|
+
linkedAdrs: {
|
|
1327
|
+
type: 'array',
|
|
1328
|
+
items: { type: 'string' },
|
|
1329
|
+
description: 'Related ADR files'
|
|
1330
|
+
},
|
|
1331
|
+
autoComplete: {
|
|
1332
|
+
type: 'boolean',
|
|
1333
|
+
default: false,
|
|
1334
|
+
description: 'Auto-complete when criteria are met'
|
|
1335
|
+
},
|
|
1336
|
+
completionCriteria: {
|
|
1337
|
+
type: 'string',
|
|
1338
|
+
description: 'Auto-completion rules'
|
|
1339
|
+
},
|
|
1340
|
+
updates: {
|
|
1341
|
+
type: 'object',
|
|
1342
|
+
properties: {
|
|
1343
|
+
title: { type: 'string' },
|
|
1344
|
+
description: { type: 'string' },
|
|
1345
|
+
status: { type: 'string', enum: ['pending', 'in_progress', 'completed', 'blocked', 'cancelled'] },
|
|
1346
|
+
priority: { type: 'string', enum: ['low', 'medium', 'high', 'critical'] },
|
|
1347
|
+
assignee: { type: 'string' },
|
|
1348
|
+
dueDate: { type: 'string' },
|
|
1349
|
+
progressPercentage: { type: 'number', minimum: 0, maximum: 100 },
|
|
1350
|
+
notes: { type: 'string' },
|
|
1351
|
+
tags: { type: 'array', items: { type: 'string' } }
|
|
1294
1352
|
},
|
|
1295
|
-
description: '
|
|
1353
|
+
description: 'Fields to update for update operations'
|
|
1296
1354
|
},
|
|
1297
|
-
|
|
1355
|
+
reason: {
|
|
1298
1356
|
type: 'string',
|
|
1299
|
-
description: '
|
|
1357
|
+
description: 'Reason for update (for changelog)'
|
|
1358
|
+
},
|
|
1359
|
+
filters: {
|
|
1360
|
+
type: 'object',
|
|
1361
|
+
properties: {
|
|
1362
|
+
status: { type: 'string', enum: ['pending', 'in_progress', 'completed', 'blocked', 'cancelled'] },
|
|
1363
|
+
priority: { type: 'string', enum: ['low', 'medium', 'high', 'critical'] },
|
|
1364
|
+
assignee: { type: 'string' },
|
|
1365
|
+
category: { type: 'string' },
|
|
1366
|
+
hasDeadline: { type: 'boolean' },
|
|
1367
|
+
overdue: { type: 'boolean' },
|
|
1368
|
+
tags: { type: 'array', items: { type: 'string' } }
|
|
1369
|
+
},
|
|
1370
|
+
description: 'Filter criteria for get_tasks operation'
|
|
1371
|
+
},
|
|
1372
|
+
sortBy: {
|
|
1373
|
+
type: 'string',
|
|
1374
|
+
enum: ['priority', 'dueDate', 'createdAt', 'updatedAt'],
|
|
1375
|
+
default: 'priority',
|
|
1376
|
+
description: 'Sort field for get_tasks operation'
|
|
1377
|
+
},
|
|
1378
|
+
sortOrder: {
|
|
1379
|
+
type: 'string',
|
|
1380
|
+
enum: ['asc', 'desc'],
|
|
1381
|
+
default: 'desc',
|
|
1382
|
+
description: 'Sort order for get_tasks operation'
|
|
1383
|
+
},
|
|
1384
|
+
limit: {
|
|
1385
|
+
type: 'number',
|
|
1386
|
+
description: 'Maximum number of tasks to return'
|
|
1387
|
+
},
|
|
1388
|
+
timeframe: {
|
|
1389
|
+
type: 'string',
|
|
1390
|
+
enum: ['day', 'week', 'month', 'all'],
|
|
1391
|
+
default: 'week',
|
|
1392
|
+
description: 'Analysis timeframe for analytics'
|
|
1393
|
+
},
|
|
1394
|
+
includeVelocity: {
|
|
1395
|
+
type: 'boolean',
|
|
1396
|
+
default: true,
|
|
1397
|
+
description: 'Include velocity metrics in analytics'
|
|
1398
|
+
},
|
|
1399
|
+
includeScoring: {
|
|
1400
|
+
type: 'boolean',
|
|
1401
|
+
default: true,
|
|
1402
|
+
description: 'Include scoring metrics in analytics'
|
|
1300
1403
|
},
|
|
1301
1404
|
adrDirectory: {
|
|
1302
1405
|
type: 'string',
|
|
1303
1406
|
default: 'docs/adrs',
|
|
1304
|
-
description: 'ADR directory path
|
|
1407
|
+
description: 'ADR directory path for imports'
|
|
1305
1408
|
},
|
|
1306
|
-
|
|
1409
|
+
preserveExisting: {
|
|
1307
1410
|
type: 'boolean',
|
|
1308
1411
|
default: true,
|
|
1309
|
-
description: 'Keep
|
|
1412
|
+
description: 'Keep existing tasks during imports'
|
|
1310
1413
|
},
|
|
1311
|
-
|
|
1414
|
+
autoLinkDependencies: {
|
|
1312
1415
|
type: 'boolean',
|
|
1313
1416
|
default: true,
|
|
1314
|
-
description: '
|
|
1417
|
+
description: 'Auto-detect task dependencies'
|
|
1315
1418
|
},
|
|
1316
|
-
|
|
1419
|
+
direction: {
|
|
1420
|
+
type: 'string',
|
|
1421
|
+
enum: ['to_kg', 'from_kg', 'bidirectional'],
|
|
1422
|
+
default: 'bidirectional',
|
|
1423
|
+
description: 'Knowledge graph sync direction'
|
|
1424
|
+
},
|
|
1425
|
+
force: {
|
|
1317
1426
|
type: 'boolean',
|
|
1318
1427
|
default: false,
|
|
1319
|
-
description: '
|
|
1428
|
+
description: 'Force operation even if conflicts exist'
|
|
1320
1429
|
},
|
|
1321
|
-
|
|
1430
|
+
mergeStrategy: {
|
|
1322
1431
|
type: 'string',
|
|
1323
|
-
enum: ['
|
|
1324
|
-
default: '
|
|
1325
|
-
description: '
|
|
1432
|
+
enum: ['overwrite', 'merge', 'preserve_json'],
|
|
1433
|
+
default: 'merge',
|
|
1434
|
+
description: 'Merge strategy for imports'
|
|
1326
1435
|
},
|
|
1327
|
-
|
|
1436
|
+
backupExisting: {
|
|
1328
1437
|
type: 'boolean',
|
|
1329
1438
|
default: true,
|
|
1330
|
-
description: '
|
|
1439
|
+
description: 'Create backup before destructive operations'
|
|
1331
1440
|
}
|
|
1332
1441
|
},
|
|
1333
1442
|
required: ['operation']
|
|
@@ -1404,7 +1513,7 @@ export class McpAdrAnalysisServer {
|
|
|
1404
1513
|
},
|
|
1405
1514
|
{
|
|
1406
1515
|
name: 'smart_git_push',
|
|
1407
|
-
description: '
|
|
1516
|
+
description: 'AI-driven security-focused git push with credential detection, file filtering, and deployment metrics tracking. Tests should be run by calling AI and results provided.',
|
|
1408
1517
|
inputSchema: {
|
|
1409
1518
|
type: 'object',
|
|
1410
1519
|
properties: {
|
|
@@ -1416,26 +1525,61 @@ export class McpAdrAnalysisServer {
|
|
|
1416
1525
|
type: 'string',
|
|
1417
1526
|
description: 'Commit message (optional, commits staged files if provided)'
|
|
1418
1527
|
},
|
|
1419
|
-
|
|
1420
|
-
type: '
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1528
|
+
testResults: {
|
|
1529
|
+
type: 'object',
|
|
1530
|
+
description: 'Test results from AI-executed tests (required for proper deployment tracking)',
|
|
1531
|
+
properties: {
|
|
1532
|
+
success: {
|
|
1533
|
+
type: 'boolean',
|
|
1534
|
+
description: 'Whether all tests passed'
|
|
1535
|
+
},
|
|
1536
|
+
testsRun: {
|
|
1537
|
+
type: 'number',
|
|
1538
|
+
description: 'Total number of tests executed'
|
|
1539
|
+
},
|
|
1540
|
+
testsPassed: {
|
|
1541
|
+
type: 'number',
|
|
1542
|
+
description: 'Number of tests that passed'
|
|
1543
|
+
},
|
|
1544
|
+
testsFailed: {
|
|
1545
|
+
type: 'number',
|
|
1546
|
+
description: 'Number of tests that failed'
|
|
1547
|
+
},
|
|
1548
|
+
duration: {
|
|
1549
|
+
type: 'number',
|
|
1550
|
+
description: 'Test execution duration in seconds'
|
|
1551
|
+
},
|
|
1552
|
+
command: {
|
|
1553
|
+
type: 'string',
|
|
1554
|
+
description: 'Test command that was executed by AI'
|
|
1555
|
+
},
|
|
1556
|
+
output: {
|
|
1557
|
+
type: 'string',
|
|
1558
|
+
description: 'Test execution output'
|
|
1559
|
+
},
|
|
1560
|
+
failureDetails: {
|
|
1561
|
+
type: 'array',
|
|
1562
|
+
items: { type: 'string' },
|
|
1563
|
+
description: 'Details of test failures'
|
|
1564
|
+
},
|
|
1565
|
+
testTypes: {
|
|
1566
|
+
type: 'object',
|
|
1567
|
+
description: 'Results broken down by test type (unit, integration, etc.)',
|
|
1568
|
+
additionalProperties: {
|
|
1569
|
+
type: 'object',
|
|
1570
|
+
properties: {
|
|
1571
|
+
passed: { type: 'number' },
|
|
1572
|
+
failed: { type: 'number' }
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
},
|
|
1577
|
+
required: ['success', 'testsRun', 'testsPassed', 'testsFailed']
|
|
1434
1578
|
},
|
|
1435
|
-
|
|
1579
|
+
skipSecurity: {
|
|
1436
1580
|
type: 'boolean',
|
|
1437
|
-
default:
|
|
1438
|
-
description: '
|
|
1581
|
+
default: false,
|
|
1582
|
+
description: 'Skip security scanning (NOT RECOMMENDED)'
|
|
1439
1583
|
},
|
|
1440
1584
|
dryRun: {
|
|
1441
1585
|
type: 'boolean',
|
|
@@ -1446,16 +1590,10 @@ export class McpAdrAnalysisServer {
|
|
|
1446
1590
|
type: 'string',
|
|
1447
1591
|
description: 'Path to project directory (defaults to current working directory)'
|
|
1448
1592
|
},
|
|
1449
|
-
|
|
1593
|
+
forceUnsafe: {
|
|
1450
1594
|
type: 'boolean',
|
|
1451
1595
|
default: false,
|
|
1452
|
-
description: '
|
|
1453
|
-
},
|
|
1454
|
-
releaseType: {
|
|
1455
|
-
type: 'string',
|
|
1456
|
-
enum: ['major', 'minor', 'patch'],
|
|
1457
|
-
default: 'minor',
|
|
1458
|
-
description: 'Type of release to check readiness for'
|
|
1596
|
+
description: 'Override security blocks and test failures (DANGEROUS)'
|
|
1459
1597
|
}
|
|
1460
1598
|
}
|
|
1461
1599
|
}
|
|
@@ -1559,7 +1697,8 @@ export class McpAdrAnalysisServer {
|
|
|
1559
1697
|
type: 'string',
|
|
1560
1698
|
description: 'Path to TODO.md file',
|
|
1561
1699
|
default: 'TODO.md'
|
|
1562
|
-
}
|
|
1700
|
+
},
|
|
1701
|
+
conversationContext: CONVERSATION_CONTEXT_SCHEMA
|
|
1563
1702
|
},
|
|
1564
1703
|
required: ['operation']
|
|
1565
1704
|
}
|
|
@@ -1572,7 +1711,7 @@ export class McpAdrAnalysisServer {
|
|
|
1572
1711
|
properties: {
|
|
1573
1712
|
operation: {
|
|
1574
1713
|
type: 'string',
|
|
1575
|
-
enum: ['recalculate_scores', 'sync_scores', 'diagnose_scores', 'optimize_weights', 'reset_scores'],
|
|
1714
|
+
enum: ['recalculate_scores', 'sync_scores', 'diagnose_scores', 'optimize_weights', 'reset_scores', 'get_score_trends', 'get_intent_scores'],
|
|
1576
1715
|
description: 'Smart scoring operation to perform'
|
|
1577
1716
|
},
|
|
1578
1717
|
projectPath: {
|
|
@@ -1607,7 +1746,7 @@ export class McpAdrAnalysisServer {
|
|
|
1607
1746
|
type: 'array',
|
|
1608
1747
|
items: {
|
|
1609
1748
|
type: 'string',
|
|
1610
|
-
enum: ['
|
|
1749
|
+
enum: ['manage_todo_json', 'smart_git_push', 'compare_adr_progress', 'analyze_content_security', 'validate_rules']
|
|
1611
1750
|
},
|
|
1612
1751
|
description: 'Tools to trigger for fresh data (for sync_scores operation)'
|
|
1613
1752
|
},
|
|
@@ -1668,56 +1807,13 @@ export class McpAdrAnalysisServer {
|
|
|
1668
1807
|
type: 'boolean',
|
|
1669
1808
|
default: true,
|
|
1670
1809
|
description: 'Immediately recalculate after reset (for reset_scores operation)'
|
|
1671
|
-
}
|
|
1672
|
-
},
|
|
1673
|
-
required: ['operation', 'projectPath']
|
|
1674
|
-
}
|
|
1675
|
-
},
|
|
1676
|
-
{
|
|
1677
|
-
name: 'human_override',
|
|
1678
|
-
description: 'Human override to force AI-powered tool planning when LLMs get confused or stuck - cuts through confusion with direct task execution',
|
|
1679
|
-
inputSchema: {
|
|
1680
|
-
type: 'object',
|
|
1681
|
-
properties: {
|
|
1682
|
-
taskDescription: {
|
|
1683
|
-
type: 'string',
|
|
1684
|
-
description: 'What the human wants accomplished (in plain English)'
|
|
1685
1810
|
},
|
|
1686
|
-
|
|
1811
|
+
intentId: {
|
|
1687
1812
|
type: 'string',
|
|
1688
|
-
description: '
|
|
1689
|
-
},
|
|
1690
|
-
adrDirectory: {
|
|
1691
|
-
type: 'string',
|
|
1692
|
-
default: 'docs/adrs',
|
|
1693
|
-
description: 'ADR directory path'
|
|
1694
|
-
},
|
|
1695
|
-
todoPath: {
|
|
1696
|
-
type: 'string',
|
|
1697
|
-
default: 'TODO.md',
|
|
1698
|
-
description: 'Path to TODO.md file'
|
|
1699
|
-
},
|
|
1700
|
-
priority: {
|
|
1701
|
-
type: 'string',
|
|
1702
|
-
enum: ['low', 'medium', 'high', 'critical'],
|
|
1703
|
-
default: 'high',
|
|
1704
|
-
description: 'Task priority level'
|
|
1705
|
-
},
|
|
1706
|
-
forceExecution: {
|
|
1707
|
-
type: 'boolean',
|
|
1708
|
-
default: true,
|
|
1709
|
-
description: 'Force immediate execution planning'
|
|
1710
|
-
},
|
|
1711
|
-
deadline: {
|
|
1712
|
-
type: 'string',
|
|
1713
|
-
description: 'When this must be completed (optional)'
|
|
1714
|
-
},
|
|
1715
|
-
additionalContext: {
|
|
1716
|
-
type: 'string',
|
|
1717
|
-
description: 'Any additional context or constraints (optional)'
|
|
1813
|
+
description: 'Intent ID to get score trends for (for get_intent_scores operation)'
|
|
1718
1814
|
}
|
|
1719
1815
|
},
|
|
1720
|
-
required: ['
|
|
1816
|
+
required: ['operation', 'projectPath']
|
|
1721
1817
|
}
|
|
1722
1818
|
}
|
|
1723
1819
|
]
|
|
@@ -1819,8 +1915,8 @@ export class McpAdrAnalysisServer {
|
|
|
1819
1915
|
case 'list_directory':
|
|
1820
1916
|
response = await this.listDirectory(args);
|
|
1821
1917
|
break;
|
|
1822
|
-
case '
|
|
1823
|
-
response = await this.
|
|
1918
|
+
case 'manage_todo_json':
|
|
1919
|
+
response = await this.manageTodoJson(args);
|
|
1824
1920
|
break;
|
|
1825
1921
|
case 'generate_deployment_guidance':
|
|
1826
1922
|
response = await this.generateDeploymentGuidance(args);
|
|
@@ -1834,9 +1930,6 @@ export class McpAdrAnalysisServer {
|
|
|
1834
1930
|
case 'smart_score':
|
|
1835
1931
|
response = await this.smartScore(args);
|
|
1836
1932
|
break;
|
|
1837
|
-
case 'human_override':
|
|
1838
|
-
response = await this.humanOverride(args);
|
|
1839
|
-
break;
|
|
1840
1933
|
default:
|
|
1841
1934
|
throw new McpAdrError(`Unknown tool: ${name}`, 'UNKNOWN_TOOL');
|
|
1842
1935
|
}
|
|
@@ -2611,6 +2704,27 @@ ${environmentResult.content[0].text}
|
|
|
2611
2704
|
temperature: 0.1,
|
|
2612
2705
|
maxTokens: 6000,
|
|
2613
2706
|
});
|
|
2707
|
+
// Step 6: Record project structure to knowledge graph
|
|
2708
|
+
try {
|
|
2709
|
+
this.logger.info('Recording project structure to knowledge graph');
|
|
2710
|
+
const projectStructureSnapshot = {
|
|
2711
|
+
projectPath,
|
|
2712
|
+
analysisDepth,
|
|
2713
|
+
recursiveDepth,
|
|
2714
|
+
technologyFocus,
|
|
2715
|
+
analysisScope,
|
|
2716
|
+
includeEnvironment,
|
|
2717
|
+
timestamp: new Date().toISOString(),
|
|
2718
|
+
structureData: baseProjectAnalysisPrompt.context || {}
|
|
2719
|
+
};
|
|
2720
|
+
await this.kgManager.recordProjectStructure(projectStructureSnapshot);
|
|
2721
|
+
this.logger.info('✅ Project structure recorded to knowledge graph');
|
|
2722
|
+
}
|
|
2723
|
+
catch (kgError) {
|
|
2724
|
+
this.logger.warn('Failed to record project structure to knowledge graph:', kgError);
|
|
2725
|
+
// Don't fail the entire analysis if KG recording fails
|
|
2726
|
+
}
|
|
2727
|
+
// Return appropriate response based on execution result
|
|
2614
2728
|
if (executionResult.isAIGenerated) {
|
|
2615
2729
|
// AI execution successful - return actual analysis results
|
|
2616
2730
|
return formatMCPResponse({
|
|
@@ -2629,6 +2743,7 @@ ${environmentResult.content[0].text}
|
|
|
2629
2743
|
- **Reflexion Learning**: ${enhancedMode && learningEnabled ? '✅ Enabled' : '❌ Disabled'}
|
|
2630
2744
|
- **Enhanced Mode**: ${enhancedMode ? '✅ Enabled' : '❌ Disabled'}
|
|
2631
2745
|
- **Technology Focus**: ${technologyFocus.length > 0 ? technologyFocus.join(', ') : 'Auto-detect'}
|
|
2746
|
+
- **Knowledge Graph**: ✅ Project structure recorded
|
|
2632
2747
|
|
|
2633
2748
|
${knowledgeContext}
|
|
2634
2749
|
|
|
@@ -2697,6 +2812,7 @@ This comprehensive analysis provides deep recursive project understanding with i
|
|
|
2697
2812
|
- **Enhanced Mode**: ${enhancedMode ? '✅ Enabled' : '❌ Disabled'}
|
|
2698
2813
|
- **Technology Focus**: ${technologyFocus.length > 0 ? technologyFocus.join(', ') : 'Auto-detect'}
|
|
2699
2814
|
- **Include Patterns**: ${includePatterns?.length ? includePatterns.join(', ') : 'Default patterns'}
|
|
2815
|
+
- **Knowledge Graph**: ✅ Project structure recorded
|
|
2700
2816
|
|
|
2701
2817
|
${knowledgeContext}
|
|
2702
2818
|
|
|
@@ -3247,371 +3363,102 @@ The enhanced process maintains full traceability from PRD requirements to genera
|
|
|
3247
3363
|
}
|
|
3248
3364
|
}
|
|
3249
3365
|
async generateAdrTodo(args) {
|
|
3250
|
-
const { scope = 'all', phase = 'both', linkAdrs = true, includeRules = true, ruleSource = 'both',
|
|
3366
|
+
const { scope = 'all', phase = 'both', linkAdrs = true, includeRules = true, ruleSource = 'both', preserveExisting = true, forceSyncToMarkdown = false, intentId, createJsonBackup = true } = args;
|
|
3251
3367
|
const { getAdrDirectoryPath } = await import('./utils/config.js');
|
|
3252
3368
|
const path = await import('path');
|
|
3253
|
-
const fs = await import('fs/promises');
|
|
3254
3369
|
// Use absolute ADR path relative to project
|
|
3255
3370
|
const absoluteAdrPath = args.adrDirectory ?
|
|
3256
3371
|
path.resolve(this.config.projectPath, args.adrDirectory) :
|
|
3257
3372
|
getAdrDirectoryPath(this.config);
|
|
3258
3373
|
// Keep relative path for display purposes
|
|
3259
3374
|
const adrDirectory = args.adrDirectory || this.config.adrDirectory;
|
|
3260
|
-
|
|
3261
|
-
const absoluteTodoPath = path.resolve(this.config.projectPath, todoPath);
|
|
3262
|
-
this.logger.info(`Generating TDD-focused todo for ADRs in: ${absoluteAdrPath} (phase: ${phase})`);
|
|
3375
|
+
this.logger.info(`Generating JSON-first TODO for ADRs in: ${absoluteAdrPath} (phase: ${phase})`);
|
|
3263
3376
|
try {
|
|
3264
|
-
//
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
this.logger.info(`Existing TODO.md found at: ${absoluteTodoPath}`);
|
|
3270
|
-
}
|
|
3271
|
-
catch (error) {
|
|
3272
|
-
if (error.code !== 'ENOENT') {
|
|
3273
|
-
this.logger.error(`Error accessing existing TODO.md: ${error.message}`);
|
|
3274
|
-
}
|
|
3275
|
-
}
|
|
3276
|
-
// If preserving existing content and file exists, use manageTodo merge instead
|
|
3277
|
-
if (preserveExisting && existingTodoExists) {
|
|
3278
|
-
this.logger.info('Preserving existing TODO.md content, using merge approach');
|
|
3279
|
-
// Use manageTodo to merge ADR updates with existing content
|
|
3280
|
-
const { manageTodo } = await import('./tools/todo-management-tool.js');
|
|
3281
|
-
const mergeResult = await manageTodo({
|
|
3282
|
-
operation: 'merge_adr_updates',
|
|
3283
|
-
todoPath: absoluteTodoPath,
|
|
3284
|
-
adrDirectory: absoluteAdrPath,
|
|
3285
|
-
preserveCompleted: true,
|
|
3286
|
-
preserveCustom: true
|
|
3287
|
-
}, this.config.projectPath);
|
|
3288
|
-
return {
|
|
3289
|
-
content: [{
|
|
3290
|
-
type: 'text',
|
|
3291
|
-
text: `# TODO.md Merge Completed
|
|
3292
|
-
|
|
3293
|
-
## Existing File Preserved
|
|
3294
|
-
- **Location**: ${absoluteTodoPath}
|
|
3295
|
-
- **Action**: Merged ADR updates with existing content
|
|
3296
|
-
- **Preservation**: Custom tasks and completed items preserved
|
|
3297
|
-
|
|
3298
|
-
## Analysis Information
|
|
3299
|
-
- **ADR Directory**: ${adrDirectory}
|
|
3300
|
-
- **Scope**: ${scope}
|
|
3301
|
-
- **TDD Phase**: ${phase}
|
|
3302
|
-
- **ADR Linking**: ${linkAdrs ? 'Enabled' : 'Disabled'}
|
|
3303
|
-
- **Rules Integration**: ${includeRules ? `Enabled (${ruleSource})` : 'Disabled'}
|
|
3304
|
-
|
|
3305
|
-
${mergeResult.content[0].text}
|
|
3306
|
-
|
|
3307
|
-
## Next Steps
|
|
3308
|
-
1. Review merged TODO.md content
|
|
3309
|
-
2. Update task statuses as needed using \`manage_todo\`
|
|
3310
|
-
3. Use \`compare_adr_progress\` to validate implementation status
|
|
3311
|
-
|
|
3312
|
-
*To force regeneration, set \`preserveExisting: false\` in the request*`
|
|
3313
|
-
}]
|
|
3314
|
-
};
|
|
3315
|
-
}
|
|
3316
|
-
const { discoverAdrsInDirectory } = await import('./utils/adr-discovery.js');
|
|
3317
|
-
const { scanProjectStructure } = await import('./utils/actual-file-operations.js');
|
|
3318
|
-
// Use actual ADR discovery
|
|
3319
|
-
const discoveryResult = await discoverAdrsInDirectory(absoluteAdrPath, true, this.config.projectPath);
|
|
3320
|
-
let adrContent = `Found ${discoveryResult.adrs.length} ADRs in ${absoluteAdrPath}:\n\n`;
|
|
3321
|
-
discoveryResult.adrs.forEach(adr => {
|
|
3322
|
-
adrContent += `### ${adr.title}\n`;
|
|
3323
|
-
adrContent += `- **File**: ${adr.filename}\n`;
|
|
3324
|
-
adrContent += `- **Status**: ${adr.status}\n`;
|
|
3325
|
-
adrContent += `- **Context**: ${adr.context}\n`;
|
|
3326
|
-
adrContent += `- **Decision**: ${adr.decision}\n`;
|
|
3327
|
-
adrContent += `- **Consequences**: ${adr.consequences}\n\n`;
|
|
3328
|
-
});
|
|
3329
|
-
// For ADR linking, also discover all project structure
|
|
3330
|
-
let projectStructurePrompt = '';
|
|
3331
|
-
if (linkAdrs) {
|
|
3332
|
-
const projectStructure = await scanProjectStructure(this.config.projectPath, {
|
|
3333
|
-
readContent: false,
|
|
3334
|
-
includeHidden: false
|
|
3335
|
-
});
|
|
3336
|
-
const codeFiles = [
|
|
3337
|
-
...projectStructure.buildFiles.filter(f => f.filename.match(/\.(ts|js|py|java|cs|go|rb|php|swift|kt|rs|cpp|c|h)$/)),
|
|
3338
|
-
...projectStructure.configFiles.filter(f => f.filename.match(/\.(ts|js)$/))
|
|
3339
|
-
];
|
|
3340
|
-
projectStructurePrompt = `
|
|
3341
|
-
## Project Structure (for ADR linking)
|
|
3342
|
-
Found ${codeFiles.length} code files:
|
|
3343
|
-
${codeFiles.map(f => `- ${f.relativePath} (${f.type})`).join('\n')}
|
|
3344
|
-
`;
|
|
3345
|
-
}
|
|
3346
|
-
// For rules integration, extract architectural rules from ADRs
|
|
3347
|
-
let rulesPrompt = '';
|
|
3348
|
-
if (includeRules) {
|
|
3377
|
+
// Always use JSON-first TODO system
|
|
3378
|
+
this.logger.info('Using JSON-first TODO system for ADR task generation');
|
|
3379
|
+
const { manageTodoV2 } = await import('./tools/todo-management-tool-v2.js');
|
|
3380
|
+
// Optional: Create backup if requested and JSON exists
|
|
3381
|
+
if (createJsonBackup) {
|
|
3349
3382
|
try {
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
adrDirectory: adrDirectory,
|
|
3383
|
+
await manageTodoV2({
|
|
3384
|
+
operation: 'import_from_markdown',
|
|
3353
3385
|
projectPath: this.config.projectPath,
|
|
3354
|
-
|
|
3386
|
+
mergeStrategy: 'preserve_json',
|
|
3387
|
+
backupExisting: true
|
|
3355
3388
|
});
|
|
3356
|
-
|
|
3357
|
-
rulesPrompt = `
|
|
3358
|
-
## Architectural Rules (for compliance validation)
|
|
3359
|
-
The following architectural rules have been extracted from ADRs and should be validated in tests:
|
|
3360
|
-
|
|
3361
|
-
${Array.isArray(rulesResult.content) ? rulesResult.content.map((c) => c.text || c).join('\n') : rulesResult.content}
|
|
3362
|
-
`;
|
|
3363
|
-
}
|
|
3389
|
+
this.logger.info('Created backup of existing JSON TODO data');
|
|
3364
3390
|
}
|
|
3365
3391
|
catch (error) {
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
## Architectural Rules (failed to extract)
|
|
3369
|
-
Note: Could not extract architectural rules automatically. Manual rule validation may be needed.
|
|
3370
|
-
`;
|
|
3392
|
+
// Continue if backup fails - might be first time setup
|
|
3393
|
+
this.logger.debug('No existing JSON data to backup');
|
|
3371
3394
|
}
|
|
3372
3395
|
}
|
|
3373
|
-
//
|
|
3374
|
-
const
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
## Step 2: TDD Todo Generation Analysis
|
|
3383
|
-
|
|
3384
|
-
Once you have discovered and read the ADR files, please analyze them and generate a comprehensive TDD-focused todo.md file.
|
|
3385
|
-
|
|
3386
|
-
## TDD Phase: ${phase}
|
|
3387
|
-
${phase === 'test' ? '**Focus on Phase 1: Mock Test Generation Only**' : ''}
|
|
3388
|
-
${phase === 'production' ? '**Focus on Phase 2: Production Code Implementation (assumes tests exist)**' : ''}
|
|
3389
|
-
${phase === 'both' ? '**Generate both Phase 1 (Tests) and Phase 2 (Production) tasks**' : ''}
|
|
3390
|
-
|
|
3391
|
-
## Requirements
|
|
3392
|
-
|
|
3393
|
-
1. **Extract Tasks**: Identify all implementation tasks from ADRs
|
|
3394
|
-
2. **TDD Approach**: For each task, create:
|
|
3395
|
-
- Phase 1: Mock test specifications
|
|
3396
|
-
- Phase 2: Production implementation tasks
|
|
3397
|
-
3. **ADR Linking**: ${linkAdrs ? 'Link related ADRs to create comprehensive system tests' : 'Focus on individual ADR tasks'}
|
|
3398
|
-
4. **Rules Integration**: ${includeRules ? `Include architectural rules validation in tests (source: ${ruleSource})` : 'Skip architectural rules validation'}
|
|
3399
|
-
5. **Categorize**: Group tasks by ADR and testing phase
|
|
3400
|
-
6. **Status Detection**: Determine task completion status
|
|
3401
|
-
7. **Progress Tracking**: Calculate overall progress for both test and implementation phases
|
|
3402
|
-
8. **Scope Filter**: ${scope === 'all' ? 'Include all tasks' : `Focus on ${scope} tasks only`}
|
|
3403
|
-
|
|
3404
|
-
## TDD Todo.md Format
|
|
3405
|
-
|
|
3406
|
-
\`\`\`markdown
|
|
3407
|
-
# TDD-Focused ADR Implementation Progress
|
|
3408
|
-
|
|
3409
|
-
**Last Updated**: [Date]
|
|
3410
|
-
**Overall Progress**: [X]% Complete
|
|
3411
|
-
**Test Coverage**: [X]% Complete
|
|
3412
|
-
**Implementation Coverage**: [X]% Complete
|
|
3413
|
-
|
|
3414
|
-
## Summary
|
|
3415
|
-
- Total ADRs: [count]
|
|
3416
|
-
- Total Tasks: [count] (Tests: [count], Implementation: [count])
|
|
3417
|
-
- Completed: [count]
|
|
3418
|
-
- In Progress: [count]
|
|
3419
|
-
- Pending: [count]
|
|
3420
|
-
|
|
3421
|
-
## System Architecture Overview (from linked ADRs)
|
|
3422
|
-
[Brief summary of how all ADRs connect to form the complete system]
|
|
3423
|
-
|
|
3424
|
-
## Phase 1: Test Generation Tasks
|
|
3425
|
-
|
|
3426
|
-
### ADR-001: [Title]
|
|
3427
|
-
#### Test Specifications
|
|
3428
|
-
- [ ] TEST: Unit test for [component/function]
|
|
3429
|
-
- Mock: [what to mock]
|
|
3430
|
-
- Expected: [expected behavior]
|
|
3431
|
-
- Coverage: [what this tests]
|
|
3432
|
-
- [ ] TEST: Integration test for [feature]
|
|
3433
|
-
- Setup: [test environment]
|
|
3434
|
-
- Scenario: [test scenario]
|
|
3435
|
-
- Assertions: [what to verify]
|
|
3436
|
-
${includeRules ? `- [ ] RULE: Architectural rule validation test for [rule name]
|
|
3437
|
-
- Validation: [what rule to check]
|
|
3438
|
-
- Pattern: [validation pattern/regex]
|
|
3439
|
-
- Expected: [compliant behavior]` : ''}
|
|
3440
|
-
|
|
3441
|
-
### ADR-002: [Title]
|
|
3442
|
-
#### Test Specifications
|
|
3443
|
-
- [ ] TEST: [test description]
|
|
3444
|
-
${includeRules ? '- [ ] RULE: [rule validation test]' : ''}
|
|
3445
|
-
...
|
|
3446
|
-
|
|
3447
|
-
## Phase 2: Production Implementation Tasks
|
|
3448
|
-
|
|
3449
|
-
### ADR-001: [Title]
|
|
3450
|
-
#### Implementation Tasks (after tests pass)
|
|
3451
|
-
- [ ] IMPL: Implement [component/function]
|
|
3452
|
-
- Precondition: Unit test for [component] exists
|
|
3453
|
-
- Definition: [what to implement]
|
|
3454
|
-
- Acceptance: All related tests pass
|
|
3455
|
-
${includeRules ? ` - Compliance: Must pass architectural rule validation` : ''}
|
|
3456
|
-
- [ ] IMPL: [implementation task]
|
|
3457
|
-
|
|
3458
|
-
### ADR-002: [Title]
|
|
3459
|
-
#### Implementation Tasks
|
|
3460
|
-
- [ ] IMPL: [implementation description]
|
|
3461
|
-
${includeRules ? ' - Compliance: [specific rule requirements]' : ''}
|
|
3462
|
-
...
|
|
3463
|
-
|
|
3464
|
-
## ADR Dependencies and Links
|
|
3465
|
-
- ADR-001 → ADR-002: [relationship description]
|
|
3466
|
-
- ADR-002 → ADR-003: [relationship description]
|
|
3467
|
-
|
|
3468
|
-
## Test-First Development Workflow
|
|
3469
|
-
1. Complete all Phase 1 tests for a component
|
|
3470
|
-
${includeRules ? '2. Complete architectural rule validation tests' : ''}
|
|
3471
|
-
${includeRules ? '3' : '2'}. Run tests (they should fail)
|
|
3472
|
-
${includeRules ? '4' : '3'}. Implement Phase 2 production code
|
|
3473
|
-
${includeRules ? '5' : '4'}. Run tests (they should pass)
|
|
3474
|
-
${includeRules ? '6. Validate architectural rule compliance' : ''}
|
|
3475
|
-
${includeRules ? '7' : '5'}. Refactor if needed while maintaining rule compliance
|
|
3476
|
-
\`\`\`
|
|
3477
|
-
|
|
3478
|
-
Please provide:
|
|
3479
|
-
1. Comprehensive task extraction from all ADRs
|
|
3480
|
-
2. Test specifications for each implementation task
|
|
3481
|
-
${includeRules ? '3. Architectural rule validation tests and compliance checks' : ''}
|
|
3482
|
-
${includeRules ? '4' : '3'}. Clear separation of test and implementation phases
|
|
3483
|
-
${includeRules ? '5' : '4'}. ADR relationship mapping for system-wide test coverage
|
|
3484
|
-
${includeRules ? '6' : '5'}. TDD workflow recommendations with rule compliance integration
|
|
3485
|
-
`;
|
|
3486
|
-
// Execute the todo generation with AI if enabled, otherwise return prompt
|
|
3487
|
-
const { executePromptWithFallback, formatMCPResponse } = await import('./utils/prompt-execution.js');
|
|
3488
|
-
const executionResult = await executePromptWithFallback(todoPrompt, 'Generate TDD-focused todo.md file from ADR analysis with test-first approach and system-wide coverage', {
|
|
3489
|
-
temperature: 0.1,
|
|
3490
|
-
maxTokens: 8000,
|
|
3491
|
-
systemPrompt: `You are an expert in Test-Driven Development (TDD) and architectural implementation.
|
|
3492
|
-
Analyze the provided ADRs to extract actionable tasks following a strict TDD approach.
|
|
3493
|
-
|
|
3494
|
-
Key responsibilities:
|
|
3495
|
-
1. For each implementation task, FIRST define the test specifications
|
|
3496
|
-
2. Create mock test descriptions that verify the expected behavior
|
|
3497
|
-
3. Link related ADRs to ensure comprehensive system test coverage
|
|
3498
|
-
4. Separate test generation (Phase 1) from production code (Phase 2)
|
|
3499
|
-
5. Ensure every production task has corresponding test coverage
|
|
3500
|
-
6. Map ADR dependencies to identify integration test requirements
|
|
3501
|
-
${includeRules ? '7. Include architectural rule validation in test specifications' : ''}
|
|
3502
|
-
${includeRules ? '8. Create compliance checks for extracted architectural rules' : ''}
|
|
3503
|
-
${includeRules ? '9. Ensure implementation tasks include rule compliance verification' : ''}
|
|
3504
|
-
|
|
3505
|
-
Follow the TDD red-green-refactor cycle:
|
|
3506
|
-
- Red: Write failing tests first (Phase 1)${includeRules ? ' including rule validation tests' : ''}
|
|
3507
|
-
- Green: Implement minimal code to pass tests (Phase 2)
|
|
3508
|
-
- Refactor: Improve code while keeping tests green${includeRules ? ' and maintaining rule compliance' : ''}
|
|
3509
|
-
|
|
3510
|
-
${includeRules ? 'The architectural rules provide constraints and patterns that must be validated in tests and followed in implementation.' : ''}
|
|
3511
|
-
|
|
3512
|
-
The todo.md should serve as the glue connecting all ADRs into a cohesive, testable${includeRules ? ', rule-compliant' : ''} system.`,
|
|
3513
|
-
responseFormat: 'text'
|
|
3396
|
+
// Import ADR tasks into JSON system with enhanced parameters
|
|
3397
|
+
const importResult = await manageTodoV2({
|
|
3398
|
+
operation: 'import_adr_tasks',
|
|
3399
|
+
projectPath: this.config.projectPath,
|
|
3400
|
+
adrDirectory: absoluteAdrPath,
|
|
3401
|
+
preserveExisting,
|
|
3402
|
+
autoLinkDependencies: linkAdrs,
|
|
3403
|
+
...(intentId && { intentId })
|
|
3514
3404
|
});
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3405
|
+
// Sync JSON data to markdown with force option
|
|
3406
|
+
await manageTodoV2({
|
|
3407
|
+
operation: 'sync_to_markdown',
|
|
3408
|
+
projectPath: this.config.projectPath,
|
|
3409
|
+
force: forceSyncToMarkdown
|
|
3410
|
+
});
|
|
3411
|
+
return {
|
|
3412
|
+
content: [{
|
|
3413
|
+
type: 'text',
|
|
3414
|
+
text: `# ✅ JSON-First TODO Generated from ADRs
|
|
3415
|
+
|
|
3416
|
+
## 🏗️ JSON-First TODO System Active
|
|
3417
|
+
✅ **todo-data.json** - JSON-first TODO backend created/updated
|
|
3418
|
+
✅ **TODO.md** - Markdown frontend ${forceSyncToMarkdown ? 'synchronized' : 'available for sync'}
|
|
3520
3419
|
|
|
3521
|
-
##
|
|
3420
|
+
## Configuration Applied
|
|
3522
3421
|
- **ADR Directory**: ${adrDirectory}
|
|
3523
3422
|
- **Scope**: ${scope}
|
|
3524
3423
|
- **TDD Phase**: ${phase}
|
|
3525
|
-
- **ADR Linking**: ${linkAdrs ? 'Enabled' : 'Disabled'}
|
|
3424
|
+
- **ADR Dependency Linking**: ${linkAdrs ? 'Enabled' : 'Disabled'}
|
|
3526
3425
|
- **Rules Integration**: ${includeRules ? `Enabled (${ruleSource})` : 'Disabled'}
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
${
|
|
3531
|
-
|
|
3532
|
-
##
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
- **
|
|
3556
|
-
- **
|
|
3557
|
-
- **
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
{
|
|
3564
|
-
"tool": "generate_adr_todo",
|
|
3565
|
-
"args": {
|
|
3566
|
-
"adrDirectory": "${adrDirectory}",
|
|
3567
|
-
"phase": "test",
|
|
3568
|
-
"linkAdrs": true,
|
|
3569
|
-
"includeRules": true,
|
|
3570
|
-
"ruleSource": "both"
|
|
3571
|
-
}
|
|
3572
|
-
}
|
|
3573
|
-
\`\`\`
|
|
3574
|
-
|
|
3575
|
-
### Generate Production Phase Only:
|
|
3576
|
-
\`\`\`json
|
|
3577
|
-
{
|
|
3578
|
-
"tool": "generate_adr_todo",
|
|
3579
|
-
"args": {
|
|
3580
|
-
"adrDirectory": "${adrDirectory}",
|
|
3581
|
-
"phase": "production",
|
|
3582
|
-
"scope": "pending",
|
|
3583
|
-
"includeRules": true
|
|
3584
|
-
}
|
|
3585
|
-
}
|
|
3586
|
-
\`\`\`
|
|
3587
|
-
|
|
3588
|
-
### Update Full TDD Todo with Rules:
|
|
3589
|
-
\`\`\`json
|
|
3590
|
-
{
|
|
3591
|
-
"tool": "generate_adr_todo",
|
|
3592
|
-
"args": {
|
|
3593
|
-
"adrDirectory": "${adrDirectory}",
|
|
3594
|
-
"phase": "both",
|
|
3595
|
-
"linkAdrs": true,
|
|
3596
|
-
"includeRules": true,
|
|
3597
|
-
"ruleSource": "both"
|
|
3598
|
-
}
|
|
3599
|
-
}
|
|
3600
|
-
\`\`\`
|
|
3601
|
-
`,
|
|
3602
|
-
});
|
|
3603
|
-
}
|
|
3604
|
-
else {
|
|
3605
|
-
// Fallback to prompt-only mode
|
|
3606
|
-
return {
|
|
3607
|
-
content: [
|
|
3608
|
-
{
|
|
3609
|
-
type: 'text',
|
|
3610
|
-
text: `TDD-focused ADR todo generation for: ${adrDirectory}\n\nPhase: ${phase}\nADR Linking: ${linkAdrs ? 'Enabled' : 'Disabled'}\nRules Integration: ${includeRules ? `Enabled (${ruleSource})` : 'Disabled'}\nScope: ${scope}\n\nPlease generate a TDD-focused todo.md using the following prompt:\n\n${todoPrompt}`
|
|
3611
|
-
}
|
|
3612
|
-
]
|
|
3613
|
-
};
|
|
3614
|
-
}
|
|
3426
|
+
- **Preserve Existing**: ${preserveExisting}
|
|
3427
|
+
- **Force Markdown Sync**: ${forceSyncToMarkdown ? 'Enabled' : 'Disabled'}
|
|
3428
|
+
- **Intent Linking**: ${intentId ? `Linked to ${intentId}` : 'None'}
|
|
3429
|
+
- **JSON Backup**: ${createJsonBackup ? 'Created' : 'Skipped'}
|
|
3430
|
+
|
|
3431
|
+
## JSON-First Architecture Benefits
|
|
3432
|
+
✅ **Structured Data**: JSON backend ensures consistent LLM interactions
|
|
3433
|
+
✅ **Automatic Sync**: JSON-to-markdown conversion maintains TODO.md compatibility
|
|
3434
|
+
✅ **Enhanced Metadata**: Full task lifecycle with dependencies, assignees, priorities
|
|
3435
|
+
✅ **Complete Integration**: Native support for scoring, git automation, and knowledge graph
|
|
3436
|
+
✅ **Backup Protection**: Automatic data preservation during updates
|
|
3437
|
+
✅ **No Manual Setup**: All cache files auto-generated, tests can immediately validate
|
|
3438
|
+
|
|
3439
|
+
${importResult.content[0].text}
|
|
3440
|
+
|
|
3441
|
+
## Available Operations (use manage_todo_v2 tool)
|
|
3442
|
+
1. **View Tasks**: \`get_tasks\` operation with filtering and sorting
|
|
3443
|
+
2. **Update Status**: \`update_task\` operation with status, progress, notes
|
|
3444
|
+
3. **Bulk Updates**: \`bulk_update\` operation for multiple tasks
|
|
3445
|
+
4. **Analytics**: \`get_analytics\` operation for progress metrics
|
|
3446
|
+
5. **Sync Control**: \`sync_to_markdown\` and \`sync_knowledge_graph\` operations
|
|
3447
|
+
|
|
3448
|
+
## Validation & Progress Tracking
|
|
3449
|
+
- **Progress Check**: Use \`compare_adr_progress\` to validate implementation vs ADRs
|
|
3450
|
+
- **Git Integration**: Use \`smart_git_push\` for automatic task status updates
|
|
3451
|
+
- **Scoring**: Integrated with smart scoring for release readiness assessment
|
|
3452
|
+
|
|
3453
|
+
## TDD Workflow Integration
|
|
3454
|
+
- **Phase 1**: Mock test generation tasks created
|
|
3455
|
+
- **Phase 2**: Production implementation tasks linked to tests
|
|
3456
|
+
- **Dependencies**: ADR relationships mapped to task dependencies
|
|
3457
|
+
- **Validation**: Architectural rules integrated into task criteria
|
|
3458
|
+
|
|
3459
|
+
*All TODO data is now managed in JSON format with automatic markdown sync*`
|
|
3460
|
+
}]
|
|
3461
|
+
};
|
|
3615
3462
|
}
|
|
3616
3463
|
catch (error) {
|
|
3617
3464
|
throw new McpAdrError(`Failed to generate ADR todo: ${error instanceof Error ? error.message : String(error)}`, 'GENERATION_ERROR');
|
|
@@ -4511,7 +4358,12 @@ Please provide:
|
|
|
4511
4358
|
}
|
|
4512
4359
|
// If no intent found, create a standalone execution record
|
|
4513
4360
|
if (!intentId) {
|
|
4514
|
-
|
|
4361
|
+
// Extract human request from conversation context if available
|
|
4362
|
+
let humanRequest = `Standalone tool execution: ${toolName}`;
|
|
4363
|
+
if (parameters?.conversationContext?.humanRequest) {
|
|
4364
|
+
humanRequest = parameters.conversationContext.humanRequest;
|
|
4365
|
+
}
|
|
4366
|
+
intentId = await this.kgManager.createIntent(humanRequest, [`Execute ${toolName}`, 'Complete tool operation'], 'medium');
|
|
4515
4367
|
}
|
|
4516
4368
|
// Determine tasks created/modified from tool operation
|
|
4517
4369
|
const todoTasksCreated = [];
|
|
@@ -4731,13 +4583,18 @@ Please provide:
|
|
|
4731
4583
|
throw new McpAdrError(`Failed to list directory: ${error instanceof Error ? error.message : String(error)}`, 'DIRECTORY_LIST_ERROR');
|
|
4732
4584
|
}
|
|
4733
4585
|
}
|
|
4734
|
-
async
|
|
4586
|
+
async manageTodoJson(args) {
|
|
4735
4587
|
try {
|
|
4736
|
-
const {
|
|
4737
|
-
|
|
4588
|
+
const { manageTodoV2 } = await import('./tools/todo-management-tool-v2.js');
|
|
4589
|
+
// Add projectPath to args if not provided
|
|
4590
|
+
const argsWithPath = {
|
|
4591
|
+
...args,
|
|
4592
|
+
projectPath: args.projectPath || this.config.projectPath
|
|
4593
|
+
};
|
|
4594
|
+
return await manageTodoV2(argsWithPath);
|
|
4738
4595
|
}
|
|
4739
4596
|
catch (error) {
|
|
4740
|
-
throw new McpAdrError(`TODO management failed: ${error instanceof Error ? error.message : String(error)}`, '
|
|
4597
|
+
throw new McpAdrError(`JSON TODO management failed: ${error instanceof Error ? error.message : String(error)}`, 'TODO_JSON_MANAGEMENT_ERROR');
|
|
4741
4598
|
}
|
|
4742
4599
|
}
|
|
4743
4600
|
async generateDeploymentGuidance(args) {
|
|
@@ -4751,7 +4608,7 @@ Please provide:
|
|
|
4751
4608
|
}
|
|
4752
4609
|
async smartGitPush(args) {
|
|
4753
4610
|
try {
|
|
4754
|
-
const { smartGitPush } = await import('./tools/smart-git-push-tool.js');
|
|
4611
|
+
const { smartGitPush } = await import('./tools/smart-git-push-tool-v2.js');
|
|
4755
4612
|
return await smartGitPush(args);
|
|
4756
4613
|
}
|
|
4757
4614
|
catch (error) {
|
|
@@ -4776,15 +4633,6 @@ Please provide:
|
|
|
4776
4633
|
throw new McpAdrError(`Smart score analysis failed: ${error instanceof Error ? error.message : String(error)}`, 'SMART_SCORE_ERROR');
|
|
4777
4634
|
}
|
|
4778
4635
|
}
|
|
4779
|
-
async humanOverride(args) {
|
|
4780
|
-
try {
|
|
4781
|
-
const { humanOverride } = await import('./tools/human-override-tool.js');
|
|
4782
|
-
return await humanOverride(args);
|
|
4783
|
-
}
|
|
4784
|
-
catch (error) {
|
|
4785
|
-
throw new McpAdrError(`Human override failed: ${error instanceof Error ? error.message : String(error)}`, 'HUMAN_OVERRIDE_ERROR');
|
|
4786
|
-
}
|
|
4787
|
-
}
|
|
4788
4636
|
}
|
|
4789
4637
|
/**
|
|
4790
4638
|
* Main execution
|