agentleFS
prestodbprestodb/presto/.claude/skills/review-presto-pr/SKILL.md

review-presto-pr

Skill17k starsChanged 41 days agoApache-2.0View on GitHub

Review a Presto pull request, commits, or local changes for code quality, style, correctness, and performance. Use when the user asks for a "code review", wants to "review commits", "review the last N commits", "review my changes", or "review the branch". Only use this skill when working in a Presto repository (prestodb/presto). Do not use for other projects.

Trending

Steady talk.about the whole repository

Dec 2025: 0 mentionsJan 2026: 1 mentionFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 2 mentionsMay 2026: 3 mentionsJun 2026: 1 mentionJul 2026: 4 mentionsAug 2026: 3 mentionsSep 2026: 3 mentionsOct 2026: 4 mentionsNov 2026: 1 mention
Dec 2025Jun 2026Nov 2026
Mentions a month of the prestodb/presto repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about prestodb/presto

The biggest 5 of 95 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 95

Talked about on GitHub, Stack Overflow, YouTube, Hacker News, Bluesky and the web (95 times).

On GitHub · 43

38 more on GitHub

On Stack Overflow · 29

24 more on Stack Overflow

On YouTube · 19

14 more on YouTube

On Hacker News · 2

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 12 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before proceeding, verify this is a Presto repository:

    line 14
  2. Very specific:

    If this is not a Presto repository, inform the user and do not proceed with this skill.

    line 21
  3. Distinctive:

    Ask to review the current branch

    line 27
  4. Very specific:

    Verify adherence to Presto style guidelines for Java code:

    line 88
  5. Very specific:

    Verify adherence to Velox style guidelines in https://github.com/facebookincubator/velox/blob/main/CODING_STYLE.md for any C++ code changes.

    line 100
  6. Distinctive:

    Before accepting new patterns or mechanisms, ask:

    line 106
  7. Distinctive:

    No data structures that can grow without bounds?

    line 122
  8. Distinctive:

    Not introducing expensive calls in performance-sensitive areas?

    line 124
  9. Distinctive:

    Keep it generic: Avoid adding hooks for specific vendor infrastructure or proprietary systems

    line 142
  10. Distinctive:

    Ask: "Would an open-source connector author find this interface reasonable and understandable?"

    line 145
  11. Distinctive:

    Do they preserve query semantics?

    line 155
  12. Very specific:

    @ConfigDescription: Every new @Config setter must have a @ConfigDescription so the property is self-documenting for operators

    line 166
  13. Very specific:

    Follow RESTful conventions (proper use of GET/POST/PUT/DELETE, resource-based URLs)

    line 171
  14. Very specific:

    If the code is implementing a SQL function or operator change which is available in Presto Java then ensure the logic of the native code is …

    line 176
  15. Distinctive:

    Ensure the PR has e2e tests using Native and HiveQueryRunners that verify the C++ implementation against the Java implementation for a …

    line 178
  16. Distinctive:

    Check usage of smart pointers and RAII for resource management.

    line 180
  17. Distinctive:

    Check for buffer overflows in any memory copies or array accesses.

    line 181
  18. Distinctive:

    Ensure that exceptions are caught appropriately and that error messages are informative.

    line 182
  19. Very specific:

    Ensure correct use of VELOX_CHECK_* vs VELOX_USER_CHECK_*.

    line 183
  20. Distinctive:

    If multiple new tests cover overlapping scenarios, prefer the most comprehensive one

    line 196
  21. Very specific:

    Always begin your review with: [review-pr skill]

    line 246

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Presto PR Review Skill

Overview

This skill guides thorough code reviews for Presto pull requests, following the project's contribution guidelines and best practices.

Prerequisites

Before proceeding, verify this is a Presto repository:

# Check for Presto-specific markers
test -f pom.xml && grep -q "com.facebook.presto" pom.xml

If this is not a Presto repository, inform the user and do not proceed with this skill.

