code-review
Systematic and adaptable code review methodology using Language Server Protocol tools. Adapts to available LSP capabilities across programming languages. Use when user asks for code reviews, quality assessments, or specific analysis of codebases in any programming language.
What this skill does
# Code Review Systematic 9-phase code review methodology using Language Server Protocol tools. Adapts to available LSP capabilities across programming languages. ## Skill Methodology Systematic 9-phase code review methodology using Language Server Protocol tools. Extends DEVELOPER profile with sequential analysis phases assessing code quality, architecture, and maintainability. > [!IMPORTANT] > The skill embodies Analyze → Verify → Document → Deliver > > - Process skill instructions systematically > - Take time to read, understand, and apply each section's logic carefully > - Rushing past documented procedures causes **fatal** execution errors ### Phase Overview 1. **Phase 1 (Project Discovery)** - Establish tool inventory, understand project structure, identify technology stack 2. **Phase 2 (Structural Analysis)** - Analyze code organization, module structure, architectural patterns 3. **Phase 3 (Dependency Mapping)** - Map import relationships, call hierarchies, dependency flow 4. **Phase 4 (Type Safety)** - Assess type coverage, identify type safety issues, verify type inference 5. **Phase 5 (Usage Analysis)** - Analyze how symbols are used throughout the codebase 6. **Phase 6 (Code Quality)** - Evaluate error handling, resource management, code maintainability 7. **Phase 7 (Refactoring Safety)** - Test rename operations, assess refactoring risk before changes 8. **Phase 8 (Consistency)** - Verify naming conventions, style consistency, architectural patterns 9. **Phase 9 (Report)** - Synthesize findings into actionable report with prioritized recommendations > [!IMPORTANT] > Review phases provide thorough investigation, tool-verified findings, and incremental validation for code quality assessment. ### Systematic Approach The phases must be completed **sequentially**: - **DO complete each phase fully** - Each phase delivers specific analysis findings - **DO wait for approval** - Confirm deliverables before proceeding to next phase - **DO adapt approach** - Adjust based on available LSP capabilities - **DO NOT skip phases** - Even if you think you have enough information > [!IMPORTANT] > Review quality improves through systematic tool usage and incremental validation. ## Understanding Language Server Capabilities The initial **Project Discovery** phase establishes which tools are available by calling `get_server_capabilities` tool. This response shows: - Which LSP capabilities are supported (`supported: true/false`) - Exact tool names mapped to each capability for this review - Tool-specific usage metadata and guidelines > [!IMPORTANT] > The server capabilities response is the authoritative source for determining which tools to use in subsequent phases. ### Adapting the Review Process The 9-phase methodology remains consistent across languages. Use the server capabilities response to determine which tools to invoke in each subsequent phase: 1. **Phase 1 (Project Discovery)** - Always available, establishes tool inventory 2. **Phase 2 (Structural Analysis)** - Requires `documentSymbolProvider` capability (universally supported) 3. **Phase 3 (Dependency Mapping)** - Best with `callHierarchyProvider` capability, adapts to definitions/references only 4. **Phase 4 (Type Safety)** - Best with `inlayHintProvider` and `typeDefinitionProvider` capabilities, adapts to hover-only 5. **Phase 5 (Usage Analysis)** - Requires `referencesProvider` capability (widely supported) 6. **Phase 6 (Code Quality)** - Adapts based on `codeActionProvider` and `diagnosticsProvider` capabilities 7. **Phase 7 (Refactoring Safety)** - Best with `renameProvider` capability, adapts to manual assessment 8. **Phase 8 (Consistency)** - Uses basic symbol and formatting tools (widely supported) 9. **Phase 9 (Report)** - Always available, synthesizes findings ### Handling Capability Gaps When a phase requires capabilities not supported by the language server: - **DO NOT skip the phase** - Analysis objective remains valid - **DO adapt your approach** - Use alternative tools or manual analysis - **DO document limitations** - Note which analyses couldn't be performed - **DO NOT fail the review** - Work with available capabilities > [!IMPORTANT] > Review quality varies based on server capabilities. Document limitations in the final report. ## Phase Execution Instructions 1. **Phase 1 (Project Discovery)** - Read [instructions](./resources/project-discovery.md) 2. **Phase 2 (Structural Analysis)** - Read [instructions](./resources/structural-analysis.md) 3. **Phase 3 (Dependency Mapping)** - Read [instructions](./resources/dependency-mapping.md) 4. **Phase 4 (Type Safety)** - Read [instructions](./resources/type-safety.md) 5. **Phase 5 (Usage Analysis)** - Read [instructions](./resources/usage-analysis.md) 6. **Phase 6 (Code Quality)** - Read [instructions](./resources/code-quality.md) 7. **Phase 7 (Refactoring Safety)** - Read [instructions](./resources/refactoring-safety.md) 8. **Phase 8 (Consistency)** - Read [instructions](./resources/consistency.md) 9. **Phase 9 (Report)** - Read [instructions](./resources/report.md) > [!IMPORTANT] > Review systematically **all** phase instructions to understand the required execution steps. ## Session Guidelines Practical guidance for applying code review methodology consistently throughout review sessions. ### Phase Execution Protocol The primary protocol for **large codebases** is strictly **one phase per turn** to manage cognitive load, token consumption and maintain collaborative pacing. This protocol must be followed unless an **explicit exception** is granted. #### Protocol (Always Followed after Each Phase) 1. **Acknowledge completion** with deliverable summary 2. **Wait for user approval** before proceeding 3. **Report only what tools verify** - no speculation #### Efficiency Exception (Small Scopes) For analysis scoped to a **subset of the codebase** (e.g., a small PR), analyze the complexity and estimated tool-call cost for the relevant phases. If this analysis determines the token cost is **low** and pacing can be accelerated, **propose combining up to three related phases** into a single turn for efficiency. The user must grant explicit approval before executing the combined phases. ### During Each Phase Best practices for executing each review phase effectively. #### DO - Use all supported LSP tools systematically - Record exact numbers (don't estimate) - Note tool failures (explain what didn't work and why) - Take time for thorough analysis (patience over speed) - Verify findings with multiple tools when possible - Check tool metadata from capabilities response for usage guidance #### DON'T - Skip phases unless an explicit exception is granted - Make statements without tool verification - Assume patterns without checking references - Rush to conclusions before completing analysis - Suggest fixes before finishing all phases ## Quality Checklist Before finalizing the review, verify: - ✅ All 9 phases completed systematically - ✅ Every claim backed by tool-verified data - ✅ Exact file:line locations for all issues - ✅ Critical issues have code examples for fixes - ✅ Metrics table populated with real numbers - ✅ Capability limitations documented - ✅ Refactoring safety assessed - ✅ Immediate actions clearly defined ## Session Completion The code review findings serve as actionable reference for improvements and refactoring work. > [!IMPORTANT] > If user requests a conversation log to document this code review session, the `conversation-log` skill provides developer-specific guidance for technical session documentation.
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.