track_document_work
Map development tasks to required documentation updates. Specify work type, file paths, and expected documents to ensure alignment between code changes and documentation.
Instructions
Track the relationship between development work and documentation requirements
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expectedDocuments | No | Expected documentation to be updated | |
| filePaths | Yes | File paths involved in the work | |
| workDescription | Yes | Description of the work being done | |
| workType | Yes | Type of development work |
Implementation Reference
- src/tools/enhanced/index.ts:266-317 (handler)Main execution handler for the track_document_work tool. Creates work-document connections using services, performs optional AI relevance analysis, checks for missing docs, and returns connection 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/tools/enhanced/index.ts:79-107 (registration)Tool definition and registration within registerEnhancedTools function, including name, description, and input schema.{ 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'] } },
- src/types/enhanced.types.ts:105-110 (schema)Zod schema definition for input validation of track_document_work tool parameters.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(), });