create_maintenance_workflows
Generate team workflows to maintain AI context quality over time by defining update schedules, checklists, metrics, and training for consistent project management.
Instructions
Create team workflows for maintaining AI context quality over time
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Path to the project directory | |
| analysisId | No | Analysis ID from analyze_codebase_deeply | |
| teamSize | Yes | Number of developers on the team | |
| updateFrequency | Yes | How often the team updates context | |
| includeChecklists | No | Include review checklists | |
| includeMetrics | No | Include metrics dashboard | |
| includeTraining | No | Include training materials |
Implementation Reference
- Main execution function that creates maintenance workflow files (handbook, checklists, procedures, onboarding guides, metrics dashboard, etc.) in the project's agent-context/workflows directory based on team size and update frequency.export async function createMaintenanceWorkflows( config: MaintenanceConfig ): Promise<MaintenanceResult> { const result: MaintenanceResult = { success: false, filesCreated: [], message: '', workflows: { regular: [], emergency: [], onboarding: [], }, }; try { // Check if analysis has been completed const analysisId = config.analysisId || global.latestAnalysisId; if (!analysisId || !global.codebaseAnalysis?.[analysisId]) { throw new Error('Codebase analysis must be completed first. Run analyze_codebase_deeply tool.'); } const analysis: DeepAnalysisResult = global.codebaseAnalysis[analysisId]; // Create workflows directory const workflowsDir = join(config.projectPath, 'agent-context', 'workflows'); if (!existsSync(workflowsDir)) { mkdirSync(workflowsDir, { recursive: true }); } // Create maintenance handbook const handbook = createMaintenanceHandbook(config, analysis); const handbookPath = join(workflowsDir, 'MAINTENANCE-HANDBOOK.md'); writeFileSync(handbookPath, handbook); result.filesCreated.push(handbookPath); result.workflows.regular.push('Maintenance Handbook'); // Create update workflow const updateWorkflow = createUpdateWorkflow(config, analysis); const updatePath = join(workflowsDir, 'context-update-workflow.md'); writeFileSync(updatePath, updateWorkflow); result.filesCreated.push(updatePath); result.workflows.regular.push('Context Update Workflow'); // Create review checklist if requested if (config.includeChecklists) { const reviewChecklist = createReviewChecklist(config, analysis); const checklistPath = join(workflowsDir, 'context-review-checklist.md'); writeFileSync(checklistPath, reviewChecklist); result.filesCreated.push(checklistPath); result.workflows.regular.push('Review Checklist'); // Create quality checklist const qualityChecklist = createQualityChecklist(analysis); const qualityPath = join(workflowsDir, 'quality-checklist.md'); writeFileSync(qualityPath, qualityChecklist); result.filesCreated.push(qualityPath); result.workflows.regular.push('Quality Checklist'); } // Create emergency procedures const emergencyProcedures = createEmergencyProcedures(config, analysis); const emergencyPath = join(workflowsDir, 'emergency-procedures.md'); writeFileSync(emergencyPath, emergencyProcedures); result.filesCreated.push(emergencyPath); result.workflows.emergency.push('Emergency Procedures'); // Create team onboarding guide const onboardingGuide = createOnboardingGuide(config, analysis); const onboardingPath = join(workflowsDir, 'team-onboarding.md'); writeFileSync(onboardingPath, onboardingGuide); result.filesCreated.push(onboardingPath); result.workflows.onboarding.push('Team Onboarding'); // Create metrics dashboard if requested if (config.includeMetrics) { const metricsDashboard = createMetricsDashboard(config, analysis); const metricsPath = join(workflowsDir, 'metrics-dashboard.md'); writeFileSync(metricsPath, metricsDashboard); result.filesCreated.push(metricsPath); result.workflows.regular.push('Metrics Dashboard'); } // Create training materials if requested if (config.includeTraining) { const trainingMaterials = createTrainingMaterials(config, analysis); const trainingPath = join(workflowsDir, 'ai-context-training.md'); writeFileSync(trainingPath, trainingMaterials); result.filesCreated.push(trainingPath); result.workflows.onboarding.push('Training Materials'); } // Create workflow index const workflowIndex = createWorkflowIndex(result.workflows, config); const indexPath = join(workflowsDir, 'README.md'); writeFileSync(indexPath, workflowIndex); result.filesCreated.push(indexPath); result.success = true; result.message = `Created ${result.filesCreated.length} maintenance workflows for ${config.teamSize}-person team`; } catch (error) { result.success = false; result.message = `Failed to create maintenance workflows: ${error}`; } return result; }
- JSON schema defining the input parameters and validation for the tool.name: 'create_maintenance_workflows', description: 'Create team workflows for maintaining AI context quality over time', inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'Path to the project directory', }, analysisId: { type: 'string', description: 'Analysis ID from analyze_codebase_deeply', }, teamSize: { type: 'number', description: 'Number of developers on the team', }, updateFrequency: { type: 'string', enum: ['daily', 'weekly', 'biweekly', 'monthly'], description: 'How often the team updates context', }, includeChecklists: { type: 'boolean', description: 'Include review checklists', }, includeMetrics: { type: 'boolean', description: 'Include metrics dashboard', }, includeTraining: { type: 'boolean', description: 'Include training materials', }, }, required: ['projectPath', 'teamSize', 'updateFrequency'], }, },
- src/tools/index.ts:318-338 (registration)Tool dispatch/registration in the main switch statement that parses arguments and calls the handler function.case 'create_maintenance_workflows': { const params = z.object({ projectPath: z.string(), analysisId: z.string().optional(), teamSize: z.number(), updateFrequency: z.enum(['daily', 'weekly', 'biweekly', 'monthly']), includeChecklists: z.boolean().optional(), includeMetrics: z.boolean().optional(), includeTraining: z.boolean().optional(), }).parse(args); const result = await createMaintenanceWorkflows(params); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/tools/index.ts:20-20 (registration)Import statement registering the handler function for use in the tool router.import { createMaintenanceWorkflows } from './workspace/create-maintenance-workflows.js';
- Supporting helper functions that generate content for individual workflow documents (handbook, checklists, emergency procedures, onboarding, metrics, training, index). Note: lines overlap with handler as they are in the same file.} function createMaintenanceHandbook(config: MaintenanceConfig, analysis: DeepAnalysisResult): string {