$npx -y skills add coleam00/custom-agent-with-skills --skill code_reviewReview code for quality, security, and best practices. Use when analyzing code, suggesting improvements, or conducting code reviews.
| 1 | # Code Review Skill |
| 2 | |
| 3 | Provides comprehensive code review capabilities covering quality, security, and best practices analysis. |
| 4 | |
| 5 | ## When to Use |
| 6 | |
| 7 | - User asks you to review their code |
| 8 | - User wants to improve code quality |
| 9 | - User asks about security vulnerabilities in code |
| 10 | - User wants to identify antipatterns or code smells |
| 11 | - User requests best practices suggestions |
| 12 | - User wants a general code quality assessment |
| 13 | |
| 14 | ## Available Operations |
| 15 | |
| 16 | 1. **Analyze Code Structure**: Evaluate organization, modularity, and architecture |
| 17 | 2. **Check Best Practices**: Compare against established coding standards |
| 18 | 3. **Security Review**: Identify potential security vulnerabilities |
| 19 | 4. **Antipattern Detection**: Find common code smells and antipatterns |
| 20 | 5. **Generate Review Report**: Provide structured feedback with recommendations |
| 21 | |
| 22 | ## Multi-Step Review Workflow |
| 23 | |
| 24 | When conducting a code review, follow these steps in order: |
| 25 | |
| 26 | ### Step 1: Initial Code Analysis |
| 27 | |
| 28 | Read the code thoroughly and identify: |
| 29 | - Primary purpose and functionality |
| 30 | - Programming language and frameworks used |
| 31 | - Overall structure and organization |
| 32 | - Entry points and main logic flow |
| 33 | |
| 34 | ### Step 2: Best Practices Check |
| 35 | |
| 36 | Evaluate the code against best practices. Load the best practices guide for comprehensive checks: |
| 37 | - `references/best_practices.md` - Comprehensive coding standards and practices |
| 38 | |
| 39 | Key areas to check: |
| 40 | - Naming conventions (variables, functions, classes) |
| 41 | - Function design (single responsibility, proper parameters) |
| 42 | - Error handling patterns |
| 43 | - Code organization and modularity |
| 44 | - Documentation and comments |
| 45 | |
| 46 | ### Step 3: Security Review |
| 47 | |
| 48 | Check for security vulnerabilities. Load the security checklist for detailed guidance: |
| 49 | - `references/security_checklist.md` - Security review checklist based on OWASP guidelines |
| 50 | |
| 51 | Key security areas: |
| 52 | - Input validation and sanitization |
| 53 | - Authentication and authorization |
| 54 | - Injection vulnerabilities (SQL, command, etc.) |
| 55 | - Data exposure and encryption |
| 56 | - Dependency security |
| 57 | |
| 58 | ### Step 4: Antipattern Detection |
| 59 | |
| 60 | Identify code smells and antipatterns. Load the antipatterns guide for reference: |
| 61 | - `references/common_antipatterns.md` - Common antipatterns and how to fix them |
| 62 | |
| 63 | Common issues to look for: |
| 64 | - God classes/functions |
| 65 | - Deep nesting |
| 66 | - Magic numbers and strings |
| 67 | - Copy-paste code |
| 68 | - Resource leaks |
| 69 | |
| 70 | ### Step 5: Generate Review Report |
| 71 | |
| 72 | Compile findings into a structured report: |
| 73 | |
| 74 | ``` |
| 75 | ## Code Review Summary |
| 76 | |
| 77 | **File/Module**: [name] |
| 78 | **Language**: [language] |
| 79 | **Overall Assessment**: [Excellent/Good/Needs Improvement/Critical Issues] |
| 80 | |
| 81 | ### Strengths |
| 82 | - [List positive aspects] |
| 83 | |
| 84 | ### Issues Found |
| 85 | |
| 86 | #### Critical (Must Fix) |
| 87 | - [Security vulnerabilities, bugs] |
| 88 | |
| 89 | #### Major (Should Fix) |
| 90 | - [Significant antipatterns, bad practices] |
| 91 | |
| 92 | #### Minor (Consider Fixing) |
| 93 | - [Style issues, small improvements] |
| 94 | |
| 95 | ### Recommendations |
| 96 | 1. [Specific actionable recommendations] |
| 97 | 2. [...] |
| 98 | |
| 99 | ### Resources Referenced |
| 100 | - [List which reference files were consulted] |
| 101 | ``` |
| 102 | |
| 103 | ## Resources |
| 104 | |
| 105 | Reference these files for detailed guidance during reviews: |
| 106 | |
| 107 | - `references/best_practices.md` - Comprehensive coding best practices covering organization, naming, error handling, testing, and documentation |
| 108 | - `references/security_checklist.md` - Security review checklist covering OWASP Top 10, input validation, authentication, and common vulnerabilities |
| 109 | - `references/common_antipatterns.md` - Guide to detecting and fixing common antipatterns like god classes, spaghetti code, and resource leaks |
| 110 | |
| 111 | ## Examples |
| 112 | |
| 113 | ### Example 1: Quick Review Request |
| 114 | |
| 115 | User asks: "Can you review this function?" |
| 116 | |
| 117 | Response approach: |
| 118 | 1. Load this skill's full instructions |
| 119 | 2. Analyze the provided code |
| 120 | 3. Check against best practices (load `references/best_practices.md` if needed) |
| 121 | 4. Identify any obvious security issues |
| 122 | 5. Provide concise feedback with specific recommendations |
| 123 | |
| 124 | ### Example 2: Security-Focused Review |
| 125 | |
| 126 | User asks: "Check this code for security vulnerabilities" |
| 127 | |
| 128 | Response approach: |
| 129 | 1. Load this skill's full instructions |
| 130 | 2. Load `references/security_checklist.md` for comprehensive security checks |
| 131 | 3. Systematically check each security category |
| 132 | 4. Provide detailed security findings with severity ratings |
| 133 | 5. Include specific fix recommendations |
| 134 | |
| 135 | ### Example 3: Comprehensive Code Review |
| 136 | |
| 137 | User asks: "I need a thorough code review of my authentication module" |
| 138 | |
| 139 | Response approach: |
| 140 | 1. Load this skill's full instructions |
| 141 | 2. Follow the complete multi-step workflow |
| 142 | 3. Load all three reference files as needed |
| 143 | 4. Provide comprehensive report covering all aspects |
| 144 | 5. Prioritize recommendations by impact |
| 145 | |
| 146 | ## Notes |
| 147 | |
| 148 | - Always be constructive in feedback - explain why something is an issue and how to fix it |
| 149 | - Severity ratings: Critical (security/bugs), Major (significant quality issues), Minor (style/polish) |
| 150 | - Focus on the most impactful issues first |