npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pr-review-ai-bot

v1.0.1

Published

GitHub PR review bot using OpenAI to post inline suggestions

Readme

🤖 GitHub PR Review Bot

Automated PR reviewer that analyzes diffs and posts inline suggestions using OpenAI. Get AI-powered code reviews on every pull request!

📋 Table of Contents

✨ Features

  • 🤖 AI-Powered Reviews: Uses OpenAI to analyze code quality, security, and performance
  • 📝 Inline Comments: Posts specific suggestions directly on code lines
  • 🔄 Auto-Triggered: Runs on PR open, sync, and ready-for-review events
  • 🛡️ Smart Filtering: Avoids duplicate and trivial comments
  • 🌍 Language Agnostic: Works with any programming language
  • Fast & Efficient: Chunks large diffs for optimal processing

🚀 Quick Setup (Choose One)

Option 1: One-Click Setup (Recommended)

npx [email protected] setup

Then add your OpenAI API key as a repository secret named OPENAI_API_KEY.

Option 2: Manual Setup

  1. Create .github/workflows/pr-review.yml in your repository:
name: PR AI Review

on:
  pull_request:
    types: [opened, synchronize, ready_for_review]

jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Run PR AI Review Action
        uses: ashugupta22/[email protected]
        with:
          openai_api_key: ${{ secrets.OPENAI_API_KEY }}
          openai_model: gpt-4o-mini
          diff_chunk_size: "12000"
          review_prompt: ''
  1. Add your OpenAI API key as a repository secret named OPENAI_API_KEY

📋 Prerequisites

  • GitHub repository with Actions enabled
  • OpenAI API key (get one from OpenAI Platform)

The Action runs on PR events (opened, synchronize, ready_for_review) and posts a single batched review with inline comments.

Use as a reusable Action in multiple repos

Quick Setup (Recommended)

npx [email protected] setup

Manual Setup

  1. In each target repository, create a workflow like:
name: PR AI Review
on:
  pull_request:
    types: [opened, synchronize, ready_for_review]
jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:
      - name: Run PR AI Review Action
        uses: ashugupta22/[email protected]
        with:
          openai_api_key: ${{ secrets.OPENAI_API_KEY }}
          openai_model: gpt-4o-mini
          diff_chunk_size: "12000"
          review_prompt: ''
  1. Add OPENAI_API_KEY secret in each target repository.

Configuration

  • OPENAI_API_KEY: OpenAI key (required)
  • OPENAI_MODEL: Model name (default: gpt-4o-mini)
  • DIFF_CHUNK_SIZE: Max characters per diff chunk sent to OpenAI (default: 12000)
  • REVIEW_PROMPT: Override the default review instruction

How it Works

  • Lists PR files and unified patches via GitHub API
  • Builds a map from file+line to diff position for inline comments
  • Concatenates and chunks patches, sends to OpenAI with a strict JSON-only instruction
  • Parses { issues: [{ file, line, comment, suggestion }] }
  • Filters trivial feedback and duplicates from existing PR review comments
  • Posts batched review comments using the Review API

Error Handling

  • Workflow fails if OpenAI API key is invalid or expired
  • Workflow fails if all OpenAI API calls fail
  • Workflow fails if GitHub API calls fail
  • Individual chunk failures are logged but don't fail the entire workflow unless all chunks fail

Prompt Template

See prompt.md for the base prompt used when REVIEW_PROMPT is not provided.

Notes and Limitations

  • Only comments on lines present in the new revision (no deleted-line comments)
  • Binary/large files with no patch are skipped
  • Duplicate detection uses path+line+body; adjust in reviewEngine.js if needed

License

MIT