How to Invoke

The user will typically:

  • Provide a GitHub PR URL (github.com/prestodb/presto)
  • Ask to review the current branch
  • Point to specific commits to review

Review Process

1. Checkout the PR Code

First, fetch and checkout the PR so the code is available locally for browsing:

# For a GitHub PR URL, checkout the PR branch
gh pr checkout <pr-number>

# Or if given a branch name
git fetch origin <branch-name>
git checkout <branch-name>

This ensures the code is available locally for the user to browse and cross-check during the review.

2. Gather Context

First, understand what changed and check for proper process:

Size and process checks:

  • Large changes should have an RFC
  • Very large PRs should be split when practical to keep review manageable; consider generated files separately
  • Medium changes should have an associated GitHub issue

First, understand what changed:

# Compare against the PR's base branch, not a hardcoded branch name.
# Most PRs target master, but release/edge branches are cut from release
# tags (e.g. release-0.290 off the 0.290 tag), so determine the base first.

# For a GitHub PR, ask gh for the base branch:
BASE=$(gh pr view <pr-number> --json baseRefName --jq .baseRefName)

# Otherwise fall back to the default branch, or the merge-base if comparing
# against a release branch:
BASE=${BASE:-$(git remote show origin | sed -n 's/.*HEAD branch: //p')}

git diff "$BASE"...HEAD --stat
git log "$BASE"..HEAD --oneline

# For a specific commit
git show <commit> --stat

Using "$BASE"...HEAD (three dots) diffs against the merge-base, which is correct even when the base branch has advanced or was created from a release tag.

Advancing Velox: It is preferred that PRs updating the Velox git submodule are restricted to updating the submodule only. They should only include code and test changes in presto-native* modules needed for building and passing tests for the updated Velox code. Features that require subsequent presto-native* module changes should be implemented in a separate PR after the Velox update is merged. Conversely, PRs that implement new features in presto-native* modules should not include Velox submodule updates.

3. Code Style Checklist

Verify adherence to Presto style guidelines for Java code:

  • Line length: Aim for 180 characters, but acceptable to exceed if breaking the line would look awkward
  • Naming: No abbreviations (use positionCount not positionCnt). This applies everywhere including lambda parameters (operator -> not op ->, pipeline -> not p ->, stage -> not s ->)
  • Static imports: Using format(), toImmutableList(), requireNonNull, checkArgument
  • Import ordering: Presto enforces strict import ordering via checkstyle. Imports must be alphabetically ordered, with static imports grouped separately. No unused or wildcard imports
  • Immutability: Preferring Guava immutable collections (ImmutableList, ImmutableMap)
  • Fields: Declared final when possible
  • Class structure: Fields before methods, ordered by access level (public -> private)
  • Nullability: Using @Nullable annotation where appropriate
  • Validation: Constructor arguments validated with requireNonNull and checkArgument

Verify adherence to Velox style guidelines in https://github.com/facebookincubator/velox/blob/main/CODING_STYLE.md for any C++ code changes.

4. Code Safety and Quality

IMPORTANT: Follow existing conventions

Before accepting new patterns or mechanisms, ask:

  • Is there an existing pattern in the codebase that does something similar?
  • Can this build on top of existing infrastructure instead of creating something new?
  • Why can't the existing approach be extended?

There is a tendency to want to redo everything from scratch. Push back on this - often existing mechanisms can be extended or reused. New abstractions should be a last resort, not a first instinct.

Evaluate changes through three axes:

Code Quality & Maintainability:

  • Does the code follow existing conventions?
  • Is it implemented cleanly with appropriate interfaces?
  • Would doing everything this way make the codebase hard to maintain?

Code Safety:

  • Thread safe?
  • No data structures that can grow without bounds?
  • Memory usage is accounted for?
  • Not introducing expensive calls in performance-sensitive areas?
  • Feature flags for risky new features?

