review
Code review and security audit
What this skill does
# Code Review Mode **Recommended model tier:** smart (opus) - this skill requires complex reasoning Comprehensive code review covering quality, security, and maintainability. ## Review Checklist ### Code Quality - [ ] Clear naming (variables, functions, classes) - [ ] Single responsibility (functions do one thing) - [ ] DRY (no unnecessary duplication) - [ ] Appropriate abstraction level - [ ] Error handling coverage - [ ] Edge cases considered ### Security (OWASP Top 10) - [ ] Input validation (no injection vulnerabilities) - [ ] Authentication checks (routes protected) - [ ] Authorization (proper access control) - [ ] Sensitive data handling (no secrets in code) - [ ] SQL/NoSQL injection prevention - [ ] XSS prevention (output encoding) - [ ] CSRF protection - [ ] Secure dependencies (no known vulnerabilities) ### Maintainability - [ ] Code is readable without comments - [ ] Comments explain "why" not "what" - [ ] Consistent with codebase patterns - [ ] Tests cover critical paths - [ ] No dead code ### Performance - [ ] No N+1 queries - [ ] Appropriate caching - [ ] No memory leaks - [ ] Efficient algorithms ## Context-Efficient Reading Prefer lightweight tools first, then read in detail where needed: - **`code_outline`** -- Collapsed skeleton with signatures and line ranges. Great first step for unfamiliar files. - **`code_symbols`** -- Quick symbol list when you only need names and kinds. - **`code_search`** / **`code_references`** -- Find symbol definitions or callers across the codebase. - **`Read` with offset/limit** -- Read specific functions using line numbers from the outline. - **Grep** -- Find patterns in code content (loops, queries, string literals) that the index doesn't cover. For reviews spanning many files, consider using **Task sub-agents** (`explore` type) which run in their own context and return summaries. ## Review Process 1. **Outline changed files** - Use `code_outline` on each changed file to understand structure. Identify areas of concern from signatures and line ranges. 2. **Read targeted sections** - Use `Read` with `offset`/`limit` to read only the specific functions/sections that need detailed review (use line numbers from the outline). 3. **Search for context** - Use `code_search`, `code_references`, and **Grep**: - `code_search` — Find related function/class/type _definitions_ by name - `code_references` — Find all callers/usages of a modified symbol (exact name match) - **Grep** — Find code _patterns_ in bodies (error handling, SQL queries, security-sensitive calls) 4. **Check integration** - How does it fit the larger system? 5. **Run static analysis** - Use lsp_diagnostics, ast_grep if available 6. **Document findings** - Use severity levels ## MCP Tools Use these tools during review: - `mcp__plugin_aide_aide__code_outline` - **Start here.** Get collapsed file skeleton with signatures and line ranges - `mcp__plugin_aide_aide__code_search` - Find symbols related to changes (e.g., `code_search query="getUserById"`) - `mcp__plugin_aide_aide__code_symbols` - List all symbols in a file being reviewed - `mcp__plugin_aide_aide__code_references` - Find all callers/usages of a modified symbol - `mcp__plugin_aide_aide__memory_search` - Check for related past decisions or issues - `mcp__plugin_aide_aide__findings_search` - Search static analysis findings (complexity, secrets, clones) related to changed code - `mcp__plugin_aide_aide__findings_list` - List findings filtered by file, severity, or analyzer - `mcp__plugin_aide_aide__findings_stats` - Overview of finding counts by analyzer and severity ## Output Format ```markdown ## Code Review: [Feature/PR Name] ### Summary [1-2 sentence overview] ### Findings #### 🔴 Critical (must fix) - **[Issue]** `file:line` - Problem: [description] - Fix: [recommendation] #### 🟡 Warning (should fix) - **[Issue]** `file:line` - Problem: [description] - Fix: [recommendation] #### 🔵 Suggestion (consider) - **[Issue]** `file:line` - Suggestion: [recommendation] ### Security Notes - [Any security-specific observations] ### Verdict [ ] ✅ Approve [ ] ⚠️ Approve with comments [ ] ❌ Request changes ``` ## Severity Guide | Level | Criteria | | ---------- | ------------------------------------------------- | | Critical | Security vulnerability, data loss risk, crash | | Warning | Bug potential, maintainability issue, performance | | Suggestion | Style, minor improvement, optional | ## Failure Handling ### If unable to complete review: 1. **Missing files** - Report which files could not be read 2. **Ambiguous scope** - Ask user to clarify what code to review 3. **Large changeset** - Break into smaller chunks, review systematically ### Reporting blockers: ```markdown ## Review Status: Incomplete ### Blockers - Could not access: `path/to/file.ts` (permission denied) - Missing context: Need to understand `AuthService` implementation ### Partial Findings [Include any findings from files that were reviewed] ``` ## Verification Criteria A complete code review must: 1. **Outline all changed files** - Use `code_outline` on every file in scope 2. **Read critical sections** - Use targeted `Read` with offset/limit on flagged areas 3. **Check for related code** - Use `code_search` and `code_references` to find callers/callees 4. **Verify test coverage** - Check if tests exist for critical paths 5. **Document all findings** - Even if no issues found, state that explicitly ### Checklist before submitting review: - [ ] All files in diff/scope have been outlined - [ ] Critical functions/sections read in detail (with offset/limit) - [ ] Related symbols searched (callers, implementations) - [ ] Security checklist evaluated - [ ] Findings documented with file:line references - [ ] Verdict provided with clear reasoning
Related in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.