|
| 1 | +--- |
| 2 | +name: github-pr-review |
| 3 | +description: Review a pull request for correctness, MATLAB/Octave behavior, EEGLAB data-structure consistency, GUI/history regressions, and repository convention compliance in sccn/eeglab. |
| 4 | +allowed-tools: Bash(gh issue view:*), Bash(gh search:*), Bash(gh issue list:*), Bash(gh pr comment:*), Bash(gh pr diff:*), Bash(gh pr view:*), Bash(gh pr list:*), Bash(gh pr review:*), Bash(git rev-parse:*), mcp__github_inline_comment__create_inline_comment |
| 5 | +--- |
| 6 | + |
| 7 | +Provide a code review for the given pull request. |
| 8 | + |
| 9 | +You are reviewing EEGLAB, a MATLAB-native toolbox for EEG and related |
| 10 | +electrophysiological signal processing. |
| 11 | + |
| 12 | +Read first: |
| 13 | + |
| 14 | +@AGENTS.md |
| 15 | + |
| 16 | +## Review Goals |
| 17 | + |
| 18 | +Prioritize: |
| 19 | + |
| 20 | +1. Correctness bugs and behavioral regressions in changed MATLAB code. |
| 21 | +2. EEG structure consistency, including dimensions, events, epochs, channel |
| 22 | + locations, ICA fields, STUDY fields, and save/history fields. |
| 23 | +3. GUI and command-line parity for `pop_*` functions. |
| 24 | +4. MATLAB and Octave compatibility where the changed code claims or implies it. |
| 25 | +5. Focused tests or reproducibility commands for changed behavior. |
| 26 | +6. Simple code that follows existing EEGLAB conventions. |
| 27 | + |
| 28 | +## High-Signal Threshold |
| 29 | + |
| 30 | +Flag only issues that are specific, actionable, and tied to changed code. |
| 31 | + |
| 32 | +Flag: |
| 33 | + |
| 34 | +- Code that will fail to parse or run in a common MATLAB or Octave path. |
| 35 | +- Incorrect dimensions, indexing, event latencies, channel metadata, ICA fields, |
| 36 | + or STUDY state after the changed operation. |
| 37 | +- A broken `pop_*` command-line path, GUI path, or returned command string. |
| 38 | +- Missing validation for a realistic regression introduced by the change. |
| 39 | +- Unsafe file, path, download, or plugin handling in changed code. |
| 40 | +- Clear violations of `AGENTS.md` or scoped directory instructions. |
| 41 | + |
| 42 | +Do not flag: |
| 43 | + |
| 44 | +- Pre-existing issues outside the PR. |
| 45 | +- Generic style preferences. |
| 46 | +- Broad refactors unrelated to the diff. |
| 47 | +- Hypothetical edge cases without a realistic EEGLAB path. |
| 48 | +- Issues a normal linter or MATLAB parser would report unless they change |
| 49 | + behavior or block execution. |
| 50 | + |
| 51 | +## Review Workflow |
| 52 | + |
| 53 | +1. Check whether the PR is closed or draft. If so, stop unless the user |
| 54 | + explicitly requested review anyway. |
| 55 | +2. Read the PR title, body, changed files, and diff: |
| 56 | + |
| 57 | + ```bash |
| 58 | + gh pr view <PR> --json title,body,files,state,isDraft,author |
| 59 | + gh pr diff <PR> |
| 60 | + ``` |
| 61 | + |
| 62 | +3. Find relevant instructions: |
| 63 | + |
| 64 | + ```bash |
| 65 | + find .. -name AGENTS.md -o -name CLAUDE.md |
| 66 | + ``` |
| 67 | + |
| 68 | + Apply only instructions in the changed file's directory or parents. |
| 69 | + |
| 70 | +4. Review changed files against the EEGLAB rules in `AGENTS.md`. |
| 71 | +5. Validate candidate findings by reading the surrounding source, not just the |
| 72 | + diff. |
| 73 | +6. Produce a concise terminal summary. If `--comment` was not provided, stop. |
| 74 | +7. If `--comment` was provided, post or update a single PR comment. |
| 75 | + |
| 76 | +## Review Comment Format |
| 77 | + |
| 78 | +Use this format: |
| 79 | + |
| 80 | +```md |
| 81 | +## Code review |
| 82 | + |
| 83 | +- Overall assessment: <safe to merge / needs changes / needs more context> |
| 84 | +- Highest-risk area: <area> |
| 85 | +- Merge recommendation: <safe to merge / needs changes / needs more context> |
| 86 | + |
| 87 | +## Blocking |
| 88 | + |
| 89 | +<findings or None.> |
| 90 | + |
| 91 | +## Important |
| 92 | + |
| 93 | +<findings or None.> |
| 94 | + |
| 95 | +## Nits |
| 96 | + |
| 97 | +<findings or None.> |
| 98 | + |
| 99 | +## Test gaps |
| 100 | + |
| 101 | +<findings or None.> |
| 102 | + |
| 103 | +## EEGLAB notes |
| 104 | + |
| 105 | +<findings or None.> |
| 106 | +``` |
| 107 | + |
| 108 | +Rules: |
| 109 | + |
| 110 | +- If a section has no findings, write `None.` |
| 111 | +- Each finding must include severity, file/function reference, why it matters, |
| 112 | + and a concrete suggested fix. |
| 113 | +- Keep the review concise. |
| 114 | +- Do not include generic praise. |
| 115 | +- If no issues were found, say: |
| 116 | + |
| 117 | +```md |
| 118 | +## Code review |
| 119 | + |
| 120 | +- Overall assessment: Looks good. |
| 121 | +- Highest-risk area: None identified. |
| 122 | +- Merge recommendation: Safe to merge. |
| 123 | + |
| 124 | +## Blocking |
| 125 | + |
| 126 | +None. |
| 127 | + |
| 128 | +## Important |
| 129 | + |
| 130 | +None. |
| 131 | + |
| 132 | +## Nits |
| 133 | + |
| 134 | +None. |
| 135 | + |
| 136 | +## Test gaps |
| 137 | + |
| 138 | +None. |
| 139 | + |
| 140 | +## EEGLAB notes |
| 141 | + |
| 142 | +None. |
| 143 | + |
| 144 | +Checked for correctness bugs, MATLAB/Octave behavior, EEG structure consistency, GUI/history regressions, changed-behavior tests, and AGENTS.md compliance. |
| 145 | +``` |
| 146 | + |
| 147 | +Post or update the review comment with: |
| 148 | + |
| 149 | +```bash |
| 150 | +gh pr comment "$PR_NUMBER" --edit-last --create-if-none --body-file <file> |
| 151 | +``` |
| 152 | + |
| 153 | +## Inline Comments |
| 154 | + |
| 155 | +Use inline comments only for validated issues that are best attached to a |
| 156 | +specific changed line. Do not duplicate summary findings inline. |
| 157 | + |
| 158 | +Inline comments must: |
| 159 | + |
| 160 | +- State severity. |
| 161 | +- Explain the concrete bug or risk. |
| 162 | +- Suggest a fix. |
| 163 | +- Include a committable suggestion only when the suggestion fully fixes the |
| 164 | + issue and is small. |
| 165 | + |
| 166 | +Never credit yourself or AI tools in review comments. |
0 commit comments