User Friendliness:

  • Config options have understandable names and descriptions?
  • New features have documentation?
  • Release notes added for user-visible changes?

Also look for:

  • Resource management: Try-with-resources for closeable resources
  • Error handling: Appropriate exception types, meaningful messages
  • Logging: Appropriate log levels, no sensitive data logged

5. Presto-Specific Concerns

For SPI Changes (presto-spi module)

SPI changes require extra scrutiny:

  • No new dependencies: The SPI must remain dependency-free to avoid forcing connectors to pull in unwanted libraries
  • Keep it generic: Avoid adding hooks for specific vendor infrastructure or proprietary systems
  • Simplicity over flexibility: A simple SPI that covers common cases is better than a complex one that handles every edge case
  • Backwards compatibility: Changes should not break existing connector implementations
  • Ask: "Would an open-source connector author find this interface reasonable and understandable?"

For Connector Changes

  • Does it properly implement the SPI interfaces?
  • Are metadata operations efficient (avoid N+1 queries)?
  • Is split generation parallelizable?
  • Are pushdowns implemented correctly?

For Planner/Optimizer Changes

  • Are optimization rules correct and complete?
  • Do they preserve query semantics?
  • Are there potential infinite loops in rule application?
  • Is cost estimation impacted?

For Execution Changes

  • Is memory tracking correct?
  • Are operators properly handling yield signals?
  • Is data processed in a streaming fashion where possible?
  • Are there potential deadlocks in exchange operations?

For Configuration Changes

  • @ConfigDescription: Every new @Config setter must have a @ConfigDescription so the property is self-documenting for operators
  • @ConfigSecuritySensitive: Annotate setters for passwords, secrets, tokens, or other sensitive values so they are masked in logs and diagnostics
  • New config properties should be documented (see the Documentation section) with their default values

For New HTTP Endpoints

  • Follow RESTful conventions (proper use of GET/POST/PUT/DELETE, resource-based URLs)
  • Consistent with existing endpoint patterns in the codebase
  • Proper error responses and status codes

