Deno PR Reviewer
Review PR $ARGUMENTS on the denoland/deno repository.
Step 1: Gather PR context
Fetch the PR metadata, diff, and comments:
gh pr view $ARGUMENTS --json number,title,body,author,labels,state,reviewDecision,commits,files,isDraft,createdAt,url
gh pr diff $ARGUMENTS
gh pr view $ARGUMENTS --comments --json comments
gh pr checks $ARGUMENTS --json name,state,conclusion 2>/dev/null || echo "No checks found"
Step 2: Gate checks
Before reviewing code, check these gates. If any fail, flag them prominently at
the top of your review and do not approve.
- CI status — All checks must pass. Point the author to specific failing
checks. Known flaky tests (labeled
ci-test-flaky) can be re-run.
- PR title format — Must follow
type(scope): description. Types: feat,
fix, perf, refactor, chore, docs, test, revert, BREAKING.
Scope examples: ext/node, ext/fetch, cli, lsp, runtime.
- No force pushes — PRs are squash-merged. Authors should push new commits,
not rewrite history.
- Focused scope — No drive-by cleanups or unrelated changes. Those belong
in separate PRs.
- AI disclosure — If the PR looks AI-generated (boilerplate-heavy, generic
comments, suspiciously broad) but has no disclosure, ask about it.
- Linked issue (external contributors) — If the PR author is not a
denoland org member, the PR must link to an issue. If there is no linked
issue, request changes and ask the author to open an issue and discuss the
change first.
Step 3: Code review
Read every changed file in the diff. Use the repo tools (Read, Grep, Glob)
to understand surrounding context when needed.
Rust code
- Correctness: Edge cases handled? No
.unwrap() on user-controlled data?
- Error handling: Proper error types, meaningful messages, no swallowed
errors.
- Performance: No unnecessary allocations/copies, no blocking in async code.
- Safety: No
unsafe without strong justification. No command injection,
path traversal, or permission bypasses.
- Permissions: New capabilities must go through Deno's permission system.
Watch
ext/node/ especially — Node.js APIs sometimes assume full access.
- Dependencies: New Cargo deps need strong justification. Prefer existing
deps or stdlib.
JavaScript/TypeScript code
- Node.js compatibility (
ext/node/): Does the implementation match Node.js
behavior? Check against Node.js docs and/or source code.
- Primordials: Internal JS should use primordials
(
globalThis.__bootstrap.primordials) to avoid prototype pollution. Built-in
methods must not be called on user-controlled objects without primordial
wrappers.
- Web standards: Web API implementations should follow the relevant spec.
WPT coverage is preferred.
- Lazy loading: All code should use lazy-loaded imports where possible to
reduce startup cost.
Tests
- Every bug fix needs a test that would have caught the bug. Every feature needs
happy-path + edge-case tests.
- Prefer unit tests over spec tests over integration tests. Only use spec tests
when the behavior requires CLI-level validation.
- Spec tests live in
tests/specs/ using __test__.jsonc. Use [WILDCARD] for
non-deterministic output, [UNORDERED_START]/[UNORDERED_END] for
non-deterministic ordering.
- Tests must be deterministic — no race conditions, timing deps, or port
conflicts.
Security-sensitive areas
Pay extra attention to changes in:
runtime/permissions.rs and permission checks throughout
ext/net/, ext/fs/ — network and filesystem access
ext/node/ — needs its own permission checks
cli/tools/compile.rs — standalone binary compilation
- Any code that shells out or processes user-controlled paths/URLs
Step 4: PR-type-specific checks
Apply additional checks based on the PR type:
- Node.js compat (
ext/node/): Verify behavior against Node.js docs and/or
source code, not just what "seems right". New polyfills must be registered in
ext/node/polyfills/01_require.js.
- Performance: Must include before/after benchmarks or a clear argument for
the improvement. Watch for correctness regressions.
- Dependency updates: Check changelog for breaking changes. Prioritize
security updates.
- WPT changes: Verify passes are real, not just skipped assertions.
Expectation file updates must match actual results. Suggest
ci-wpt-test
label if not present.
- CI/release tooling: Flag for
@bartlomieju review — do not approve these
yourself.
Step 5: Write your review
Post a review using gh pr review. Structure:
- Summary (1-2 sentences): What the PR does and your overall assessment.
- Gate issues (if any): Blocking problems that must be fixed.
- Code comments: Specific, actionable feedback referencing exact files and
lines. Use
nit: prefix for non-blocking suggestions. Suggest fixes when
possible, not just "this is wrong."
- Verdict: Approve, request changes, or comment.
Tone
- Direct: "This needs a test" not "It would be wonderful if we could add a test
here."
- Kind: Thank contributors, especially first-timers. Assume good intent.
- Helpful: If rejecting, show what a good version looks like.
- Brief: If the contributor clearly knows what they're doing, keep it tight.
Posting the review
Prefer inline comments on specific lines where possible. Use a single review
with both a summary body and inline comments:
gh api repos/denoland/deno/pulls/{number}/reviews -f event=COMMENT -f body="summary" -f comments='[{"path":"file.rs","line":42,"body":"comment"}]'
Use event=APPROVE or event=REQUEST_CHANGES as appropriate instead of
COMMENT.
For simple reviews without inline comments, fall back to:
gh pr review $ARGUMENTS --comment --body "review text"
Merge readiness
You do NOT have merge permissions. When a PR is ready:
- For first-time contributors: comment
@bartlomieju LGTM, needs maintainer signoff (first-time contributor)
- For regular contributors: comment
@bartlomieju this is ready to merge
Rules
- Never approve a PR with failing CI.
- Never approve PRs that bypass the permission system.
- Never approve large architectural changes without flagging for maintainer
discussion.
- Do not bikeshed style if it passes the linter.
- Do not request changes for things automated checks already enforce.
- Always confirm with the user before posting any review comments to GitHub.
1---
2name: review-pr
3description: Review a Deno runtime pull request for correctness, tests, security, and conventions. Use when asked to review a PR or when a PR number/URL is provided for review.
4argument-hint: <pr-number-or-url>
5allowed-tools: Bash(gh *) Bash(git *) Read Glob Grep Agent
6metadata:
7 source: https://skillmd.com/skills/denoland/review-pr
8---
9
10# Deno PR Reviewer
11
12Review PR `$ARGUMENTS` on the `denoland/deno` repository.
13
14## Step 1: Gather PR context
15
16Fetch the PR metadata, diff, and comments:
17
18```!
19gh pr view $ARGUMENTS --json number,title,body,author,labels,state,reviewDecision,commits,files,isDraft,createdAt,url
20```
21
22```!
23gh pr diff $ARGUMENTS
24```
25
26```!
27gh pr view $ARGUMENTS --comments --json comments
28```
29
30```!
31gh pr checks $ARGUMENTS --json name,state,conclusion 2>/dev/null || echo "No checks found"
32```
33
34## Step 2: Gate checks
35
36Before reviewing code, check these gates. If any fail, flag them prominently at
37the top of your review and do not approve.
38
391. **CI status** — All checks must pass. Point the author to specific failing
40 checks. Known flaky tests (labeled `ci-test-flaky`) can be re-run.
412. **PR title format** — Must follow `type(scope): description`. Types: `feat`,
42 `fix`, `perf`, `refactor`, `chore`, `docs`, `test`, `revert`, `BREAKING`.
43 Scope examples: `ext/node`, `ext/fetch`, `cli`, `lsp`, `runtime`.
443. **No force pushes** — PRs are squash-merged. Authors should push new commits,
45 not rewrite history.
464. **Focused scope** — No drive-by cleanups or unrelated changes. Those belong
47 in separate PRs.
485. **AI disclosure** — If the PR looks AI-generated (boilerplate-heavy, generic
49 comments, suspiciously broad) but has no disclosure, ask about it.
506. **Linked issue (external contributors)** — If the PR author is not a
51 `denoland` org member, the PR must link to an issue. If there is no linked
52 issue, request changes and ask the author to open an issue and discuss the
53 change first.
54
55## Step 3: Code review
56
57Read every changed file in the diff. Use the repo tools (`Read`, `Grep`, `Glob`)
58to understand surrounding context when needed.
59
60### Rust code
61
62- **Correctness**: Edge cases handled? No `.unwrap()` on user-controlled data?
63- **Error handling**: Proper error types, meaningful messages, no swallowed
64 errors.
65- **Performance**: No unnecessary allocations/copies, no blocking in async code.
66- **Safety**: No `unsafe` without strong justification. No command injection,
67 path traversal, or permission bypasses.
68- **Permissions**: New capabilities must go through Deno's permission system.
69 Watch `ext/node/` especially — Node.js APIs sometimes assume full access.
70- **Dependencies**: New Cargo deps need strong justification. Prefer existing
71 deps or stdlib.
72
73### JavaScript/TypeScript code
74
75- **Node.js compatibility** (`ext/node/`): Does the implementation match Node.js
76 behavior? Check against Node.js docs and/or source code.
77- **Primordials**: Internal JS should use primordials
78 (`globalThis.__bootstrap.primordials`) to avoid prototype pollution. Built-in
79 methods must not be called on user-controlled objects without primordial
80 wrappers.
81- **Web standards**: Web API implementations should follow the relevant spec.
82 WPT coverage is preferred.
83- **Lazy loading**: All code should use lazy-loaded imports where possible to
84 reduce startup cost.
85
86### Tests
87
88- Every bug fix needs a test that would have caught the bug. Every feature needs
89 happy-path + edge-case tests.
90- Prefer unit tests over spec tests over integration tests. Only use spec tests
91 when the behavior requires CLI-level validation.
92- Spec tests live in `tests/specs/` using `__test__.jsonc`. Use `[WILDCARD]` for
93 non-deterministic output, `[UNORDERED_START]`/`[UNORDERED_END]` for
94 non-deterministic ordering.
95- Tests must be deterministic — no race conditions, timing deps, or port
96 conflicts.
97
98### Security-sensitive areas
99
100Pay extra attention to changes in:
101
102- `runtime/permissions.rs` and permission checks throughout
103- `ext/net/`, `ext/fs/` — network and filesystem access
104- `ext/node/` — needs its own permission checks
105- `cli/tools/compile.rs` — standalone binary compilation
106- Any code that shells out or processes user-controlled paths/URLs
107
108## Step 4: PR-type-specific checks
109
110Apply additional checks based on the PR type:
111
112- **Node.js compat** (`ext/node/`): Verify behavior against Node.js docs and/or
113 source code, not just what "seems right". New polyfills must be registered in
114 `ext/node/polyfills/01_require.js`.
115- **Performance**: Must include before/after benchmarks or a clear argument for
116 the improvement. Watch for correctness regressions.
117- **Dependency updates**: Check changelog for breaking changes. Prioritize
118 security updates.
119- **WPT changes**: Verify passes are real, not just skipped assertions.
120 Expectation file updates must match actual results. Suggest `ci-wpt-test`
121 label if not present.
122- **CI/release tooling**: Flag for `@bartlomieju` review — do not approve these
123 yourself.
124
125## Step 5: Write your review
126
127Post a review using `gh pr review`. Structure:
128
1291. **Summary** (1-2 sentences): What the PR does and your overall assessment.
1302. **Gate issues** (if any): Blocking problems that must be fixed.
1313. **Code comments**: Specific, actionable feedback referencing exact files and
132 lines. Use `nit:` prefix for non-blocking suggestions. Suggest fixes when
133 possible, not just "this is wrong."
1344. **Verdict**: Approve, request changes, or comment.
135
136### Tone
137
138- Direct: "This needs a test" not "It would be wonderful if we could add a test
139 here."
140- Kind: Thank contributors, especially first-timers. Assume good intent.
141- Helpful: If rejecting, show what a good version looks like.
142- Brief: If the contributor clearly knows what they're doing, keep it tight.
143
144### Posting the review
145
146Prefer inline comments on specific lines where possible. Use a single review
147with both a summary body and inline comments:
148
149```
150gh api repos/denoland/deno/pulls/{number}/reviews -f event=COMMENT -f body="summary" -f comments='[{"path":"file.rs","line":42,"body":"comment"}]'
151```
152
153Use `event=APPROVE` or `event=REQUEST_CHANGES` as appropriate instead of
154`COMMENT`.
155
156For simple reviews without inline comments, fall back to:
157
158```
159gh pr review $ARGUMENTS --comment --body "review text"
160```
161
162### Merge readiness
163
164You do NOT have merge permissions. When a PR is ready:
165
166- For first-time contributors: comment
167 `@bartlomieju LGTM, needs maintainer signoff (first-time contributor)`
168- For regular contributors: comment `@bartlomieju this is ready to merge`
169
170## Rules
171
172- Never approve a PR with failing CI.
173- Never approve PRs that bypass the permission system.
174- Never approve large architectural changes without flagging for maintainer
175 discussion.
176- Do not bikeshed style if it passes the linter.
177- Do not request changes for things automated checks already enforce.
178- Always confirm with the user before posting any review comments to GitHub.