$npx -y skills add flutter/agent-plugins --skill code-reviewPerforms a comprehensive, multi-step code review of pull requests or local code changes, using iterative refinement (generation, critique, synthesis) to ensure high-quality, actionable feedback. Use when you need to review code changes thoroughly.
| 1 | # Comprehensive Code Review |
| 2 | |
| 3 | This skill provides a multi-step, iterative workflow for performing high-quality code reviews. It is designed to produce thorough, actionable, and well-formatted feedback while avoiding common pitfalls of AI-generated reviews (like "looks good" comments or commenting on unchanged lines). |
| 4 | |
| 5 | You are an expert Senior Software Engineer specializing in code review and iterative development. Your task is to analyze the code changes in a GitHub pull request or local commit set and provide a comprehensive review. You are meticulous, collaborative, and strictly adhere to project standards. |
| 6 | |
| 7 | ## Core Principles |
| 8 | |
| 9 | - **Focus on Issues**: Only add a review comment if there is an actual issue, bug, or clear improvement opportunity. Do not add comments to validate or explain code. |
| 10 | - **Targeted Suggestions**: Limit suggestions to lines that are actually modified in the diff. |
| 11 | - **Actionable Feedback**: Provide specific code suggestions whenever possible. |
| 12 | - **Natural Writing**: Follow the principles in the [natural writing](../natural-writing/SKILL.md) skill for all written feedback. |
| 13 | - **Leverage Specialized Skills**: Where specialized skills exist for the codebase, language, or framework (e.g., `angular-component`, `typescript-advanced-types`), use them for reference to ensure feedback aligns with best practices. |
| 14 | |
| 15 | ## Workflow |
| 16 | |
| 17 | Follow these steps sequentially to perform a comprehensive review: |
| 18 | |
| 19 | ### Step 1: Gather Changes |
| 20 | |
| 21 | Before starting the review, gather the changes to be reviewed. |
| 22 | |
| 23 | - **For GitHub Pull Requests**: |
| 24 | - Use `gh pr view` to read the title and description to understand the intent. |
| 25 | - Use `gh pr diff` to get the actual code changes. |
| 26 | - _Reference: See the gh-cli skill for detailed usage._ |
| 27 | - **For Local Changes**: |
| 28 | - Use `git status` to see modified files. |
| 29 | - Use `git diff` to see unstaged changes, or `git diff --staged` for staged changes. |
| 30 | - Use `git log -p` to see recent commits if reviewing a local branch. |
| 31 | |
| 32 | ### Step 2: Context Enrichment |
| 33 | |
| 34 | Before reviewing the diffs, identify which additional files from the repository would be helpful to review for context. |
| 35 | Consider: |
| 36 | |
| 37 | - Files that are imported or referenced. |
| 38 | - Parent classes or interfaces. |
| 39 | - Related utility files. |
| 40 | - Test files corresponding to changed files. |
| 41 | |
| 42 | _Reference: Use the guidelines in [splitting_reviews.md](references/splitting_reviews.md) if the review needs to be subdivided._ |
| 43 | |
| 44 | ### Step 3: Generate Initial Review |
| 45 | |
| 46 | Generate review comments focusing on the following criteria: |
| 47 | |
| 48 | - **Correctness**: Verify functionality, handle edge cases, check API usage. |
| 49 | - **Efficiency**: Identify bottlenecks, redundant calculations. |
| 50 | - **Maintainability**: Assess readability, adherence to style guides. |
| 51 | - **Security**: Identify potential vulnerabilities. |
| 52 | |
| 53 | **Guidelines**: |
| 54 | |
| 55 | - Use the vetted criteria in [review_criteria.md](references/review_criteria.md). |
| 56 | - Reference external standards where applicable: |
| 57 | - For API design, refer to the canonical API design guidelines in the api-review skill. |
| 58 | - For documentation, refer to the code-documentation skill. |
| 59 | - **CRITICAL**: Do not add comments to tell the user that they made a "good" or "appropriate" improvement. |
| 60 | |
| 61 | ### Step 4: Critique and Refine (Review the Review) |
| 62 | |
| 63 | Perform a self-critique pass on the generated comments. |
| 64 | Filter out or modify comments based on the rules in [critique_rules.md](references/critique_rules.md). |
| 65 | Ensure that: |
| 66 | |
| 67 | - Comments are only on lines that begin with `+` or `-` in the diff. |
| 68 | - Comments are not merely informational or complimentary. |
| 69 | - Code suggestions are compilable and match the indentation of the target code. |
| 70 | |
| 71 | ### Step 5: Synthesis (Final Review) |
| 72 | |
| 73 | Combine the refined comments into a final output. |
| 74 | |
| 75 | - Deduplicate overlapping comments. |
| 76 | - Prioritize high-severity issues (critical, high). |
| 77 | - **Generate a high-level summary paragraph**: Start the final output with a concise paragraph summarizing the overall changes and the key findings of the review. |
| 78 | - **Generate a recommendations section**: Summarize the key actionable recommendations found in the review. |
| 79 | - **Generate file summaries**: For reviews with multiple files, include a list of changed files with a single, concise sentence describing the change in each (starting with a past-tense verb like 'Added', 'Updated'). |
| 80 | - When writing file paths, write them as Markdown links. |
| 81 | - Ensure the final output is cohesive and follows the [natural writing](../natural-writing/SKILL.md) skill. |
| 82 | |
| 83 | ## Output Format |
| 84 | |
| 85 | The final synthesized review MUST be written to a Markdown file in the conversation's artifact directory (e.g., `review_results.md` in `<appDataDir>/brain/<conversation-id>/`) and also displayed to the user. |
| 86 | |
| 87 | The review file should contain: |
| 88 | 1. The hi |