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

prompt-check

v0.1.1

Published

CLI tool for validating AI outputs against expected results.

Downloads

6

Readme

prompt-check

Open source CLI tool to validate AI outputs against expected outputs using rules and concept matching.

Quick Start

Install and Use

# Install globally
npm install -g prompt-check

# Or use with npx (no installation needed)
npx prompt-check init
npx prompt-check run

Setup

  1. Initialize the data folder (creates structure and prompts for API key):
prompt-check init
  1. Add your test data - Edit the JSON files in prompt-check-data/test-cases/:

    • Fill in referenceOutput (what you expect)
    • Fill in outputs (what your AI produced)
  2. Run tests:

prompt-check run

Configuration

API Key Setup

Option A: Environment variable (recommended for CI/CD):

export OPENAI_API_KEY=your-api-key

Option B: Local config (saved during init): The API key is stored in prompt-check-data/config.json

Folder Structure

After running init, you'll have:

prompt-check-data/
  ├── config.json           # OpenAI API key (not committed to git)
  ├── rules.json            # Rules for validation
  └── test-cases/
      ├── example-test-case.json
      └── example-with-concepts.json

File Formats

rules.json

{
  "rules": [
    "be short and concise",
    "be friendly",
    "use clear and professional language"
  ]
}

Test Case File

Basic test case:

{
  "id": "my-test-case",
  "referenceOutput": "The expected output from your AI.",
  "outputs": "The actual output from your AI system."
}

With concept validation:

{
  "id": "support-response",
  "referenceOutput": "A customer support response should acknowledge the issue.",
  "outputs": "I understand this is frustrating. Your ticket is being reviewed.",
  "expectedConcepts": [
    "acknowledgment",
    "ticket reference",
    "timeline"
  ]
}

CLI Commands

Initialize

prompt-check init

Creates the data folder structure with example files.

Run Tests

# Run all test cases
prompt-check run

# Run a specific test case
prompt-check run --file example-test-case.json

# Use custom rules file
prompt-check run --rules custom-rules.json

# Use custom data directory
prompt-check run --dir ./my-data-folder

How It Works

  1. Rules Validation: Checks if outputs follow the rules defined in rules.json
  2. Concept Matching: Validates that expected concepts are present (if expectedConcepts is specified)
  3. Scoring: Returns a percentage score with PASS/FAIL for each rule

Results show:

  • Overall score percentage
  • Per-rule breakdown with explanations
  • Concept validation results

License

MIT