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

@sidhxntt/prompt-optimizer

v1.0.0

Published

Rewrites weak prompts into tight, effective ones using vibe-lint rules + Claude

Downloads

122

Readme

Prompt Optimizer

Rewrites weak prompts into tight, effective ones using vibe-lint rules + Claude

Node.js License

Features

  • Interactive prompt analysis — Scans for 20+ prompt antipatterns using vibe-lint rules
  • Real-time feedback — Shows warnings and errors with specific suggestions
  • Claude API integration — Automatically rewrites prompts with optimization suggestions
  • Color-coded output — Visual severity indicators (errors in red, warnings in yellow)
  • CLI-first design — Works directly in terminal with readline interface

Prerequisites

  • Node.js 14 or higher
  • Claude API access (Anthropic account required)

Installation

npm install -g prompt-optimizer

Or run directly with npx:

npx prompt-optimizer

Configuration

Set your Claude API key as an environment variable:

export ANTHROPIC_API_KEY="your_api_key_here"

Usage

Launch the interactive prompt optimizer:

prompt-optimizer

The tool will analyze your prompts for common issues including:

Error Categories (Will block optimization)

  • Ambiguous scope"do your best", "handle it", "as needed"
  • Role confusion"you are an AI assistant"
  • Missing context — References to "the code above" without providing it
  • Contradictions"be brief and comprehensive"

Warning Categories (Suggestions for improvement)

  • Vague quality"make it better", "high-quality"
  • Output format"in a good format", "respond appropriately"
  • Politeness bloat"please try to", "feel free to"
  • Negation-only"don't be vague" without positive guidance

Example

Input prompt:

Please try to make my code better and more professional. Handle any issues as needed and respond in a good format.

The tool identifies:

  • W008: "Please try to" (politeness bloat)
  • W001: "make it better" (vague quality)
  • W003: "more professional" (subjective without rubric)
  • E002: "as needed" (ambiguous scope)
  • W004: "good format" (unspecified structure)

Optimized version:

Refactor this code to pass ESLint strict rules and achieve <10 cyclomatic complexity. Add JSDoc comments to all public functions. Return as a markdown code block with before/after sections.

Project Structure

prompt_optimiser/
├── LICENSE.txt          # MIT license
├── index.js            # Main CLI application with vibe-lint rules
├── package-lock.json   # Dependency lock file  
└── package.json        # Package configuration and binary definition

Key Files

  • index.js — Contains 20+ prompt linting rules, Claude API integration, and interactive CLI interface
  • package.json — Defines the prompt-optimizer CLI command and project metadata

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Add new rules to the RULES array in index.js following the existing pattern
  4. Test your changes with various prompt inputs
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Rule Structure

{
  id: "W010",
  severity: "warn", // or "error"  
  category: "category-name",
  pattern: /regex_pattern/gi,
  message: "Brief explanation of the problem",
  suggestions: [
    "Specific suggestion 1",
    "Specific suggestion 2"
  ]
}

License

MIT License - see LICENSE.txt for details.