|
| 1 | +--- |
| 2 | +description: "Perform a thorough code review on local changes and return findings as a summary (no comments posted)" |
| 3 | +model: "code-review" |
| 4 | +--- |
| 5 | + |
| 6 | +**IMPORTANT: This is a dry-run review. Do NOT post any comments to GitHub. Return all findings as a summary to the user.** |
| 7 | + |
| 8 | +Tooling constraints: |
| 9 | +- Allowed tools: `launch-process`, `view` |
| 10 | +- Disallowed tools: `github-api` |
| 11 | + |
| 12 | +## Step 1: Gather Changes to Review |
| 13 | + |
| 14 | +Run the following git commands to gather local changes: |
| 15 | + |
| 16 | +1. Run `git fetch origin main` to ensure accurate comparison |
| 17 | +2. Run `git diff origin/main...HEAD` to get the full diff of committed changes |
| 18 | +3. Run `git diff --stat origin/main...HEAD` to get file statistics |
| 19 | +4. Run `git diff --name-only origin/main...HEAD` to list changed files |
| 20 | +5. If there are uncommitted changes, include those as well: |
| 21 | + - **Staged changes:** `git diff --staged` (changes staged in the index vs HEAD) |
| 22 | + - **Unstaged changes:** `git diff` (working tree vs index) |
| 23 | + - Note: These diffs are relative to the current HEAD/index, not origin/main. They represent work-in-progress that hasn't been committed yet. |
| 24 | + |
| 25 | +### Changes Summary Format |
| 26 | + |
| 27 | +After gathering the data, organize it as follows: |
| 28 | + |
| 29 | +**Proposed Changes Summary:** |
| 30 | +- [One sentence describing what this change set does] |
| 31 | +- **Files changed:** [count] |
| 32 | +- **Additions:** [+lines] | **Deletions:** [-lines] |
| 33 | + |
| 34 | +## Step 2: Check for Custom Guidelines |
| 35 | + |
| 36 | +Look for custom code review guidelines in the repository: |
| 37 | +- Check if `.augment/code_review_guidelines.yaml` exists in the repository root |
| 38 | +- If the file doesn't exist or can't be read, skip this step and proceed without custom guidelines |
| 39 | +- If found, read the file and identify areas and rules relevant to the changed files: |
| 40 | + - Match file paths from Step 1 against the `globs` patterns in each area |
| 41 | + - Collect the matching rules to apply during review |
| 42 | + - Do not apply custom guidelines to Augment internal files (`.augment/**/*.md`) |
| 43 | + |
| 44 | +When referencing a custom guideline in your review findings, mention it using the format: |
| 45 | +`(Guideline: <guideline_id>)` |
| 46 | + |
| 47 | +## Step 3: Review the Changes |
| 48 | + |
| 49 | +Analyze the diff and identify issues. Apply any custom guidelines loaded in Step 2. Focus on high confidence findings—bugs, security issues, logic errors. Skip low-severity issues unless they indicate a pattern. |
| 50 | + |
| 51 | +## Step 4: Format the Review Summary |
| 52 | + |
| 53 | +Present the review using this format: |
| 54 | + |
| 55 | +``` |
| 56 | +## Local Changes Summary |
| 57 | +
|
| 58 | +Branch: [branch-name] | Base: origin/main | Commits: [N] |
| 59 | +Files: [N] | +[additions] -[deletions] |
| 60 | +
|
| 61 | +[One sentence describing what this change set does] |
| 62 | +
|
| 63 | +## Review Findings |
| 64 | +
|
| 65 | +1. [file/path.ext]:[line(s)] |
| 66 | +
|
| 67 | + Severity: [low|medium|high] |
| 68 | + [Description of issue and suggested fix] |
| 69 | +
|
| 70 | +2. [file/path.ext]:[line(s)] |
| 71 | +
|
| 72 | + Severity: [low|medium|high] |
| 73 | + [Description of issue and suggested fix] |
| 74 | +``` |
| 75 | + |
| 76 | +## Guidelines |
| 77 | + |
| 78 | +- Be specific with file paths and line numbers |
| 79 | +- Explain *why* something is problematic |
| 80 | +- Skip style nitpicks if there are real bugs |
| 81 | + |
| 82 | +**Do NOT post any comments to GitHub. Return findings as a summary only.** |
0 commit comments