--- allowed-tools: [Read, Write, Edit, Bash, Glob, Grep, Task, TodoWrite, WebSearch] description: "Comprehensive code quality validation using AI-driven analysis and modern best practices" tags: [quality, linting, security, testing, analysis, best-practices, prompt-driven] version: "2.0.0" --- ## Context I'll perform a comprehensive code quality assessment using intelligent analysis and modern development practices. This command uses prompt-driven evaluation to adapt to your specific project structure and requirements. Let me start by understanding your project environment and establishing a quality analysis framework. ## Your Task Perform a comprehensive code quality audit using AI-driven analysis techniques and industry best practices. I'll evaluate multiple quality dimensions through intelligent prompting and provide actionable recommendations for improvement. **ANALYSIS FRAMEWORK:** - **Project Discovery**: Intelligent project structure and technology analysis - **Static Analysis**: AI-guided code style, linting, and type checking assessment - **Security Assessment**: Intelligent vulnerability scanning and dependency analysis - **Architecture Review**: Design patterns, SOLID principles, and maintainability evaluation - **Testing Quality**: Coverage analysis, test patterns, and reliability assessment - **Documentation**: Code comments, README, and API documentation review - **Performance**: AI-identified optimization opportunities and anti-patterns - **Dependency Management**: Security, licensing, and maintenance analysis Let me think step-by-step about the optimal approach for your specific project and create an adaptive quality validation workflow. ## STEP 1: INTELLIGENT PROJECT DISCOVERY First, I need to understand your codebase through intelligent analysis rather than hardcoded commands. Let me use AI-driven discovery to identify the project characteristics. I'll start by creating a comprehensive task plan and then intelligently discover your project structure: **TodoWrite**: Initialize quality assessment workflow with adaptive analysis tasks based on project discovery. **Task Agent - Project Discovery**: Deploy a specialized agent to intelligently analyze project structure, identify technologies, detect existing quality tools, and assess current development practices. This agent should adapt its analysis based on what it discovers. **Key Discovery Areas:** - Project type and primary technologies - Existing quality tooling and configurations - Development workflow and CI/CD setup - Architecture patterns and organization - Current testing approaches - Documentation practices ## STEP 2: ADAPTIVE QUALITY ANALYSIS ORCHESTRATION Based on the project discovery, I'll deploy specialized analysis agents that adapt to your specific technology stack and requirements. **Sequential Thinking**: Let me think deeply about the optimal analysis strategy based on the discovered project characteristics and create a tailored approach. **Multi-Agent Orchestration**: Deploy parallel specialized agents for different quality dimensions: 1. **Static Analysis Agent**: Intelligently identify and run appropriate linting, formatting, and type checking tools based on detected languages and existing configurations 2. **Security Assessment Agent**: Perform adaptive security scanning focusing on the specific technologies and patterns found in the codebase 3. **Architecture Review Agent**: Analyze design patterns, modularity, and architectural quality using project-specific context 4. **Testing Quality Agent**: Evaluate test coverage, patterns, and quality appropriate to the detected testing frameworks 5. **Documentation Agent**: Assess documentation completeness and quality for the specific project type and domain 6. **Performance Analysis Agent**: Identify optimization opportunities and anti-patterns relevant to the detected technology stack 7. **Dependency Management Agent**: Analyze dependency security, maintenance, and licensing based on the package managers and dependency files found ## STEP 3: INTELLIGENT ANALYSIS EXECUTION Think step-by-step about each quality dimension and use intelligent tool selection based on project characteristics: **Static Code Analysis Workflow:** - Identify available linting tools for detected languages - Analyze existing configuration files and standards - Run appropriate static analysis tools with intelligent parameter selection - Adapt analysis depth based on project size and complexity **Security Assessment Workflow:** - Perform intelligent credential scanning adapted to the project structure - Analyze dependencies for known vulnerabilities using appropriate tools - Review security patterns and anti-patterns relevant to the technology stack - Assess input validation and security best practices **Architecture and Design Workflow:** - Analyze directory structure and organization patterns intelligently - Identify architectural patterns and assess adherence to SOLID principles - Evaluate separation of concerns and coupling appropriate to the project type - Check for circular dependencies using technology-appropriate methods **Testing Quality Workflow:** - Discover test files and frameworks intelligently - Analyze test coverage using available tools or estimation techniques - Evaluate test quality patterns and practices - Assess test maintainability and reliability **Documentation Assessment Workflow:** - Intelligently locate and analyze documentation files - Evaluate code comment density and quality - Assess README completeness and setup instructions - Review API documentation coverage **Performance Analysis Workflow:** - Identify performance anti-patterns relevant to the technology stack - Analyze code complexity and potential bottlenecks - Review for optimization opportunities - Assess scalability considerations ## STEP 4: SYNTHESIS AND REPORTING **Extended Thinking**: Think harder about the relationships between different quality dimensions and how they impact overall codebase health. Consider the trade-offs and prioritization of improvements. Synthesize all analysis results into a comprehensive, prioritized quality report with: ### **๐Ÿ” INTELLIGENT CODE QUALITY ASSESSMENT REPORT** **PROJECT PROFILE:** - Technology stack and architecture assessment - Codebase metrics and characteristics - Development maturity indicators **QUALITY DIMENSIONS EVALUATED:** #### 1. **STATIC ANALYSIS** โšก - Adaptive linting and style assessment - Type safety evaluation (where applicable) - Code standards adherence #### 2. **SECURITY POSTURE** ๐Ÿ”’ - Vulnerability assessment results - Credential safety analysis - Security best practices evaluation #### 3. **TESTING QUALITY** ๐Ÿงช - Test coverage and completeness - Test pattern quality assessment - Testing framework utilization #### 4. **DOCUMENTATION** ๐Ÿ“š - Documentation completeness score - Code comment quality assessment - Setup and usage documentation review #### 5. **ARCHITECTURE & DESIGN** ๐Ÿ—๏ธ - Design pattern adherence - SOLID principles evaluation - Modularity and coupling analysis #### 6. **DEPENDENCY MANAGEMENT** ๐Ÿ“ฆ - Security vulnerability assessment - Maintenance and update status - License compatibility review #### 7. **PERFORMANCE** โšก - Performance anti-pattern identification - Optimization opportunity analysis - Scalability assessment ### **๐Ÿ“Š INTELLIGENT PRIORITY RECOMMENDATIONS** **๐Ÿ”ด CRITICAL (Address Immediately):** - Security vulnerabilities with exploit potential - Blocking issues preventing safe deployment - Critical architectural flaws **๐ŸŸก HIGH PRIORITY (Address This Sprint):** - Maintainability issues impacting velocity - Missing test coverage in critical paths - Documentation gaps affecting team productivity **๐ŸŸข MEDIUM PRIORITY (Address This Quarter):** - Code style inconsistencies - Performance optimization opportunities - Dependency updates and cleanup **๐Ÿ”ต LOW PRIORITY (Future Enhancement):** - Advanced tooling improvements - Additional documentation - Code organization refinements ### **๐Ÿ› ๏ธ ACTIONABLE IMPROVEMENT PLAN** **Immediate Actions (This Week):** - Specific, prioritized actions with clear impact - Tool recommendations and setup instructions - Critical issue resolution steps **Short Term Goals (This Month):** - Systematic improvement initiatives - Process enhancement recommendations - Team practice improvements **Long Term Vision (Ongoing):** - Continuous improvement processes - Advanced tooling integration - Quality culture development ### **๐Ÿ“ˆ QUALITY METRICS DASHBOARD** - **Overall Quality Score**: Composite assessment with rationale - **Security Rating**: Risk-based security posture evaluation - **Maintainability Index**: Long-term codebase health indicator - **Team Readiness**: Development team effectiveness assessment **SUCCESS INDICATORS:** - Zero critical security vulnerabilities - Comprehensive test coverage on critical paths - Consistent code style and standards - Clear documentation for all stakeholders - Healthy dependency ecosystem - Sustainable architecture patterns ### **๐ŸŽฏ COMPLETION VALIDATION** **Quality Assessment Checklist (All โœ…):** - [ ] Project characteristics intelligently analyzed - [ ] Technology-appropriate static analysis completed - [ ] Security assessment performed with context - [ ] Testing quality evaluated comprehensively - [ ] Documentation thoroughly reviewed - [ ] Architecture patterns analyzed in context - [ ] Dependencies assessed for all risk vectors - [ ] Prioritized recommendations with clear rationale - [ ] Actionable improvement plan provided - [ ] Success metrics defined and measurable This AI-driven analysis adapts to your specific project needs and provides a roadmap for systematic quality improvement. The recommendations prioritize impact and feasibility, ensuring you can make meaningful progress toward a maintainable, secure, and high-quality codebase. **Next Steps**: Review the critical and high-priority recommendations, then implement the immediate actions to begin your quality improvement journey.