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

@amulyavarshney/snip

v0.1.0

Published

Ruthless efficiency mode for AI coding agents. Delete first. Build last.

Readme

✂ snip

Ruthless efficiency mode for AI coding agents. Delete first. Build last.

Snip enforces a 7-rung deletion ladder on AI agents — starting with "can this be deleted entirely?" — and protects production paths from over-simplification with snip:prod annotations.


The problem snip solves

AI agents have a strong bias toward completeness. Ask for email validation, get a 27-line EmailValidator class with a regex that still rejects valid addresses. Ask for a cache, get a 120-line TTLCache with a lock, hit counter, and eviction policy — for a function that's called twice.

Snip shifts the default the other way.


snip: vs snip:prod — why this matters

No other tool in this space makes this distinction:

// snip: plain object dispatch; upgrade to class registry if handlers exceed 10
const handlers = { 'order.created': handleOrder, 'user.signup': handleSignup };
(handlers[event.type] ?? noop)(event);

// snip:prod — HMAC verification is a timing-attack boundary; do not simplify
const sig = Buffer.from(req.headers['x-signature'], 'hex');
const expected = createHmac('sha256', secret).update(req.rawBody).digest();
if (!timingSafeEqual(sig, expected)) return res.status(401).end();

Both are minimal. One is safe to shrink further. One is not. snip tells you which is which.

// snip:prod lines are excluded from the snip score — they are correctly complex by definition.


Install

Claude Code

/plugin install snip

Cursor

curl -o .cursor/rules/snip.mdc \
  https://raw.githubusercontent.com/amulyavarshney/snip/main/.cursor/rules/snip.mdc

Windsurf

curl -o .windsurf/rules/snip.md \
  https://raw.githubusercontent.com/amulyavarshney/snip/main/.windsurf/rules/snip.md

GitHub Copilot

curl -o .github/copilot-instructions.md \
  https://raw.githubusercontent.com/amulyavarshney/snip/main/.github/copilot-instructions.md

VS Code Extension

Search "Snip" in the VS Code Extension Marketplace, or:

code --install-extension amulyavarshney.snip

npm CLI

npm install -g @amulyavarshney/snip
snip init       # create .snip.json in current project
snip score src/ # score your codebase

Benchmark results

Measured across 6 production-realistic tasks (JWT auth middleware, Go rate limiter, webhook HMAC validation, config loader, retry logic, query builder). Median of 10 runs per cell.

| | baseline | snip full | snip ultra | |--|--|--|--| | LOC (median) | 68 | 14 | 8 | | Reduction | — | ~80% | ~88% |

Run yourself: npm run bench (requires ANTHROPIC_API_KEY)


Modes

| Mode | Behavior | |------|----------| | lite | Builds what's asked; names the leaner option in one line | | full | Full 7-rung ladder + language overlays (default) | | ultra | Deletion-first; challenges requirements before writing | | prod | Full ladder + // snip:prod protection for trust boundaries | | off | Deactivated |

/snip             activate at default
/snip ultra       switch to ultra
/snip prod        switch to prod (recommended for financial/auth codebases)
/snip lang go     switch language overlay
/snip-review      review current code for over-engineering

The 7-rung ladder

Before any code is written, snip stops at the first rung that holds:

0. Can this be deleted entirely?
1. Does this need to exist at all? (YAGNI)
2. Does the standard library do this? Use it.
3. Does a native platform feature cover it? Use it.
4. Does an already-installed dependency solve it? Use it.
5. Can it be one line? Make it one line.
6. Only then: write the minimum code that works.

Rung 0 is what makes snip different from other minimal-code tools — it fires on existing code, not just code being written.


Language overlays

Snip auto-detects your project's dominant language and adds idiomatic shortcuts.

Python — list comprehensions over loops, @dataclass, functools.lru_cache, pathlib.Path, contextlib.suppress

TypeScript — discriminated unions over class hierarchies, as const over enums, crypto.randomUUID() (Node 19+), fetch (Node 18+)

Goerrors.New + fmt.Errorf("%w") over custom error structs, table-driven tests, sync.Once, io.Reader/io.Writer

Disable per-language in .snip.json:

{ "overlays": { "python": false } }

Team config

Commit .snip.json to your repo. Every developer and CI run picks it up automatically.

{
  "mode": "full",
  "language": "auto",
  "prod": { "protect": ["auth", "payments", "billing"] },
  "score": { "minScore": 60, "failBelow": true }
}

CI gate

# .github/workflows/snip.yml
- name: Check snip score
  run: npx @amulyavarshney/snip score src/ --min-score 60 --fail-below

The snip score (0–100) measures how much of your codebase could be deleted or replaced with stdlib. snip:prod lines are excluded — they're correctly complex.


Before/after examples

| Example | Without | With | |---------|---------|------| | JWT auth middleware | 5 files, ~60 lines | 10 lines + snip:prod tag | | Retry with backoff | 3-class hierarchy, 120 lines | 12-line async loop | | Config loading | ConfigManager + 4 sources, 70 lines | 10 lines | | Webhook HMAC | 5 classes, 80 lines | 8 lines + snip:prod tag | | Go error types | 7 types, 50 lines | 4 sentinel vars |


Development

# Run all tests
npm test

# Sync IDE rule copies from rules/base.md
npm run sync

# Run benchmarks
npm run bench

Tests use Node.js built-in node:test. Zero test dependencies.


License

MIT