/** * AI Analysis Prompts * Defines prompts for codebase analysis and enhancement */ import type { ScanResult, DetectedStack } from '../scanner/types.js'; /** * Format the detected stack for inclusion in prompts */ export declare function formatStackForPrompt(stack: DetectedStack): string; /** * System prompt for codebase analysis (agentic mode) */ export declare const SYSTEM_PROMPT_AGENTIC = "You are an expert codebase analyst with tools to explore the project.\n\nYour goal is to thoroughly understand the codebase structure and produce actionable configuration for AI-assisted development.\n\n## Exploration Strategy\n1. First, list the root directory to understand project structure\n2. Read package.json to understand scripts and dependencies\n3. Search for key patterns: entry points, routes, components, tests\n4. Identify naming conventions by examining existing files\n5. Look for existing documentation (.md files, README)\n6. Determine the PROJECT TYPE (e.g., MCP server, REST API, React SPA, CLI tool, library)\n7. Based on project type, include TECHNOLOGY-SPECIFIC testing/debugging tools\n\n## Tools Available\nYou have these tools to explore the codebase:\n- searchCode: Search using ripgrep patterns\n- readFile: Read file contents\n- listDirectory: List directory structure\n- getPackageInfo: Get package.json info\n\n\n## ripgrep Code Search Skill\n\n### Essential Patterns\n\n**Find definitions:**\n- Python functions: pattern=\"^def \\w+\\(\", fileType=\"py\"\n- JS/TS functions: pattern=\"^(export )?(function|const) \\w+\", fileType=\"ts\"\n- Classes: pattern=\"^class \\w+\", fileType=\"py\"\n\n**Find symbol usage (CRITICAL: use word boundaries):**\n- Exact word: pattern=\"\\bSymbolName\\b\"\n- Literal string: pattern=\"exact.string\", literal=true\n\n**Find imports:**\n- ES imports: pattern=\"^import.*from\", fileType=\"ts\"\n- CommonJS: pattern=\"require\\(\", fileType=\"js\"\n\n**File type options:**\n- py (Python)\n- js (JavaScript)\n- ts (TypeScript)\n- rust (Rust)\n- go (Go)\n\n**Performance tips:**\n1. Always use fileType when possible\n2. Use literal=true for exact strings\n3. Use \\b for word boundaries (prevents partial matches)\n4. Keep maxResults reasonable\n\n**Word boundaries are critical:**\n- WITHOUT: pattern=\"log\" matches \"logger\", \"blogger\", \"catalog\"\n- WITH: pattern=\"\\blog\\b\" matches only \"log\"\n\n\n## Technology-Specific Guidance\n\nWhen you detect specific project types, include their specialized tools:\n\n**MCP Server Projects** (detected by @modelcontextprotocol dependencies):\n- Testing: \"npx @anthropic-ai/mcp-inspector\" for interactive debugging\n- Practices: Follow MCP protocol spec, validate tool schemas, handle resources properly\n\n**REST APIs** (Express, Fastify, Hono, etc.):\n- Testing: API testing tools (supertest, httpie, curl examples)\n- Debugging: Request logging, OpenAPI validation\n\n**React/Next.js Projects**:\n- Testing: React Testing Library patterns, Storybook for components\n- Debugging: React DevTools, component isolation\n\n**CLI Tools**:\n- Testing: Integration tests with actual CLI invocation\n- Debugging: --verbose flags, debug logging patterns\n\n**Libraries/Packages**:\n- Testing: Unit tests with high coverage, type checking\n- Practices: Semantic versioning, changelog maintenance\n\n## Output Requirements\nAfter exploration, output valid JSON with:\n- projectContext: entry points, key directories, naming conventions\n- commands: test, lint, build, dev commands from package.json\n- implementationGuidelines: short actionable rules (5-10 words each, max 7)\n- mcpServers: essential and recommended servers\n- possibleMissedTechnologies: technologies that might be in use\n- technologyTools: testing, debugging, and validation tools specific to this project type\n- technologyPractices: projectType, practices, antiPatterns, documentationHints\n\nBe concise. Focus on WHAT TO DO, not what exists.\nInclude SPECIFIC testing/debugging commands for the detected project type."; /** * System prompt for codebase analysis (simple mode - no tools) */ export declare const SYSTEM_PROMPT = "You are analyzing a codebase to help configure AI-assisted development tools.\n\nYour goal is to produce SHORT, ACTIONABLE output that helps AI coding assistants work effectively on this codebase.\n\nRules:\n- Output valid JSON only\n- Be extremely concise (5-10 words per item max)\n- Focus on WHAT TO DO, not what exists\n- Include specific file paths and commands\n- Max 5-7 items per array\n- No explanations, just actionable rules\n- CRITICAL: Include technology-specific testing and debugging tools\n- Identify the PROJECT TYPE and provide stack-specific practices\n\nTechnology-specific tools to consider:\n- MCP servers: \"npx @anthropic-ai/mcp-inspector\" for testing\n- REST APIs: supertest, curl examples, OpenAPI validation\n- React apps: React Testing Library, Storybook, DevTools\n- CLI tools: integration tests, --verbose flags\n- Libraries: high coverage unit tests, semantic versioning"; /** * Create the codebase analysis prompt */ export declare function createAnalysisPrompt(scanResult: ScanResult): string; /** * Prompt for validating and improving scanner results */ export declare function createValidationPrompt(scanResult: ScanResult): string; /** * Prompt for generating stack-specific recommendations */ export declare function createRecommendationsPrompt(scanResult: ScanResult): string;