track_document_work
Track development work to identify required documentation updates, ensuring code changes align with project documentation requirements.
Instructions
Track the relationship between development work and documentation requirements
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workType | Yes | Type of development work | |
| workDescription | Yes | Description of the work being done | |
| filePaths | Yes | File paths involved in the work | |
| expectedDocuments | No | Expected documentation to be updated |
Implementation Reference
- src/tools/enhanced/index.ts:266-317 (handler)The main handler function that executes the track_document_work tool. It logs the work, finds relevant documents, creates a work-document connection, optionally performs AI analysis to update connection strength, checks for missing docs, and returns a success response with details.tools.set('track_document_work', async (args: any) => { try { logger.info(`Tracking work: ${args.workType} - ${args.workDescription}`); // Find relevant existing documents const relevantDocs = await findRelevantDocuments(args.workType, args.filePaths, lifecycleService); // Create work-document connection const connection = await connectionService.createConnection({ workType: args.workType, workDescription: args.workDescription, filePaths: args.filePaths, connectedDocuments: relevantDocs.map(doc => doc.id), connectionStrength: 0.8, // Will be updated by AI analysis lastSyncedAt: dateTimeService.getCurrentTimestamp() }); // Perform AI analysis if enabled let aiInsights: string[] = []; if (config.ai.enabled && aiService) { const analysis = await aiService.calculateRelevance( args.filePaths.join(', '), args.workDescription ); aiInsights = analysis.insights; // Update connection strength based on AI analysis await connectionService.updateConnectionStrength( connection.id, analysis.score ); } // Check for missing documentation const missingDocs = args.expectedDocuments ? args.expectedDocuments.filter((doc: string) => !relevantDocs.find(existing => existing.title.includes(doc))) : []; return { success: true, connectionId: connection.id, connectedDocuments: relevantDocs.length, connectionStrength: Math.round(connection.connectionStrength * 100), aiInsights, missingDocs, message: `Work-document connection tracked successfully` }; } catch (error) { logger.error('Failed to track document work:', error); throw error; } });
- src/types/enhanced.types.ts:105-110 (schema)Zod input schema for validating arguments to the track_document_work tool, defining workType enum, required description and filePaths, optional expectedDocuments.export const TrackDocumentWorkSchema = z.object({ workType: z.enum(['frontend', 'backend', 'database', 'electron', 'testing', 'deployment']), workDescription: z.string(), filePaths: z.array(z.string()), expectedDocuments: z.array(z.string()).optional(), });
- src/tools/enhanced/index.ts:79-107 (registration)MCPTool definition object registering the track_document_work tool with name, description, and JSON schema for input validation, returned by registerEnhancedTools.{ name: 'track_document_work', description: 'Track the relationship between development work and documentation requirements', inputSchema: { type: 'object', properties: { workType: { type: 'string', enum: ['frontend', 'backend', 'database', 'electron', 'testing', 'deployment'], description: 'Type of development work' }, workDescription: { type: 'string', description: 'Description of the work being done' }, filePaths: { type: 'array', items: { type: 'string' }, description: 'File paths involved in the work' }, expectedDocuments: { type: 'array', items: { type: 'string' }, description: 'Expected documentation to be updated' } }, required: ['workType', 'workDescription', 'filePaths'] } },