UNPKG

vibe-coder-mcp

Version:

Production-ready MCP server with complete agent integration, multi-transport support, and comprehensive development automation tools for AI-assisted workflows.

155 lines 12.3 kB
import { ContextCuratorLLMTask } from '../types/llm-tasks.js'; import { ProjectTypeAnalysisResult, LanguageAnalysisResult } from '../types/llm-tasks.js'; export declare const INTENT_ANALYSIS_SYSTEM_PROMPT = "You are an expert software architect and development analyst specializing in understanding development requests within codebase contexts.\n\nYour task is to analyze a user's development request against a provided codebase summary and determine:\n\n1. **Task Type Classification**: Identify the primary type of development work being requested\n2. **Architectural Impact**: Determine which components and systems will be affected\n3. **Scope Assessment**: Evaluate complexity, effort, and risk levels\n4. **Focus Areas**: Suggest specific areas that require attention\n5. **Confidence Assessment**: Provide confidence levels for your analysis\n\n## TASK TYPE DEFINITIONS\n\n**refactoring**: Improving code structure, readability, or performance without changing functionality\n- Code cleanup, optimization, restructuring\n- Design pattern implementation\n- Performance improvements\n- Technical debt reduction\n\n**feature_addition**: Adding new functionality or capabilities to the system\n- New user features, API endpoints, UI components\n- Integration with external services\n- New business logic or workflows\n- Extending existing functionality\n\n**bug_fix**: Resolving defects, errors, or unexpected behavior\n- Fixing crashes, errors, or incorrect behavior\n- Resolving security vulnerabilities\n- Correcting logic errors or edge cases\n- Addressing performance issues\n\n**general**: Broad development tasks that don't fit other categories\n- Documentation updates, configuration changes\n- Development environment setup\n- Mixed tasks spanning multiple categories\n- Exploratory or research tasks\n\n## ARCHITECTURAL COMPONENTS\n\nIdentify relevant components such as:\n- Frontend/UI layers (React, Vue, Angular components)\n- Backend services (APIs, microservices, databases)\n- Authentication/authorization systems\n- Data models and persistence layers\n- External integrations and APIs\n- Infrastructure and deployment systems\n- Testing and quality assurance systems\n\n## SCOPE ASSESSMENT CRITERIA\n\n**Complexity Levels:**\n- **simple**: Straightforward implementation, minimal dependencies, low risk\n- **moderate**: Some complexity, moderate dependencies, manageable risk\n- **complex**: High complexity, many dependencies, significant risk\n\n**Risk Levels:**\n- **low**: Minimal impact, well-understood changes, low failure probability\n- **medium**: Moderate impact, some unknowns, manageable failure scenarios\n- **high**: Significant impact, many unknowns, potential for major issues\n\n**Effort Estimation:**\n- **low**: 1-3 days of development work\n- **medium**: 1-2 weeks of development work\n- **high**: 2-4 weeks of development work\n- **very_high**: More than 4 weeks of development work\n\n## RESPONSE FORMAT\n\nCRITICAL: Respond with a valid JSON object matching this exact structure:\n\n{\n \"taskType\": \"refactoring\" | \"feature_addition\" | \"bug_fix\" | \"general\",\n \"confidence\": 0.0-1.0,\n \"reasoning\": [\"reason1\", \"reason2\", \"reason3\"],\n \"architecturalComponents\": [\"component1\", \"component2\"],\n \"scopeAssessment\": {\n \"complexity\": \"simple\" | \"moderate\" | \"complex\",\n \"estimatedFiles\": number,\n \"riskLevel\": \"low\" | \"medium\" | \"high\"\n },\n \"suggestedFocusAreas\": [\"area1\", \"area2\"],\n \"estimatedEffort\": \"low\" | \"medium\" | \"high\" | \"very_high\"\n}\n\n## ANALYSIS GUIDELINES\n\n1. **Be Specific**: Provide detailed reasoning for your classifications\n2. **Consider Context**: Use the codebase summary to inform your analysis\n3. **Be Conservative**: When uncertain, lean toward higher complexity/risk assessments\n4. **Focus on Impact**: Consider both immediate and downstream effects\n5. **Provide Value**: Suggest actionable focus areas for implementation\n\n## CRITICAL: ANTI-HALLUCINATION REQUIREMENTS\n\n**MANDATORY**: Base your analysis EXCLUSIVELY on the provided codebase summary. DO NOT:\n- Suggest files that don't exist in the codebase\n- Assume standard web application patterns (routes/, models/, middleware/) unless they exist\n- Recommend architectural components not present in the actual project structure\n- Use generic software development knowledge to fill gaps\n\n**REQUIRED**: Your analysis must reflect the ACTUAL codebase architecture shown in the summary.\nIf the codebase doesn't follow typical patterns, adapt your recommendations accordingly.\nOnly suggest modifications to files that actually exist or new files that fit the existing architecture.\n\nAnalyze thoroughly but respond concisely with the required JSON structure."; export declare function buildIntentAnalysisPrompt(userPrompt: string, codemapContent: string, additionalContext?: { projectType?: string; projectAnalysis?: ProjectTypeAnalysisResult; languageAnalysis?: LanguageAnalysisResult; existingPatterns?: string[]; patternConfidence?: { [pattern: string]: number; }; patternEvidence?: { [pattern: string]: string[]; }; teamSize?: number; timeConstraints?: string; existingIssues?: string[]; technicalConstraints?: string[]; }): string; export declare const INTENT_ANALYSIS_RESPONSE_SCHEMA: { readonly type: "object"; readonly properties: { readonly taskType: { readonly type: "string"; readonly enum: readonly ["refactoring", "feature_addition", "bug_fix", "general"]; readonly description: "The primary type of development task"; }; readonly confidence: { readonly type: "number"; readonly minimum: 0; readonly maximum: 1; readonly description: "Confidence level in the analysis (0.0 to 1.0)"; }; readonly reasoning: { readonly type: "array"; readonly items: { readonly type: "string"; }; readonly minItems: 1; readonly description: "Detailed reasoning for the task type classification"; }; readonly architecturalComponents: { readonly type: "array"; readonly items: { readonly type: "string"; }; readonly description: "List of architectural components that will be affected"; }; readonly scopeAssessment: { readonly type: "object"; readonly properties: { readonly complexity: { readonly type: "string"; readonly enum: readonly ["simple", "moderate", "complex"]; readonly description: "Overall complexity assessment"; }; readonly estimatedFiles: { readonly type: "number"; readonly minimum: 0; readonly description: "Estimated number of files that will be modified"; }; readonly riskLevel: { readonly type: "string"; readonly enum: readonly ["low", "medium", "high"]; readonly description: "Risk level assessment for the changes"; }; }; readonly required: readonly ["complexity", "estimatedFiles", "riskLevel"]; readonly description: "Comprehensive scope assessment"; }; readonly suggestedFocusAreas: { readonly type: "array"; readonly items: { readonly type: "string"; }; readonly description: "Suggested areas to focus on during implementation"; }; readonly estimatedEffort: { readonly type: "string"; readonly enum: readonly ["low", "medium", "high", "very_high"]; readonly description: "Estimated effort level for completion"; }; }; readonly required: readonly ["taskType", "confidence", "reasoning", "architecturalComponents", "scopeAssessment", "suggestedFocusAreas", "estimatedEffort"]; readonly additionalProperties: false; }; export declare const INTENT_ANALYSIS_EXAMPLES: { readonly refactoring: { readonly userPrompt: "Refactor the authentication module to use a more secure token-based approach"; readonly expectedResponse: { readonly taskType: "refactoring"; readonly confidence: 0.9; readonly reasoning: readonly ["Request explicitly mentions refactoring existing authentication", "Focus is on improving security rather than adding new features", "Involves restructuring existing code without changing core functionality"]; readonly architecturalComponents: readonly ["authentication", "security", "token-management"]; readonly scopeAssessment: { readonly complexity: "moderate"; readonly estimatedFiles: 8; readonly riskLevel: "medium"; }; readonly suggestedFocusAreas: readonly ["security-patterns", "token-validation", "backward-compatibility"]; readonly estimatedEffort: "medium"; }; }; readonly feature_addition: { readonly userPrompt: "Add a user dashboard with analytics and reporting capabilities"; readonly expectedResponse: { readonly taskType: "feature_addition"; readonly confidence: 0.95; readonly reasoning: readonly ["Request is for adding new functionality (dashboard)", "Involves creating new user-facing features", "Requires new UI components and data visualization"]; readonly architecturalComponents: readonly ["frontend", "ui-components", "analytics", "reporting", "data-visualization"]; readonly scopeAssessment: { readonly complexity: "complex"; readonly estimatedFiles: 15; readonly riskLevel: "medium"; }; readonly suggestedFocusAreas: readonly ["ui-design", "data-aggregation", "performance-optimization"]; readonly estimatedEffort: "high"; }; }; readonly bug_fix: { readonly userPrompt: "Fix the memory leak in the file upload component that causes crashes"; readonly expectedResponse: { readonly taskType: "bug_fix"; readonly confidence: 0.95; readonly reasoning: readonly ["Request explicitly mentions fixing a specific issue", "Addresses a defect causing system crashes", "Focus is on resolving existing problematic behavior"]; readonly architecturalComponents: readonly ["file-upload", "memory-management", "frontend"]; readonly scopeAssessment: { readonly complexity: "moderate"; readonly estimatedFiles: 3; readonly riskLevel: "high"; }; readonly suggestedFocusAreas: readonly ["memory-profiling", "resource-cleanup", "error-handling"]; readonly estimatedEffort: "medium"; }; }; readonly general: { readonly userPrompt: "Update documentation and add development environment setup instructions"; readonly expectedResponse: { readonly taskType: "general"; readonly confidence: 0.85; readonly reasoning: readonly ["Request involves documentation updates", "Includes development environment configuration", "Does not involve code functionality changes"]; readonly architecturalComponents: readonly ["documentation", "development-environment", "setup-scripts"]; readonly scopeAssessment: { readonly complexity: "simple"; readonly estimatedFiles: 5; readonly riskLevel: "low"; }; readonly suggestedFocusAreas: readonly ["documentation-clarity", "setup-automation", "developer-experience"]; readonly estimatedEffort: "low"; }; }; }; export declare function getIntentAnalysisTaskId(): ContextCuratorLLMTask; export declare function validateIntentAnalysisResponse(response: unknown): boolean; //# sourceMappingURL=intent-analysis.d.ts.map