For presto-native* Module Changes

  • If the code is implementing a SQL function or operator change which is available in Presto Java then ensure the logic of the native code is consistent with it. Focus on logic errors, off-by-one, null/empty handling, boundary conditions, integer overflow, floating point edge cases (NaN, Inf, negative zero). Ensure the PR has e2e tests using Native and HiveQueryRunners that verify the C++ implementation against the Java implementation for a variety of inputs, including edge cases.
  • Ensure that presto_protocol changes included in the PR are not manually written. Any edit to a generated .h/.cpp in presto-native-execution/presto_cpp/presto_protocol directory (they have a // DO NOT EDIT header) should come with a matching change to a .yml, special/, or mustache source or a java class serialization annotation.
  • Check usage of smart pointers and RAII for resource management. Ensure that raw pointers are not used unless absolutely necessary and are properly managed. If raw pointers are needed then check memory safety: Use-after-free, double-free, leaks, dangling pointers/references and ownership issues.
  • Check for buffer overflows in any memory copies or array accesses. Ensure that all buffer sizes are properly checked.
  • Ensure that exceptions are caught appropriately and that error messages are informative. The error message should try to include suggestions to fix user errors and should not include internal details that are not useful to users.
  • Ensure correct use of VELOX_CHECK_* vs VELOX_USER_CHECK_. VELOX_CHECK_ should be used for internal consistency checks that indicate a bug if they fail, while VELOX_USER_CHECK_* should be used for validating user input and providing informative error messages.

6. Test Coverage

Verify:

  • New code has corresponding tests
  • Bug fixes include regression tests
  • Edge cases are tested
  • Tests are deterministic (no Thread.sleep, no random values)
  • Integration tests if behavior changes cross module boundaries

Avoid test duplication:

  • If multiple new tests cover overlapping scenarios, prefer the most comprehensive one
  • Example: If test A covers scenarios X, Y, Z and test B only covers X, Y - just keep test A
  • Each test should add distinct value; don't add tests just for coverage numbers

Require negative test cases:

  • Feature flags: Test that behavior is correct when the feature is disabled
  • Access control: Test that denied permissions actually block access (not just that granted permissions work)
  • Validation: Test that invalid inputs are properly rejected
  • Error paths: Test that failures are handled gracefully, not just the happy path

7. Documentation

Documentation is required for:

  • New SPI interfaces or changes: Update the Developer Guide
  • New session properties: Document in connector or relevant module docs
  • New config properties: Document with clear descriptions that operators can understand
  • Release notes: Required for user-visible changes

Also check:

  • Javadoc where it adds value (complex interfaces, non-obvious behavior) - not required everywhere
  • Comments for complex logic
  • README updates if user-facing behavior changes

8. Commit Structure

Presto uses Conventional Commits. PR titles must follow this format:

<type>[(scope)]: <description>

Types: feat, fix, docs, refactor, perf, test, build, ci, chore, revert, misc

Common scopes: parser, analyzer, planner, spi, scheduler, connector, function, operator, native, docs

Examples:

  • feat(connector): Add support for dynamic catalog registration
  • fix: Resolve memory leak in query executor
  • feat!: Remove deprecated configuration options (breaking change)

Verify:

  • PR title follows conventional commit format
  • Each commit passes tests independently
  • Body explains what and why (not how)
  • Related issues referenced (e.g., Resolves: #1234)

Output Format

IMPORTANT: Output the review directly in the conversation for the user to read. Do NOT post comments directly to GitHub - the user will decide what feedback to share.

Always begin your review with: [review-pr skill]

Structure your review as:

<!-- Reviewed using review-pr skill -->

## High-Level Overview
A brief 2-3 sentence summary of what this change accomplishes at a conceptual level. Focus on the "what" and "why" - what problem does this solve and what is the approach? This should be understandable by someone unfamiliar with the specific code.

## In-Depth Overview
A detailed explanation of the implementation:
- What components/modules are modified and why
- Key classes, interfaces, or methods introduced or changed
- How the pieces fit together
- Any notable design decisions or trade-offs made

## Change Flow Diagram
**Include when applicable** - especially for changes involving:
- Multiple components interacting
- New request/response flows
- Data transformations or pipelines
- State machines or lifecycle changes

Use ASCII diagrams or Mermaid syntax:

┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ Component A │───>│ Component B │───>│ Component C │ └──────────────┘ └──────────────┘ └──────────────┘


Or for more complex flows, use Mermaid:

```mermaid
graph LR
    A[Analyzer] --> B[Planner]
    B --> C[Optimizer]
    C --> D[Executor]

Skip this section for simple changes (single-file bug fixes, documentation updates, minor refactors).

Summary

Brief overall assessment of the PR quality, readiness for merge, and any high-level concerns.

Highlights

Things done well in the PR.

Issues Found

Critical

Issues that must be fixed before merging.

Suggestions

Improvements that would make the code better but aren't blocking.

Nits

Minor style or formatting issues.

Questions

Clarifications needed from the author.

Testing Recommendations

Additional tests that should be considered.


## Running Checks

```bash
# Check code style
./mvnw checkstyle:check -pl <module-name>

# Compile to catch type errors
./mvnw compile -pl <module-name>

# Run tests
./mvnw test -pl <module-name> -Dtest=<TestClass>

Common Issues to Watch For

  1. Incorrect imports: com.facebook.presto.spi.QueryId vs com.facebook.presto.execution.QueryId
  2. Missing null checks: Especially in connectors handling external data
  3. Unclosed resources: Iterators, streams, connections
  4. Hardcoded values: Magic numbers, hardcoded paths
  5. Backwards compatibility: Breaking changes to public APIs
  6. Security: SQL injection, command injection, XSS in Web UI

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.