complete_setup_workflow
Analyze codebase, create context files, and configure automation for AI agent projects to enhance coding capabilities.
Instructions
Complete MCP setup workflow: analyze codebase, create all context files, and configure automation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Path to the project directory | |
| projectName | Yes | Name of the project | |
| teamSize | No | Number of developers on the team | |
| updateSchedule | No | How often to update context files | |
| ide | No | Which IDE configurations to create | |
| includeAll | No | Include all optional features |
Implementation Reference
- Main handler function that orchestrates the entire setup workflow by sequentially calling analysis, initialization, conversation starters, token optimization, IDE configs, persistence automation, and maintenance workflows.export async function completeSetupWorkflow(config: SetupConfig): Promise<SetupResult> { const result: SetupResult = { success: false, message: '', steps: {}, filesCreated: [], recommendations: [], }; try { console.log('š Starting Complete Setup Workflow...'); // Step 1: Deep Analysis console.log('\nš Step 1/7: Analyzing codebase deeply...'); const analysisResult = await analyzeCodebaseDeeply({ projectPath: config.projectPath }); result.steps.analysis = { success: analysisResult.success, analysisId: analysisResult.analysisId, message: analysisResult.success ? `Analyzed ${analysisResult.summary.totalFiles} files` : 'Analysis failed', }; if (!analysisResult.success || !analysisResult.analysisId) { throw new Error('Deep analysis failed. Cannot proceed with setup.'); } const analysisId = analysisResult.analysisId; // Step 2: Initialize Workspace console.log('\nšÆ Step 2/7: Initializing agent workspace...'); const initResult = await initializeAgentWorkspace({ projectPath: config.projectPath, projectName: config.projectName, techStack: { language: analysisResult.summary.primaryLanguage, framework: analysisResult.summary.frameworks[0], uiLibrary: analysisResult.summary.frameworks.find(f => ['React', 'Vue', 'Angular', 'Svelte'].includes(f) ), testFramework: analysisResult.summary.testingFrameworks[0], }, }); result.steps.initialization = { success: initResult.success, message: initResult.message, }; result.filesCreated.push(...initResult.filesCreated); // Step 3: Create Conversation Starters console.log('\nš¬ Step 3/7: Creating conversation starters...'); const conversationResult = await createConversationStarters({ projectPath: config.projectPath, analysisId, includeQuickTasks: true, includeCurrentWork: true, }); result.steps.conversationStarters = { success: conversationResult.success, message: conversationResult.message, }; result.filesCreated.push(...conversationResult.filesCreated); // Step 4: Create Token Optimizer console.log('\nš Step 4/7: Creating token optimization tiers...'); const tokenResult = await createTokenOptimizer({ projectPath: config.projectPath, analysisId, tiers: ['minimal', 'standard', 'comprehensive'], trackUsage: true, generateMetrics: true, }); result.steps.tokenOptimizer = { success: tokenResult.success, message: tokenResult.message, }; result.filesCreated.push(...tokenResult.filesCreated); // Step 5: Create IDE Configurations console.log('\nš ļø Step 5/7: Creating IDE configurations...'); const ideResult = await createIDEConfigs({ projectPath: config.projectPath, analysisId, ide: config.ide || 'all', autoLoadContext: true, includeDebugConfigs: true, }); result.steps.ideConfigs = { success: ideResult.success, message: ideResult.message, }; result.filesCreated.push(...ideResult.filesCreated); // Step 6: Setup Persistence Automation console.log('\nš Step 6/7: Setting up persistence automation...'); const persistenceResult = await setupPersistenceAutomation({ projectPath: config.projectPath, analysisId, updateSchedule: config.updateSchedule || 'weekly', gitHooks: true, monitoring: true, }); result.steps.persistence = { success: persistenceResult.success, message: persistenceResult.message, }; result.filesCreated.push(...persistenceResult.filesCreated); // Step 7: Create Maintenance Workflows console.log('\nš Step 7/7: Creating maintenance workflows...'); const maintenanceResult = await createMaintenanceWorkflows({ projectPath: config.projectPath, analysisId, teamSize: config.teamSize || 1, updateFrequency: config.updateSchedule === 'daily' ? 'daily' : 'weekly', includeChecklists: true, includeMetrics: true, includeTraining: !!(config.teamSize && config.teamSize > 1), }); result.steps.maintenance = { success: maintenanceResult.success, message: maintenanceResult.message, }; result.filesCreated.push(...maintenanceResult.filesCreated); // Generate recommendations result.recommendations = generateSetupRecommendations( analysisResult, config, result.steps ); // Final summary const successfulSteps = Object.values(result.steps).filter(s => s.success).length; result.success = successfulSteps === 7; result.message = result.success ? `ā Complete setup successful! Created ${result.filesCreated.length} files.` : `ā ļø Setup completed with issues. ${successfulSteps}/7 steps successful.`; // Print summary console.log('\n' + '='.repeat(60)); console.log('š SETUP SUMMARY'); console.log('='.repeat(60)); console.log(`Status: ${result.success ? 'ā SUCCESS' : 'ā ļø PARTIAL SUCCESS'}`); console.log(`Files Created: ${result.filesCreated.length}`); console.log('\nSteps:'); Object.entries(result.steps).forEach(([step, status]) => { console.log(` ${status.success ? 'ā ' : 'ā'} ${step}: ${status.message}`); }); if (result.recommendations.length > 0) { console.log('\nš Recommendations:'); result.recommendations.forEach((rec, i) => { console.log(` ${i + 1}. ${rec}`); }); } console.log('\nš Setup workflow complete!'); } catch (error) { result.success = false; result.message = `Setup failed: ${error}`; console.error('\nā Setup failed:', error); } return result; }
- Tool schema definition including name, description, and inputSchema for validation.{ name: 'complete_setup_workflow', description: 'Complete MCP setup workflow: analyze codebase, create all context files, and configure automation', inputSchema: { type: 'object', properties: { projectPath: { type: 'string', description: 'Path to the project directory', }, projectName: { type: 'string', description: 'Name of the project', }, teamSize: { type: 'number', description: 'Number of developers on the team', }, updateSchedule: { type: 'string', enum: ['daily', 'weekly', 'on-change', 'manual'], description: 'How often to update context files', }, ide: { type: 'string', enum: ['cursor', 'vscode', 'intellij', 'all'], description: 'Which IDE configurations to create', }, includeAll: { type: 'boolean', description: 'Include all optional features', }, }, required: ['projectPath', 'projectName'], }, },
- src/tools/index.ts:358-377 (registration)Registration and dispatch handler in the main tool switch statement, with Zod input validation and call to the handler function.case 'complete_setup_workflow': { const params = z.object({ projectPath: z.string(), projectName: z.string(), teamSize: z.number().optional(), updateSchedule: z.enum(['daily', 'weekly', 'on-change', 'manual']).optional(), ide: z.enum(['cursor', 'vscode', 'intellij', 'all']).optional(), includeAll: z.boolean().optional(), }).parse(args); const result = await completeSetupWorkflow(params); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- TypeScript interfaces defining input (SetupConfig) and output (SetupResult) types for the handler.interface SetupConfig { projectPath: string; projectName: string; teamSize?: number; updateSchedule?: 'daily' | 'weekly' | 'on-change' | 'manual'; ide?: 'cursor' | 'vscode' | 'intellij' | 'all'; includeAll?: boolean; } interface SetupResult { success: boolean; message: string; steps: { analysis?: { success: boolean; analysisId?: string; message: string }; initialization?: { success: boolean; message: string }; conversationStarters?: { success: boolean; message: string }; tokenOptimizer?: { success: boolean; message: string }; ideConfigs?: { success: boolean; message: string }; persistence?: { success: boolean; message: string }; maintenance?: { success: boolean; message: string }; }; filesCreated: string[]; recommendations: string[]; }
- src/tools/index.ts:22-22 (registration)Import statement registering the handler function for use in the tool dispatcher.import { completeSetupWorkflow } from './workspace/complete-setup-workflow.js';