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

prsmith

v2.1.0

Published

Forge professional pull request review comments from simple prompts.

Downloads

942

Readme

npm version License: MIT CI


PRSmith streamlines the process of writing code reviews by providing an interactive prompt that generates consistently formatted, polite, and actionable Markdown comments. With v2.0.0, PRSmith evolves into an intelligent, automated, production-grade Code Review suite featuring AI-powered tone polishing, direct GitHub integrations, file context, and batch review loops.

Architecture Flow

The tool operates via a straightforward interactive flow, generating structured markdown from your inputs and supporting remote integrations.

 ┌──────────────────────────┐
 │  Run `prsmith` Command   │
 └────────────┬─────────────┘
              ▼
 ┌──────────────────────────┐
 │   Interactive Prompts    │
 │ (File, Snippets, Issue)  │
 └────────────┬─────────────┘
              ▼
 ┌──────────────────────────┐
 │   AI Polish (Optional)   │
 │ (Gemini, OpenAI, Groq)   │
 └────────────┬─────────────┘
              ▼
 ┌──────────────────────────┐
 │   Markdown Generation    │
 └────────────┬─────────────┘
              ▼
 ┌──────────────────────────┐
 │  Export / Direct Post    │
 │ (GitHub, Clipboard, File)│
 └──────────────────────────┘

Installation

Install globally to use it anywhere on your machine.

npm install -g prsmith

⚡ Key Features (v2.0.0)

PRSmith has been completely overhauled with a set of powerful new features:

  1. 🚀 GitHub Integration (PR Comments & Reviews):
    • Post your generated review comment directly to a Pull Request as an issue comment, or as a native GitHub code review.
    • Zero-Config Repo Auto-Detection: Auto-detects the repository owner and name from your local .git/config remotes.
  2. ✨ AI "Rude-to-Polite" Polish:
    • Polishes blunt or harsh descriptions into constructive, professional, and empathetic reviews.
    • Built-in support for Gemini (default), OpenAI, and Groq via lightweight native HTTP requests.
  3. 📁 File & Line Number Context:
    • Link your feedback directly to code files and line ranges (e.g. src/utils.js:45-50).
    • If GitHub integration is active, PRSmith generates clickable GitHub deep links straight to the code!
  4. 🔍 Before/After Code Snippet Comparisons:
    • Provide original and proposed code blocks. Outputs collapsible <details> blocks featuring gorgeous syntax highlighting.
  5. 📦 Batch Review Mode (prsmith batch):
    • Run a single review runner loop to review multiple files or issues in one go.
    • Export all bundled reviews together: copy them, save to a report, or submit a native multi-comment review on GitHub in a single click!

💻 Usage

1. Fully Interactive Mode

The simplest way to use PRSmith:

prsmith

This starts the wizard, prompting you for:

  • Severity level & Title
  • Problem description & Suggested fix (opens your system's default $EDITOR like VS Code, Vim, or Nano for comfortable multi-line editing)
  • Optional File & Line context
  • Optional Before & After code snippets
  • Optional AI Polish toggle

2. Interactive Batch Mode (New)

Review multiple issues in a single terminal session and compile them into a unified report:

prsmith batch

At the end of the batch review, an interactive menu allows you to copy the unified report, save it to a file, or submit all comments at once as native inline review threads on a GitHub PR.

3. Non-Interactive CLI Flags

Bypass the prompts entirely for fast operations or CI/CD pipelines:

prsmith -s Critical -t "Resource Leak" -i "The connection is never closed." -f "Add a finally block." -p "src/db.js" -l "12-15" --ai --github --pr 42

| Flag | Full | Description | | :--------- | :----------- | :----------------------------------------------------------------- | | -s | --severity | Severity level (e.g., Critical, Suggestion) | | -t | --title | The review title | | -i | --issue | Description of the problem | | -f | --fix | Suggested solution | | -o | --out | Save generated markdown to a specific file | | -p | --path | File path context of code under review | | -l | --line | Line number or range (e.g. 12 or 45-50) | | --lang | --lang | Programming language for code highlighting (default: javascript) | | --before | --before | Original code snippet (Before) | | --after | --after | Proposed code snippet (After) | | --ai | --ai | Toggle AI-assisted polishing for constructive tone | | --github | --github | Post comments directly to GitHub | | --pr | --pr | The GitHub Pull Request number | | --repo | --repo | GitHub repository in owner/repo format |


🛠️ Configuration (.prsmith.json)

To enable AI polishing and GitHub integration, create a .prsmith.json file in your home directory (~/) or current project working directory:

{
  "githubToken": "ghp_yourGitHubPersonalAccessToken",
  "aiProvider": "gemini",
  "aiApiKey": "AI_PROVIDER_API_KEY",
  "aiModel": "gemini-1.5-flash",
  "defaultBranch": "main",
  "templates": {
    "Nitpick": "This is just a tiny nitpick, no pressure to fix.",
    "Security": "CRITICAL SECURITY VULNERABILITY DETECTED."
  }
}

AI Configuration Mappings:

  • aiProvider: gemini (default), openai, or groq.
  • aiModel:
    • Gemini default: gemini-1.5-flash
    • OpenAI default: gpt-4o-mini
    • Groq default: llama-3.3-70b-versatile
  • Credentials can also be supplied via Environment Variables:
    • GITHUB_TOKEN
    • GEMINI_API_KEY
    • OPENAI_API_KEY
    • GROQ_API_KEY

Suggestion: Optimized Loop

The implementation works, but there may be a cleaner approach.

📁 File: src/utils/math.js:15-20

Problem

The current forEach iteration is performing multiple lookups on a large array, which has a noticeable performance overhead in hot paths.

Suggested Fix

We can optimize this by storing the length in a local variable and utilizing a standard for-i loop.

Before:

items.forEach((item) => {
  doCalculation(item);
});

After:

const len = items.length;
for (let i = 0; i < len; i++) {
  doCalculation(items[i]);
}

Development & Contribution

To set up the project locally:

# Install dependencies
npm install

# Run the CLI locally
npm start

# Run unit tests
npm test

# Lint the codebase
npm run lint

# Format the code
npm run format

License

This project is licensed under the MIT License.