You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/skills/review-code/SKILL.md
+66-87Lines changed: 66 additions & 87 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,49 +31,45 @@ If a PR URL or number is provided:
31
31
32
32
If a branch name is provided (not a PR):
33
33
34
-
1. Identify the repository from the current working directory or the user's prompt
35
-
2. Change to that repository directory
36
-
3. Verify the branch exists and check it out:
34
+
1. Identify the repository from the current working directory or the user's prompt. If a repo name is given, locate it as a peer directory of `edge-conventions` (see **Repository Synchronization** for details).
35
+
2. Read the target repository's `AGENTS.md` and any `.cursor/rules/` files for repo-specific conventions.
4. Determine the base branch for comparison (typically `master` or `main`):
44
+
5. Determine the base branch for comparison (typically `master` or `main`):
44
45
```bash
45
46
git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
46
47
```
47
-
5. If the branch has uncommitted or unstaged changes (no commits beyond the base), use `git diff` for unstaged changes and `git diff --cached` for staged changes instead of `git diff <base>...HEAD`. No git checkout operations are needed in this case.
48
-
6. Skip the GitHub MCP sections and proceed directly to **Review Process**
48
+
6. If the branch has uncommitted or unstaged changes (no commits beyond the base), use `git diff` for unstaged changes and `git diff --cached` for staged changes instead of `git diff <base>...HEAD`. No git checkout operations are needed in this case.
49
+
7. Skip the GitHub PR sections and proceed directly to **Review Process**
49
50
50
51
## Repository Synchronization (GitHub PRs)
51
52
52
-
1. Find the matching repository directory in the workspace by name (do NOT use absolute paths - search the workspace for a directory matching the repository name)
53
-
2. Change to that repository directory
53
+
1. Locate the target repository as a peer directory of `edge-conventions`. Determine the parent directory containing `edge-conventions` (e.g., if this skill is at `git/edge-conventions/.cursor/skills/review-code/SKILL.md`, the parent is `git/`). The target repo will be a sibling directory under that parent (e.g., `git/edge-react-gui` for the `edge-react-gui` repository).
54
+
2. Read the target repository's `AGENTS.md` and any `.cursor/rules/` files to understand repo-specific conventions. Pass these as context to the review subagents.
55
+
3. Change to that repository directory
54
56
55
57
### Detecting Fork vs Internal Branch
56
58
57
-
Use the GitHub MCP server to get PR metadata including the head repository owner:
59
+
Get PR metadata including the head repository owner:
-`head.repo.owner.login`: The owner of the source repository (fork owner or same org)
71
-
-`head.ref`: The branch name in the source repo
72
-
-`base.ref`: The target branch (usually "master" or "main")
73
-
-`base.repo.owner.login`: The owner of the target repository
66
+
The JSON response includes:
67
+
-`headRepositoryOwner.login`: The owner of the source repository (fork owner or same org)
68
+
-`headRefName`: The branch name in the source repo
69
+
-`baseRefName`: The target branch (usually "master" or "main")
74
70
75
71
**Fork Detection Logic:**
76
-
- If `head.repo.owner.login`equals `base.repo.owner.login`, it's an **internal branch**
72
+
- If `headRepositoryOwner.login`matches the baserepoowner, it's an **internal branch**
77
73
- If they differ, it's a **fork** from an external user/organization
78
74
79
75
### GitHub PR Checkout
@@ -169,95 +165,78 @@ Provide a structured review with:
169
165
-**Suggestions**: Consider for improvement
170
166
-**Conventions Checklist**: Which conventions were checked and passed/failed
171
167
172
-
Save the review to a markdown document in the system temp directory (`/tmp` on macOS/Linux), then open it in the current Cursor workspace for the user to review:
173
-
174
-
```bash
175
-
cursor --reuse-window <review-document-path>
176
-
```
168
+
Save the review to a markdown document in the system temp directory (`/tmp` on macOS/Linux).
-**For local branches**: `MMDDhhmm_[repository-name]_[branch-name]_review.md`
181
173
182
-
Pause for the user to review.
174
+
**If running in the Cursor IDE GUI** (detected by the `CURSOR_TRACE_ID` environment variable being set), open the document in Cursor and pause for the user to review:
183
175
184
-
**For GitHub PRs only:** Once the user has iterated and agreed on the changes, submit the review to GitHub using the process below.
176
+
```bash
177
+
cursor --reuse-window <review-document-path>
178
+
```
179
+
180
+
**If running from a terminal-based agent** (Cursor CLI, opencode, crush, or similar), print the full path to the saved document.
181
+
182
+
**For GitHub PRs only:** Submit the review to GitHub using the process below.
185
183
186
184
**For local branches:** After the user reviews, offer to help fix any issues found or create a PR if desired.
187
185
188
186
## Submitting PR Review with Inline Comments (GitHub PRs Only)
189
187
190
-
Use the GitHub MCP server to add comments inline to specific lines of code rather than one large summary comment. **Skip this section for local branch reviews.**
191
-
192
-
### Step 1: Create a Pending Review
188
+
Use the `gh` CLI to add comments inline to specific lines of code rather than one large summary comment. **Skip this section for local branch reviews.**
0 commit comments