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

@safetnsr/ai-ready

v1.3.0

Published

Pre-session codebase AI-readiness scorer for Claude Code and agent workflows

Readme

ai-ready

Pre-session codebase AI-readiness scorer — know before you claude.

Analyzes your codebase and tells you which files will hit the AI complexity wall before you start a Claude Code session.

Install

npx @safetnsr/ai-ready

Usage

ai-ready [dir] [options]

Sample Output

ai-ready — codebase scan complete

FILE                    SCORE  TOP ISSUE              FIX
src/auth/index.ts        12    function too long      split into smaller functions
src/api/middleware.ts    34    high coupling           extract shared utils
src/utils/helpers.ts     87    ✓ AI-ready

overall: 54/100 ⚠️  some modules need work before AI sessions
→ split src/auth/index.ts into smaller files first (biggest win)
→ high coupling in src/api/middleware.ts

Flags

| Flag | Description | |------|-------------| | [dir] | Directory to scan (default: .) | | --json | Machine-readable JSON output | | --top N | Show only worst N files | | --min-score N | Only show files below score N | | --ci | Exit 1 if overall < 60, exit 0 if ≥ 60 | | --explain | Show per-signal breakdown per file | | --ext LIST | Comma-separated extensions (default: .ts,.js,.tsx,.jsx) | | -h, --help | Show help |

Scoring

Each file is scored 0-100 based on five signals:

| Signal | Weight | What it measures | |--------|--------|-----------------| | Function length | 30% | Average function length (< 20 lines = 100) | | Coupling | 25% | Import count (≤ 3 = 100) | | Test coverage | 25% | Matching test file exists | | Comment density | 10% | Comment-to-code ratio | | File size | 10% | Total line count (≤ 150 = 100) |

Agent Interface (--json)

ai-ready --json | jq '.files[] | select(.score < 40)'

JSON schema:

{
  "files": [
    {
      "path": "src/auth/index.ts",
      "score": 12,
      "issues": ["function too long", "split into smaller functions"],
      "signals": {
        "functionLength": 0,
        "coupling": 0,
        "testCoverage": 0,
        "commentDensity": 10,
        "fileSize": 40
      }
    }
  ],
  "overall": 54,
  "recommendations": ["split src/auth/index.ts into smaller files first (biggest win)"]
}

CI Integration

# .github/workflows/ai-ready.yml
- name: Check AI readiness
  run: npx @safetnsr/ai-ready --ci

Exit codes:

  • 0 — overall score ≥ 60 (ready for AI sessions)
  • 1 — overall score < 60 (refactor first)

Pair With

License

MIT