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

ship-shield

v1.0.0

Published

Pre-commit guardrail that scans staged diffs for AI-code risks. Zero dependencies.

Readme

ShipShield

Pre-commit guardrail that scans staged diffs for AI-code risks before you commit.

Zero dependencies. Works with any git repo. Catches the stuff AI assistants leave behind — leaked secrets, ghost imports, forgotten TODOs, stub functions.

npm version License: MIT


Quick Start

# Install globally
npm install -g ship-shield

# Or use npx (no install)
npx ship-shield

# Run in any git repo
cd your-project
ship-shield

What It Checks

| Check | Description | Severity | |-------|-------------|----------| | Secrets | API keys, tokens, private keys, database URLs | ERROR or WARN | | Ghost Files | Relative imports/file references that do not resolve on disk or in the Git index | WARN | | TODO/FIXME | Incomplete markers left in added lines | WARN or ERROR | | Stub Functions | Placeholder implementations such as pass, empty functions, Not implemented | WARN | | External Imports | Newly added non-relative imports that should be verified against project manifests | WARN |

* --fail-on-todo upgrades TODO/FIXME-style warnings to blocking errors.


Usage

# Basic scan of staged changes
ship-shield

# Short alias
oguard

# JSON output for CI/CD
ship-shield --json

# Only show output if issues found
ship-shield --quiet

# Treat TODO/FIXME as errors
ship-shield --fail-on-todo

# Print version
ship-shield --version

# Combined options
ship-shield --json --fail-on-todo > scan-results.json

Options

| Option | Description | |--------|-------------| | --json | Emit machine-readable JSON results | | --quiet | Suppress output unless findings are present; scanner errors still return exit code 2 | | --fail-on-todo | Upgrade TODO/FIXME-style warnings to blocking errors | | --version | Print the current CLI version | | -h, --help | Show usage |


Exit Codes

| Code | Meaning | |------|---------| | 0 | No blocking issues found (warnings alone do not fail) | | 1 | One or more blocking issues found | | 2 | Scanner error or not a git repo |


Git Hook Setup

Husky (recommended)

npm install --save-dev husky
npx husky init

echo 'npx ship-shield' > .husky/pre-commit

Manual pre-commit

# Create hook
cat > .git/hooks/pre-commit << 'EOF'
#!/bin/sh
npx ship-shield --quiet
EOF

# Make executable
chmod +x .git/hooks/pre-commit

Example Output

╔══════════════════════════════════════════════════════════════╗
║            SHIPSHIELD - AI-Code Risk Report                 ║
╚══════════════════════════════════════════════════════════════╝

┌────────────────────────────────────────────────────────────┐
│  ✗ BLOCKING ISSUES FOUND                                   │
│     ● Errors: 1                                            │
│     ● Warnings: 2                                          │
│     ○ Total: 3                                             │
└────────────────────────────────────────────────────────────┘

▶ SECRETS
────────────────────────────────────────────────────────────
  [ERR] AWS Access Key ID
  File: src/config.js:12
  Code: const key = "AKIA..."
  Match: AKIA***IOSF

  [ERR] OpenAI API Key
  File: src/ai.js:5
  Code: apiKey: "sk-..."
  Match: sk-***test

▶ TODO-FIXME
────────────────────────────────────────────────────────────
  [WARN] Stub Function
  File: src/utils.js:42
  Code: function calculate() { return null; // TODO }
  Note: Function appears to be an incomplete stub

┌────────────────────────────────────────────────────────────┐
│  Commit blocked: Fix errors before committing              │
└────────────────────────────────────────────────────────────┘

Behavior Notes

  • ShipShield scans git diff --staged; unstaged changes are ignored.
  • Findings are reported against added lines in staged hunks.
  • Relative file checks use the working tree plus the Git index, so newly staged files count as existing.
  • Non-relative imports are not resolved against node_modules or Python environments; they are reported as warnings to review.
  • Binary content and generated artifacts are only visible if Git includes text diff output for them.

Secret Detection Patterns

ShipShield detects:

  • AWS: Access keys, secret keys
  • GitHub: Personal access tokens (ghp_, gho_, ghs_, etc.)
  • Slack: Bot/user tokens (xoxb-, xoxp-)
  • Stripe: Live secret keys (sk_live_)
  • OpenAI: API keys (sk-...)
  • Generic: High-entropy secrets, database URLs with passwords
  • Private Keys: PEM-encoded RSA/DSA/EC keys

CI/CD Integration

GitHub Actions

name: Guard Checks

on: [push, pull_request]

jobs:
  guard:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      
      - name: Run ShipShield
        run: npx ship-shield --fail-on-todo

Why ShipShield?

AI coding assistants are powerful, but they still:

  • Hallucinate file paths that don't exist
  • Leave TODOs as "temporary" fixes that become permanent
  • Hardcode credentials for "testing"
  • Generate stub functions you forget to implement

ShipShield catches the obvious stuff before it hits your repo.


License

MIT. Do whatever you want with these.

About

Made by @BChopLXXXII

Pre-commit armor for vibe coders. Stop shipping AI mistakes.

Ship it. 🚀


If this helped, — it helps others find it.